| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 return true; | 404 return true; |
| 405 | 405 |
| 406 if (!PrimaryFont()) | 406 if (!PrimaryFont()) |
| 407 return false; | 407 return false; |
| 408 | 408 |
| 409 const FontPlatformData& platform_data = PrimaryFont()->PlatformData(); | 409 const FontPlatformData& platform_data = PrimaryFont()->PlatformData(); |
| 410 TypesettingFeatures features = GetFontDescription().GetTypesettingFeatures(); | 410 TypesettingFeatures features = GetFontDescription().GetTypesettingFeatures(); |
| 411 return !platform_data.HasSpaceInLigaturesOrKerning(features); | 411 return !platform_data.HasSpaceInLigaturesOrKerning(features); |
| 412 }; | 412 }; |
| 413 | 413 |
| 414 void Font::ReportNotDefGlyph() const { |
| 415 FontSelector* fontSelector = font_fallback_list_->GetFontSelector(); |
| 416 // We have a few non-DOM usages of Font code, for example in DragImage::Create |
| 417 // and in EmbeddedObjectPainter::paintReplaced. In those cases, we can't |
| 418 // retrieve a font selector as our connection to a Document object to report |
| 419 // UseCounter metrics, and thus we cannot report notdef glyphs. |
| 420 if (fontSelector) |
| 421 fontSelector->ReportNotDefGlyph(); |
| 422 } |
| 423 |
| 414 void Font::WillUseFontData(const String& text) const { | 424 void Font::WillUseFontData(const String& text) const { |
| 415 const FontFamily& family = GetFontDescription().Family(); | 425 const FontFamily& family = GetFontDescription().Family(); |
| 416 if (font_fallback_list_ && font_fallback_list_->GetFontSelector() && | 426 if (font_fallback_list_ && font_fallback_list_->GetFontSelector() && |
| 417 !family.FamilyIsEmpty()) | 427 !family.FamilyIsEmpty()) |
| 418 font_fallback_list_->GetFontSelector()->WillUseFontData( | 428 font_fallback_list_->GetFontSelector()->WillUseFontData( |
| 419 GetFontDescription(), family.Family(), text); | 429 GetFontDescription(), family.Family(), text); |
| 420 } | 430 } |
| 421 | 431 |
| 422 PassRefPtr<FontFallbackIterator> Font::CreateFontFallbackIterator( | 432 PassRefPtr<FontFallbackIterator> Font::CreateFontFallbackIterator( |
| 423 FontFallbackPriority fallback_priority) const { | 433 FontFallbackPriority fallback_priority) const { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 | 499 |
| 490 bool Font::LoadingCustomFonts() const { | 500 bool Font::LoadingCustomFonts() const { |
| 491 return font_fallback_list_ && font_fallback_list_->LoadingCustomFonts(); | 501 return font_fallback_list_ && font_fallback_list_->LoadingCustomFonts(); |
| 492 } | 502 } |
| 493 | 503 |
| 494 bool Font::IsFallbackValid() const { | 504 bool Font::IsFallbackValid() const { |
| 495 return !font_fallback_list_ || font_fallback_list_->IsValid(); | 505 return !font_fallback_list_ || font_fallback_list_->IsValid(); |
| 496 } | 506 } |
| 497 | 507 |
| 498 } // namespace blink | 508 } // namespace blink |
| OLD | NEW |