| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Computer, Inc. | 2 * Copyright (C) 2007 Apple Computer, Inc. |
| 3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. | 3 * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. |
| 4 * Copyright (C) 2010 Company 100, Inc. | 4 * Copyright (C) 2010 Company 100, Inc. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 if (syntheticBold || syntheticItalic) { | 66 if (syntheticBold || syntheticItalic) { |
| 67 SkString name; | 67 SkString name; |
| 68 m_typeface->getFamilyName(&name); | 68 m_typeface->getFamilyName(&name); |
| 69 | 69 |
| 70 int style = SkTypeface::kNormal; | 70 int style = SkTypeface::kNormal; |
| 71 if (syntheticBold) | 71 if (syntheticBold) |
| 72 style |= SkTypeface::kBold; | 72 style |= SkTypeface::kBold; |
| 73 if (syntheticItalic) | 73 if (syntheticItalic) |
| 74 style |= SkTypeface::kItalic; | 74 style |= SkTypeface::kItalic; |
| 75 | 75 |
| 76 RefPtr<SkTypeface> typeface = adoptRef(SkTypeface::CreateFromName(name.c
_str(), static_cast<SkTypeface::Style>(style))); | 76 RefPtr<SkTypeface> typeface = adoptRef(FontCache::fontCache()->fontManag
er()->legacyCreateTypeface(name.c_str(), static_cast<SkTypeface::Style>(style)))
; |
| 77 syntheticBold = false; | 77 syntheticBold = false; |
| 78 syntheticItalic = false; | 78 syntheticItalic = false; |
| 79 return FontPlatformData(typeface.release(), "", size, syntheticBold, syn
theticItalic, orientation); | 79 return FontPlatformData(typeface.release(), "", size, syntheticBold, syn
theticItalic, orientation); |
| 80 } | 80 } |
| 81 #endif | 81 #endif |
| 82 return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isB
old(), italic && !m_typeface->isItalic(), orientation); | 82 return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isB
old(), italic && !m_typeface->isItalic(), orientation); |
| 83 } | 83 } |
| 84 | 84 |
| 85 PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer*
buffer) | 85 PassOwnPtr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer*
buffer) |
| 86 { | 86 { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 103 | 103 |
| 104 return adoptPtr(new FontCustomPlatformData(typeface.release())); | 104 return adoptPtr(new FontCustomPlatformData(typeface.release())); |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool FontCustomPlatformData::supportsFormat(const String& format) | 107 bool FontCustomPlatformData::supportsFormat(const String& format) |
| 108 { | 108 { |
| 109 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "o
pentype") || OpenTypeSanitizer::supportsFormat(format); | 109 return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "o
pentype") || OpenTypeSanitizer::supportsFormat(format); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } | 112 } |
| OLD | NEW |