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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 ShapeCache* getShapeCache(const FallbackListCompositeKey&); | 101 ShapeCache* getShapeCache(const FallbackListCompositeKey&); |
102 | 102 |
103 void addClient(FontCacheClient*); | 103 void addClient(FontCacheClient*); |
104 | 104 |
105 unsigned short generation(); | 105 unsigned short generation(); |
106 void invalidate(); | 106 void invalidate(); |
107 | 107 |
108 SkFontMgr* fontManager() { return m_fontManager.get(); } | 108 SkFontMgr* fontManager() { return m_fontManager.get(); } |
109 static void setFontManager(const sk_sp<SkFontMgr>&); | 109 static void setFontManager(const sk_sp<SkFontMgr>&); |
110 | 110 |
| 111 static const AtomicString& systemFontFamily(); |
111 #if OS(WIN) | 112 #if OS(WIN) |
112 static bool antialiasedTextEnabled() { return s_antialiasedTextEnabled; } | 113 static bool antialiasedTextEnabled() { return s_antialiasedTextEnabled; } |
113 static bool lcdTextEnabled() { return s_lcdTextEnabled; } | 114 static bool lcdTextEnabled() { return s_lcdTextEnabled; } |
114 static float deviceScaleFactor() { return s_deviceScaleFactor; } | 115 static float deviceScaleFactor() { return s_deviceScaleFactor; } |
115 static void setAntialiasedTextEnabled(bool enabled) { s_antialiasedTextEnabl
ed = enabled; } | 116 static void setAntialiasedTextEnabled(bool enabled) { s_antialiasedTextEnabl
ed = enabled; } |
116 static void setLCDTextEnabled(bool enabled) { s_lcdTextEnabled = enabled; } | 117 static void setLCDTextEnabled(bool enabled) { s_lcdTextEnabled = enabled; } |
117 static void setDeviceScaleFactor(float deviceScaleFactor) { s_deviceScaleFac
tor = deviceScaleFactor; } | 118 static void setDeviceScaleFactor(float deviceScaleFactor) { s_deviceScaleFac
tor = deviceScaleFactor; } |
118 static void addSideloadedFontForTesting(SkTypeface*); | 119 static void addSideloadedFontForTesting(SkTypeface*); |
119 // Functions to cache and retrieve the system font metrics. | 120 // Functions to cache and retrieve the system font metrics. |
120 static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
); | 121 static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight
); |
121 static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight); | 122 static void setSmallCaptionFontMetrics(const wchar_t* familyName, int32_t fo
ntHeight); |
122 static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht); | 123 static void setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
ht); |
123 static int32_t menuFontHeight() { return s_menuFontHeight; } | 124 static int32_t menuFontHeight() { return s_menuFontHeight; } |
124 static const AtomicString& menuFontFamily() { return *s_smallCaptionFontFami
lyName; } | 125 static const AtomicString& menuFontFamily() { return *s_smallCaptionFontFami
lyName; } |
125 static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } | 126 static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } |
126 static const AtomicString& smallCaptionFontFamily() { return *s_smallCaption
FontFamilyName; } | 127 static const AtomicString& smallCaptionFontFamily() { return *s_smallCaption
FontFamilyName; } |
127 static int32_t statusFontHeight() { return s_statusFontHeight; } | 128 static int32_t statusFontHeight() { return s_statusFontHeight; } |
128 static const AtomicString& statusFontFamily() { return *s_statusFontFamilyNa
me; } | 129 static const AtomicString& statusFontFamily() { return *s_statusFontFamilyNa
me; } |
129 static void setUseSkiaFontFallback(bool useSkiaFontFallback) { s_useSkiaFont
Fallback = useSkiaFontFallback; } | 130 static void setUseSkiaFontFallback(bool useSkiaFontFallback) { s_useSkiaFont
Fallback = useSkiaFontFallback; } |
| 131 #elif OS(LINUX) || OS(ANDROID) |
| 132 static void setSystemFontFamily(const char*); |
130 #endif | 133 #endif |
131 | 134 |
132 typedef uint32_t FontFileKey; | 135 typedef uint32_t FontFileKey; |
133 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); | 136 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); |
134 | 137 |
135 static void acceptLanguagesChanged(const String&); | 138 static void acceptLanguagesChanged(const String&); |
136 | 139 |
137 #if OS(ANDROID) | 140 #if OS(ANDROID) |
138 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, const FontDescription&); | 141 static AtomicString getGenericFamilyNameForScript(const AtomicString& family
Name, const FontDescription&); |
139 #else | 142 #else |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 static float s_deviceScaleFactor; | 201 static float s_deviceScaleFactor; |
199 static HashMap<String, sk_sp<SkTypeface>>* s_sideloadedFonts; | 202 static HashMap<String, sk_sp<SkTypeface>>* s_sideloadedFonts; |
200 // The system font metrics cache. | 203 // The system font metrics cache. |
201 static AtomicString* s_menuFontFamilyName; | 204 static AtomicString* s_menuFontFamilyName; |
202 static int32_t s_menuFontHeight; | 205 static int32_t s_menuFontHeight; |
203 static AtomicString* s_smallCaptionFontFamilyName; | 206 static AtomicString* s_smallCaptionFontFamilyName; |
204 static int32_t s_smallCaptionFontHeight; | 207 static int32_t s_smallCaptionFontHeight; |
205 static AtomicString* s_statusFontFamilyName; | 208 static AtomicString* s_statusFontFamilyName; |
206 static int32_t s_statusFontHeight; | 209 static int32_t s_statusFontHeight; |
207 static bool s_useSkiaFontFallback; | 210 static bool s_useSkiaFontFallback; |
| 211 #elif OS(LINUX) |
| 212 static AtomicString* s_systemFontFamilyName; |
208 #endif | 213 #endif |
209 | 214 |
210 friend class SimpleFontData; // For fontDataFromFontPlatformData | 215 friend class SimpleFontData; // For fontDataFromFontPlatformData |
211 friend class FontFallbackList; | 216 friend class FontFallbackList; |
212 }; | 217 }; |
213 | 218 |
214 class PLATFORM_EXPORT FontCachePurgePreventer { | 219 class PLATFORM_EXPORT FontCachePurgePreventer { |
215 USING_FAST_MALLOC(FontCachePurgePreventer); | 220 USING_FAST_MALLOC(FontCachePurgePreventer); |
216 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); | 221 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); |
217 public: | 222 public: |
218 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } | 223 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } |
219 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } | 224 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } |
220 }; | 225 }; |
221 | 226 |
222 } // namespace blink | 227 } // namespace blink |
223 | 228 |
224 #endif | 229 #endif |
OLD | NEW |