Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1309)

Unified Diff: Source/platform/fonts/opentype/OpenTypeSanitizer.cpp

Issue 1306343006: Make OTS passthru GDEF/GSUB/GPOS tables (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
diff --git a/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp b/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
index d01193b0c5254929d1b8b64f6a4a29afc0465b78..9ea591bcdd19afccd9497e97afd84978cf5b1af5 100644
--- a/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
+++ b/Source/platform/fonts/opentype/OpenTypeSanitizer.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "platform/fonts/opentype/OpenTypeSanitizer.h"
+#include "hb.h"
#include "ots-memory-stream.h"
#include "platform/SharedBuffer.h"
#include "platform/TraceEvent.h"
@@ -130,6 +131,10 @@ void BlinkOTSContext::Message(int level, const char *format, ...)
}
}
+#if !defined(HB_VERSION_ATLEAST)
+#define HB_VERSION_ATLEAST(major, minor, micro) 0
eae 2015/09/03 23:35:29 Why is this needed?
eae 2015/09/04 00:26:50 If so I'd prefer the check at line 157 to look som
+#endif
+
ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag)
{
#define TABLE_TAG(c1, c2, c3, c4) ((uint32_t)((((uint8_t)(c1)) << 24) | (((uint8_t)(c2)) << 16) | (((uint8_t)(c3)) << 8) | ((uint8_t)(c4))))
@@ -138,6 +143,9 @@ ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag)
const uint32_t cblcTag = TABLE_TAG('C', 'B', 'L', 'C');
const uint32_t colrTag = TABLE_TAG('C', 'O', 'L', 'R');
const uint32_t cpalTag = TABLE_TAG('C', 'P', 'A', 'L');
+ const uint32_t gdefTag = TABLE_TAG('G', 'D', 'E', 'F');
achuithb 2015/09/10 09:11:28 These need to be surrounded by #if HB_VERSION_ATLE
+ const uint32_t gposTag = TABLE_TAG('G', 'P', 'O', 'S');
+ const uint32_t gsubTag = TABLE_TAG('G', 'S', 'U', 'B');
switch (tag) {
// Google Color Emoji Tables
@@ -146,6 +154,12 @@ ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag)
// Windows Color Emoji Tables
case colrTag:
case cpalTag:
+#if HB_VERSION_ATLEAST(1, 0, 0)
+ // Let HarfBuzz handle how to deal with broken tables.
+ case gdefTag:
+ case gposTag:
+ case gsubTag:
+#endif
return ots::TABLE_ACTION_PASSTHRU;
default:
return ots::TABLE_ACTION_DEFAULT;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698