OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef OpenTypeCapsSupport_h |
| 6 #define OpenTypeCapsSupport_h |
| 7 |
| 8 #include "platform/fonts/FontDescription.h" |
| 9 #include "platform/fonts/SmallCapsIterator.h" |
| 10 #include "platform/fonts/opentype/OpenTypeCapsSupport.h" |
| 11 #include "platform/fonts/shaping/CaseMappingHarfBuzzBufferFiller.h" |
| 12 #include "platform/fonts/shaping/HarfBuzzFace.h" |
| 13 |
| 14 #include <hb.h> |
| 15 |
| 16 namespace blink { |
| 17 |
| 18 class PLATFORM_EXPORT OpenTypeCapsSupport { |
| 19 public: |
| 20 OpenTypeCapsSupport(); |
| 21 OpenTypeCapsSupport(const HarfBuzzFace*, |
| 22 FontDescription::FontVariantCaps requestedCaps, |
| 23 hb_script_t); |
| 24 |
| 25 bool needsRunCaseSplitting(); |
| 26 bool needsSyntheticFont(SmallCapsIterator::SmallCapsBehavior runCase); |
| 27 FontDescription::FontVariantCaps fontFeatureToUse(SmallCapsIterator::SmallCa
psBehavior runCase); |
| 28 CaseMapIntend needsCaseChange(SmallCapsIterator::SmallCapsBehavior runCase); |
| 29 |
| 30 private: |
| 31 void determineFontSupport(hb_script_t); |
| 32 bool supportsOpenTypeFeature(hb_script_t, uint32_t tag) const; |
| 33 |
| 34 const HarfBuzzFace* m_harfBuzzFace; |
| 35 FontDescription::FontVariantCaps m_requestedCaps; |
| 36 SmallCapsIterator::SmallCapsBehavior m_runCase; |
| 37 |
| 38 enum class FontSupport { |
| 39 Full, |
| 40 Fallback, // Fall back to 'smcp' or 'smcp' + 'c2sc' |
| 41 None |
| 42 }; |
| 43 |
| 44 enum class CapsSynthesis { |
| 45 None, |
| 46 LowerToSmallCaps, |
| 47 UpperToSmallCaps, |
| 48 BothToSmallCaps |
| 49 }; |
| 50 |
| 51 FontSupport m_fontSupport; |
| 52 CapsSynthesis m_capsSynthesis; |
| 53 }; |
| 54 |
| 55 }; // namespace blink |
| 56 |
| 57 #endif |
OLD | NEW |