Bug 59480 - Bitmap fonts (in FON-Format) are rendered as Helvetica-like fonts
Summary: Bitmap fonts (in FON-Format) are rendered as Helvetica-like fonts
Status: RESOLVED MOVED
Alias: None
Product: fontconfig
Classification: Unclassified
Component: conf (show other bugs)
Version: 2.9
Hardware: All All
: medium normal
Assignee: fontconfig-bugs
QA Contact: Behdad Esfahbod
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-16 20:00 UTC by Scit2010
Modified: 2018-08-20 21:49 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Result of fc-query command on one of the affected fonts (430 bytes, text/plain)
2013-01-17 19:49 UTC, Scit2010
Details

Description Scit2010 2013-01-16 20:00:48 UTC
In GIMP 2.8.2 for Windows and Mac OS X we have the problem, that bitmap fonts are shown as bold Helvetica-like fonts (on Windows it looks closest to FixedSys, on Mac to Arial Hebrew). See also https://bugzilla.gnome.org/show_bug.cgi?id=691782.
At least the Windows build uses FontConfig 2.9.0.
On several sites I read FontConfig disabled bitmap font support by default a longer time ago. I tried to reenable it by applying the advices for Linux analogously to Windows (e.g. copyied C:\Program Files\GIMP 2\etc\fonts\conf.avail\70-yes-bitmaps.conf to ..\conf.d, removed C:\Program Files\GIMP 2\etc\fonts\conf.avail\70-no-bitmaps.conf, refreshed the font cache in GIMP and extra restarted GIMP) - nothing helped.
Comment 1 Akira TAGOH 2013-01-17 05:37:50 UTC
Try first if you can see that font with fc-list. if not, possible reason why it's disabled in fontconfig is because it may be missing encoding to map glyphs. you can check that with fc-query if no hexadecimal blocks are shown in charset section.
Comment 2 Scit2010 2013-01-17 19:49:35 UTC
Created attachment 73196 [details]
Result of fc-query command on one of the affected fonts

I tested on Mac OS X, because I have no fontconfig on Windows (GIMP only has a fontconfig DLL).
Results of fc-list: 
font is not found. When I copy the font into the /Library/Fonts folder, fc-list finds it. However, it's not rendered correctly in GIMP.

Results of fc-query: see attachment.
Comment 3 Akira TAGOH 2013-01-22 03:19:07 UTC
(In reply to comment #2)
> Created attachment 73196 [details]

That explains why this happened. that font seems not containing any information to determine the charset. so fontconfig won't help anything for such fonts. that said, freetype is capable to deal with it so you can still open it with freetype API directly though.
Comment 4 Scit2010 2013-01-23 04:02:31 UTC
Thank you for your answer. 
The GIMP application uses FontConfig as well as FreeType. However the fonts are rendered wrong. What else can we do?
Comment 5 Akira TAGOH 2013-01-23 07:25:00 UTC
Has that font ever been rendered correctly?

I suppose the default behavior is expecting that the font is in Unicode. if that font isn't, I'm not that surprised the rendering is wrong.

After some research, I see now FON-format version 3 has a field to determine the charset. so given that that font contains any charset information, there are two steps to render it properly.

1) implement FcFontDecode in fcfreetype.c for that
2) Use FcFreeTypeCharIndex() instead of FT_Get_Char_Index() in applications (in this case in GIMP if not yet)

I'm not sure if it's worth doing. if appearing those fonts in the list is the issue, blacklisting it may be easier perhaps.
Comment 6 Michael Natterer 2013-03-24 23:46:17 UTC
It's certainly not worth to consider such fonts for any kind of advanced typesetting, but bitmap fonts are of course a valid case for artistic purposes, as in every text is also an image. This particularly applies to GIMP. It would be nice if they just worked via fontconfig.
Comment 7 Michael Natterer 2013-03-24 23:56:10 UTC
Apparently the fonts rendered correctly when GIMP still used freetype
directly to render the glyphs. These days we simply say
pango_cairo_show_layout(). Is fontconfig at all the right place to
report this?
Comment 8 Akira TAGOH 2013-03-27 04:31:18 UTC
maybe since cairo also uses fontconfig to determine. though this is lower priority for me or even wonder if we should support non-Unicode-mapped fonts.
Comment 9 Behdad Esfahbod 2013-03-27 17:01:47 UTC
The place to fix this is definitely in Fontconfig.

mitch, bitmap fonts generally works.  It's 'FON' fonts that seem to be at issue here, not all bitmap formats.

Akira, in case you want to give it a try, ftwinfnt.h may be a good place to start.
Comment 10 GitLab Migration User 2018-08-20 21:49:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/67.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.