| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { | 204 if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { |
| 205 if (Platform::current()->sandboxSupport()) | 205 if (Platform::current()->sandboxSupport()) |
| 206 return typefaceForFontconfigInterfaceIdAndTtcIndex( | 206 return typefaceForFontconfigInterfaceIdAndTtcIndex( |
| 207 creationParams.fontconfigInterfaceId(), creationParams.ttcIndex()); | 207 creationParams.fontconfigInterfaceId(), creationParams.ttcIndex()); |
| 208 return SkTypeface::MakeFromFile(creationParams.filename().data(), | 208 return SkTypeface::MakeFromFile(creationParams.filename().data(), |
| 209 creationParams.ttcIndex()); | 209 creationParams.ttcIndex()); |
| 210 } | 210 } |
| 211 #endif | 211 #endif |
| 212 | 212 |
| 213 AtomicString family = creationParams.family(); | 213 AtomicString family = creationParams.family(); |
| 214 DCHECK_NE(family, FontFamilyNames::system_ui); |
| 214 // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the | 215 // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the |
| 215 // name into the fallback name (like "monospace") that fontconfig understands. | 216 // name into the fallback name (like "monospace") that fontconfig understands. |
| 216 if (!family.length() || family.startsWith("-webkit-")) { | 217 if (!family.length() || family.startsWith("-webkit-")) { |
| 217 name = getFallbackFontFamily(fontDescription).getString().utf8(); | 218 name = getFallbackFontFamily(fontDescription).getString().utf8(); |
| 218 } else { | 219 } else { |
| 219 // convert the name to utf8 | 220 // convert the name to utf8 |
| 220 name = family.utf8(); | 221 name = family.utf8(); |
| 221 } | 222 } |
| 222 | 223 |
| 223 #if OS(WIN) | 224 #if OS(WIN) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 fontDescription.isSyntheticBold(), | 263 fontDescription.isSyntheticBold(), |
| 263 ((fontDescription.style() == FontStyleItalic || | 264 ((fontDescription.style() == FontStyleItalic || |
| 264 fontDescription.style() == FontStyleOblique) && | 265 fontDescription.style() == FontStyleOblique) && |
| 265 !tf->isItalic()) || | 266 !tf->isItalic()) || |
| 266 fontDescription.isSyntheticItalic(), | 267 fontDescription.isSyntheticItalic(), |
| 267 fontDescription.orientation())); | 268 fontDescription.orientation())); |
| 268 } | 269 } |
| 269 #endif // !OS(WIN) | 270 #endif // !OS(WIN) |
| 270 | 271 |
| 271 } // namespace blink | 272 } // namespace blink |
| OLD | NEW |