freetype
[Top][All Lists]
Advanced

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

Re: [ft] Vert advance on line break


From: Mickey Gabel
Subject: Re: [ft] Vert advance on line break
Date: Mon, 26 Jan 2009 10:36:04 +0200
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Werner:

From the documentation of FT_FaceRec:

  height        

    The height is the vertical distance between two consecutive
    baselines, expressed in font units.  It is always positive.  Only
    relevant for scalable formats.

Or do you mean something different?

      Werner

mpsuzuki and Disch:

                      I tried using [i]face->size->metrics.height[/i], but
this seemed far too steep for some fonts (almost like the font was
double-spaced), and simply doesn't exist at all (is zero) for many, many
fonts such as Courier, which makes it completely useless for me.

Yeah, it notices the height of glyph, not the space between
the lines. Usually, the calculation of the space between the
lines is not recognized as the role of the fonts.

This is a seemingly simple question, yet the tutorials fail to mention
anything about it, the documentation leaves it unclear, and I've even tried
searching this forum with no success (someone asked the question, then
replied saying they found the answer -- but never said what the answer is).

Maybe you want to pass "single space" or "double space" to
some FT2 API and receive the appropriate shift from the
previous line to current line, but such 2D layout work is
for more intelligent layout systems. In fact, the LineGaps
in hhea & OS/2 are no more than the minimum space. Some font
file formats does not provide such informations at all. It
would be the reason why FT2 tutorials don't describe line-to-
line process.


Werner:


1) What about "line gap" (aka "external leading") mentioned in docs/glyphs/glyphs-3.html (Glyph Convension)? How does FT2 get this line gap if it's not specified in the font? 2) If FT2 does get it, how do I get this line gap / external leading from FT2?
I thought face->size->metrics.height IS the way to get it!
3) It seems mpsuzuki and Werner have two contradicting answers :(
Werner says "use height", mpsuzuki says "don't use it, it's wrong".
Can you help clarify?
4) Does FT2 use the hhea table in anyway by itself? (for example to initialize the FaceRec "height" member? 5) We sometimes use (2 + ascender - descender) as a the line height. This seems to work, and may be useful workaround so I mentioned it here.

Thanks,
        Mickey





reply via email to

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