From: Jonathan K. <jon...@jf...> - 2009-02-25 05:36:45
|
On 24 Feb 2009, at 19:58, Sergey Tolstov wrote: > Hello, > > We use ICU 3.8.1. > > It seems that the OpenTypeLayoutEngine does not apply kerning. It should apply kerning from the GPOS table, if present, but it does not apply the pre-OpenType 'kern' table. > We get different glyph positions for the same Latin text with the > Times New Roman font (times.ttf) on Windows XP and Vista. > > The LayoutEngine::layoutEngineFactory creates the > OpenTypeLayoutEngine instance for the Vista's Times New Roman, > and the LayoutEngine instance for the XP font. Does the Vista font include a 'kern' feature for Latin script in the GPOS table, and does it match the old-style 'kern' table? If not, it makes sense that you would see different results. > > Both fonts have the 'kern' table with the same values, but the table > is not applied by the OpenTypeLayoutEngine and is applied by the > LayoutEngine, although we request it through the typoFlags parameter > to the layoutEngineFactory. > > The text is > > Test > > There is -143 kerning for Te pair. > > In the ICU 4.0.1 source code it looks that the OpenTypeLayoutEngine > had not been changed to apply kerning. > > OpenTypeLayoutEngine::adjustGlyphPositions implementation contains > this: > #if 0 > // This is where separate kerning adjustments > // should get applied. > xAdjust += xKerning; > yAdjust += yKerning; > #endif > > Should we not use the typoFlags and apply the kerning ourselves, or > it is a bug? You might like to look at the slightly-customized version of ICU used in XeTeX, which applies the old 'kern' table if there is no OpenType kerning. For the OpenTypeLayoutEngine changes used with ICU 4.0, see http://scripts.sil.org/svn-view/xetex/TRUNK/libs/icu-release-4-0-source/layout/OpenTypeLayoutEngine.cpp?r1=756&r2=764 or look in the older icu-release-3-8-1-source directory for the corresponding changes in 3.8.1. (Note that the xetex version has some other changes besides this feature, so you may want to be selective about adopting patches from there.) JK |