OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 2009 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 FontDescription::GenericFamilyType type = fontDescription.genericFamily(
); | 126 FontDescription::GenericFamilyType type = fontDescription.genericFamily(
); |
127 for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) { | 127 for (unsigned i = 0; i < SK_ARRAY_COUNT(fontDescriptions); i++) { |
128 if (type == fontDescriptions[i].mType) { | 128 if (type == fontDescriptions[i].mType) { |
129 name = fontDescriptions[i].mName; | 129 name = fontDescriptions[i].mName; |
130 break; | 130 break; |
131 } | 131 } |
132 } | 132 } |
133 } else { | 133 } else { |
134 // convert the name to utf8 | 134 // convert the name to utf8 |
135 name = family.string().utf8(); | 135 name = family.utf8(); |
136 } | 136 } |
137 | 137 |
138 int style = SkTypeface::kNormal; | 138 int style = SkTypeface::kNormal; |
139 if (fontDescription.weight() >= FontWeightBold) | 139 if (fontDescription.weight() >= FontWeightBold) |
140 style |= SkTypeface::kBold; | 140 style |= SkTypeface::kBold; |
141 if (fontDescription.italic()) | 141 if (fontDescription.italic()) |
142 style |= SkTypeface::kItalic; | 142 style |= SkTypeface::kItalic; |
143 | 143 |
144 // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypefa
ce. | 144 // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypefa
ce. |
145 #if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS) | 145 #if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS) |
(...skipping 17 matching lines...) Expand all Loading... |
163 fontSize, | 163 fontSize, |
164 (fontDescription.weight() >= FontWeightBold && !tf->isBold()) || fontDes
cription.isSyntheticBold(), | 164 (fontDescription.weight() >= FontWeightBold && !tf->isBold()) || fontDes
cription.isSyntheticBold(), |
165 (fontDescription.italic() && !tf->isItalic()) || fontDescription.isSynth
eticItalic(), | 165 (fontDescription.italic() && !tf->isItalic()) || fontDescription.isSynth
eticItalic(), |
166 fontDescription.orientation(), | 166 fontDescription.orientation(), |
167 fontDescription.useSubpixelPositioning()); | 167 fontDescription.useSubpixelPositioning()); |
168 return result; | 168 return result; |
169 } | 169 } |
170 #endif // !OS(WINDOWNS) | 170 #endif // !OS(WINDOWNS) |
171 | 171 |
172 } // namespace WebCore | 172 } // namespace WebCore |
OLD | NEW |