Chromium Code Reviews| 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 // FIXME: For now Skia does not support underline Thickness and Position, |
| 137 // code, till then setting Underline Thickness to Zero so that default calcu lation is done. | 137 // once submitted patch is comitted (https://codereview.chromium.org/1520730 03/) |
| 138 // we can uncomment following code, till then setting Underline Thickness an d Position to Zero so that | |
| 139 // default calculation is done. | |
| 140 | |
| 138 // float underlineThickness = SkScalarToFloat(metrics.fUnderlineThickness); | 141 // float underlineThickness = SkScalarToFloat(metrics.fUnderlineThickness); |
| 139 // m_fontMetrics.setUnderlineThickness(underlineThickness); | 142 // m_fontMetrics.setUnderlineThickness(underlineThickness); |
| 143 | |
| 144 // float underlinePosition = SkScalarToFloat(metrics.fUnderlinePosition); | |
| 145 // m_fontMetrics.setUnderlineThickness(underlinePosition); | |
|
jungshik at Google
2014/03/06 01:05:32
Can you just wait for a Skia change to land and ro
| |
| 146 | |
| 140 m_fontMetrics.setUnderlineThickness(0.f); | 147 m_fontMetrics.setUnderlineThickness(0.f); |
| 148 m_fontMetrics.setUnderlinePosition(0.f); | |
| 141 | 149 |
| 142 if (platformData().orientation() == Vertical && !isTextOrientationFallback() ) { | 150 if (platformData().orientation() == Vertical && !isTextOrientationFallback() ) { |
| 143 static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); | 151 static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); |
| 144 static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); | 152 static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); |
| 145 size_t vheaSize = face->getTableSize(vheaTag); | 153 size_t vheaSize = face->getTableSize(vheaTag); |
| 146 size_t vorgSize = face->getTableSize(vorgTag); | 154 size_t vorgSize = face->getTableSize(vorgTag); |
| 147 if ((vheaSize > 0) || (vorgSize > 0)) | 155 if ((vheaSize > 0) || (vorgSize > 0)) |
| 148 m_hasVerticalGlyphs = true; | 156 m_hasVerticalGlyphs = true; |
| 149 } | 157 } |
| 150 | 158 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); | 284 paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); |
| 277 if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) { | 285 if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) { |
| 278 addResult.storedValue->value = true; | 286 addResult.storedValue->value = true; |
| 279 return true; | 287 return true; |
| 280 } | 288 } |
| 281 return false; | 289 return false; |
| 282 } | 290 } |
| 283 #endif | 291 #endif |
| 284 | 292 |
| 285 } // namespace WebCore | 293 } // namespace WebCore |
| OLD | NEW |