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; } | |
127 #endif | 126 #endif |
128 | 127 |
129 typedef uint32_t FontFileKey; | 128 typedef uint32_t FontFileKey; |
130 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); | 129 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); |
131 | 130 |
132 static void acceptLanguagesChanged(const String&); | 131 static void acceptLanguagesChanged(const String&); |
133 | 132 |
134 #if OS(ANDROID) | 133 #if OS(ANDROID) |
135 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, const FontDescription&); | 134 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, const FontDescription&); |
136 #else | 135 #else |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 static float s_deviceScaleFactor; | 194 static float s_deviceScaleFactor; |
196 static bool s_useSubpixelPositioning; | 195 static bool s_useSubpixelPositioning; |
197 static HashMap<String, RefPtr<SkTypeface>>* s_sideloadedFonts; | 196 static HashMap<String, RefPtr<SkTypeface>>* s_sideloadedFonts; |
198 // The system font metrics cache. | 197 // The system font metrics cache. |
199 static AtomicString* s_menuFontFamilyName; | 198 static AtomicString* s_menuFontFamilyName; |
200 static int32_t s_menuFontHeight; | 199 static int32_t s_menuFontHeight; |
201 static AtomicString* s_smallCaptionFontFamilyName; | 200 static AtomicString* s_smallCaptionFontFamilyName; |
202 static int32_t s_smallCaptionFontHeight; | 201 static int32_t s_smallCaptionFontHeight; |
203 static AtomicString* s_statusFontFamilyName; | 202 static AtomicString* s_statusFontFamilyName; |
204 static int32_t s_statusFontHeight; | 203 static int32_t s_statusFontHeight; |
205 static bool s_useSkiaFontFallback; | |
206 #endif | 204 #endif |
207 | 205 |
208 friend class SimpleFontData; // For fontDataFromFontPlatformData | 206 friend class SimpleFontData; // For fontDataFromFontPlatformData |
209 friend class FontFallbackList; | 207 friend class FontFallbackList; |
210 }; | 208 }; |
211 | 209 |
212 class PLATFORM_EXPORT FontCachePurgePreventer { | 210 class PLATFORM_EXPORT FontCachePurgePreventer { |
213 USING_FAST_MALLOC(FontCachePurgePreventer); | 211 USING_FAST_MALLOC(FontCachePurgePreventer); |
214 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); | 212 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); |
215 public: | 213 public: |
216 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } | 214 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } |
217 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } | 215 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } |
218 }; | 216 }; |
219 | 217 |
220 CString toSkFontMgrLocale(const String& locale); | |
221 | |
222 } // namespace blink | 218 } // namespace blink |
223 | 219 |
224 #endif | 220 #endif |
OLD | NEW |