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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 m_fontDescription.setSizeAdjust(aspectValue); | 134 m_fontDescription.setSizeAdjust(aspectValue); |
135 } | 135 } |
136 | 136 |
137 void FontBuilder::setStretch(FontStretch fontStretch) | 137 void FontBuilder::setStretch(FontStretch fontStretch) |
138 { | 138 { |
139 set(PropertySetFlag::Stretch); | 139 set(PropertySetFlag::Stretch); |
140 | 140 |
141 m_fontDescription.setStretch(fontStretch); | 141 m_fontDescription.setStretch(fontStretch); |
142 } | 142 } |
143 | 143 |
144 void FontBuilder::setLocale(const AtomicString& locale) | 144 void FontBuilder::setLocale(PassRefPtr<const LayoutLocale> locale) |
145 { | 145 { |
146 set(PropertySetFlag::Locale); | 146 set(PropertySetFlag::Locale); |
147 | 147 |
148 m_fontDescription.setLocale(locale); | 148 m_fontDescription.setLocale(locale); |
149 } | 149 } |
150 | 150 |
151 void FontBuilder::setStyle(FontStyle italic) | 151 void FontBuilder::setStyle(FontStyle italic) |
152 { | 152 { |
153 set(PropertySetFlag::Style); | 153 set(PropertySetFlag::Style); |
154 | 154 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 } | 362 } |
363 if (isSet(PropertySetFlag::SizeAdjust)) | 363 if (isSet(PropertySetFlag::SizeAdjust)) |
364 description.setSizeAdjust(m_fontDescription.sizeAdjust()); | 364 description.setSizeAdjust(m_fontDescription.sizeAdjust()); |
365 if (isSet(PropertySetFlag::Weight)) | 365 if (isSet(PropertySetFlag::Weight)) |
366 description.setWeight(m_fontDescription.weight()); | 366 description.setWeight(m_fontDescription.weight()); |
367 if (isSet(PropertySetFlag::Stretch)) | 367 if (isSet(PropertySetFlag::Stretch)) |
368 description.setStretch(m_fontDescription.stretch()); | 368 description.setStretch(m_fontDescription.stretch()); |
369 if (isSet(PropertySetFlag::FeatureSettings)) | 369 if (isSet(PropertySetFlag::FeatureSettings)) |
370 description.setFeatureSettings(m_fontDescription.featureSettings()); | 370 description.setFeatureSettings(m_fontDescription.featureSettings()); |
371 if (isSet(PropertySetFlag::Locale)) | 371 if (isSet(PropertySetFlag::Locale)) |
372 description.setLocale(m_fontDescription.locale(false)); | 372 description.setLocale(m_fontDescription.locale()); |
373 if (isSet(PropertySetFlag::Style)) | 373 if (isSet(PropertySetFlag::Style)) |
374 description.setStyle(m_fontDescription.style()); | 374 description.setStyle(m_fontDescription.style()); |
375 if (isSet(PropertySetFlag::VariantCaps)) | 375 if (isSet(PropertySetFlag::VariantCaps)) |
376 description.setVariantCaps(m_fontDescription.variantCaps()); | 376 description.setVariantCaps(m_fontDescription.variantCaps()); |
377 if (isSet(PropertySetFlag::VariantLigatures)) | 377 if (isSet(PropertySetFlag::VariantLigatures)) |
378 description.setVariantLigatures(m_fontDescription.getVariantLigatures())
; | 378 description.setVariantLigatures(m_fontDescription.getVariantLigatures())
; |
379 if (isSet(PropertySetFlag::VariantNumeric)) | 379 if (isSet(PropertySetFlag::VariantNumeric)) |
380 description.setVariantNumeric(m_fontDescription.variantNumeric()); | 380 description.setVariantNumeric(m_fontDescription.variantNumeric()); |
381 if (isSet(PropertySetFlag::TextRendering)) | 381 if (isSet(PropertySetFlag::TextRendering)) |
382 description.setTextRendering(m_fontDescription.textRendering()); | 382 description.setTextRendering(m_fontDescription.textRendering()); |
383 if (isSet(PropertySetFlag::Kerning)) | 383 if (isSet(PropertySetFlag::Kerning)) |
384 description.setKerning(m_fontDescription.getKerning()); | 384 description.setKerning(m_fontDescription.getKerning()); |
385 if (isSet(PropertySetFlag::FontSmoothing)) | 385 if (isSet(PropertySetFlag::FontSmoothing)) |
386 description.setFontSmoothing(m_fontDescription.fontSmoothing()); | 386 description.setFontSmoothing(m_fontDescription.fontSmoothing()); |
387 if (isSet(PropertySetFlag::TextOrientation) || isSet(PropertySetFlag::Writin
gMode)) | 387 if (isSet(PropertySetFlag::TextOrientation) || isSet(PropertySetFlag::Writin
gMode)) |
388 updateOrientation(description, style); | 388 updateOrientation(description, style); |
389 | 389 |
390 updateSpecifiedSize(description, style); | 390 updateSpecifiedSize(description, style); |
391 updateComputedSize(description, style); | 391 updateComputedSize(description, style); |
392 updateAdjustedSize(description, style, fontSelector); | 392 updateAdjustedSize(description, style, fontSelector); |
393 | 393 |
394 style.setFontDescription(description); | 394 style.setFontDescription(description); |
395 style.font().update(fontSelector); | 395 style.font().update(fontSelector); |
396 m_flags = 0; | 396 m_flags = 0; |
397 } | 397 } |
398 | 398 |
399 void FontBuilder::createFontForDocument(FontSelector* fontSelector, ComputedStyl
e& documentStyle) | 399 void FontBuilder::createFontForDocument(FontSelector* fontSelector, ComputedStyl
e& documentStyle) |
400 { | 400 { |
401 FontDescription fontDescription = FontDescription(); | 401 FontDescription fontDescription = FontDescription(); |
402 fontDescription.setLocale(documentStyle.locale()); | 402 fontDescription.setLocale(documentStyle.getFontDescription().locale()); |
403 | 403 |
404 setFamilyDescription(fontDescription, FontBuilder::initialFamilyDescription(
)); | 404 setFamilyDescription(fontDescription, FontBuilder::initialFamilyDescription(
)); |
405 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize(
), 0.0f, false)); | 405 setSize(fontDescription, FontDescription::Size(FontSize::initialKeywordSize(
), 0.0f, false)); |
406 updateSpecifiedSize(fontDescription, documentStyle); | 406 updateSpecifiedSize(fontDescription, documentStyle); |
407 updateComputedSize(fontDescription, documentStyle); | 407 updateComputedSize(fontDescription, documentStyle); |
408 | 408 |
409 updateOrientation(fontDescription, documentStyle); | 409 updateOrientation(fontDescription, documentStyle); |
410 documentStyle.setFontDescription(fontDescription); | 410 documentStyle.setFontDescription(fontDescription); |
411 documentStyle.font().update(fontSelector); | 411 documentStyle.font().update(fontSelector); |
412 } | 412 } |
413 | 413 |
414 } // namespace blink | 414 } // namespace blink |
OLD | NEW |