| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if (Platform::current()->sandboxSupport()) | 197 if (Platform::current()->sandboxSupport()) |
| 198 return typefaceForFontconfigInterfaceIdAndTtcIndex(creationParams.fo
ntconfigInterfaceId(), creationParams.ttcIndex()); | 198 return typefaceForFontconfigInterfaceIdAndTtcIndex(creationParams.fo
ntconfigInterfaceId(), creationParams.ttcIndex()); |
| 199 return adoptRef(SkTypeface::CreateFromFile(creationParams.filename().dat
a(), creationParams.ttcIndex())); | 199 return adoptRef(SkTypeface::CreateFromFile(creationParams.filename().dat
a(), creationParams.ttcIndex())); |
| 200 } | 200 } |
| 201 #endif | 201 #endif |
| 202 | 202 |
| 203 AtomicString family = creationParams.family(); | 203 AtomicString family = creationParams.family(); |
| 204 // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the
name into | 204 // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the
name into |
| 205 // the fallback name (like "monospace") that fontconfig understands. | 205 // the fallback name (like "monospace") that fontconfig understands. |
| 206 if (!family.length() || family.startsWith("-webkit-")) { | 206 if (!family.length() || family.startsWith("-webkit-")) { |
| 207 name = getFallbackFontFamily(fontDescription).string().utf8(); | 207 name = getFallbackFontFamily(fontDescription).getString().utf8(); |
| 208 } else { | 208 } else { |
| 209 // convert the name to utf8 | 209 // convert the name to utf8 |
| 210 name = family.utf8(); | 210 name = family.utf8(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 int style = SkTypeface::kNormal; | 213 int style = SkTypeface::kNormal; |
| 214 if (fontDescription.weight() >= FontWeight600) | 214 if (fontDescription.weight() >= FontWeight600) |
| 215 style |= SkTypeface::kBold; | 215 style |= SkTypeface::kBold; |
| 216 if (fontDescription.style()) | 216 if (fontDescription.style()) |
| 217 style |= SkTypeface::kItalic; | 217 style |= SkTypeface::kItalic; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 name.data(), | 258 name.data(), |
| 259 fontSize, | 259 fontSize, |
| 260 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc
ription.isSyntheticBold(), | 260 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc
ription.isSyntheticBold(), |
| 261 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), | 261 ((fontDescription.style() == FontStyleItalic || fontDescription.style()
== FontStyleOblique) && !tf->isItalic()) || fontDescription.isSyntheticItalic(), |
| 262 fontDescription.orientation(), | 262 fontDescription.orientation(), |
| 263 fontDescription.useSubpixelPositioning())); | 263 fontDescription.useSubpixelPositioning())); |
| 264 } | 264 } |
| 265 #endif // !OS(WIN) | 265 #endif // !OS(WIN) |
| 266 | 266 |
| 267 } // namespace blink | 267 } // namespace blink |
| OLD | NEW |