freetype
[Top][All Lists]
Advanced

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

Re: [ft] Incorrect y position glyph render


From: Werner LEMBERG
Subject: Re: [ft] Incorrect y position glyph render
Date: Fri, 21 Oct 2016 08:05:21 +0200 (CEST)

> I'm rendering the text using freetype 2.7 and Adobe's free Source
> Code Pro [1] font but I can't seem to figure out how to render out
> the glyphs correctly vertically since it seems that the demo program
> ftstring also has the same problem.

What do you mean with `vertically'?  Is your typesetting direction
from top do bottom?  Or left to right?

> The sample text I'm rendering is '1+4*8' and the '*' character in
> ftstring isn't being rendered higher than the '+' like it should
> (eg. on Windows using WordPad).  This results in it being hard to
> tell the difference between the plus and multiply operators.

For left-to-right typesetting, FreeType simply takes the metrics
directly from the font.  However, it doesn't apply higher-level
OpenType tables like `GSUB' and `GPOS'.  Right now I'm too lazy to
check, but it is possible that the font in question either contains
GSUB data to replace the glyphs with special variants or GPOS data to
move glyphs vertically if `+' or `*' is positioned between digits.

Either have a look into the font (ttx, your preferred font editor,
...) or try the demo programs of HarfBuzz to check whether you get
better results.

[BTW, you should also check whether WordPad really uses the glyphs of
 the font for mathematical stuff.]

For top-to-bottom typesetting, there are known problems with the CFF
format since FreeType doesn't currently support the `VORG' table.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]