#317: patch thebes for graphite2 alignment issues; enable graphite fonts

This commit is contained in:
Cameron Kaiser 2017-10-06 21:05:26 -07:00
parent 083639c711
commit b7fead52bc
3 changed files with 8 additions and 4 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);