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

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

Issue 444413003: Make style building for font-weight less custom. (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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 uint32_t bitfields; 45 uint32_t bitfields;
46 uint32_t bitfields2 : 7; 46 uint32_t bitfields2 : 7;
47 }; 47 };
48 48
49 COMPILE_ASSERT(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), Fon tDescription_should_stay_small); 49 COMPILE_ASSERT(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), Fon tDescription_should_stay_small);
50 50
51 TypesettingFeatures FontDescription::s_defaultTypesettingFeatures = 0; 51 TypesettingFeatures FontDescription::s_defaultTypesettingFeatures = 0;
52 52
53 bool FontDescription::s_useSubpixelTextPositioning = false; 53 bool FontDescription::s_useSubpixelTextPositioning = false;
54 54
55 FontWeight FontDescription::lighterWeight(void) const 55 FontWeight FontDescription::lighterWeight(FontWeight weight)
56 { 56 {
57 switch (m_weight) { 57 switch (weight) {
58 case FontWeight100: 58 case FontWeight100:
59 case FontWeight200: 59 case FontWeight200:
60 case FontWeight300: 60 case FontWeight300:
61 case FontWeight400: 61 case FontWeight400:
62 case FontWeight500: 62 case FontWeight500:
63 return FontWeight100; 63 return FontWeight100;
64 64
65 case FontWeight600: 65 case FontWeight600:
66 case FontWeight700: 66 case FontWeight700:
67 return FontWeight400; 67 return FontWeight400;
68 68
69 case FontWeight800: 69 case FontWeight800:
70 case FontWeight900: 70 case FontWeight900:
71 return FontWeight700; 71 return FontWeight700;
72 } 72 }
73 ASSERT_NOT_REACHED(); 73 ASSERT_NOT_REACHED();
74 return FontWeightNormal; 74 return FontWeightNormal;
75 } 75 }
76 76
77 FontWeight FontDescription::bolderWeight(void) const 77 FontWeight FontDescription::bolderWeight(FontWeight weight)
78 { 78 {
79 switch (m_weight) { 79 switch (weight) {
80 case FontWeight100: 80 case FontWeight100:
81 case FontWeight200: 81 case FontWeight200:
82 case FontWeight300: 82 case FontWeight300:
83 return FontWeight400; 83 return FontWeight400;
84 84
85 case FontWeight400: 85 case FontWeight400:
86 case FontWeight500: 86 case FontWeight500:
87 return FontWeight700; 87 return FontWeight700;
88 88
89 case FontWeight600: 89 case FontWeight600:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt ate 221 if (discretionaryLigaturesState() == FontDescription::EnabledLigaturesSt ate
222 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt ate 222 || historicalLigaturesState() == FontDescription::EnabledLigaturesSt ate
223 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt ate) { 223 || contextualLigaturesState() == FontDescription::EnabledLigaturesSt ate) {
224 m_typesettingFeatures |= blink::Ligatures; 224 m_typesettingFeatures |= blink::Ligatures;
225 } 225 }
226 } 226 }
227 } 227 }
228 228
229 } // namespace blink 229 } // 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