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

Unified Diff: trunk/src/ots.cc

Issue 341983012: OTS: Add DoNotDropColorBitmapTables() API. (Closed) Base URL: http://ots.googlecode.com/svn/
Patch Set: Created 6 years, 6 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 | « trunk/src/ots.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ots.cc
===================================================================
--- trunk/src/ots.cc (revision 113)
+++ trunk/src/ots.cc (working copy)
@@ -143,6 +143,10 @@
ots::ots_vmtx_should_serialise, ots::ots_vmtx_free, false },
{ "MATH", ots::ots_math_parse, ots::ots_math_serialise,
ots::ots_math_should_serialise, ots::ots_math_free, false },
+ { "CBDT", ots::ots_cbdt_parse, ots::ots_cbdt_serialise,
+ ots::ots_cbdt_should_serialise, ots::ots_cbdt_free, false },
+ { "CBLC", ots::ots_cblc_parse, ots::ots_cblc_serialise,
+ ots::ots_cblc_should_serialise, ots::ots_cblc_free, false },
// TODO(bashi): Support mort, base, and jstf tables.
{ 0, NULL, NULL, NULL, NULL, false },
};
@@ -557,9 +561,8 @@
return OTS_FAILURE();
}
} else {
- if (!header->glyf || !header->loca) {
- // No TrueType glyph found.
- // Note: bitmap-only fonts are not supported.
+ if ((!header->glyf || !header->loca) && (!header->cbdt || !header->cblc)) {
+ // No TrueType glyph or color bitmap found.
return OTS_FAILURE();
}
}
@@ -685,6 +688,8 @@
namespace ots {
+bool g_drop_color_bitmap_tables = true;
+
bool IsValidVersionTag(uint32_t tag) {
return tag == Tag("\x00\x01\x00\x00") ||
// OpenType fonts with CFF data have 'OTTO' tag.
@@ -702,6 +707,10 @@
g_enable_woff2 = true;
}
+void DoNotDropColorBitmapTables() {
+ g_drop_color_bitmap_tables = false;
+}
+
bool Process(OTSStream *output, const uint8_t *data, size_t length) {
OpenTypeFile header;
if (length < 4) {
« no previous file with comments | « trunk/src/ots.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698