From 655f7e95b6132f998ccf867b414be3910bdd506d Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 2 Oct 2013 06:56:05 +0200 Subject: [PATCH] Support multiple scripts. [2/7] Pass `sfnt' to functions which use CVT_* macros. In forthcoming changes we have to access script-specific blue zone data. --- lib/tabytecode.c | 9 +++++++-- lib/tafpgm.c | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/tabytecode.c b/lib/tabytecode.c index a23c480..5871ad0 100644 --- a/lib/tabytecode.c +++ b/lib/tabytecode.c @@ -43,6 +43,7 @@ typedef struct Hints_Record_ typedef struct Recorder_ { + SFNT* sfnt; FONT* font; GLYPH* glyph; /* the current glyph */ Hints_Record hints_record; @@ -1126,6 +1127,7 @@ TA_hints_recorder(TA_Action action, TA_Point points = hints->points; Recorder* recorder = (Recorder*)hints->user; + SFNT* sfnt = recorder->sfnt; FONT* font = recorder->font; FT_UShort* wraps = recorder->wrap_around_segments; FT_Byte* p = recorder->hints_record.buf; @@ -1498,6 +1500,7 @@ TA_hints_recorder(TA_Action action, static FT_Error TA_init_recorder(Recorder* recorder, + SFNT* sfnt, FONT* font, GLYPH* glyph, TA_GlyphHints hints) @@ -1514,6 +1517,7 @@ TA_init_recorder(Recorder* recorder, FT_UShort num_strong_points = 0; FT_UShort* wrap_around_segment; + recorder->sfnt = sfnt; recorder->font = font; recorder->glyph = glyph; recorder->num_segments = axis->num_segments; @@ -1745,7 +1749,8 @@ TA_sfnt_build_glyph_instructions(SFNT* sfnt, if (font->loader->metrics->script_class == &ta_dflt_script_class) { /* since `TA_init_recorder' hasn't been called yet, */ - /* we manually initialize the `font' and `glyph' fields */ + /* we manually initialize the `sfnt', `font', and `glyph' fields */ + recorder.sfnt = sfnt; recorder.font = font; recorder.glyph = glyph; @@ -1759,7 +1764,7 @@ TA_sfnt_build_glyph_instructions(SFNT* sfnt, goto Done1; } - error = TA_init_recorder(&recorder, font, glyph, hints); + error = TA_init_recorder(&recorder, sfnt, font, glyph, hints); if (error) goto Err; diff --git a/lib/tafpgm.c b/lib/tafpgm.c index eff48c2..63967b9 100644 --- a/lib/tafpgm.c +++ b/lib/tafpgm.c @@ -5112,6 +5112,7 @@ unsigned char FPGM(bci_hint_glyph) [] = static FT_Error TA_table_build_fpgm(FT_Byte** fpgm, FT_ULong* fpgm_len, + SFNT* sfnt, FONT* font) { FT_UInt buf_len; @@ -5452,7 +5453,7 @@ TA_sfnt_build_fpgm_table(SFNT* sfnt, goto Exit; } - error = TA_table_build_fpgm(&fpgm_buf, &fpgm_len, font); + error = TA_table_build_fpgm(&fpgm_buf, &fpgm_len, sfnt, font); if (error) goto Exit; -- 2.11.4.GIT