| 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 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "core/css/resolver/FontBuilder.h" | 24 #include "core/css/resolver/FontBuilder.h" |
| 25 | 25 |
| 26 #include "core/css/CSSCalculationValue.h" | 26 #include "core/css/CSSCalculationValue.h" |
| 27 #include "core/css/CSSFontFeatureValue.h" | 27 #include "core/css/CSSFontFeatureValue.h" |
| 28 #include "core/css/CSSToLengthConversionData.h" | 28 #include "core/css/CSSToLengthConversionData.h" |
| 29 #include "core/css/FontSize.h" | 29 #include "core/css/FontSize.h" |
| 30 #include "core/frame/LocalFrame.h" | 30 #include "core/frame/LocalFrame.h" |
| 31 #include "core/frame/Settings.h" | 31 #include "core/frame/Settings.h" |
| 32 #include "core/rendering/RenderTheme.h" | 32 #include "core/rendering/RenderTheme.h" |
| 33 #include "core/rendering/RenderView.h" | 33 #include "core/rendering/RenderView.h" |
| 34 #include "platform/fonts/FontDescription.h" |
| 34 #include "platform/text/LocaleToScriptMapping.h" | 35 #include "platform/text/LocaleToScriptMapping.h" |
| 35 | 36 |
| 36 namespace WebCore { | 37 namespace WebCore { |
| 37 | 38 |
| 38 // FIXME: This scoping class is a short-term fix to minimize the changes in | 39 // FIXME: This scoping class is a short-term fix to minimize the changes in |
| 39 // Font-constructing logic. | 40 // Font-constructing logic. |
| 40 class FontDescriptionChangeScope { | 41 class FontDescriptionChangeScope { |
| 41 public: | 42 public: |
| 42 FontDescriptionChangeScope(FontBuilder* fontBuilder) | 43 FontDescriptionChangeScope(FontBuilder* fontBuilder) |
| 43 : m_fontBuilder(fontBuilder) | 44 : m_fontBuilder(fontBuilder) |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 scope.fontDescription().setCommonLigaturesState(commonLigaturesState); | 451 scope.fontDescription().setCommonLigaturesState(commonLigaturesState); |
| 451 scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigature
sState); | 452 scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigature
sState); |
| 452 scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState
); | 453 scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState
); |
| 453 scope.fontDescription().setContextualLigaturesState(contextualLigaturesState
); | 454 scope.fontDescription().setContextualLigaturesState(contextualLigaturesState
); |
| 454 } | 455 } |
| 455 | 456 |
| 456 void FontBuilder::setScript(const String& locale) | 457 void FontBuilder::setScript(const String& locale) |
| 457 { | 458 { |
| 458 FontDescriptionChangeScope scope(this); | 459 FontDescriptionChangeScope scope(this); |
| 459 | 460 |
| 461 scope.fontDescription().setLocale(locale); |
| 460 scope.fontDescription().setScript(localeToScriptCodeForFontSelection(locale)
); | 462 scope.fontDescription().setScript(localeToScriptCodeForFontSelection(locale)
); |
| 461 } | 463 } |
| 462 | 464 |
| 463 void FontBuilder::setStyle(FontStyle italic) | 465 void FontBuilder::setStyle(FontStyle italic) |
| 464 { | 466 { |
| 465 FontDescriptionChangeScope scope(this); | 467 FontDescriptionChangeScope scope(this); |
| 466 | 468 |
| 467 scope.fontDescription().setStyle(italic); | 469 scope.fontDescription().setStyle(italic); |
| 468 } | 470 } |
| 469 | 471 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 FontOrientation fontOrientation; | 665 FontOrientation fontOrientation; |
| 664 NonCJKGlyphOrientation glyphOrientation; | 666 NonCJKGlyphOrientation glyphOrientation; |
| 665 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 667 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
| 666 fontDescription.setOrientation(fontOrientation); | 668 fontDescription.setOrientation(fontOrientation); |
| 667 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 669 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
| 668 documentStyle->setFontDescription(fontDescription); | 670 documentStyle->setFontDescription(fontDescription); |
| 669 documentStyle->font().update(fontSelector); | 671 documentStyle->font().update(fontSelector); |
| 670 } | 672 } |
| 671 | 673 |
| 672 } | 674 } |
| OLD | NEW |