<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [PATCH] Replace Splash font rendering by Qt font rendering"
href="https://bugs.freedesktop.org/show_bug.cgi?id=102290#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [PATCH] Replace Splash font rendering by Qt font rendering"
href="https://bugs.freedesktop.org/show_bug.cgi?id=102290">bug 102290</a>
from <span class="vcard"><a class="email" href="mailto:ajohnson@redneon.com" title="Adrian Johnson <ajohnson@redneon.com>"> <span class="fn">Adrian Johnson</span></a>
</span></b>
<pre>Have a look in Gfx.cc where drawChar() is called. nBytes comes from the call to
getNextChar() in GfxFont. There is a comment explaining it in GfxFont.h. The
text strings in the content stream can consists of either 8-bit or 16-bit
character codes depending on the font. nBytes is the number of bytes in the
character code. You can ignore it.
If you look at CairoOutputDev::drawChar() it essentially is:
glyphs[glyphCount].index = currentFont->getGlyph (code, u, uLen);
glyphs[glyphCount].x = x - originX;
glyphs[glyphCount].y = y - originY;
glyphCount++;
ie it builds up a run of glyphs to show when endString() is called. index is
the glyph index. x, y is the location.
The hard part is loading the fonts and finding the code to glyph index mapping.
See CairoFreeTypeFont::create() in CairoFontEngine.cc for how it handles all
the different font types.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>