Browse Source

Merge pull request #563 from olliwang/linegap

Fixes the issue that line gap may ruin the text layout.
shared-context
Mikko Mononen GitHub 5 years ago
parent
commit
db50e12d03
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/fontstash.h

+ 2
- 1
src/fontstash.h View File

@@ -964,10 +964,11 @@ int fonsAddFontMem(FONScontext* stash, const char* name, unsigned char* data, in
// Store normalized line height. The real line height is got
// by multiplying the lineh by font size.
fons__tt_getFontVMetrics( &font->font, &ascent, &descent, &lineGap);
ascent += lineGap;
fh = ascent - descent;
font->ascender = (float)ascent / (float)fh;
font->descender = (float)descent / (float)fh;
font->lineh = (float)(fh + lineGap) / (float)fh;
font->lineh = font->ascender - font->descender;

return idx;



Loading…
Cancel
Save