diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-03-08 01:27:27 +0100 |
---|---|---|
committer | João Abecasis <joao.abecasis@nokia.com> | 2012-03-08 01:27:39 +0100 |
commit | 12f221410fbe41d0b2efda4cd3289dfcf9044aa8 (patch) | |
tree | 897cf6bfb1814b0935982ff5975a6cbfb48d6d9e /src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | |
parent | 3d19422ef16a230bb11dbbfe4a8cc9667f39bf15 (diff) | |
parent | 6c612c933803ef57ea45e907d0181b40659148ac (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Change-Id: I89dc2e193bd01624c1fb50484610d516e39b1538
Diffstat (limited to 'src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp')
-rw-r--r-- | src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index af0ee52e9a..f6900325bc 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -995,7 +995,7 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta return stream; } -HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) +HB_Face HB_AllocFace(void *font, HB_GetFontTableFunc tableFunc) { HB_Face face = (HB_Face )malloc(sizeof(HB_FaceRec)); if (!face) @@ -1012,6 +1012,30 @@ HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) face->tmpLogClusters = 0; face->glyphs_substituted = false; face->buffer = 0; + face->font_for_init = font; + face->get_font_table_func = tableFunc; + + return face; +} + +HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) +{ + HB_Face face = HB_AllocFace(font, tableFunc); + if (face) + face = HB_LoadFace(face); + return face; +} + +HB_Face HB_LoadFace(HB_Face face) +{ + void *font = face->font_for_init; + if (!font) + return face; + + HB_GetFontTableFunc tableFunc = face->get_font_table_func; + + face->get_font_table_func = 0; + face->font_for_init = 0; HB_Error error = HB_Err_Ok; HB_Stream stream; |