View Single Post
Old 11-03-2013, 03:18 PM   #81
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,563
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Psymon View Post
How on earth does it do that, like, how does a font "know" if the character is at the beginning, middle or end of the word? Is that what that "hist=1, liga=1, dlig=1" stuff you mentioned earlier does (somehow)?
Well, it's actually not the font, but the renderer who follows the font's instructions. Basically, the font says:

If you want an "s", draw this vector image (this is the "s" glyph)
...but if the "s" is followed by any of these characters (a list of all lowercase letters follows), you should draw this other vector image instead (this is the "long-s" glyph)

The renderer reads the input text, reads the font, and choses the glyphs accordingly. The replacement of "s" with "long-s" is optional, and that is what we need to enable, otherwise the renderer will only interpret the first rule (draw an "s"). In OpenType, there is a set of standard names for this kind of features like you may want to enable or disable (ligatures, swash forms, smallcaps...), and this particular one is "hist".

Quote:
I'm utterly clueless how that works!
Now what we need is to find out how to tell each reader that we want the long-s (with the "hist" feature) and the discretionary ligatures for ct, is, etc. (the "dlig" feature). The other ligatures (ff, fl... and even long-s t or long-s h) should be turned on by default.

This is usually done with CSS, but since it's a rather new part, it's not yet fully standardized, and every rendering engine uses a slightly different syntax. That's what the code I posted was suppose to do: use the appropriate syntax for every known engine.

Now, if you don't know what is CSS, how it works or how to write/modify, you should really have a look at some tutorials. It's pretty simple, don't be afraid.

Quote:
However, if I put in "ct" (as two letters, not a lig), then if what you say was actually working, shouldn't all those double-character combos (in the first "column") have been automatically changed to the ligature??? They don't, though, they stay as the two characters.
"ct" would not work out of the box, as it is a discretionary ligature. Try "ff" or "fi", those should work in ADE (at least in the newest version) without any special action on your part (just using an embedded font). And the same goes for kerning, by the way, it should be active by default.

[EDIT: actually, you can see in the screenshot that the first two columns for "ff", "fi", etc. are identical, this means the ligature is being used when you write the two separate characters!]

Quote:
I'm stunned -- and pleasantly, elatedly so -- that it apparently works just fine in ADE, including all the ligs!
Well, I wouldn't be surprised if enabling the non-default OpenType features didn't work in ADE. In that case, I would not recommend hard-coding the ligatures, even if you can do that

Last edited by Jellby; 11-03-2013 at 03:22 PM.
Jellby is offline   Reply With Quote