OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Alexey Proskuryakov | 3 * Copyright (C) 2006 Alexey Proskuryakov |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 m_platformData.setupPaint(&paint); | 97 m_platformData.setupPaint(&paint); |
98 paint.getFontMetrics(&metrics); | 98 paint.getFontMetrics(&metrics); |
99 SkTypeface* face = paint.getTypeface(); | 99 SkTypeface* face = paint.getTypeface(); |
100 ASSERT(face); | 100 ASSERT(face); |
101 | 101 |
102 int vdmxAscent = 0, vdmxDescent = 0; | 102 int vdmxAscent = 0, vdmxDescent = 0; |
103 bool isVDMXValid = false; | 103 bool isVDMXValid = false; |
104 | 104 |
105 #if OS(LINUX) || OS(ANDROID) | 105 #if OS(LINUX) || OS(ANDROID) |
106 // Manually digging up VDMX metrics is only applicable when bytecode hinting
using FreeType. | 106 // Manually digging up VDMX metrics is only applicable when bytecode hinting
using FreeType. |
107 // With GDI, the metrics will already have taken this into account (as neede
d). | |
108 // With DirectWrite or CoreText, no bytecode hinting is ever done. | 107 // With DirectWrite or CoreText, no bytecode hinting is ever done. |
109 // This code should be pushed into FreeType (hinted font metrics). | 108 // This code should be pushed into FreeType (hinted font metrics). |
110 static const uint32_t vdmxTag = SkSetFourByteTag('V', 'D', 'M', 'X'); | 109 static const uint32_t vdmxTag = SkSetFourByteTag('V', 'D', 'M', 'X'); |
111 int pixelSize = m_platformData.size() + 0.5; | 110 int pixelSize = m_platformData.size() + 0.5; |
112 if (!paint.isAutohinted() | 111 if (!paint.isAutohinted() |
113 && (paint.getHinting() == SkPaint::kFull_Hinting | 112 && (paint.getHinting() == SkPaint::kFull_Hinting |
114 || paint.getHinting() == SkPaint::kNormal_Hinting)) | 113 || paint.getHinting() == SkPaint::kNormal_Hinting)) |
115 { | 114 { |
116 size_t vdmxSize = face->getTableSize(vdmxTag); | 115 size_t vdmxSize = face->getTableSize(vdmxTag); |
117 if (vdmxSize && vdmxSize < maxVDMXTableSize) { | 116 if (vdmxSize && vdmxSize < maxVDMXTableSize) { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 if (glyphs[i]) { | 446 if (glyphs[i]) { |
448 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); | 447 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); |
449 haveGlyphs = true; | 448 haveGlyphs = true; |
450 } | 449 } |
451 } | 450 } |
452 | 451 |
453 return haveGlyphs; | 452 return haveGlyphs; |
454 } | 453 } |
455 | 454 |
456 } // namespace blink | 455 } // namespace blink |
OLD | NEW |