Skip to content
Myr

stb_truetype: Fix a couple of CFF bugs

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

The CFF/Type 2 changes broke including without STB_TRUETYPE_IMPLEMENTATION defined, and had a typo. Sorry!

authored by Dougall Johnson · committed by GitHub · parent 94374c9 · Browse files · 1 file+6 added−6 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+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:stb_truetype.h+6 added-6 removed
458 unmodified lines
459460// private structure461typedef struct462{463 stbtt_uint8 *data;463 unsigned char *data;464 int cursor;465 int size;466} stbtt__buf;467
1283 unmodified lines
1751 if (y < c->min_y || !c->started) c->min_y = y;1752 c->started = 1;1753}17541755static void stbtt__cstx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1)1755static void stbtt__csctx_v(stbtt__csctx *c, stbtt_uint8 type, stbtt_int32 x, stbtt_int32 y, stbtt_int32 cx, stbtt_int32 cy, stbtt_int32 cx1, stbtt_int32 cy1)1756{1757 if (c->bounds) {1758 stbtt__track_vertex(c, x, y);1759 if (type == STBTT_vcubic) {
10 unmodified lines
17701771static void stbtt__csctx_close_shape(stbtt__csctx *ctx)1772{1773 if (ctx->first_x != ctx->x || ctx->first_y != ctx->y)1774 stbtt__cstx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0);1774 stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->first_x, (int)ctx->first_y, 0, 0, 0, 0);1775}17761777static void stbtt__csctx_rmove_to(stbtt__csctx *ctx, float dx, float dy)1778{1779 stbtt__csctx_close_shape(ctx);1780 ctx->first_x = ctx->x = ctx->x + dx;1781 ctx->first_y = ctx->y = ctx->y + dy;1782 stbtt__cstx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0);1782 stbtt__csctx_v(ctx, STBTT_vmove, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0);1783}17841785static void stbtt__csctx_rline_to(stbtt__csctx *ctx, float dx, float dy)1786{1787 ctx->x += dx;1788 ctx->y += dy;1789 stbtt__cstx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0);1789 stbtt__csctx_v(ctx, STBTT_vline, (int)ctx->x, (int)ctx->y, 0, 0, 0, 0);1790}17911792static void stbtt__csctx_rccurve_to(stbtt__csctx *ctx, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3)1793{
2 unmodified lines
1796 float cx2 = cx1 + dx2;1797 float cy2 = cy1 + dy2;1798 ctx->x = cx2 + dx3;1799 ctx->y = cy2 + dy3;1800 stbtt__cstx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2);1800 stbtt__csctx_v(ctx, STBTT_vcubic, (int)ctx->x, (int)ctx->y, (int)cx1, (int)cy1, (int)cx2, (int)cy2);1801}18021803static stbtt__buf stbtt__get_subr(stbtt__buf idx, int n)1804{
2214 unmodified lines