OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 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 24 matching lines...) Expand all Loading... | |
35 #include "core/platform/graphics/FontDescription.h" | 35 #include "core/platform/graphics/FontDescription.h" |
36 #include "core/platform/graphics/SimpleFontData.h" | 36 #include "core/platform/graphics/SimpleFontData.h" |
37 | 37 |
38 #include "SkTypeface_android.h" | 38 #include "SkTypeface_android.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace WebCore { |
41 | 41 |
42 PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c) | 42 PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c) |
43 { | 43 { |
44 SkString skiaFamilyName; | 44 SkString skiaFamilyName; |
45 if (!SkGetFallbackFamilyNameForChar(c, &skiaFamilyName) || skiaFamilyName.is Empty()) | 45 if (!SkGetFallbackFamilyNameForChar(c, font.fontDescription().locale().strin g().ascii().data(), &skiaFamilyName) |
falken
2013/09/25 08:11:51
What happens if a page has -webkit-locale: '<crazy
djsollen
2013/09/25 13:20:19
Skia uses that value to search over a list of know
| |
46 || skiaFamilyName.isEmpty()) | |
46 return 0; | 47 return 0; |
47 return getFontResourceData(getFontResourcePlatformData(font.fontDescription( ), AtomicString(skiaFamilyName.c_str()), DoNotRetain), DoNotRetain); | 48 return getFontResourceData(getFontResourcePlatformData(font.fontDescription( ), AtomicString(skiaFamilyName.c_str()), DoNotRetain), DoNotRetain); |
48 } | 49 } |
49 | 50 |
50 } // namespace WebCore | 51 } // namespace WebCore |
OLD | NEW |