Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: Source/platform/fonts/Font.cpp

Issue 870523003: Check for Unicode in Font before ICU call (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test patch - Convert to NFC for if diacritical marks are present Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 if (variant == NormalVariant) { 554 if (variant == NormalVariant) {
555 page->setGlyphDataForCharacter(c, data.glyph, data.fontData); 555 page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
556 data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyph PageTreeLevel(), node->level())); 556 data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyph PageTreeLevel(), node->level()));
557 } 557 }
558 return std::make_pair(data, page); 558 return std::make_pair(data, page);
559 } 559 }
560 560
561 bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const 561 bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const
562 { 562 {
563 ASSERT(primaryFont()); 563 ASSERT(primaryFont());
564 unsigned pageNumber = (character / GlyphPage::size); 564 return primaryFont()->fontHasGlyphForCharacter(character);
565
566 GlyphPageTreeNode* node = GlyphPageTreeNode::getNormalRootChild(primaryFont( ), pageNumber);
567 GlyphPage* page = node->page();
568
569 return page && page->glyphForCharacter(character);
570 } 565 }
571 566
572 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the 567 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
573 // standard emphasis marks do so. 568 // standard emphasis marks do so.
574 bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphDa ta) const 569 bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphDa ta) const
575 { 570 {
576 if (mark.isEmpty()) 571 if (mark.isEmpty())
577 return false; 572 return false;
578 573
579 UChar32 character = mark[0]; 574 UChar32 character = mark[0];
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 if (delta <= 0) 943 if (delta <= 0)
949 break; 944 break;
950 } 945 }
951 } 946 }
952 } 947 }
953 948
954 return offset; 949 return offset;
955 } 950 }
956 951
957 } // namespace blink 952 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698