|
From: | Jan Slupski |
Subject: | RE: [ft] WG: Character Width Problem |
Date: | Thu, 6 Oct 2005 16:23:16 +0200 (CEST) |
On Thu, 6 Oct 2005, Anton Zemlyanov wrote:
Martin, FreeType is a font (face) rendering engine, not a word processor. This is for FT user to build a text line from the individual glyphs. For TT fonts, "char width" is useless because chars (Glyphs) can be overlapped. Width of a string is not a sum of widthes of individual chars. I use the following method: StringWidth = sum(AdvanceWidths) - LeftBearingFirstChar - RightBearingLastChar;
You may also take kerning distances between chars into equation. eg. usually: advanceWidth('VA') < advanceWidth('V') + advanceWidth('A') _ _ _ _ _____________________________________________ | |_| |\ | S L U P S K I address@hidden |_| | | | \| http://juljas.net/
[Prev in Thread] | Current Thread | [Next in Thread] |