| OLD | NEW |
| 1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
| 2 * | 2 * |
| 3 * This Source Code Form is subject to the terms of the Mozilla Public | 3 * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 * | 6 * |
| 7 * ***** END LICENSE BLOCK ***** */ | 7 * ***** END LICENSE BLOCK ***** */ |
| 8 | 8 |
| 9 #include "platform/fonts/opentype/OpenTypeCapsSupport.h" | 9 #include "platform/fonts/opentype/OpenTypeCapsSupport.h" |
| 10 | 10 |
| 11 #include <hb-ot.h> | 11 #include <hb-ot.h> |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 bool OpenTypeCapsSupport::SupportsOpenTypeFeature(hb_script_t script, | 15 bool OpenTypeCapsSupport::SupportsOpenTypeFeature(hb_script_t script, |
| 16 uint32_t tag) const { | 16 uint32_t tag) const { |
| 17 hb_face_t* face = hb_font_get_face(harf_buzz_face_->GetScaledFont()); | 17 hb_face_t* face = hb_font_get_face(harf_buzz_face_->GetScaledFont()); |
| 18 ASSERT(face); | 18 DCHECK(face); |
| 19 | 19 |
| 20 ASSERT( | 20 DCHECK( |
| 21 (tag == HB_TAG('s', 'm', 'c', 'p') || tag == HB_TAG('c', '2', 's', 'c') || | 21 (tag == HB_TAG('s', 'm', 'c', 'p') || tag == HB_TAG('c', '2', 's', 'c') || |
| 22 tag == HB_TAG('p', 'c', 'a', 'p') || tag == HB_TAG('c', '2', 'p', 'c') || | 22 tag == HB_TAG('p', 'c', 'a', 'p') || tag == HB_TAG('c', '2', 'p', 'c') || |
| 23 tag == HB_TAG('s', 'u', 'p', 's') || tag == HB_TAG('s', 'u', 'b', 's') || | 23 tag == HB_TAG('s', 'u', 'p', 's') || tag == HB_TAG('s', 'u', 'b', 's') || |
| 24 tag == HB_TAG('t', 'i', 't', 'l') || tag == HB_TAG('u', 'n', 'i', 'c') || | 24 tag == HB_TAG('t', 'i', 't', 'l') || tag == HB_TAG('u', 'n', 'i', 'c') || |
| 25 tag == HB_TAG('v', 'e', 'r', 't'))); | 25 tag == HB_TAG('v', 'e', 'r', 't'))); |
| 26 | 26 |
| 27 if (!hb_ot_layout_has_substitution(face)) | 27 if (!hb_ot_layout_has_substitution(face)) |
| 28 return false; | 28 return false; |
| 29 | 29 |
| 30 // Get the OpenType tag(s) that match this script code | 30 // Get the OpenType tag(s) that match this script code |
| (...skipping 11 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 if (hb_ot_layout_language_find_feature(face, kGSUB, script_index, | 43 if (hb_ot_layout_language_find_feature(face, kGSUB, script_index, |
| 44 HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX, | 44 HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX, |
| 45 tag, nullptr)) { | 45 tag, nullptr)) { |
| 46 return true; | 46 return true; |
| 47 } | 47 } |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace blink | 51 } // namespace blink |
| OLD | NEW |