OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 bool FontPlatformFeatures::canExpandAroundIdeographsInComplexText() | 47 bool FontPlatformFeatures::canExpandAroundIdeographsInComplexText() |
48 { | 48 { |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
52 static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Fon
t* font, bool shouldAntialias, bool shouldSmoothFonts) | 52 static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Fon
t* font, bool shouldAntialias, bool shouldSmoothFonts) |
53 { | 53 { |
54 const FontPlatformData& platformData = fontData->platformData(); | 54 const FontPlatformData& platformData = fontData->platformData(); |
55 const float textSize = platformData.m_textSize >= 0 ? platformData.m_textSiz
e : 12; | 55 const float textSize = platformData.m_size >= 0 ? platformData.m_size : 12; |
56 | 56 |
57 paint->setAntiAlias(shouldAntialias); | 57 paint->setAntiAlias(shouldAntialias); |
58 paint->setEmbeddedBitmapText(false); | 58 paint->setEmbeddedBitmapText(false); |
59 paint->setTextSize(SkFloatToScalar(textSize)); | 59 paint->setTextSize(SkFloatToScalar(textSize)); |
60 paint->setVerticalText(platformData.orientation() == Vertical); | 60 paint->setVerticalText(platformData.orientation() == Vertical); |
61 paint->setTypeface(platformData.typeface()); | 61 paint->setTypeface(platformData.typeface()); |
62 paint->setFakeBoldText(platformData.m_syntheticBold); | 62 paint->setFakeBoldText(platformData.m_syntheticBold); |
63 paint->setTextSkewX(platformData.m_syntheticItalic ? -SK_Scalar1 / 4 : 0); | 63 paint->setTextSkewX(platformData.m_syntheticOblique ? -SK_Scalar1 / 4 : 0); |
64 paint->setAutohinted(false); // freetype specific | 64 paint->setAutohinted(false); // freetype specific |
65 paint->setLCDRenderText(shouldSmoothFonts); | 65 paint->setLCDRenderText(shouldSmoothFonts); |
66 paint->setSubpixelText(true); | 66 paint->setSubpixelText(true); |
67 | 67 |
68 // When using CoreGraphics, disable hinting when webkit-font-smoothing:antia
liased is used. | 68 // When using CoreGraphics, disable hinting when webkit-font-smoothing:antia
liased is used. |
69 // See crbug.com/152304 | 69 // See crbug.com/152304 |
70 if (font->fontDescription().fontSmoothing() == Antialiased || font->fontDesc
ription().textRendering() == GeometricPrecision) | 70 if (font->fontDescription().fontSmoothing() == Antialiased || font->fontDesc
ription().textRendering() == GeometricPrecision) |
71 paint->setHinting(SkPaint::kNo_Hinting); | 71 paint->setHinting(SkPaint::kNo_Hinting); |
72 } | 72 } |
73 | 73 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // FIXME: Add text blob support to FontMac. | 172 // FIXME: Add text blob support to FontMac. |
173 } | 173 } |
174 | 174 |
175 PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initia
lAdvance, const FloatRect& bounds) const | 175 PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initia
lAdvance, const FloatRect& bounds) const |
176 { | 176 { |
177 // FIXME: Add text blob support to FontMac. | 177 // FIXME: Add text blob support to FontMac. |
178 return nullptr; | 178 return nullptr; |
179 } | 179 } |
180 | 180 |
181 } // namespace blink | 181 } // namespace blink |
OLD | NEW |