Quantcast

A little info about ligatures and e.g. Calibri

classic Classic list List threaded Threaded
9 messages Options
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

A little info about ligatures and e.g. Calibri

FWIW, as it came up as a question in the main track FOSDEM LibreOffice
talk, in vcl/generic/glyphs/gcach_layout.cxx see IcuLayoutEngine::layout
and...
if (rArgs.mnFlags & SAL_LAYOUT_ENABLE_LIGATURES)
    nLayoutFlags |= LayoutEngine::kTypoFlagLiga;
so ligatures are disabled by default unless SAL_LAYOUT_ENABLE_LIGATURES
is enabled, and SAL_LAYOUT_ENABLE_LIGATURES is only set if
TEXT_LAYOUT_ENABLE_LIGATURES is set on the outputdevice, and that
doesn't happen anywhere as of yet :-(

It would be no major problem to e.g. bubble up allowing those ligatures
to be set explicitly via the UI, or e.g. defaulted on via a new
compatibility flag for new docs, but the last time I played around with
it I ran into the snag that with our current Linux rendering stack via
cairo we get the unfortunate visual effect that ligatures appear bold in
Calibri, etc.

Here's a screenshot of gedit which renders for me today like we would do
if we enabled ligatures in above code.
https://bugzilla.redhat.com/attachment.cgi?id=613610 
from https://bugzilla.redhat.com/show_bug.cgi?id=857860

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Khaled Hosny Khaled Hosny
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

On Sun, Feb 03, 2013 at 03:39:36PM +0000, Caolán McNamara wrote:
> FWIW, as it came up as a question in the main track FOSDEM LibreOffice
> talk, in vcl/generic/glyphs/gcach_layout.cxx see IcuLayoutEngine::layout
> and...
> if (rArgs.mnFlags & SAL_LAYOUT_ENABLE_LIGATURES)
>     nLayoutFlags |= LayoutEngine::kTypoFlagLiga;
> so ligatures are disabled by default unless SAL_LAYOUT_ENABLE_LIGATURES
> is enabled, and SAL_LAYOUT_ENABLE_LIGATURES is only set if
> TEXT_LAYOUT_ENABLE_LIGATURES is set on the outputdevice, and that
> doesn't happen anywhere as of yet :-(

I was wondering about this a while ago, but thought it was just me not
finding where the magic is.

> It would be no major problem to e.g. bubble up allowing those ligatures
> to be set explicitly via the UI, or e.g. defaulted on via a new
> compatibility flag for new docs, but the last time I played around with
> it I ran into the snag that with our current Linux rendering stack via
> cairo we get the unfortunate visual effect that ligatures appear bold in
> Calibri, etc.

I see Calibri only, no etc's :), so blocking ligature support (which is
so 80s, even MS Office now supports OpenType features for Latin) because
is of a bug in a single font in certain configurations is overreacting
IMHO.

Regards,
Khaled
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

On Sun, 2013-02-03 at 17:58 +0200, Khaled Hosny wrote:
> I see Calibri only, no etc's :), so blocking ligature support (which is
> so 80s, even MS Office now supports OpenType features for Latin) because
> is of a bug in a single font in certain configurations is overreacting
> IMHO.

*shrug*, its why I wasn't motivated to go and figure out a UI to
enable/disable ligatures or see if a compatibility option was a better
idea etc because I'd just get a slew of bugs that "my text is bold".

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Khaled Hosny Khaled Hosny
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

On Sun, Feb 03, 2013 at 04:15:00PM +0000, Caolán McNamara wrote:
> On Sun, 2013-02-03 at 17:58 +0200, Khaled Hosny wrote:
> > I see Calibri only, no etc's :), so blocking ligature support (which is
> > so 80s, even MS Office now supports OpenType features for Latin) because
> > is of a bug in a single font in certain configurations is overreacting
> > IMHO.
>
> *shrug*, its why I wasn't motivated to go and figure out a UI to
> enable/disable ligatures or see if a compatibility option was a better
> idea etc because I'd just get a slew of bugs that "my text is bold".

GTK have been enabling ligatures and other default OpenType features
since ages (since before I started using computers :p), so probably the
situation is not that bad.

