freetype
[Top][All Lists]
Advanced

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

Re: glyph info


From: Werner LEMBERG
Subject: Re: glyph info
Date: Mon, 02 Oct 2000 03:17:08 +0200 (CEST)

> hi, i have a problem and hope someone can help.  my problem is that
> i need the horizAdvance of the glyphs i'm drawing in an unit not
> related to the bitmap dimensions.  more specifically, i need the
> horizAdvance in 1/65536 pt units, no matter what is the scale i
> render the bitmap in (which will normally be on the order of 10
> pixels wide).  is there any simple way to do it

I suppose that you don't mean `scaling' but `resolution'.

Further I assume that you use FreeType 2.

You have to write your own module if you want to access the advance
widths for all glyphs in a font before loading the actual glyphs --
not all font formats allow this in an inexpensive way (i.e., without
scanning the whole font file).

On a per-glyph basis, the field face->glyph->linearHoriAdvance (after
a call to FT_Load_Glyph) contains the advance width in original font
units if the flag FT_LOAD_UNSCALED_LINEAR has been used.  Together
with face->units_per_EM you should be able to do what you want.


    Werner



reply via email to

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