Fri 05 Mar 2010 01:08:13 PM UTC, original submission:
In ttgload.c, compute_glyph_metrics, line 2647:
/* Now take care of vertical metrics. In the case where there is */
/* no vertical information within the font (relatively common), */
/* create some metrics manually */
I can see why this is useful in a pure TrueType environment, as the writing direction is known. If the font has no vertical metrics (which are optional) but is used in a vertical writing mode, some approximate metrics are important.
However, for a PostScript interpreter, there is no concept of a writing direction. Glyphs are simply drawn and then the current point advanced by the horizontal and vertical advances. See bug #28678 for (extensive) discussion of this point related to type 1 fonts.
Now, when processing a type 42 font we supply the sfnts data to FreeType as a TrueType font. The data is correctly processed and the glyph rendered. However, if there is no vhea/vmtx data, then the code in ttgload.c creates some useful metrics and supplies these back.
The PostScript interpreter, not knowing which way the text is advancing, simply applies both metrics, with the result that the glyphs advance 'diagonally' instead of horizontally.
I appreciate that the synthesised information is highly useful to 'real' TrueType users, but its devastating in the PostScript environment.
Would it be possible to switch off this metric synthesis, perhaps by using a new FT_LOAD flag ? (so that existing users need not change their code I would suggest FT_LOAD_NO_SYNTHETIC_METRICS)
Attached patches to achieve this effect. (please be aware that the line numbers in ttgload.c.diff may not match the GIT repository)
|