Monospace doesn't align well

  • We are using wPDF with C++ Builder XE8. End of July, we switched to the wPDF4 DLL build dated May 27th, 2015.
    For the last few years, we had more or less the same printing algorithm that created our documents using monospace font Futura Lt BT. All letters aligned well.

    When we use the new DLL with current or older, previously functional versions of our software, it sometimes happens that single lines of text are rendered slightly too narrow. If we simply use the old code and old DLL, all is well.
    The difference is minimal, yet noticeable. Example: in a document that is zoomed to 85cm displayed width, the offset between previously aligned digits near the end of the line is about 2mm. Since we need our text well-aligned (and this is why we picked a monospace font), the result is not acceptable.

    Is this a bug or does the new build require different handling? What should we be doing to get good results in monospace print?

    • Offizieller Beitrag

    Hi,

    please make sure to select CanvasReference = refPrinter so a higher pixel pitch is used. Since wPDF uses the positions provided by windows this helps to limit rounding errors.

    There is also a switch wpNoTextScaling for the property modes wich disables text width adjustment.

    Julian

  • Hi Julian,

    thanks for the hint. We have been using refPrinter for years, so I could rule that one out. wpNoTextScaling didn't do the trick either. But after you pointed me at the Modes property, I found the one that now made things work again, it's wpExactTextPositioning (someone here has been doing severe positioning calculus, the new wPDF seems to "optimize" that out of existence, maybe fixing a bug that didn't properly evaluate "Modes"). Thanks for putting me in the right direction!

    Best Regards,
    Ute