summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-03-08 01:27:27 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-03-08 01:27:39 +0100
commit12f221410fbe41d0b2efda4cd3289dfcf9044aa8 (patch)
tree897cf6bfb1814b0935982ff5975a6cbfb48d6d9e /src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
parent3d19422ef16a230bb11dbbfe4a8cc9667f39bf15 (diff)
parent6c612c933803ef57ea45e907d0181b40659148ac (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Diffstat (limited to 'src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp26
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;