Home | History | Annotate | Download | only in graphics

Lines Matching refs:glyphBuffer

29 #include "GlyphBuffer.h"
325 float Font::getGlyphsAndAdvancesForSimpleText(const TextRun& run, int from, int to, GlyphBuffer& glyphBuffer, ForTextEmphasisOrNot forTextEmphasis) const
332 it.advance(to, &glyphBuffer);
334 if (glyphBuffer.isEmpty())
346 for (int i = 0, end = glyphBuffer.size() - 1; i < glyphBuffer.size() / 2; ++i, --end)
347 glyphBuffer.swap(i, end);
356 GlyphBuffer glyphBuffer;
358 float startX = point.x() + getGlyphsAndAdvancesForSimpleText(run, from, to, glyphBuffer);
360 if (glyphBuffer.isEmpty())
364 drawGlyphBuffer(context, glyphBuffer, startPoint);
369 GlyphBuffer glyphBuffer;
370 float initialAdvance = getGlyphsAndAdvancesForSimpleText(run, from, to, glyphBuffer, ForTextEmphasis);
372 if (glyphBuffer.isEmpty())
375 drawEmphasisMarks(context, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
378 void Font::drawGlyphBuffer(GraphicsContext* context, const GlyphBuffer& glyphBuffer, const FloatPoint& point) const
381 const SimpleFontData* fontData = glyphBuffer.fontDataAt(0);
382 FloatSize offset = glyphBuffer.offsetAt(0);
387 while (nextGlyph < glyphBuffer.size()) {
388 const SimpleFontData* nextFontData = glyphBuffer.fontDataAt(nextGlyph);
389 FloatSize nextOffset = glyphBuffer.offsetAt(nextGlyph);
391 drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
398 nextX += glyphBuffer.advanceAt(nextGlyph);
402 drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
415 inline static float offsetToMiddleOfGlyphAtIndex(const GlyphBuffer& glyphBuffer, size_t i)
417 return offsetToMiddleOfGlyph(glyphBuffer.fontDataAt(i), glyphBuffer.glyphAt(i));
420 void Font::drawEmphasisMarks(GraphicsContext* context, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
434 float middleOfLastGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, 0);
437 GlyphBuffer markBuffer;
438 for (int i = 0; i + 1 < glyphBuffer.size(); ++i) {
439 float middleOfNextGlyph = offsetToMiddleOfGlyphAtIndex(glyphBuffer, i + 1);
440 float advance = glyphBuffer.advanceAt(i) - middleOfLastGlyph + middleOfNextGlyph;
441 markBuffer.add(glyphBuffer.glyphAt(i) ? markGlyph : spaceGlyph, markFontData, advance);
444 markBuffer.add(glyphBuffer.glyphAt(glyphBuffer.size() - 1) ? markGlyph : spaceGlyph, markFontData, 0);
449 float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
452 it.advance(run.length(), glyphBuffer);
487 GlyphBuffer localGlyphBuffer;