Skip to content
Myr

Update stbtt_fontinfo.userdata field on paths where user never has access to it.

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 · parent ad9a570 · Browse files · 1 file+4 added−2 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+4 added−2 removed

  • other:+4 added−2 removed

1 file+4 added−2 removed

modified:stb_truetype.h+4 added-2 removed
48 unmodified lines
49// Ryan Gordon50//51// VERSION HISTORY52//53// 1.09 (2016-01-16) warning fix; avoid crash on outofmem53// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use allocation userdata properly54// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges55// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;56// variant PackFontRanges to pack and render in separate phases;57// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);
2463 unmodified lines
2521{2522 float scale;2523 int x,y,bottom_y, i;2524 stbtt_fontinfo f;2525 f.userdata = NULL;2526 if (!stbtt_InitFont(&f, data, offset))2527 return -1;2528 STBTT_memset(pixels, 0, pw*ph); // background of 0 around pixels2529 x=y=1;
456 unmodified lines
2986 rects = (stbrp_rect *) STBTT_malloc(sizeof(*rects) * n, spc->user_allocator_context);2987 if (rects == NULL)2988 return 0;29892990 info.userdata = spc->user_allocator_context;2991 stbtt_InitFont(&info, fontdata, stbtt_GetFontOffsetForIndex(fontdata,font_index));29922993 n = stbtt_PackFontRangesGatherRects(spc, &info, ranges, num_ranges, rects);2994
209 unmodified lines
320432053206// FULL VERSION HISTORY3207//3206// 1.09 (2016-01-16) warning fix; avoid crash on outofmem3208// 1.09 (2016-01-16) warning fix; avoid crash on outofmem; use alloc userdata for PackFontRanges3209// 1.08 (2015-09-13) document stbtt_Rasterize(); fixes for vertical & horizontal edges3210// 1.07 (2015-08-01) allow PackFontRanges to accept arrays of sparse codepoints;3211// allow PackFontRanges to pack and render in separate phases;3212// fix stbtt_GetFontOFfsetForIndex (never worked for non-0 input?);
37 unmodified lines