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

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

Issue 1883483002: Add code to call skia's matchFamilyStyleCharacter API, which uses the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fallbackproxy
Patch Set: Add expectation for font-fallback failure on Win7 and revert DEPS change Created 4 years, 8 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
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 addFloatToHash(hash, m_adjustedSize); 271 addFloatToHash(hash, m_adjustedSize);
272 addFloatToHash(hash, m_sizeAdjust); 272 addFloatToHash(hash, m_sizeAdjust);
273 addFloatToHash(hash, m_letterSpacing); 273 addFloatToHash(hash, m_letterSpacing);
274 addFloatToHash(hash, m_wordSpacing); 274 addFloatToHash(hash, m_wordSpacing);
275 addToHash(hash, m_fieldsAsUnsigned[0]); 275 addToHash(hash, m_fieldsAsUnsigned[0]);
276 addToHash(hash, m_fieldsAsUnsigned[1]); 276 addToHash(hash, m_fieldsAsUnsigned[1]);
277 277
278 return hash; 278 return hash;
279 } 279 }
280 280
281 SkFontStyle FontDescription::skiaFontStyle() const
282 {
283 int width = static_cast<int>(stretch());
284 SkFontStyle::Slant slant = style() == FontStyleItalic
285 ? SkFontStyle::kItalic_Slant
286 : SkFontStyle::kUpright_Slant;
287 return SkFontStyle(numericFontWeight(weight()), width, slant);
288 static_assert(
289 static_cast<int>(FontStretchUltraCondensed) == static_cast<int>(SkFontSt yle::kUltraCondensed_Width),
290 "FontStretchUltraCondensed should map to kUltraCondensed_Width");
291 static_assert(
292 static_cast<int>(FontStretchNormal) == static_cast<int>(SkFontStyle::kNo rmal_Width),
293 "FontStretchNormal should map to kNormal_Width");
294 static_assert(
295 static_cast<int>(FontStretchUltraExpanded) == static_cast<int>(SkFontSty le::kUltaExpanded_Width),
296 "FontStretchUltraExpanded should map to kUltaExpanded_Width");
297 }
298
281 } // namespace blink 299 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontDescription.h ('k') | third_party/WebKit/Source/platform/fonts/FontTraits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698