| 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 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef FontCache_h | 29 #ifndef FontCache_h |
| 30 #define FontCache_h | 30 #define FontCache_h |
| 31 | 31 |
| 32 #include <limits.h> | 32 #include <limits.h> |
| 33 #include <wtf/Vector.h> | 33 #include <wtf/Vector.h> |
| 34 #include <unicode/uscript.h> | |
| 35 #include <wtf/unicode/Unicode.h> | 34 #include <wtf/unicode/Unicode.h> |
| 36 | 35 |
| 37 #if PLATFORM(WIN) | 36 #if PLATFORM(WIN) |
| 38 #include <objidl.h> | 37 #include <objidl.h> |
| 39 #include <mlang.h> | 38 #include <mlang.h> |
| 40 #endif | 39 #endif |
| 41 | 40 |
| 42 namespace WebCore | 41 namespace WebCore |
| 43 { | 42 { |
| 44 | 43 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 69 #endif | 68 #endif |
| 70 | 69 |
| 71 void getTraitsInFamily(const AtomicString&, Vector<unsigned>&); | 70 void getTraitsInFamily(const AtomicString&, Vector<unsigned>&); |
| 72 | 71 |
| 73 FontPlatformData* getCachedFontPlatformData(const FontDescription&, const At
omicString& family, bool checkingAlternateName = false); | 72 FontPlatformData* getCachedFontPlatformData(const FontDescription&, const At
omicString& family, bool checkingAlternateName = false); |
| 74 SimpleFontData* getCachedFontData(const FontPlatformData*); | 73 SimpleFontData* getCachedFontData(const FontPlatformData*); |
| 75 FontPlatformData* getLastResortFallbackFont(const FontDescription&); | 74 FontPlatformData* getLastResortFallbackFont(const FontDescription&); |
| 76 | 75 |
| 77 void addClient(FontSelector*); | 76 void addClient(FontSelector*); |
| 78 void removeClient(FontSelector*); | 77 void removeClient(FontSelector*); |
| 79 // TODO(jungshik): Is this the best place to put this function? It may | |
| 80 // or may not be. Font.h is another place we can cosider. | |
| 81 // Return a font family for |script| and |FontDescription.genericFamily()|. | |
| 82 // It will return an empty atom if we can't find a font matching | |
| 83 // script and genericFamily in FontDescription. A caller should check | |
| 84 // the emptyness before using it. | |
| 85 static AtomicString getGenericFontForScript(UScriptCode script, const FontDe
scription&); | |
| 86 | 78 |
| 87 unsigned generation(); | 79 unsigned generation(); |
| 88 void invalidate(); | 80 void invalidate(); |
| 89 | 81 |
| 90 size_t fontDataCount(); | 82 size_t fontDataCount(); |
| 91 size_t inactiveFontDataCount(); | 83 size_t inactiveFontDataCount(); |
| 92 void purgeInactiveFontData(int count = INT_MAX); | 84 void purgeInactiveFontData(int count = INT_MAX); |
| 93 | 85 |
| 94 private: | 86 private: |
| 95 FontCache(); | 87 FontCache(); |
| 96 | 88 |
| 97 // These methods are implemented by each platform. | 89 // These methods are implemented by each platform. |
| 98 FontPlatformData* getSimilarFontPlatformData(const Font&); | 90 FontPlatformData* getSimilarFontPlatformData(const Font&); |
| 99 FontPlatformData* createFontPlatformData(const FontDescription&, const Atomi
cString& family); | 91 FontPlatformData* createFontPlatformData(const FontDescription&, const Atomi
cString& family); |
| 100 | 92 |
| 101 friend class SimpleFontData; | 93 friend class SimpleFontData; |
| 102 friend class FontFallbackList; | 94 friend class FontFallbackList; |
| 103 }; | 95 }; |
| 104 | 96 |
| 105 // Get the global fontCache. | 97 // Get the global fontCache. |
| 106 FontCache* fontCache(); | 98 FontCache* fontCache(); |
| 107 } | 99 } |
| 108 | 100 |
| 109 #endif | 101 #endif |
| OLD | NEW |