| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 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 paint->setTypeface(m_typeface.get()); | 204 paint->setTypeface(m_typeface.get()); |
| 205 paint->setFakeBoldText(m_fakeBold); | 205 paint->setFakeBoldText(m_fakeBold); |
| 206 paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0); | 206 paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0); |
| 207 } | 207 } |
| 208 | 208 |
| 209 SkFontID FontPlatformData::uniqueID() const | 209 SkFontID FontPlatformData::uniqueID() const |
| 210 { | 210 { |
| 211 return m_typeface->uniqueID(); | 211 return m_typeface->uniqueID(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 String FontPlatformData::fontFamilyName() const |
| 215 { |
| 216 SkTypeface::LocalizedStrings* fontFamilyIterator = this->typeface()->createF
amilyNameIterator(); |
| 217 SkTypeface::LocalizedString localizedString; |
| 218 while (fontFamilyIterator->next(&localizedString) && !localizedString.fStrin
g.size()) { } |
| 219 fontFamilyIterator->unref(); |
| 220 return String(localizedString.fString.c_str()); |
| 221 } |
| 222 |
| 214 bool FontPlatformData::operator==(const FontPlatformData& a) const | 223 bool FontPlatformData::operator==(const FontPlatformData& a) const |
| 215 { | 224 { |
| 216 // If either of the typeface pointers are null then we test for pointer | 225 // If either of the typeface pointers are null then we test for pointer |
| 217 // equality. Otherwise, we call SkTypeface::Equal on the valid pointers. | 226 // equality. Otherwise, we call SkTypeface::Equal on the valid pointers. |
| 218 bool typefacesEqual; | 227 bool typefacesEqual; |
| 219 if (!m_typeface || !a.m_typeface) | 228 if (!m_typeface || !a.m_typeface) |
| 220 typefacesEqual = m_typeface == a.m_typeface; | 229 typefacesEqual = m_typeface == a.m_typeface; |
| 221 else | 230 else |
| 222 typefacesEqual = SkTypeface::Equal(m_typeface.get(), a.m_typeface.get())
; | 231 typefacesEqual = SkTypeface::Equal(m_typeface.get(), a.m_typeface.get())
; |
| 223 | 232 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 m_style.useAutoHint = useSkiaAutoHint; | 305 m_style.useAutoHint = useSkiaAutoHint; |
| 297 if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference) | 306 if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference) |
| 298 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; | 307 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; |
| 299 if (m_style.useAntiAlias == FontRenderStyle::NoPreference) | 308 if (m_style.useAntiAlias == FontRenderStyle::NoPreference) |
| 300 m_style.useAntiAlias = useSkiaAntiAlias; | 309 m_style.useAntiAlias = useSkiaAntiAlias; |
| 301 if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) | 310 if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) |
| 302 m_style.useSubpixelRendering = useSkiaSubpixelRendering; | 311 m_style.useSubpixelRendering = useSkiaSubpixelRendering; |
| 303 } | 312 } |
| 304 | 313 |
| 305 } // namespace WebCore | 314 } // namespace WebCore |
| OLD | NEW |