OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 28 matching lines...) Expand all Loading... |
39 FontWeight400 = 3, | 39 FontWeight400 = 3, |
40 FontWeight500 = 4, | 40 FontWeight500 = 4, |
41 FontWeight600 = 5, | 41 FontWeight600 = 5, |
42 FontWeight700 = 6, | 42 FontWeight700 = 6, |
43 FontWeight800 = 7, | 43 FontWeight800 = 7, |
44 FontWeight900 = 8, | 44 FontWeight900 = 8, |
45 FontWeightNormal = FontWeight400, | 45 FontWeightNormal = FontWeight400, |
46 FontWeightBold = FontWeight700 | 46 FontWeightBold = FontWeight700 |
47 }; | 47 }; |
48 | 48 |
49 // Converts a FontWeight to its corresponding numeric value | |
50 inline int numericFontWeight(FontWeight weight) | |
51 { | |
52 return (weight - FontWeight100 + 1) * 100; | |
53 } | |
54 | |
55 // Numeric values matching OS/2 & Windows Metrics usWidthClass table. | 49 // Numeric values matching OS/2 & Windows Metrics usWidthClass table. |
56 // https://www.microsoft.com/typography/otspec/os2.htm | 50 // https://www.microsoft.com/typography/otspec/os2.htm |
57 enum FontStretch { | 51 enum FontStretch { |
58 FontStretchUltraCondensed = 1, | 52 FontStretchUltraCondensed = 1, |
59 FontStretchExtraCondensed = 2, | 53 FontStretchExtraCondensed = 2, |
60 FontStretchCondensed = 3, | 54 FontStretchCondensed = 3, |
61 FontStretchSemiCondensed = 4, | 55 FontStretchSemiCondensed = 4, |
62 FontStretchNormal = 5, | 56 FontStretchNormal = 5, |
63 FontStretchSemiExpanded = 6, | 57 FontStretchSemiExpanded = 6, |
64 FontStretchExpanded = 7, | 58 FontStretchExpanded = 7, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 unsigned m_weight : 4; | 109 unsigned m_weight : 4; |
116 unsigned m_stretch : 4; | 110 unsigned m_stretch : 4; |
117 unsigned m_filler : 21; | 111 unsigned m_filler : 21; |
118 } m_traits; | 112 } m_traits; |
119 FontTraitsBitfield m_bitfield; | 113 FontTraitsBitfield m_bitfield; |
120 }; | 114 }; |
121 }; | 115 }; |
122 | 116 |
123 } // namespace blink | 117 } // namespace blink |
124 #endif // FontTraits_h | 118 #endif // FontTraits_h |
OLD | NEW |