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

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

Issue 444333005: Remove custom style building for -webkit-font-feature-settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void FontDescription::setVariantLigatures(const VariantLigatures& ligatures) 124 void FontDescription::setVariantLigatures(const VariantLigatures& ligatures)
125 { 125 {
126 m_commonLigaturesState = ligatures.common; 126 m_commonLigaturesState = ligatures.common;
127 m_discretionaryLigaturesState = ligatures.discretionary; 127 m_discretionaryLigaturesState = ligatures.discretionary;
128 m_historicalLigaturesState = ligatures.historical; 128 m_historicalLigaturesState = ligatures.historical;
129 m_contextualLigaturesState = ligatures.contextual; 129 m_contextualLigaturesState = ligatures.contextual;
130 130
131 updateTypesettingFeatures(); 131 updateTypesettingFeatures();
132 } 132 }
133 133
134 FontDescription FontDescription::makeNormalFeatureSettings() const
135 {
136 FontDescription normalDescription(*this);
137 normalDescription.setFeatureSettings(nullptr);
138 return normalDescription;
139 }
140
141 float FontDescription::effectiveFontSize() const 134 float FontDescription::effectiveFontSize() const
142 { 135 {
143 float size = (RuntimeEnabledFeatures::subpixelFontScalingEnabled()) 136 float size = (RuntimeEnabledFeatures::subpixelFontScalingEnabled())
144 ? computedSize() 137 ? computedSize()
145 : computedPixelSize(); 138 : computedPixelSize();
146 139
147 // Ensure that the effective precision matches the font-cache precision. 140 // Ensure that the effective precision matches the font-cache precision.
148 // This guarantees that the same precision is used regardless of cache statu s. 141 // This guarantees that the same precision is used regardless of cache statu s.
149 return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::pr ecisionMultiplier(); 142 return floorf(size * FontCacheKey::precisionMultiplier()) / FontCacheKey::pr ecisionMultiplier();
150 } 143 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 213
221 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt ate 214 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt ate
222 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt ate 215 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt ate
223 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt ate) { 216 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt ate) {
224 m_typesettingFeatures |= blink::Ligatures; 217 m_typesettingFeatures |= blink::Ligatures;
225 } 218 }
226 } 219 }
227 } 220 }
228 221
229 } // namespace blink 222 } // 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