freetype
[Top][All Lists]
Advanced

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

[ft] Right justification of text with glyphs reaching further than advan


From: Gregor Mückl
Subject: [ft] Right justification of text with glyphs reaching further than advance
Date: Mon, 18 Feb 2013 02:03:41 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

Hi!

I'm having a sort of conceptual problem: text that is right-aligned by my layout algorithm is overshooting the right boundary when rendered. This is bad because the last glyph in the line ends up getting visibly truncated there. All glyph dimensions used by this algorithm are provided by Freetype.

This problem seems to occur because of two conditions that are met:

1. using the advance of the last glyph in the line to compute the total line length and therefore implicitly the space between the second-to-last character and the right edge.

2. an italic font where the top parts of most glyphs reach further than the advance

So how would I find out the actual width of the character so that right-aligning it will never lead to truncation of the glyph?

My guess is that I need some sort of bounding box, but for some reason I cannot make FT_Glyph_Get_CBox return a non-zero bounding box. Is there some other way how I can obtain a control box or bounding box for a TrueType font at the current font size? Or do I need to use a different measure anyway?

Regards,
Gregor



reply via email to

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