OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
4 * Copyright (C) 2013 Google, Inc. All rights reserved. | 4 * Copyright (C) 2013 Google, Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return helvetica; | 99 return helvetica; |
100 if (equalIgnoringCase(familyName, helvetica)) | 100 if (equalIgnoringCase(familyName, helvetica)) |
101 return arial; | 101 return arial; |
102 | 102 |
103 return emptyAtom; | 103 return emptyAtom; |
104 } | 104 } |
105 | 105 |
106 | 106 |
107 inline const AtomicString getFallbackFontFamily(const FontDescription& descripti
on) | 107 inline const AtomicString getFallbackFontFamily(const FontDescription& descripti
on) |
108 { | 108 { |
109 DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("Sans", AtomicString::Cons
tructFromLiteral)); | 109 DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("sans-serif", AtomicString
::ConstructFromLiteral)); |
110 DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("Serif", AtomicString::Co
nstructFromLiteral)); | 110 DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("serif", AtomicString::Co
nstructFromLiteral)); |
111 DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("Monospace", AtomicSt
ring::ConstructFromLiteral)); | 111 DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("monospace", AtomicSt
ring::ConstructFromLiteral)); |
| 112 DEFINE_STATIC_LOCAL(const AtomicString, cursiveStr, ("cursive", AtomicString
::ConstructFromLiteral)); |
| 113 DEFINE_STATIC_LOCAL(const AtomicString, fantasyStr, ("fantasy", AtomicString
::ConstructFromLiteral)); |
112 | 114 |
113 switch (description.genericFamily()) { | 115 switch (description.genericFamily()) { |
| 116 case FontDescription::SansSerifFamily: |
| 117 return sansStr; |
114 case FontDescription::SerifFamily: | 118 case FontDescription::SerifFamily: |
115 return serifStr; | 119 return serifStr; |
116 case FontDescription::MonospaceFamily: | 120 case FontDescription::MonospaceFamily: |
117 return monospaceStr; | 121 return monospaceStr; |
118 case FontDescription::SansSerifFamily: | 122 case FontDescription::CursiveFamily: |
| 123 return cursiveStr; |
| 124 case FontDescription::FantasyFamily: |
| 125 return fantasyStr; |
119 default: | 126 default: |
120 return sansStr; | 127 // Let the caller use the system default font. |
| 128 return emptyAtom; |
121 } | 129 } |
122 } | 130 } |
123 | 131 |
124 } // namespace WebCore | 132 } // namespace WebCore |
125 | 133 |
126 #endif // AlternateFontFamily_h | 134 #endif // AlternateFontFamily_h |
OLD | NEW |