| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 void setFantasy(const AtomicString&, UScriptCode = USCRIPT_COMMON); | 67 void setFantasy(const AtomicString&, UScriptCode = USCRIPT_COMMON); |
| 68 const AtomicString& fantasy(UScriptCode = USCRIPT_COMMON) const; | 68 const AtomicString& fantasy(UScriptCode = USCRIPT_COMMON) const; |
| 69 | 69 |
| 70 void setPictograph(const AtomicString&, UScriptCode = USCRIPT_COMMON); | 70 void setPictograph(const AtomicString&, UScriptCode = USCRIPT_COMMON); |
| 71 const AtomicString& pictograph(UScriptCode = USCRIPT_COMMON) const; | 71 const AtomicString& pictograph(UScriptCode = USCRIPT_COMMON) const; |
| 72 | 72 |
| 73 // Only called by InternalSettings to clear font family maps. | 73 // Only called by InternalSettings to clear font family maps. |
| 74 void reset(); | 74 void reset(); |
| 75 | 75 |
| 76 GenericFontFamilySettings& operator=(const GenericFontFamilySettings&); |
| 77 |
| 76 private: | 78 private: |
| 77 GenericFontFamilySettings& operator=(const GenericFontFamilySettings&) WTF_D
ELETED_FUNCTION; | |
| 78 | |
| 79 // UScriptCode uses -1 and 0 for UScriptInvalidCode and UScriptCommon. | 79 // UScriptCode uses -1 and 0 for UScriptInvalidCode and UScriptCommon. |
| 80 // We need to use -2 and -3 for empty value and deleted value. | 80 // We need to use -2 and -3 for empty value and deleted value. |
| 81 struct UScriptCodeHashTraits : WTF::GenericHashTraits<int> { | 81 struct UScriptCodeHashTraits : WTF::GenericHashTraits<int> { |
| 82 static const bool emptyValueIsZero = false; | 82 static const bool emptyValueIsZero = false; |
| 83 static int emptyValue() { return -2; } | 83 static int emptyValue() { return -2; } |
| 84 static void constructDeletedValue(int& slot) { slot = -3; } | 84 static void constructDeletedValue(int& slot) { slot = -3; } |
| 85 static bool isDeletedValue(int value) { return value == -3; } | 85 static bool isDeletedValue(int value) { return value == -3; } |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 typedef HashMap<int, AtomicString, DefaultHash<int>::Hash, UScriptCodeHashTr
aits> ScriptFontFamilyMap; | 88 typedef HashMap<int, AtomicString, DefaultHash<int>::Hash, UScriptCodeHashTr
aits> ScriptFontFamilyMap; |
| 89 | 89 |
| 90 void setGenericFontFamilyMap(ScriptFontFamilyMap&, const AtomicString&, UScr
iptCode); | 90 void setGenericFontFamilyMap(ScriptFontFamilyMap&, const AtomicString&, UScr
iptCode); |
| 91 const AtomicString& genericFontFamilyForScript(const ScriptFontFamilyMap&, U
ScriptCode) const; | 91 const AtomicString& genericFontFamilyForScript(const ScriptFontFamilyMap&, U
ScriptCode) const; |
| 92 | 92 |
| 93 ScriptFontFamilyMap m_standardFontFamilyMap; | 93 ScriptFontFamilyMap m_standardFontFamilyMap; |
| 94 ScriptFontFamilyMap m_serifFontFamilyMap; | 94 ScriptFontFamilyMap m_serifFontFamilyMap; |
| 95 ScriptFontFamilyMap m_fixedFontFamilyMap; | 95 ScriptFontFamilyMap m_fixedFontFamilyMap; |
| 96 ScriptFontFamilyMap m_sansSerifFontFamilyMap; | 96 ScriptFontFamilyMap m_sansSerifFontFamilyMap; |
| 97 ScriptFontFamilyMap m_cursiveFontFamilyMap; | 97 ScriptFontFamilyMap m_cursiveFontFamilyMap; |
| 98 ScriptFontFamilyMap m_fantasyFontFamilyMap; | 98 ScriptFontFamilyMap m_fantasyFontFamilyMap; |
| 99 ScriptFontFamilyMap m_pictographFontFamilyMap; | 99 ScriptFontFamilyMap m_pictographFontFamilyMap; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } | 102 } |
| 103 | 103 |
| 104 #endif | 104 #endif |
| OLD | NEW |