Adjust the font's height when creating the bitmap

Now the font's height to compute the bitmap is computed correcty but:

- STB truetype takes the pixel height as a float
- AGG takes an integer
This commit is contained in:
Francesco Abbate
2020-05-30 20:01:37 +02:00
parent 4334d09bab
commit 7c57b1d6ca
3 changed files with 16 additions and 53 deletions
+1
View File
@@ -107,6 +107,7 @@ retry:
float s =
stbtt_ScaleForMappingEmToPixels(&font->stbfont, 1) /
stbtt_ScaleForPixelHeight(&font->stbfont, 1);
fprintf(stderr, "Using height: %g in BakeFontBitmap\n", font->size * s);
int res = stbtt_BakeFontBitmap(
font->data, 0, font->size * s, (void*) set->image->pixels,
width, height, idx * 256, 256, set->glyphs);