Commit Graph

10 Commits

Author SHA1 Message Date
wangqr cdebf5f3d4 Handle long path in GDI font lister 2020-04-09 11:03:23 -04:00
wangqr cd7ee8d505 Use the first matched font in GDI font lister
Previously, when reading font data, we only set FaceName to the matched font. When we are using some font with special font weight (e.g. @Source Han Sans J Heavy), if we do not correct the font weight in the LOGFONTW struct, then subsequent call to get_font_data will fall back to default font. This causes wrongly matching Arial.ttf to any font that does not provide standard font weights.

Instead of only correcting FaceName using the matched font, we simply use the first matched font, thus the FaceName, Weight, CharSet, etc. will all be correct. This also eliminates the memcpy.
2020-01-05 17:12:02 -05:00
wangqr 7c500a096a Search user fonts in GDI font lister
Windows now allow user install fonts without admin. List HKCU for those fonts.
https://blogs.windows.com/windowsexperience/2018/06/27/announcing-windows-10-insider-preview-build-17704/
2019-09-13 15:49:15 -04:00
Thomas Goyne dba8f1c062 Use Uniscribe to check glyph coverage of non-BMP characters rather than just skipping them 2016-04-08 11:24:26 -07:00
Thomas Goyne bb3e0de728 Handle i/o errors when indexing fonts for GDI 2016-01-10 19:47:25 -08:00
Thomas Goyne 913b8438f3 Fix Windows x64 compilation 2015-12-29 19:55:58 -08:00
Thomas Goyne 3b13260ca1 Use murmur3 to explicitly hash the font index keys
This significantly improves performance by avoiding the need to
construct std::strings of the things to be hashed, eliminating a bunch
of memory allocations and copies.
2015-12-29 12:38:01 -08:00
Thomas Goyne 879661a379 Only index the first kilobyte of font files to speed up indexing 2015-12-29 12:38:00 -08:00
Thomas Goyne 82f250dbbb Fix the checks for fake bold/italic
EnumFontFamiliesEx doesn't actually use the lfItalic andlfWeight fields,
so we have to check separately.
2015-12-29 12:38:00 -08:00
Thomas Goyne ddc5cd155f Add a GDI-based fonts collector backend 2015-12-29 12:38:00 -08:00