Skip to content
Myr

Merge branch 'truetype-skip_missing_glyphs' of https://github.com/ocornut/stb into working

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

authored by Sean Barrett · committed by Sean Barrett · parents 9092c04, 886cca8 · 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
3975 unmodified lines
3976 for (j=0; j < ranges[i].num_chars; ++j) {3977 int x0,y0,x1,y1;3978 int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];3979 int glyph = stbtt_FindGlyphIndex(info, codepoint);3980 if (glyph != 0) {3980 stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,3981 scale * spc->h_oversample,3982 scale * spc->v_oversample,3983 0,0,3984 &x0,&y0,&x1,&y1);3985 rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);3986 rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);3981 stbtt_GetGlyphBitmapBoxSubpixel(info,glyph,3982 scale * spc->h_oversample,3983 scale * spc->v_oversample,3984 0,0,3985 &x0,&y0,&x1,&y1);3986 rects[k].w = (stbrp_coord) (x1-x0 + spc->padding + spc->h_oversample-1);3987 rects[k].h = (stbrp_coord) (y1-y0 + spc->padding + spc->v_oversample-1);3988 } else {3989 rects[k].w = rects[k].h = 0;3990 }3991 ++k;3992 }3993 }3994
44 unmodified lines
4039 sub_x = stbtt__oversample_shift(spc->h_oversample);4040 sub_y = stbtt__oversample_shift(spc->v_oversample);4041 for (j=0; j < ranges[i].num_chars; ++j) {4042 stbrp_rect *r = &rects[k];4039 if (r->was_packed) {4043 if (r->was_packed && r->w != 0 && r->h != 0) {4044 stbtt_packedchar *bc = &ranges[i].chardata_for_range[j];4045 int advance, lsb, x0,y0,x1,y1;4046 int codepoint = ranges[i].array_of_unicode_codepoints == NULL ? ranges[i].first_unicode_codepoint_in_range + j : ranges[i].array_of_unicode_codepoints[j];4047 int glyph = stbtt_FindGlyphIndex(info, codepoint);
833 unmodified lines