Index: third_party/WebKit/Source/platform/fonts/FontLocale.h |
diff --git a/third_party/WebKit/Source/platform/fonts/FontLocale.h b/third_party/WebKit/Source/platform/fonts/FontLocale.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ca73be7d59b3aa853132ecfcf85b66b3f6ca65ce |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/fonts/FontLocale.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef FontLocale_h |
+#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.
|
+ |
+#include "platform/PlatformExport.h" |
+#include "wtf/Forward.h" |
+#include "wtf/RefCounted.h" |
+#include "wtf/text/AtomicString.h" |
+ |
+#include <unicode/uscript.h> |
+ |
+namespace blink { |
+ |
+class Hyphenation; |
+ |
+class PLATFORM_EXPORT FontLocale : public RefCounted<FontLocale> { |
+public: |
+ static const FontLocale* get(const AtomicString& locale); |
+ static const FontLocale& getDefault(); |
+ |
+ operator const AtomicString&() const { return m_string; } |
+ const AtomicString& localeString() const { return m_string; } |
+ CString ascii() const { return m_string.ascii(); } |
+ |
+ UScriptCode script() const { return m_script; } |
+ const void* harfbuzzLanguage() const { return m_harfbuzzLanguage; } |
+ const CString& localeForSkFontMgr() const; |
+ |
+ Hyphenation* getHyphenation() const; |
+ |
+private: |
+ FontLocale(const AtomicString&); |
+ |
+ AtomicString m_string; |
+ mutable CString m_stringForSkFontMgr; |
+ UScriptCode m_script; |
+ // hb_language_t is defined in hb.h, which not all files can include. |
+ const void* m_harfbuzzLanguage; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // FontLocale_h |