| 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.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * Copyright (C) 2015 Collabora Ltd. All rights reserved. | 5 * Copyright (C) 2015 Collabora Ltd. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 | 327 |
| 328 void FontBuilder::updateComputedSize(FontDescription& fontDescription, const Com
putedStyle& style) | 328 void FontBuilder::updateComputedSize(FontDescription& fontDescription, const Com
putedStyle& style) |
| 329 { | 329 { |
| 330 float computedSize = getComputedSizeFromSpecifiedSize(fontDescription, style
.effectiveZoom(), fontDescription.specifiedSize()); | 330 float computedSize = getComputedSizeFromSpecifiedSize(fontDescription, style
.effectiveZoom(), fontDescription.specifiedSize()); |
| 331 float multiplier = style.textAutosizingMultiplier(); | 331 float multiplier = style.textAutosizingMultiplier(); |
| 332 if (multiplier > 1) | 332 if (multiplier > 1) |
| 333 computedSize = TextAutosizer::computeAutosizedFontSize(computedSize, mul
tiplier); | 333 computedSize = TextAutosizer::computeAutosizedFontSize(computedSize, mul
tiplier); |
| 334 fontDescription.setComputedSize(computedSize); | 334 fontDescription.setComputedSize(computedSize); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void FontBuilder::createFont(PassRefPtrWillBeRawPtr<FontSelector> fontSelector,
ComputedStyle& style) | 337 void FontBuilder::createFont(RawPtr<FontSelector> fontSelector, ComputedStyle& s
tyle) |
| 338 { | 338 { |
| 339 if (!m_flags) | 339 if (!m_flags) |
| 340 return; | 340 return; |
| 341 | 341 |
| 342 FontDescription description = style.fontDescription(); | 342 FontDescription description = style.fontDescription(); |
| 343 | 343 |
| 344 if (isSet(PropertySetFlag::Family)) { | 344 if (isSet(PropertySetFlag::Family)) { |
| 345 description.setGenericFamily(m_fontDescription.genericFamily()); | 345 description.setGenericFamily(m_fontDescription.genericFamily()); |
| 346 description.setFamily(m_fontDescription.family()); | 346 description.setFamily(m_fontDescription.family()); |
| 347 } | 347 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 377 | 377 |
| 378 updateSpecifiedSize(description, style); | 378 updateSpecifiedSize(description, style); |
| 379 updateComputedSize(description, style); | 379 updateComputedSize(description, style); |
| 380 updateAdjustedSize(description, style, fontSelector.get()); | 380 updateAdjustedSize(description, style, fontSelector.get()); |
| 381 | 381 |
| 382 style.setFontDescription(description); | 382 style.setFontDescription(description); |
| 383 style.font().update(fontSelector); | 383 style.font().update(fontSelector); |
| 384 m_flags = 0; | 384 m_flags = 0; |
| 385 } | 385 } |
| 386 | 386 |
| 387 void FontBuilder::createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector> fon
tSelector, ComputedStyle& documentStyle) | 387 void FontBuilder::createFontForDocument(RawPtr<FontSelector> fontSelector, Compu
tedStyle& documentStyle) |
| 388 { | 388 { |
| 389 FontDescription fontDescription = FontDescription(); | 389 FontDescription fontDescription = FontDescription(); |
| 390 fontDescription.setLocale(documentStyle.locale()); | 390 fontDescription.setLocale(documentStyle.locale()); |
| 391 | 391 |
| 392 setFamilyDescription(fontDescription, FontBuilder::initialFamilyDescription(
)); | 392 setFamilyDescription(fontDescription, FontBuilder::initialFamilyDescription(
)); |
| 393 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize(
), 0.0f, false)); | 393 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize(
), 0.0f, false)); |
| 394 updateSpecifiedSize(fontDescription, documentStyle); | 394 updateSpecifiedSize(fontDescription, documentStyle); |
| 395 updateComputedSize(fontDescription, documentStyle); | 395 updateComputedSize(fontDescription, documentStyle); |
| 396 | 396 |
| 397 updateOrientation(fontDescription, documentStyle); | 397 updateOrientation(fontDescription, documentStyle); |
| 398 documentStyle.setFontDescription(fontDescription); | 398 documentStyle.setFontDescription(fontDescription); |
| 399 documentStyle.font().update(fontSelector); | 399 documentStyle.font().update(fontSelector); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace blink | 402 } // namespace blink |
| OLD | NEW |