Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: Source/platform/fonts/FontDescription.cpp

Issue 468793003: Make style building for 'font-size' less custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix regression related to FontDescriptions with isAbsolute=true. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/fonts/FontDescription.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com> 2 * Copyright (C) 2007 Nicholas Shanks <contact@nickshanks.com>
3 * Copyright (C) 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 case FontWeight600: 89 case FontWeight600:
90 case FontWeight700: 90 case FontWeight700:
91 case FontWeight800: 91 case FontWeight800:
92 case FontWeight900: 92 case FontWeight900:
93 return FontWeight900; 93 return FontWeight900;
94 } 94 }
95 ASSERT_NOT_REACHED(); 95 ASSERT_NOT_REACHED();
96 return FontWeightNormal; 96 return FontWeightNormal;
97 } 97 }
98 98
99 FontDescription::Size FontDescription::largerSize(const Size& size)
100 {
101 return Size(0, size.value * 1.2, size.isAbsolute);
102 }
103
104 FontDescription::Size FontDescription::smallerSize(const Size& size)
105 {
106 return Size(0, size.value / 1.2, size.isAbsolute);
107 }
108
99 FontTraits FontDescription::traits() const 109 FontTraits FontDescription::traits() const
100 { 110 {
101 return FontTraits(style(), variant(), weight(), stretch()); 111 return FontTraits(style(), variant(), weight(), stretch());
102 } 112 }
103 113
104 FontDescription::VariantLigatures FontDescription::variantLigatures() const 114 FontDescription::VariantLigatures FontDescription::variantLigatures() const
105 { 115 {
106 VariantLigatures ligatures; 116 VariantLigatures ligatures;
107 117
108 ligatures.common = commonLigaturesState(); 118 ligatures.common = commonLigaturesState();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 223
214 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt ate 224 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt ate
215 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt ate 225 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt ate
216 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt ate) { 226 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt ate) {
217 m_typesettingFeatures |= blink::Ligatures; 227 m_typesettingFeatures |= blink::Ligatures;
218 } 228 }
219 } 229 }
220 } 230 }
221 231
222 } // namespace blink 232 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/FontDescription.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698