OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 } else { | 126 } else { |
127 xHeight = ascent * 0.56; // Best guess from Windows font metrics. | 127 xHeight = ascent * 0.56; // Best guess from Windows font metrics. |
128 m_fontMetrics.setXHeight(xHeight); | 128 m_fontMetrics.setXHeight(xHeight); |
129 m_fontMetrics.setHasXHeight(false); | 129 m_fontMetrics.setHasXHeight(false); |
130 } | 130 } |
131 | 131 |
132 float lineGap = SkScalarToFloat(metrics.fLeading); | 132 float lineGap = SkScalarToFloat(metrics.fLeading); |
133 m_fontMetrics.setLineGap(lineGap); | 133 m_fontMetrics.setLineGap(lineGap); |
134 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(li neGap)); | 134 m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(li neGap)); |
135 | 135 |
136 // For now Skia does not support underline Thickness, once patch is comitted we can uncomment following | 136 // For now Skia does not support underline Thickness and Position, once subm itted patch is comitted |
137 // code, till then setting Underline Thickness to Zero so that default calcu lation is done. | 137 // we can uncomment following code, till then setting Underline Thickness an d Position to Zero so that |
138 // default calculation is done. | |
eae
2014/02/28 17:37:59
Could you add a FIXME comment with a link to the b
h.joshi
2014/03/01 03:36:12
Will add FIXME comment in next patch.
On 2014/02/
| |
139 | |
138 // float underlineThickness = SkScalarToFloat(metrics.fUnderlineThickness); | 140 // float underlineThickness = SkScalarToFloat(metrics.fUnderlineThickness); |
139 // m_fontMetrics.setUnderlineThickness(underlineThickness); | 141 // m_fontMetrics.setUnderlineThickness(underlineThickness); |
142 | |
143 // float underlinePosition = SkScalarToFloat(metrics.fUnderlinePosition); | |
144 // m_fontMetrics.setUnderlineThickness(underlinePosition); | |
140 m_fontMetrics.setUnderlineThickness(0.f); | 145 m_fontMetrics.setUnderlineThickness(0.f); |
146 m_fontMetrics.setUnderlinePosition(0.f); | |
141 | 147 |
142 if (platformData().orientation() == Vertical && !isTextOrientationFallback() ) { | 148 if (platformData().orientation() == Vertical && !isTextOrientationFallback() ) { |
143 static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); | 149 static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); |
144 static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); | 150 static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); |
145 size_t vheaSize = face->getTableSize(vheaTag); | 151 size_t vheaSize = face->getTableSize(vheaTag); |
146 size_t vorgSize = face->getTableSize(vorgTag); | 152 size_t vorgSize = face->getTableSize(vorgTag); |
147 if ((vheaSize > 0) || (vorgSize > 0)) | 153 if ((vheaSize > 0) || (vorgSize > 0)) |
148 m_hasVerticalGlyphs = true; | 154 m_hasVerticalGlyphs = true; |
149 } | 155 } |
150 | 156 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
276 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); | 282 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); |
277 if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) { | 283 if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) { |
278 addResult.storedValue->value = true; | 284 addResult.storedValue->value = true; |
279 return true; | 285 return true; |
280 } | 286 } |
281 return false; | 287 return false; |
282 } | 288 } |
283 #endif | 289 #endif |
284 | 290 |
285 } // namespace WebCore | 291 } // namespace WebCore |
OLD | NEW |