himselfv / wakan

Japanese and Chinese learning tool with dictionary
39 stars 7 forks source link

Fonts are not auto-detected properly when Japanese locale is active #126

Closed himselfv closed 11 years ago

himselfv commented 11 years ago

Original report by me.

Originally reported on Google Code with ID 126

And related problems:
- All fonts in font selection window are shown to be "ANSI"
- If Mincho/Gothic/etc are missing, try to choose a random font with appropriate coverage.
- Choose the font with the best available Unicode coverage (see msdn:DESIGNVECTOR)
+ When charset-filtering, for japanese look for SHIFTJIS_CHARSET, for chinese  GB2312_CHARSET
and CHINESEBIG5_CHARSET for different cases.
- Support fallback for Latin fonts too:
  Verdana->Tahoma->default screen font
  Arial->default screen font
 This might seem not needed on Windows, but suppose we're running under Wine.

Some comments:
+ No auto-detect on Japanese locale: as the reporter correctly stated elsewhere, some
(asian) fonts have two names, localized and english ones. Since Windows 2000 both are
accepted everywhere, but Delphi's Screen.Fonts lists only one, which was the reason
auto-detection believed they are missing. Fixed by querying EnumFontFamilies instead.
- All fonts ANSI: Older fonts declare one or several charsets they support. Newer ones
simply declare itself as UNICODE and Windows always reports them as ANSI. This sucks,
but there's a way to retrieve their coverage of Unicode blocks, so we'll manage.

Reported by himselfv on 2013-03-13 14:12:47

himselfv commented 11 years ago
- Do not assume fixed font names if a single font setting is not found in registry.
- "Missing fonts are preceded by !" have to hold true, no matter the changes

Reported by himselfv on 2013-03-13 14:30:13

himselfv commented 11 years ago
x Do not assume fixed font names if a single font setting is not found in registry.
Whatever.

+ "Missing fonts are preceded by !" have to hold true, no matter the changes
Done.

+ If Mincho/Gothic/etc are missing, try to choose a random font with appropriate coverage.

x All fonts in font selection window are shown to be "ANSI"
x Choose the font with the best available Unicode coverage (see msdn:DESIGNVECTOR)
x Support fallback for Latin fonts too

Not doing for now. Latin fonts exist almost everywhere so no gain. And I'm too lazy
to mess with Unicode coverage unless someone asks for it.

@r441.

Reported by himselfv on 2013-03-14 06:35:06