OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 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 27 matching lines...) Expand all Loading... |
38 void FontPlatformData::setupPaint(SkPaint* paint, | 38 void FontPlatformData::setupPaint(SkPaint* paint, |
39 float deviceScaleFactor, | 39 float deviceScaleFactor, |
40 const Font*) const { | 40 const Font*) const { |
41 m_style.applyToPaint(*paint, deviceScaleFactor); | 41 m_style.applyToPaint(*paint, deviceScaleFactor); |
42 | 42 |
43 const float ts = m_textSize >= 0 ? m_textSize : 12; | 43 const float ts = m_textSize >= 0 ? m_textSize : 12; |
44 paint->setTextSize(SkFloatToScalar(ts)); | 44 paint->setTextSize(SkFloatToScalar(ts)); |
45 paint->setTypeface(m_typeface); | 45 paint->setTypeface(m_typeface); |
46 paint->setFakeBoldText(m_syntheticBold); | 46 paint->setFakeBoldText(m_syntheticBold); |
47 paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); | 47 paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); |
| 48 |
| 49 // TODO(drott): Due to Skia bug 5917 |
| 50 // https://bugs.chromium.org/p/skia/issues/detail?id=5917 correct advance |
| 51 // width scaling with FreeType for font sizes under 257px currently only works |
| 52 // with: |
| 53 // paint->setHinting(SkPaint::kNo_Hinting); |
48 } | 54 } |
49 | 55 |
50 } // namespace blink | 56 } // namespace blink |
OLD | NEW |