Regards,
Khaled
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

On Sun, 2013-02-03 at 18:26 +0200, Khaled Hosny wrote:
> GTK have been enabling ligatures and other default OpenType features
> since ages (since before I started using computers :p), so probably the
> situation is not that bad.

oh, I forgot, we also don't have proper cursor positions for ligatures
either!, that's another epic lack.

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
sberg sberg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

On 02/05/2013 11:36 AM, Caolán McNamara wrote:
> On Sun, 2013-02-03 at 18:26 +0200, Khaled Hosny wrote:
>> GTK have been enabling ligatures and other default OpenType features
>> since ages (since before I started using computers :p), so probably the
>> situation is not that bad.
>
> oh, I forgot, we also don't have proper cursor positions for ligatures
> either!, that's another epic lack.

And do we have decent support to let the user specify where not to use
ligatures in the input?  Or do users need to insert explicit U+200C ZWNJ
with their input method of choice?

(At least for German, where ligatures need to be broken quite
frequently, I generally don't understand the enthusiasm for
ligature-enabled fonts anyway, as in the hands of incompetent typists
they lead to more harm than good.  What could probably help is to have
automated rules that tell the computer where to break ligatures, similar
to hyphenation rules.)

Stephan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

On Thu, 2013-02-07 at 14:22 +0100, Stephan Bergmann wrote:
> do users need to insert explicit U+200C ZWNJ
> with their input method of choice?

yeah, I wonder why we don't list ZWJ and ZWNJ in insert->formatting mark
but do list zero width space 0x200B, and word joiner 0x2060 (with CTL UI
enabled) using kind of odd names for them. Maybe we should rename those
to their standard unicode names and add ZWJ and ZWNJ in there too.

C.


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Németh László-2 Németh László-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

In reply to this post by sberg
Hi,

2013/2/7 Stephan Bergmann <[hidden email]>
And do we have decent support to let the user specify where not to use ligatures in the input?  Or do users need to insert explicit U+200C ZWNJ with their input method of choice?

(At least for German, where ligatures need to be broken quite frequently, I generally don't understand the enthusiasm for ligature-enabled fonts anyway, as in the hands of incompetent typists they lead to more harm than good.  What could probably help is to have automated rules that tell the computer where to break ligatures, similar to hyphenation rules.)

You are right. I knew the special requirement of German typography, but I didn't check ZWNJ usage with ligature-enabled Linux Libertine G Graphite font before. (It seems, the ligature replacement is default for German in the original OpenType version, too). I have filled an issue about the problems and the possible fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60427.

I have made an initial patch in this direction: now spell checking accepts the words with ZWNJ and ZWJ characters, also with Unicode f-ligatures in the case of 8-bit encoded spelling dictionaries. (It seems, users of poor TTF fonts need this poor man's method: https://bugs.freedesktop.org/show_bug.cgi?id=59337, for UTF-8 encoded spelling dictionaries, you can set ICONV and IGNORE Hunspell options, if needed).

I have already added some language specific exceptions for Dutch f-ligature replacement in Linux Libertine G, but Graphite is not enough to handle the requirements of German. Maybe a good method to handle this problem is a new Localized option of Autocorrect "add ZWNJ for German compounds", also an optional grammar checker feature "check ZWNJ in German compound".  Also hyphenation and search/replacement may need modification.

Regards,
László


Stephan

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Khaled Hosny Khaled Hosny
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A little info about ligatures and e.g. Calibri

In reply to this post by Caolán McNamara
On Tue, Feb 05, 2013 at 10:36:38AM +0000, Caolán McNamara wrote:
> On Sun, 2013-02-03 at 18:26 +0200, Khaled Hosny wrote:
> > GTK have been enabling ligatures and other default OpenType features
> > since ages (since before I started using computers :p), so probably the
> > situation is not that bad.
>
> oh, I forgot, we also don't have proper cursor positions for ligatures
> either!, that's another epic lack.

Cursor positioning inside ligatures seems to work for Arabic when using
OpenType fonts, but not with Latin ligature when using Graphite fonts
(couldn't find Arabic Graphite fonts with ligatures), so may be it is an
issue with Graphite integration.

Regards,
Khaled
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Loading...