| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 { | 89 { |
| 90 // First try the specified font with standard style & weight. | 90 // First try the specified font with standard style & weight. |
| 91 if (fontDescription.style() == FontStyleItalic | 91 if (fontDescription.style() == FontStyleItalic |
| 92 || fontDescription.weight() >= FontWeight600) { | 92 || fontDescription.weight() >= FontWeight600) { |
| 93 RefPtr<SimpleFontData> fontData = fallbackOnStandardFontStyle( | 93 RefPtr<SimpleFontData> fontData = fallbackOnStandardFontStyle( |
| 94 fontDescription, c); | 94 fontDescription, c); |
| 95 if (fontData) | 95 if (fontData) |
| 96 return fontData; | 96 return fontData; |
| 97 } | 97 } |
| 98 | 98 |
| 99 icu::Locale locale = icu::Locale::getDefault(); | |
| 100 FontCache::PlatformFallbackFont fallbackFont; | 99 FontCache::PlatformFallbackFont fallbackFont; |
| 101 FontCache::getFontForCharacter(c, locale.getLanguage(), &fallbackFont); | 100 FontCache::getFontForCharacter(c, "", &fallbackFont); |
| 102 if (fallbackFont.name.isEmpty()) | 101 if (fallbackFont.name.isEmpty()) |
| 103 return nullptr; | 102 return nullptr; |
| 104 | 103 |
| 105 FontFaceCreationParams creationParams; | 104 FontFaceCreationParams creationParams; |
| 106 creationParams = FontFaceCreationParams(fallbackFont.filename, fallbackFont.
fontconfigInterfaceId, fallbackFont.ttcIndex); | 105 creationParams = FontFaceCreationParams(fallbackFont.filename, fallbackFont.
fontconfigInterfaceId, fallbackFont.ttcIndex); |
| 107 | 106 |
| 108 // Changes weight and/or italic of given FontDescription depends on | 107 // Changes weight and/or italic of given FontDescription depends on |
| 109 // the result of fontconfig so that keeping the correct font mapping | 108 // the result of fontconfig so that keeping the correct font mapping |
| 110 // of the given character. See http://crbug.com/32109 for details. | 109 // of the given character. See http://crbug.com/32109 for details. |
| 111 bool shouldSetSyntheticBold = false; | 110 bool shouldSetSyntheticBold = false; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 fontSize, | 214 fontSize, |
| 216 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc
ription.isSyntheticBold(), | 215 (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || fontDesc
ription.isSyntheticBold(), |
| 217 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe
ticItalic(), | 216 (fontDescription.style() && !tf->isItalic()) || fontDescription.isSynthe
ticItalic(), |
| 218 fontDescription.orientation(), | 217 fontDescription.orientation(), |
| 219 fontDescription.useSubpixelPositioning()); | 218 fontDescription.useSubpixelPositioning()); |
| 220 return result; | 219 return result; |
| 221 } | 220 } |
| 222 #endif // !OS(WIN) | 221 #endif // !OS(WIN) |
| 223 | 222 |
| 224 } // namespace WebCore | 223 } // namespace WebCore |
| OLD | NEW |