Skip to content

Instantly share code, notes, and snippets.

@trustin
Created November 1, 2013 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trustin/7269400 to your computer and use it in GitHub Desktop.
Save trustin/7269400 to your computer and use it in GitHub Desktop.
Wine patch for saner font hinting configuration, which applies 'hintslight' for ASCII glyphs and 'hintnone' for others such as CJK glyphs. I hope Wine uses fontconfig to respect the hintstyle, lcdfilter, and rgba properties like other GTK apps do.
diff -urN wine-orig/dlls/gdi32/freetype.c wine-patched/dlls/gdi32/freetype.c
--- wine-orig/dlls/gdi32/freetype.c 2013-07-19 02:57:36.000000000 +0900
+++ wine-patched/dlls/gdi32/freetype.c 2013-11-01 11:05:11.998232947 +0900
@@ -6199,10 +6199,15 @@
}
if(format & GGO_UNHINTED) {
- load_flags |= FT_LOAD_NO_HINTING;
format &= ~GGO_UNHINTED;
}
+ if ((format & GGO_GLYPH_INDEX) || original_index > 255) {
+ load_flags |= FT_LOAD_NO_HINTING;
+ } else {
+ load_flags |= FT_LOAD_TARGET_LIGHT;
+ }
+
if(original_index >= font->gmsize * GM_BLOCK_SIZE) {
font->gmsize = (original_index / GM_BLOCK_SIZE + 1);
font->gm = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, font->gm,
@trustin
Copy link
Author

trustin commented Nov 1, 2013

Screenshot which shows nicely rendered text: http://i.imgur.com/oYpsCHX.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment