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 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 * | 20 * |
21 */ | 21 */ |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
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/FontFeatureValue.h" | 27 #include "core/css/CSSFontFeatureValue.h" |
28 #include "core/css/FontSize.h" | 28 #include "core/css/FontSize.h" |
29 #include "core/page/Frame.h" | 29 #include "core/page/Frame.h" |
30 #include "core/page/Settings.h" | 30 #include "core/page/Settings.h" |
31 #include "core/rendering/RenderTheme.h" | 31 #include "core/rendering/RenderTheme.h" |
32 #include "core/rendering/RenderView.h" | 32 #include "core/rendering/RenderView.h" |
33 #include "platform/text/LocaleToScriptMapping.h" | 33 #include "platform/text/LocaleToScriptMapping.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 // FIXME: This scoping class is a short-term fix to minimize the changes in | 37 // FIXME: This scoping class is a short-term fix to minimize the changes in |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 { | 498 { |
499 FontDescriptionChangeScope scope(this); | 499 FontDescriptionChangeScope scope(this); |
500 | 500 |
501 CSSValueList* list = toCSSValueList(value); | 501 CSSValueList* list = toCSSValueList(value); |
502 RefPtr<FontFeatureSettings> settings = FontFeatureSettings::create(); | 502 RefPtr<FontFeatureSettings> settings = FontFeatureSettings::create(); |
503 int len = list->length(); | 503 int len = list->length(); |
504 for (int i = 0; i < len; ++i) { | 504 for (int i = 0; i < len; ++i) { |
505 CSSValue* item = list->itemWithoutBoundsCheck(i); | 505 CSSValue* item = list->itemWithoutBoundsCheck(i); |
506 if (!item->isFontFeatureValue()) | 506 if (!item->isFontFeatureValue()) |
507 continue; | 507 continue; |
508 FontFeatureValue* feature = static_cast<FontFeatureValue*>(item); | 508 CSSFontFeatureValue* feature = toCSSFontFeatureValue(item); |
509 settings->append(FontFeature(feature->tag(), feature->value())); | 509 settings->append(FontFeature(feature->tag(), feature->value())); |
510 } | 510 } |
511 scope.fontDescription().setFeatureSettings(settings.release()); | 511 scope.fontDescription().setFeatureSettings(settings.release()); |
512 } | 512 } |
513 | 513 |
514 void FontBuilder::setSize(FontDescription& fontDescription, float effectiveZoom,
float size) | 514 void FontBuilder::setSize(FontDescription& fontDescription, float effectiveZoom,
float size) |
515 { | 515 { |
516 fontDescription.setSpecifiedSize(size); | 516 fontDescription.setSpecifiedSize(size); |
517 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip
tion, effectiveZoom, size)); | 517 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip
tion, effectiveZoom, size)); |
518 } | 518 } |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 FontOrientation fontOrientation; | 666 FontOrientation fontOrientation; |
667 NonCJKGlyphOrientation glyphOrientation; | 667 NonCJKGlyphOrientation glyphOrientation; |
668 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 668 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
669 fontDescription.setOrientation(fontOrientation); | 669 fontDescription.setOrientation(fontOrientation); |
670 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 670 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
671 documentStyle->setFontDescription(fontDescription); | 671 documentStyle->setFontDescription(fontDescription); |
672 documentStyle->font().update(fontSelector); | 672 documentStyle->font().update(fontSelector); |
673 } | 673 } |
674 | 674 |
675 } | 675 } |
OLD | NEW |