[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Origin and Line spacing
From: |
Werner LEMBERG |
Subject: |
Re: [ft] Origin and Line spacing |
Date: |
Sat, 31 Mar 2007 08:18:52 +0200 (CEST) |
> I try to set the position of my text like we can do it under windows
> with GDI or .NET (font origin at the top-left) and i got two problem
> [...]
Have a look at the new ftdiff demo program which shows how to position
multi-line text with FreeType.
> First, i need to move the origin a the top-left corner of the font for
> drawing like a GDI DrawText. (I used glyph->metrics.vertAdvance to move
> my Y origin, but i dont know if is a good choice).
Using `vertAdvance' is bad. This is a metrics for scripts written
vertically (and it is documented as such). Most fonts don't contain
info about the line spacing -- additionally, it's really a matter of
taste.
s a rule of thumb, similar to TeX, just multiply the design size by
1.2 to get the line spacing. For example, a 12pt font should have
about 14pt line spacing. BTW, slightly bigger factors often give more
pleasant results (at least in printed books).
Werner