| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2015 Collabora Ltd. All rights reserved. | 6 * Copyright (C) 2015 Collabora Ltd. 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 void FontBuilder::UpdateAdjustedSize(FontDescription& font_description, | 313 void FontBuilder::UpdateAdjustedSize(FontDescription& font_description, |
| 314 const ComputedStyle& style, | 314 const ComputedStyle& style, |
| 315 FontSelector* font_selector) { | 315 FontSelector* font_selector) { |
| 316 const float specified_size = font_description.SpecifiedSize(); | 316 const float specified_size = font_description.SpecifiedSize(); |
| 317 if (!font_description.HasSizeAdjust() || !specified_size) | 317 if (!font_description.HasSizeAdjust() || !specified_size) |
| 318 return; | 318 return; |
| 319 | 319 |
| 320 // We need to create a temporal Font to get xHeight of a primary font. | 320 // We need to create a temporal Font to get xHeight of a primary font. |
| 321 // The aspect value is based on the xHeight of the font for the computed font | 321 // The aspect value is based on the xHeight of the font for the computed font |
| 322 // size, so we need to reset the adjustedSize to computedSize. See | 322 // size, so we need to reset the adjustedSize to computedSize. See |
| 323 // FontDescription::effectiveFontSize. | 323 // FontDescription::EffectiveFontSize. |
| 324 font_description.SetAdjustedSize(font_description.ComputedSize()); | 324 font_description.SetAdjustedSize(font_description.ComputedSize()); |
| 325 | 325 |
| 326 Font font(font_description); | 326 Font font(font_description); |
| 327 font.Update(font_selector); | 327 font.Update(font_selector); |
| 328 | 328 |
| 329 const SimpleFontData* font_data = font.PrimaryFont(); | 329 const SimpleFontData* font_data = font.PrimaryFont(); |
| 330 | 330 |
| 331 if (!font_data || !font_data->GetFontMetrics().HasXHeight()) | 331 if (!font_data || !font_data->GetFontMetrics().HasXHeight()) |
| 332 return; | 332 return; |
| 333 | 333 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 FontDescription::Size(FontSize::InitialKeywordSize(), 0.0f, false)); | 420 FontDescription::Size(FontSize::InitialKeywordSize(), 0.0f, false)); |
| 421 UpdateSpecifiedSize(font_description, document_style); | 421 UpdateSpecifiedSize(font_description, document_style); |
| 422 UpdateComputedSize(font_description, document_style); | 422 UpdateComputedSize(font_description, document_style); |
| 423 | 423 |
| 424 UpdateOrientation(font_description, document_style); | 424 UpdateOrientation(font_description, document_style); |
| 425 document_style.SetFontDescription(font_description); | 425 document_style.SetFontDescription(font_description); |
| 426 document_style.GetFont().Update(font_selector); | 426 document_style.GetFont().Update(font_selector); |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace blink | 429 } // namespace blink |
| OLD | NEW |