[AD] [ alleg-Bugs-2840965 ] ttf addon decomposed characters

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #2840965, was opened at 2009-08-20 10:14
Message generated for change (Comment added) made by elias
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2840965&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 4.9
>Status: Closed
>Resolution: Wont Fix
Priority: 1
Private: No
Submitted By: Peter Wang (tjaden)
Assigned to: Elias Pschernig (elias)
Summary: ttf addon decomposed characters

Initial Comment:
The TTF addon doesn't quite display decomposed characters properly. e.g. compare <U+00DC> with <U+0055 U+0308>. The umlaut on the decomposed version are in the wrong place.

----------------------------------------------------------------------

>Comment By: Elias Pschernig (elias)
Date: 2009-08-20 14:42

Message:
Ok, the problem is that Freetype, by design, does not do glyph
substitution. Quoting from their FAQ [1]:

"The library doesn't support text layout operations. Sophisticated
features like glyph substitution, positioning (kerning), justification,
bi-directional ordering, etc.m are not part of a font service in itself.
They must be handled one level higher."

and

"For FreeType 2, we have decided that the layout operations provided
through these tables are better placed in a specific text-layout library
like Pango."

With "these tables" they also mean the glyph substitution tables. Now, it
would be easy enough to add support for Pango - but it would require a
different API from Allegro. Basically, it means feeding a chunk of text to
Pango, which then when it sees a U character followed by a combining
character picks the right glyph (and event font) to display it properly.
You then can tell Pango to render the chunk of text.

However, Allegro right now does text rendering on a glyph by glyph bases.
But at the time the U is drawn, there is nothing which can be done any
longer. (Freetype as a fallback gives the " symbol for the combining
character (shifted left by its width) - but that's not supposed to work
well.)

Now what we can do is add support for glyph and font substitution (and
also layout, quite a few languages require right-to-left support). But it
means a completely new font addon, the current allegro_font and allegro_ttf
addons at a fundamental level are not designed for it.

Therefore I'll close this bug - you can add a feature request for "glyph
substitution", or just in general for a Pango-addon or text-layout addon
instead.

[1]: http://freetype.org/freetype2/docs/ft2faq.html#general-donts

----------------------------------------------------------------------

Comment By: Peter Wang (tjaden)
Date: 2009-08-20 14:40

Message:
Attached a screenshot of what happens on my system and the source. I will
try to investigate further tomorrow.

----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2009-08-20 14:00

Message:
Are you sure this bug is in Allegro? Here it looks exactly like it does in
other applications

Ü vs Ü

In the left one, the two dots are lower and to the right. Looks the same
pixel-by-pixel as A5 does it. Unless Firefox and A5 somehow have the same
bug, the problem is either in the used font or in Freetype.

Do you have a screenshot of using the same TTF file to display the Ü
with A5 and in another application, but have the other application display
it differently?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2840965&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/