[Poppler-bugs] [Bug 102290] [PATCH] Replace Splash font rendering by Qt font rendering

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Aug 23 09:49:55 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=102290

--- Comment #10 from Adrian Johnson <ajohnson at redneon.com> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20170823/a7e24b36/attachment.html>


More information about the Poppler-bugs mailing list