Browse Source

Compatibility changes also to the unused nanoVG FT backend

pull/229/head
Jean Pierre Cimalando 3 years ago
parent
commit
ac7e275981
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      dgl/src/nanovg/fontstash.h

+ 10
- 0
dgl/src/nanovg/fontstash.h View File

@@ -215,9 +215,19 @@ int fons__tt_buildGlyphBitmap(FONSttFontImpl *font, int glyph, float size, float
FT_Fixed advFixed;
FONS_NOTUSED(scale);

#if 1
// Note(DPF) maintain pixel-based units for compat after nanovg update
ftError = FT_Set_Pixel_Sizes(font->font, 0, (FT_UInt)(size * (float)font->font->units_per_EM / (float)(font->font->ascender - font->font->descender)));
#else
ftError = FT_Set_Pixel_Sizes(font->font, 0, size);
#endif
if (ftError) return 0;
#if 1
// Note(DPF) maintain pixel-based units for compat after nanovg update
ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER);
#else
ftError = FT_Load_Glyph(font->font, glyph, FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT);
#endif
if (ftError) return 0;
ftError = FT_Get_Advance(font->font, glyph, FT_LOAD_NO_SCALE, &advFixed);
if (ftError) return 0;


Loading…
Cancel
Save