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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp

Issue 2581083003: Initial OpenType Font Variations Support (Closed)
Patch Set: Fix makeUnique syntax Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag) { 93 ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag) {
94 const uint32_t cbdtTag = OTS_TAG('C', 'B', 'D', 'T'); 94 const uint32_t cbdtTag = OTS_TAG('C', 'B', 'D', 'T');
95 const uint32_t cblcTag = OTS_TAG('C', 'B', 'L', 'C'); 95 const uint32_t cblcTag = OTS_TAG('C', 'B', 'L', 'C');
96 const uint32_t colrTag = OTS_TAG('C', 'O', 'L', 'R'); 96 const uint32_t colrTag = OTS_TAG('C', 'O', 'L', 'R');
97 const uint32_t cpalTag = OTS_TAG('C', 'P', 'A', 'L'); 97 const uint32_t cpalTag = OTS_TAG('C', 'P', 'A', 'L');
98 #if HB_VERSION_ATLEAST(1, 0, 0) 98 #if HB_VERSION_ATLEAST(1, 0, 0)
99 const uint32_t gdefTag = OTS_TAG('G', 'D', 'E', 'F'); 99 const uint32_t gdefTag = OTS_TAG('G', 'D', 'E', 'F');
100 const uint32_t gposTag = OTS_TAG('G', 'P', 'O', 'S'); 100 const uint32_t gposTag = OTS_TAG('G', 'P', 'O', 'S');
101 const uint32_t gsubTag = OTS_TAG('G', 'S', 'U', 'B'); 101 const uint32_t gsubTag = OTS_TAG('G', 'S', 'U', 'B');
102
103 // Font Variations related tables
104 // See "Variation Tables" in Terminology section of
105 // https://www.microsoft.com/typography/otspec/otvaroverview.htm
106 const uint32_t avarTag = OTS_TAG('a', 'v', 'a', 'r');
107 const uint32_t cvarTag = OTS_TAG('c', 'v', 'a', 'r');
108 const uint32_t fvarTag = OTS_TAG('f', 'v', 'a', 'r');
109 const uint32_t gvarTag = OTS_TAG('g', 'v', 'a', 'r');
110 const uint32_t hvarTag = OTS_TAG('H', 'V', 'A', 'R');
111 const uint32_t mvarTag = OTS_TAG('M', 'V', 'A', 'R');
112 const uint32_t vvarTag = OTS_TAG('V', 'V', 'A', 'R');
102 #endif 113 #endif
103 114
104 switch (tag) { 115 switch (tag) {
105 // Google Color Emoji Tables 116 // Google Color Emoji Tables
106 case cbdtTag: 117 case cbdtTag:
107 case cblcTag: 118 case cblcTag:
108 // Windows Color Emoji Tables 119 // Windows Color Emoji Tables
109 case colrTag: 120 case colrTag:
110 case cpalTag: 121 case cpalTag:
111 #if HB_VERSION_ATLEAST(1, 0, 0) 122 #if HB_VERSION_ATLEAST(1, 0, 0)
112 // Let HarfBuzz handle how to deal with broken tables. 123 // Let HarfBuzz handle how to deal with broken tables.
124 case avarTag:
125 case cvarTag:
126 case fvarTag:
127 case gvarTag:
128 case hvarTag:
129 case mvarTag:
130 case vvarTag:
113 case gdefTag: 131 case gdefTag:
114 case gposTag: 132 case gposTag:
115 case gsubTag: 133 case gsubTag:
116 #endif 134 #endif
117 return ots::TABLE_ACTION_PASSTHRU; 135 return ots::TABLE_ACTION_PASSTHRU;
118 default: 136 default:
119 return ots::TABLE_ACTION_DEFAULT; 137 return ots::TABLE_ACTION_DEFAULT;
120 } 138 }
121 } 139 }
122 140
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (!typeface) { 226 if (!typeface) {
209 setErrorString("Not a valid font data"); 227 setErrorString("Not a valid font data");
210 return nullptr; 228 return nullptr;
211 } 229 }
212 230
213 m_decodedSize = decodedLength; 231 m_decodedSize = decodedLength;
214 return typeface; 232 return typeface;
215 } 233 }
216 234
217 } // namespace blink 235 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698