Re: Ligatures and Pango?



Owen Taylor wrote:
I investigated this a while ago and it seemed to be quite
non-standard how ligatures are mapped in TTF fonts. There are Unicode
codepoints for some of the common ligatures, but fonts (as I recall)
frequently mapped even those ligatures into the private-use area. And
had other ligatures in the private use area as well.

You'd need extra per-font supplemental data to do it well. Though
maybe something simple is possible that will get ff/fi/ffi for a
reasonable percentage of common fonts.

The information is in the GSUB table of the TTF font in question. And this is a standard AFAIK. So, the information is there, you just have to use it... :p


If I'm not mistaken, "TTF files" above was in contrast to "OpenType fonts", so presumably meant "TTF files without GSUB tables". Of course,
the distinction between an OpenType font and a TTF one is a very
thin distinction :-)

I just installed CVS Pango, to test ligatures. It turns that out of my 180 ttf files (including the ones that Apple ships with MacOS 10.3) none have GSUB tables. However, loading the font into Fontforge, and saving as TTF (and OTF/CFF I guess) adds a GSUB table. Wonderful!

I noticed that LilyPond doesn't do kerning automatically; for a PangoGlyphString, we just do

  PGIX PGIY rmoveto GLYPHNAME glyphshow

for each glyph (PGIX = PangoGlyphInfo->PangoGlyphGeometry.x) I thought kerning would be put into PGIX. I tried doing

  gsave GLYPHNAME glyphshow grestore PGIWIDTH 0 rmoveto

but then all letters are maximally kerned (touching each other). Should I insert some kind of font-dependent space between each glyph?

--
 Han-Wen Nienhuys - hanwen xs4all nl - http://www.xs4all.nl/~hanwen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]