Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: third_party/WebKit/Source/platform/fonts/FontLocale.h

Issue 2161683002: Add LayoutLocale class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittest fix Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698