OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
ufferLength, const SimpleFontData* fontData) | 54 bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned b
ufferLength, const SimpleFontData* fontData) |
55 { | 55 { |
56 bool haveGlyphs = false; | 56 bool haveGlyphs = false; |
57 | 57 |
58 Vector<CGGlyph, 512> glyphs(bufferLength); | 58 Vector<CGGlyph, 512> glyphs(bufferLength); |
59 if (!shouldUseCoreText(buffer, bufferLength, fontData)) { | 59 if (!shouldUseCoreText(buffer, bufferLength, fontData)) { |
60 wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyp
hs.data(), bufferLength); | 60 WKGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyp
hs.data(), bufferLength); |
61 for (unsigned i = 0; i < length; ++i) { | 61 for (unsigned i = 0; i < length; ++i) { |
62 if (!glyphs[i]) | 62 if (!glyphs[i]) |
63 setGlyphDataForIndex(offset + i, 0, 0); | 63 setGlyphDataForIndex(offset + i, 0, 0); |
64 else { | 64 else { |
65 setGlyphDataForIndex(offset + i, glyphs[i], fontData); | 65 setGlyphDataForIndex(offset + i, glyphs[i], fontData); |
66 haveGlyphs = true; | 66 haveGlyphs = true; |
67 } | 67 } |
68 } | 68 } |
69 } else if (!fontData->platformData().isCompositeFontReference() && ((fontDat
a->platformData().widthVariant() == RegularWidth) ? wkGetVerticalGlyphsForCharac
ters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength) | 69 } else if (!fontData->platformData().isCompositeFontReference() && ((fontDat
a->platformData().widthVariant() == RegularWidth) ? WKGetVerticalGlyphsForCharac
ters(fontData->platformData().ctFont(), buffer, glyphs.data(), bufferLength) |
70 : CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(),
buffer, glyphs.data(), bufferLength))) { | 70 : CTFontGetGlyphsForCharacters(fontData->platformData().ctFont(),
buffer, glyphs.data(), bufferLength))) { |
71 // When buffer consists of surrogate pairs, wkGetVerticalGlyphsForCharac
ters and CTFontGetGlyphsForCharacters | 71 // When buffer consists of surrogate pairs, WKGetVerticalGlyphsForCharac
ters and CTFontGetGlyphsForCharacters |
72 // place the glyphs at indices corresponding to the first character of e
ach pair. | 72 // place the glyphs at indices corresponding to the first character of e
ach pair. |
73 unsigned glyphStep = bufferLength / length; | 73 unsigned glyphStep = bufferLength / length; |
74 for (unsigned i = 0; i < length; ++i) { | 74 for (unsigned i = 0; i < length; ++i) { |
75 if (!glyphs[i * glyphStep]) | 75 if (!glyphs[i * glyphStep]) |
76 setGlyphDataForIndex(offset + i, 0, 0); | 76 setGlyphDataForIndex(offset + i, 0, 0); |
77 else { | 77 else { |
78 setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData
); | 78 setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData
); |
79 haveGlyphs = true; | 79 haveGlyphs = true; |
80 } | 80 } |
81 } | 81 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 return haveGlyphs; | 160 return haveGlyphs; |
161 } | 161 } |
162 | 162 |
163 } // namespace WebCore | 163 } // namespace WebCore |
OLD | NEW |