OLD | NEW |
---|---|
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 13 matching lines...) Expand all Loading... | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "platform/fonts/opentype/OpenTypeSanitizer.h" | 32 #include "platform/fonts/opentype/OpenTypeSanitizer.h" |
33 | 33 |
34 #include "hb.h" | |
34 #include "ots-memory-stream.h" | 35 #include "ots-memory-stream.h" |
35 #include "platform/SharedBuffer.h" | 36 #include "platform/SharedBuffer.h" |
36 #include "platform/TraceEvent.h" | 37 #include "platform/TraceEvent.h" |
37 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
38 #include "wtf/CurrentTime.h" | 39 #include "wtf/CurrentTime.h" |
39 | 40 |
40 #include <stdarg.h> | 41 #include <stdarg.h> |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 unsigned len = result; | 124 unsigned len = result; |
124 buffer.grow(len + 1); | 125 buffer.grow(len + 1); |
125 | 126 |
126 va_start(args, format); | 127 va_start(args, format); |
127 vsnprintf(buffer.data(), buffer.size(), format, args); | 128 vsnprintf(buffer.data(), buffer.size(), format, args); |
128 va_end(args); | 129 va_end(args); |
129 m_errorString = StringImpl::create(reinterpret_cast<const LChar*>(buffer .data()), len); | 130 m_errorString = StringImpl::create(reinterpret_cast<const LChar*>(buffer .data()), len); |
130 } | 131 } |
131 } | 132 } |
132 | 133 |
134 #if !defined(HB_VERSION_ATLEAST) | |
135 #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
| |
136 #endif | |
137 | |
133 ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag) | 138 ots::TableAction BlinkOTSContext::GetTableAction(uint32_t tag) |
134 { | 139 { |
135 #define TABLE_TAG(c1, c2, c3, c4) ((uint32_t)((((uint8_t)(c1)) << 24) | (((uint8 _t)(c2)) << 16) | (((uint8_t)(c3)) << 8) | ((uint8_t)(c4)))) | 140 #define TABLE_TAG(c1, c2, c3, c4) ((uint32_t)((((uint8_t)(c1)) << 24) | (((uint8 _t)(c2)) << 16) | (((uint8_t)(c3)) << 8) | ((uint8_t)(c4)))) |
136 | 141 |
137 const uint32_t cbdtTag = TABLE_TAG('C', 'B', 'D', 'T'); | 142 const uint32_t cbdtTag = TABLE_TAG('C', 'B', 'D', 'T'); |
138 const uint32_t cblcTag = TABLE_TAG('C', 'B', 'L', 'C'); | 143 const uint32_t cblcTag = TABLE_TAG('C', 'B', 'L', 'C'); |
139 const uint32_t colrTag = TABLE_TAG('C', 'O', 'L', 'R'); | 144 const uint32_t colrTag = TABLE_TAG('C', 'O', 'L', 'R'); |
140 const uint32_t cpalTag = TABLE_TAG('C', 'P', 'A', 'L'); | 145 const uint32_t cpalTag = TABLE_TAG('C', 'P', 'A', 'L'); |
146 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
| |
147 const uint32_t gposTag = TABLE_TAG('G', 'P', 'O', 'S'); | |
148 const uint32_t gsubTag = TABLE_TAG('G', 'S', 'U', 'B'); | |
141 | 149 |
142 switch (tag) { | 150 switch (tag) { |
143 // Google Color Emoji Tables | 151 // Google Color Emoji Tables |
144 case cbdtTag: | 152 case cbdtTag: |
145 case cblcTag: | 153 case cblcTag: |
146 // Windows Color Emoji Tables | 154 // Windows Color Emoji Tables |
147 case colrTag: | 155 case colrTag: |
148 case cpalTag: | 156 case cpalTag: |
157 #if HB_VERSION_ATLEAST(1, 0, 0) | |
158 // Let HarfBuzz handle how to deal with broken tables. | |
159 case gdefTag: | |
160 case gposTag: | |
161 case gsubTag: | |
162 #endif | |
149 return ots::TABLE_ACTION_PASSTHRU; | 163 return ots::TABLE_ACTION_PASSTHRU; |
150 default: | 164 default: |
151 return ots::TABLE_ACTION_DEFAULT; | 165 return ots::TABLE_ACTION_DEFAULT; |
152 } | 166 } |
153 #undef TABLE_TAG | 167 #undef TABLE_TAG |
154 } | 168 } |
155 | 169 |
156 } // namespace blink | 170 } // namespace blink |
OLD | NEW |