Windows bitmap fonts (like font named "Small Fonts" - smalle.fon) does not show
up when processed by win32 backend. More -- they does not give any status about
the failure, so the user does not know that something went wrong.
Internally "Small Fonts" is processed using win32 module _scaled_* functions
so it seems to be wrong by definition.
Processing ends up on querying the font with GetGlyphOutlineW that returns
an error (that is not passed down to the caller).
By MSDN definition "The GetGlyphOutline function retrieves the outline
or bitmap for a character in the *TrueType* font".
Created attachment 8482 [details] [review]
workaround: Force Windows to select from among TrueType fonts only
1. Add support for the windows bitmap fonts
- this can be difficult since lack of scaling, and rotation only at 0, 90, 180,
2. Return an error status indicating that this kind of font is available on the
system but unsupported
3. Treat the bitmap font like missing/unknown font (i.e. use default one)
3a. Force Windows to select from among scalable fonts only.
Attached patch adds OUT_TT_ONLY_PRECIS flag to CreateFontIndirect call.
OUT_TT_ONLY_PRECIS: Instructs the font mapper to choose from only TrueType
fonts. If there are no TrueType fonts installed in the system, the font mapper
returns to default behavior.
"only TrueType fonts" may be to limiting, but seems to be good workaround (at
the moment at least)...
Alternative OUT_OUTLINE_PRECIS option didn't seem to work for me.
There has been some recent patches committed to fix Windows bitmap fonts. The latest git version should work for bitmap fonts that are not rotated.
The workaround you suggested can be done from your application. Just set the LOGFONT to filter out bitmaps then call cairo_win32_font_face_create_for_logfontw(). Also your patch excludes OpenType/PS and Type 1 fonts. I would suggest:
logfont.lfOutPrecision = OUT_OUTLINE_PRECIS
Closing this as the original bug report "bitmap fonts do not show up" has been fixed. Since 1.8.0 bitmap fonts should be working fine.