truetypefs: fall back to width if advance is zero

combining marks will have zero advance, but it results in zero-width
glyphs in subfonts.  fall back to width so something meaningful is
rendered even if its not combined properly.
front
mischief 2018-10-12 08:34:17 -07:00
parent 3a41ce3bf3
commit aec4240c0c
1 changed files with 4 additions and 1 deletions

View File

@ -186,7 +186,10 @@ compilesub(TFont *f, TSubfont *s)
*p++ = 0;
*p++ = h;
*p++ = gs[i]->xminpx;
*p++ = gs[i]->advanceWidthpx;
if(gs[i]->advanceWidthpx != 0)
*p++ = gs[i]->advanceWidthpx;
else
*p++ = gs[i]->width;
x += gs[i]->width;
}
*p++ = x;