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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 scope.fontDescription().setCommonLigaturesState(commonLigaturesState); | 453 scope.fontDescription().setCommonLigaturesState(commonLigaturesState); |
453 scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigature
sState); | 454 scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigature
sState); |
454 scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState
); | 455 scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState
); |
455 scope.fontDescription().setContextualLigaturesState(contextualLigaturesState
); | 456 scope.fontDescription().setContextualLigaturesState(contextualLigaturesState
); |
456 } | 457 } |
457 | 458 |
458 void FontBuilder::setScript(const String& locale) | 459 void FontBuilder::setScript(const String& locale) |
459 { | 460 { |
460 FontDescriptionChangeScope scope(this); | 461 FontDescriptionChangeScope scope(this); |
461 | 462 |
| 463 scope.fontDescription().setLocale(locale); |
462 scope.fontDescription().setScript(localeToScriptCodeForFontSelection(locale)
); | 464 scope.fontDescription().setScript(localeToScriptCodeForFontSelection(locale)
); |
463 } | 465 } |
464 | 466 |
465 void FontBuilder::setStyle(FontStyle italic) | 467 void FontBuilder::setStyle(FontStyle italic) |
466 { | 468 { |
467 FontDescriptionChangeScope scope(this); | 469 FontDescriptionChangeScope scope(this); |
468 | 470 |
469 scope.fontDescription().setStyle(italic); | 471 scope.fontDescription().setStyle(italic); |
470 } | 472 } |
471 | 473 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 FontOrientation fontOrientation; | 668 FontOrientation fontOrientation; |
667 NonCJKGlyphOrientation glyphOrientation; | 669 NonCJKGlyphOrientation glyphOrientation; |
668 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 670 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
669 fontDescription.setOrientation(fontOrientation); | 671 fontDescription.setOrientation(fontOrientation); |
670 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 672 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
671 documentStyle->setFontDescription(fontDescription); | 673 documentStyle->setFontDescription(fontDescription); |
672 documentStyle->font().update(fontSelector); | 674 documentStyle->font().update(fontSelector); |
673 } | 675 } |
674 | 676 |
675 } | 677 } |
OLD | NEW |