From b7fead52bc5e5c1df671e7b68cda20e8bd600c8b Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Fri, 6 Oct 2017 21:05:26 -0700 Subject: [PATCH] #317: patch thebes for graphite2 alignment issues; enable graphite fonts --- gfx/ots/src/ots.cc | 1 + gfx/thebes/gfxFontEntry.cpp | 7 +++++++ modules/libpref/init/all.js | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gfx/ots/src/ots.cc b/gfx/ots/src/ots.cc index 198a44035..281aa7288 100644 --- a/gfx/ots/src/ots.cc +++ b/gfx/ots/src/ots.cc @@ -960,6 +960,7 @@ bool Table::ShouldSerialize() { void Table::Message(int level, const char *format, va_list va) { char msg[206] = { OTS_UNTAG(m_tag), ':', ' ' }; std::vsnprintf(msg + 6, 200, format, va); +// fprintf(stderr, format, va); // font debugging, see TenFourFox issue 317 m_font->file->context->Message(level, msg); } diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index a333d0bfc..a046e4252 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -790,6 +790,13 @@ gfxFontEntry::GrGetTable(const void *aAppFaceHandle, unsigned int aName, unsigned int blobLength; const void *tableData = hb_blob_get_data(blob, &blobLength); fontEntry->mGrTableMap->Put(tableData, blob); + +/* TenFourFox issue 317: round up the reported length to the nearest 32-bit + word to work around various alignment issues with the structs Graphite2 + uses internally. */ + if (blobLength & 1) blobLength += 1; + if (blobLength & 2) blobLength += 2; + *aLen = blobLength; return tableData; } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index db8ac67a7..fcc2321c2 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -683,11 +683,7 @@ pref("gfx.font_rendering.wordcache.charlimit", 32); // cache shaped word results pref("gfx.font_rendering.wordcache.maxentries", 10000); -#ifdef RELEASE_BUILD -pref("gfx.font_rendering.graphite.enabled", false); -#else pref("gfx.font_rendering.graphite.enabled", true); -#endif #ifdef XP_WIN pref("gfx.font_rendering.directwrite.force-enabled", false);