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