| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov | 3 * Copyright (C) 2006 Alexey Proskuryakov |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 if (brokenIdeograph) | 371 if (brokenIdeograph) |
| 372 GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get()); | 372 GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get()); |
| 373 if (verticalRightOrientation) | 373 if (verticalRightOrientation) |
| 374 GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get(
)); | 374 GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get(
)); |
| 375 if (uprightOrientation) | 375 if (uprightOrientation) |
| 376 GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get()); | 376 GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get()); |
| 377 } | 377 } |
| 378 | 378 |
| 379 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
ption& fontDescription, float scaleFactor) const | 379 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
ption& fontDescription, float scaleFactor) const |
| 380 { | 380 { |
| 381 // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general th
is should be achievable. | |
| 382 if (isSVGFont()) | |
| 383 return nullptr; | |
| 384 | |
| 385 return platformCreateScaledFontData(fontDescription, scaleFactor); | 381 return platformCreateScaledFontData(fontDescription, scaleFactor); |
| 386 } | 382 } |
| 387 | 383 |
| 388 | |
| 389 | |
| 390 PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const Fo
ntDescription& fontDescription, float scaleFactor) const | 384 PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const Fo
ntDescription& fontDescription, float scaleFactor) const |
| 391 { | 385 { |
| 392 const float scaledSize = lroundf(fontDescription.computedSize() * scaleFacto
r); | 386 const float scaledSize = lroundf(fontDescription.computedSize() * scaleFacto
r); |
| 393 return SimpleFontData::create(FontPlatformData(m_platformData, scaledSize),
isCustomFont() ? CustomFontData::create() : nullptr); | 387 return SimpleFontData::create(FontPlatformData(m_platformData, scaledSize),
isCustomFont() ? CustomFontData::create() : nullptr); |
| 394 } | 388 } |
| 395 | 389 |
| 396 void SimpleFontData::determinePitch() | 390 void SimpleFontData::determinePitch() |
| 397 { | 391 { |
| 398 m_treatAsFixedPitch = platformData().isFixedPitch(); | 392 m_treatAsFixedPitch = platformData().isFixedPitch(); |
| 399 } | 393 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 if (glyphs[i]) { | 484 if (glyphs[i]) { |
| 491 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); | 485 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); |
| 492 haveGlyphs = true; | 486 haveGlyphs = true; |
| 493 } | 487 } |
| 494 } | 488 } |
| 495 | 489 |
| 496 return haveGlyphs; | 490 return haveGlyphs; |
| 497 } | 491 } |
| 498 | 492 |
| 499 } // namespace blink | 493 } // namespace blink |
| OLD | NEW |