Browse Source

Forces autohint when loading glyph using FreeType.

This commit adds the `FT_LOAD_FORCE_AUTOHINT` parameter to `FT_Load_Glyph()` to fix wonky characters.
shared-context
Olli Wang 6 years ago
parent
commit
83da90e1c8
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/fontstash.h

+ 1
- 1
src/fontstash.h View File

@@ -204,7 +204,7 @@ int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float


ftError = FT_Set_Pixel_Sizes(font->font, 0, (FT_UInt)(size * (float)font->font->units_per_EM / (float)(font->font->ascender - font->font->descender))); ftError = FT_Set_Pixel_Sizes(font->font, 0, (FT_UInt)(size * (float)font->font->units_per_EM / (float)(font->font->ascender - font->font->descender)));
if (ftError) return 0; if (ftError) return 0;
ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER);
ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT);
if (ftError) return 0; if (ftError) return 0;
ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed); ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed);
if (ftError) return 0; if (ftError) return 0;


Loading…
Cancel
Save