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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (!initialDesc.firstFamily().familyIsEmpty()) | 148 if (!initialDesc.firstFamily().familyIsEmpty()) |
149 scope.fontDescription().setFamily(initialDesc.firstFamily()); | 149 scope.fontDescription().setFamily(initialDesc.firstFamily()); |
150 } | 150 } |
151 | 151 |
152 void FontBuilder::setFontFamilyInherit(const FontDescription& parentFontDescript
ion) | 152 void FontBuilder::setFontFamilyInherit(const FontDescription& parentFontDescript
ion) |
153 { | 153 { |
154 FontDescriptionChangeScope scope(this); | 154 FontDescriptionChangeScope scope(this); |
155 | 155 |
156 scope.fontDescription().setGenericFamily(parentFontDescription.genericFamily
()); | 156 scope.fontDescription().setGenericFamily(parentFontDescription.genericFamily
()); |
157 scope.fontDescription().setFamily(parentFontDescription.family()); | 157 scope.fontDescription().setFamily(parentFontDescription.family()); |
158 scope.fontDescription().setIsSpecifiedFont(parentFontDescription.isSpecified
Font()); | |
159 } | 158 } |
160 | 159 |
161 // FIXME: I am not convinced FontBuilder needs to know anything about CSSValues. | 160 // FIXME: I am not convinced FontBuilder needs to know anything about CSSValues. |
162 void FontBuilder::setFontFamilyValue(CSSValue* value) | 161 void FontBuilder::setFontFamilyValue(CSSValue* value) |
163 { | 162 { |
164 FontDescriptionChangeScope scope(this); | 163 FontDescriptionChangeScope scope(this); |
165 | 164 |
166 if (!value->isValueList()) | 165 if (!value->isValueList()) |
167 return; | 166 return; |
168 | 167 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 break; | 214 break; |
216 } | 215 } |
217 } | 216 } |
218 | 217 |
219 if (!face.isEmpty()) { | 218 if (!face.isEmpty()) { |
220 if (!currFamily) { | 219 if (!currFamily) { |
221 // Filling in the first family. | 220 // Filling in the first family. |
222 firstFamily.setFamily(face); | 221 firstFamily.setFamily(face); |
223 firstFamily.appendFamily(nullptr); // Remove any inherited famil
y-fallback list. | 222 firstFamily.appendFamily(nullptr); // Remove any inherited famil
y-fallback list. |
224 currFamily = &firstFamily; | 223 currFamily = &firstFamily; |
225 scope.fontDescription().setIsSpecifiedFont(scope.fontDescription
().genericFamily() == FontDescription::NoFamily); | |
226 } else { | 224 } else { |
227 RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create(); | 225 RefPtr<SharedFontFamily> newFamily = SharedFontFamily::create(); |
228 newFamily->setFamily(face); | 226 newFamily->setFamily(face); |
229 currFamily->appendFamily(newFamily); | 227 currFamily->appendFamily(newFamily); |
230 currFamily = newFamily.get(); | 228 currFamily = newFamily.get(); |
231 } | 229 } |
232 } | 230 } |
233 } | 231 } |
234 | 232 |
235 // We can't call useFixedDefaultSize() until all new font families have been
added | 233 // We can't call useFixedDefaultSize() until all new font families have been
added |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 FontOrientation fontOrientation; | 674 FontOrientation fontOrientation; |
677 NonCJKGlyphOrientation glyphOrientation; | 675 NonCJKGlyphOrientation glyphOrientation; |
678 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 676 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
679 fontDescription.setOrientation(fontOrientation); | 677 fontDescription.setOrientation(fontOrientation); |
680 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 678 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
681 documentStyle->setFontDescription(fontDescription); | 679 documentStyle->setFontDescription(fontDescription); |
682 documentStyle->font().update(fontSelector); | 680 documentStyle->font().update(fontSelector); |
683 } | 681 } |
684 | 682 |
685 } | 683 } |
OLD | NEW |