Skip to content
Myr

stb_truetype: stbtt_PackFontRanges skip missing glyphs.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Omar · committed by Omar · parent e6afb9c · Browse files · 1 file+12 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−8 removed

  • other:+12 added−8 removed

1 file+12 added−8 removed

modified:stb_truetype.h+12 added-8 removed
3965 unmodified lines
3966 for (j=0; j < ranges[i].num_chars; ++j) {3967 int x0,y0,x1,y1;3968 int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];3969 int glyph = stbtt_FindGlyphIndex(info, codepoint);3970 if (glyph != 0) {3970 stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,3971 scale * spc->h_oversample,3972 scale * spc->v_oversample,3973 0,0,3974 &x0,&y0,&x1,&y1);3975 rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);3976 rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);3971 stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,3972 scale * spc->h_oversample,3973 scale * spc->v_oversample,3974 0,0,3975 &x0,&y0,&x1,&y1);3976 rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);3977 rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);3978 } else {3979 rects[k].w = rects[k].h = 0;3980 }3981 ++k;3982 }3983 }3984
44 unmodified lines
4029 sub_x = stbtt__oversample_shift(spc->h_oversample);4030 sub_y = stbtt__oversample_shift(spc->v_oversample);4031 for (j=0; j < ranges[i].num_chars; ++j) {4032 stbrp_rect *r = &rects[k];4029 if (r->was_packed) {4033 if (r->was_packed && r->w != 0 && r->h != 0) {4034 stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];4035 int advance, lsb, x0,y0,x1,y1;4036 int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];4037 int glyph = stbtt_FindGlyphIndex(info, codepoint);
820 unmodified lines