Chromium Code Reviews| 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 FontLocale_h | |
| 6 #define FontLocale_h | |
|
drott
2016/07/19 15:28:53
I am thinking about the naming, I don't have a str
kojii
2016/07/20 06:01:53
Yeah, thought about it, but we have text/PlatformL
drott
2016/07/21 09:23:49
Yes, that'd work.
| |
| 7 | |
| 8 #include "platform/PlatformExport.h" | |
| 9 #include "wtf/Forward.h" | |
| 10 #include "wtf/RefCounted.h" | |
| 11 #include "wtf/text/AtomicString.h" | |
| 12 | |
| 13 #include <unicode/uscript.h> | |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class Hyphenation; | |
| 18 | |
| 19 class PLATFORM_EXPORT FontLocale : public RefCounted<FontLocale> { | |
| 20 public: | |
| 21 static const FontLocale* get(const AtomicString& locale); | |
| 22 static const FontLocale& getDefault(); | |
| 23 | |
| 24 operator const AtomicString&() const { return m_string; } | |
| 25 const AtomicString& localeString() const { return m_string; } | |
| 26 CString ascii() const { return m_string.ascii(); } | |
| 27 | |
| 28 UScriptCode script() const { return m_script; } | |
| 29 const void* harfbuzzLanguage() const { return m_harfbuzzLanguage; } | |
| 30 const CString& localeForSkFontMgr() const; | |
| 31 | |
| 32 Hyphenation* getHyphenation() const; | |
| 33 | |
| 34 private: | |
| 35 FontLocale(const AtomicString&); | |
| 36 | |
| 37 AtomicString m_string; | |
| 38 mutable CString m_stringForSkFontMgr; | |
| 39 UScriptCode m_script; | |
| 40 // hb_language_t is defined in hb.h, which not all files can include. | |
| 41 const void* m_harfbuzzLanguage; | |
| 42 }; | |
| 43 | |
| 44 } // namespace blink | |
| 45 | |
| 46 #endif // FontLocale_h | |
| OLD | NEW |