summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-04-25 13:12:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-28 19:49:56 +0200
commit40b195d0f9ee7ef1b917a635bb073fa108b2ed40 (patch)
tree3c264c4772fbc190b92376549bfa42b17fa05bb4 /src/3rdparty
parent9ab41425519510b5bfbe93ac916e3f40aa0e4510 (diff)
Fix font fallback handling with Harfbuzz and CoreText
Comparing CGFontRefs is not reliable it seems, CFEqual on them appears to compare pointers and there's no guarantee that CTFontCopyGraphicsFont returns the same pointer all the time. So instead let's compare CTFontRefs, which we keep around and also provide as input to CoreText shaping. Task-number: 38363 Change-Id: I6073ea88f0c9f5ebf49d17cba0d76041ade32570 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-coretext.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
index 4a905ee189..4fef861acc 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
@@ -690,13 +690,10 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
*/
CFDictionaryRef attributes = CTRunGetAttributes (run);
CTFontRef run_ct_font = static_cast<CTFontRef>(CFDictionaryGetValue (attributes, kCTFontAttributeName));
- CGFontRef run_cg_font = CTFontCopyGraphicsFont (run_ct_font, 0);
CFRange range = CTRunGetStringRange (run);
- if (!CFEqual (run_cg_font, face_data->cg_font))
+ if (!CFEqual (run_ct_font, font_data->ct_font))
{
- CFRelease (run_cg_font);
-
buffer->ensure (buffer->len + range.length);
if (buffer->in_error)
FAIL ("Buffer resize failed");
@@ -731,7 +728,6 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan,
}
continue;
}
- CFRelease (run_cg_font);
/* CoreText throws away the PDF token, while the OpenType backend will add a zero-advance
* glyph for this. We need to make sure the two produce the same output. */