OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2008 Torch Mobile, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Functions to cache and retrieve the system font metrics. | 116 // Functions to cache and retrieve the system font metrics. |
117 static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
); | 117 static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
); |
118 static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight); | 118 static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight); |
119 static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht); | 119 static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht); |
120 static int32_t menuFontHeight() { return s_menuFontHeight; } | 120 static int32_t menuFontHeight() { return s_menuFontHeight; } |
121 static const AtomicString& menuFontFamily() { return *s_smallCaptionFontFami
lyName; } | 121 static const AtomicString& menuFontFamily() { return *s_smallCaptionFontFami
lyName; } |
122 static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } | 122 static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } |
123 static const AtomicString& smallCaptionFontFamily() { return *s_smallCaption
FontFamilyName; } | 123 static const AtomicString& smallCaptionFontFamily() { return *s_smallCaption
FontFamilyName; } |
124 static int32_t statusFontHeight() { return s_statusFontHeight; } | 124 static int32_t statusFontHeight() { return s_statusFontHeight; } |
125 static const AtomicString& statusFontFamily() { return *s_statusFontFamilyNa
me; } | 125 static const AtomicString& statusFontFamily() { return *s_statusFontFamilyNa
me; } |
| 126 static void setUseSkiaFontFallback(bool useSkiaFontFallback) { s_useSkiaFont
Fallback = useSkiaFontFallback; } |
126 #endif | 127 #endif |
127 | 128 |
128 typedef uint32_t FontFileKey; | 129 typedef uint32_t FontFileKey; |
129 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); | 130 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); |
130 | 131 |
131 static void acceptLanguagesChanged(const String&); | 132 static void acceptLanguagesChanged(const String&); |
132 | 133 |
133 #if OS(ANDROID) | 134 #if OS(ANDROID) |
134 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, const FontDescription&); | 135 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, const FontDescription&); |
135 #else | 136 #else |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 static float s_deviceScaleFactor; | 195 static float s_deviceScaleFactor; |
195 static bool s_useSubpixelPositioning; | 196 static bool s_useSubpixelPositioning; |
196 static HashMap<String, RefPtr<SkTypeface>>* s_sideloadedFonts; | 197 static HashMap<String, RefPtr<SkTypeface>>* s_sideloadedFonts; |
197 // The system font metrics cache. | 198 // The system font metrics cache. |
198 static AtomicString* s_menuFontFamilyName; | 199 static AtomicString* s_menuFontFamilyName; |
199 static int32_t s_menuFontHeight; | 200 static int32_t s_menuFontHeight; |
200 static AtomicString* s_smallCaptionFontFamilyName; | 201 static AtomicString* s_smallCaptionFontFamilyName; |
201 static int32_t s_smallCaptionFontHeight; | 202 static int32_t s_smallCaptionFontHeight; |
202 static AtomicString* s_statusFontFamilyName; | 203 static AtomicString* s_statusFontFamilyName; |
203 static int32_t s_statusFontHeight; | 204 static int32_t s_statusFontHeight; |
| 205 static bool s_useSkiaFontFallback; |
204 #endif | 206 #endif |
205 | 207 |
206 friend class SimpleFontData; // For fontDataFromFontPlatformData | 208 friend class SimpleFontData; // For fontDataFromFontPlatformData |
207 friend class FontFallbackList; | 209 friend class FontFallbackList; |
208 }; | 210 }; |
209 | 211 |
210 class PLATFORM_EXPORT FontCachePurgePreventer { | 212 class PLATFORM_EXPORT FontCachePurgePreventer { |
211 USING_FAST_MALLOC(FontCachePurgePreventer); | 213 USING_FAST_MALLOC(FontCachePurgePreventer); |
212 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); | 214 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); |
213 public: | 215 public: |
214 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } | 216 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } |
215 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } | 217 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } |
216 }; | 218 }; |
217 | 219 |
| 220 CString toSkFontMgrLocale(const String& locale); |
| 221 |
218 } // namespace blink | 222 } // namespace blink |
219 | 223 |
220 #endif | 224 #endif |
OLD | NEW |