[Poppler-bugs] [Bug 20769] New: Incorrect text scaling with substituted fonts on SplashOutputDev.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 20 08:46:45 PDT 2009


http://bugs.freedesktop.org/show_bug.cgi?id=20769

           Summary: Incorrect text scaling with substituted fonts on
                    SplashOutputDev.
           Product: poppler
           Version: unspecified
          Platform: x86 (IA32)
        OS/Version: Windows (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: splash backend
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: kav at exitonsoftware.com


In the case when some font, which is substituted, is used inside one text
object with several sizes, there can be incorrect text scaling when size is
changed.
Sample PDF enclosed.

It seems that the problem concerns the fonts cache in SplashFontEngine. It uses
the same FT_Face instance for all the instances of SplashFTFont of the same
font. After you use some new size that not in the cache, the new instance of
SplashFTFont sets the size into FT_Face. It works well until you try to use
another size which was set for that font before. It is found in cache, but
different size in FT_Face has already been set by previous SplashFTFont
constructor call and that's a problem. It tries to calculate scale for
substituted font in SplashOutputDev::doUpdateFont() and uses incorrect width of
'm' character.

I think, it would be nice to add some activation procedure after it find the
font in cache.

To solve the problem I added method 
void SplashFTFont::activate() {
        FT_Activate_Size(sizeObj);
}
and corresponding virtual void activate() {} in SplashFont
and call it after the font is found in cache. It seems that it can solve the
problem.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list