Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. |
| 6 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. | 6 * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 ASSERT(node->isSystemFallback()); | 506 ASSERT(node->isSystemFallback()); |
| 507 | 507 |
| 508 // System fallback is character-dependent. When we get here, we | 508 // System fallback is character-dependent. When we get here, we |
| 509 // know that the character in question isn't in the system fallback | 509 // know that the character in question isn't in the system fallback |
| 510 // font's glyph page. Try to lazily create it here. | 510 // font's glyph page. Try to lazily create it here. |
| 511 | 511 |
| 512 // FIXME: Unclear if this should normalizeSpaces above 0xFFFF. | 512 // FIXME: Unclear if this should normalizeSpaces above 0xFFFF. |
| 513 // Doing so changes fast/text/international/plane2-diffs.html | 513 // Doing so changes fast/text/international/plane2-diffs.html |
| 514 UChar32 characterToRender = c; | 514 UChar32 characterToRender = c; |
| 515 if (characterToRender <= 0xFFFF) | 515 if (characterToRender <= 0xFFFF) |
| 516 characterToRender = Character::normalizeSpaces(characterToRender); | 516 characterToRender = Character::normalizeSpaces(characterToRender); |
|
kochi
2015/08/26 12:02:59
is translated to U+00A0, but at this point
| |
| 517 | 517 |
| 518 const FontData* fontData = fontDataAt(0); | 518 const FontData* fontData = fontDataAt(0); |
| 519 if (fontData) { | 519 if (fontData) { |
| 520 const SimpleFontData* fontDataToSubstitute = fontData->fontDataForCharac ter(characterToRender); | 520 const SimpleFontData* fontDataToSubstitute = fontData->fontDataForCharac ter(characterToRender); |
| 521 RefPtr<SimpleFontData> characterFontData = FontCache::fontCache()->fallb ackFontForCharacter(m_fontDescription, characterToRender, fontDataToSubstitute); | 521 RefPtr<SimpleFontData> characterFontData = FontCache::fontCache()->fallb ackFontForCharacter(m_fontDescription, characterToRender, fontDataToSubstitute); |
| 522 if (characterFontData && variant != NormalVariant) { | 522 if (characterFontData && variant != NormalVariant) { |
| 523 characterFontData = characterFontData->variantFontData(m_fontDescrip tion, variant); | 523 characterFontData = characterFontData->variantFontData(m_fontDescrip tion, variant); |
| 524 } | 524 } |
| 525 if (characterFontData) { | 525 if (characterFontData) { |
| 526 // Got the fallback glyph and font. | 526 // Got the fallback glyph and font. |
| 527 GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterF ontData.get(), pageNumber)->page(); | 527 GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterF ontData.get(), pageNumber)->page(); |
| 528 GlyphData data = fallbackPage && fallbackPage->glyphForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData() ; | 528 GlyphData data = fallbackPage && fallbackPage->glyphForCharacter(cha racterToRender) ? fallbackPage->glyphDataForCharacter(characterToRender) : chara cterFontData->missingGlyphData(); |
|
kochi
2015/08/26 12:02:59
On this line, fallbackPage->glyphForCharacter(0xa0
kojii
2015/08/26 13:45:09
Yeah, this code path looks ok, so the caller shoul
kochi
2015/08/26 16:06:07
I think on Linux fallbackPage->glyphForCharacter(c
| |
| 529 // Cache it so we don't have to do system fallback again next time. | 529 // Cache it so we don't have to do system fallback again next time. |
| 530 if (variant == NormalVariant) { | 530 if (variant == NormalVariant) { |
| 531 page->setGlyphDataForCharacter(c, data.glyph, data.fontData); | 531 page->setGlyphDataForCharacter(characterToRender, data.glyph, da ta.fontData); |
| 532 data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData-> maxGlyphPageTreeLevel(), node->level())); | 532 data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData-> maxGlyphPageTreeLevel(), node->level())); |
| 533 if (data.fontData->platformData().isVerticalAnyUpright() && !dat a.fontData->isTextOrientationFallback() && !Character::isCJKIdeographOrSymbol(c) ) | 533 if (data.fontData->platformData().isVerticalAnyUpright() && !dat a.fontData->isTextOrientationFallback() && !Character::isCJKIdeographOrSymbol(ch aracterToRender)) |
| 534 return glyphDataForNonCJKCharacterWithGlyphOrientation(c, m_ fontDescription.isVerticalUpright(c), data, pageNumber); | 534 return glyphDataForNonCJKCharacterWithGlyphOrientation(chara cterToRender, m_fontDescription.isVerticalUpright(characterToRender), data, page Number); |
| 535 } | 535 } |
| 536 return data; | 536 return data; |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| 540 // Even system fallback can fail; use the missing glyph in that case. | 540 // Even system fallback can fail; use the missing glyph in that case. |
| 541 // FIXME: It would be nicer to use the missing glyph from the last resort fo nt instead. | 541 // FIXME: It would be nicer to use the missing glyph from the last resort fo nt instead. |
| 542 ASSERT(primaryFont()); | 542 ASSERT(primaryFont()); |
| 543 GlyphData data = primaryFont()->missingGlyphData(); | 543 GlyphData data = primaryFont()->missingGlyphData(); |
| 544 if (variant == NormalVariant) { | 544 if (variant == NormalVariant) { |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 { | 820 { |
| 821 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); | 821 return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); |
| 822 } | 822 } |
| 823 | 823 |
| 824 bool Font::isFallbackValid() const | 824 bool Font::isFallbackValid() const |
| 825 { | 825 { |
| 826 return !m_fontFallbackList || m_fontFallbackList->isValid(); | 826 return !m_fontFallbackList || m_fontFallbackList->isValid(); |
| 827 } | 827 } |
| 828 | 828 |
| 829 } // namespace blink | 829 } // namespace blink |
| OLD | NEW |