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.
the sample pdf got lost, can you add it?
Created attachment 24146 [details] Invalid text scaling sample. 2nd & 3rd lines
I fixed it in a different way, please check it works for you, see http://cgit.freedesktop.org/poppler/poppler/commit/?id=e4b3f7cbcb6ccdfa8b18d8da5f7074f4140b776a
(In reply to comment #3) > I fixed it in a different way, please check it works for you, see > http://cgit.freedesktop.org/poppler/poppler/commit/?id=e4b3f7cbcb6ccdfa8b18d8da5f7074f4140b776a > It works, thanks
*** Bug 21821 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.