gnash-dev
[Top][All Lists]
Advanced

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

[Gnash-dev] PATCH: gnash 0.8.5: match TTF fonts on the fullname attribut


From: Bernd Kischnick
Subject: [Gnash-dev] PATCH: gnash 0.8.5: match TTF fonts on the fullname attribute
Date: Fri, 18 Jun 2010 11:04:07 +0200

Hi all,

this is a patch for gnash 0.8.5.

gnash refused to display bold fonts for us, displaying a completely different font instead. This turned out to be caused by the encoding of the font in the SWF in combination with the font-matching rules of the freetype2 library.

If you use TextFields with the option "use device fonts" (in Adobe Flash), then the font name and properties are encoded into the SWF. The encoding seems to combine the font family name and the font style in a single string. e.g., you try to use font family "DejaVu Sans", style "Bold", then the SWF contains the font name "DejaVu Sans Bold".

gnash 0.8.5 passes this string to the freetype library to match, using function FcNameParse(). But freetype essentially matches the name on the font family attribute only, so it tries and fails to find fonts with font family "DejaVu Sans Bold", and returns a default sans-serif font instead. (Observed with freetype2 2.3.7) In fact the string used by flash is present as the "fullname" attribute in the fonts. Freetype doesn't allow for a simple match on the "fullname" attribute, so we enumerate all the fonts find a match.

I've not checked whether gnash 0.8.6 or 0.8.7 show the same behaviour.
Also, one could argue that freetype should be enhanced instead of gnash.

- Bernd Kischnick

Attachment: gnash-0.8.5-fontnamematching.patch
Description: Binary data


reply via email to

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