Where is a related (unit)test? How can you ensure that there will not be
any regressions? Do you even have a concept of quality control for
Thank you for your gratitude.
WeasyPrint has tests, covering 94% of the code. These tests are launched for each commit with 6 different versions of Python, on Travis.
That's all I have to offer as a "concept of quality control".
Writing tests is sometimes hard and long, especially for text-related features of WeasyPrint. For example, I had no layout problem with your sample page, because I don't have Droid or Calibri installed. I had to change random characters to get your problem.
We can use a special font and rely on it to test some features. Actually, that's what we do: we use Ahem, a font specially crafted for tests. It helps, it makes writing some tests go from impossible to quite hard. But it's sometimes not enough: the test testing 'font-stretch' doesn't work on my computer because the default font used for tests has no condensed variant.
I could take the time to create a condensed font. I just don't want to. I prefer spending this time with my family.
And that's sometimes not only a problem of time. This particular bug was caused by a hack introduced because of hinting problems. The way how hinting is done depends on your OS, the versions of the font rendering libraries installed, and your personnal font rendering settings. On some systems, it may even depend on the screens plugged to the device, and on the orientation of these screens. So, if there's a reliable way to test hinting-related features for all the versions of the font-rendering libraries installed on these computers, I'd be happy to know it. I've already tried hard, please believe me. But I don't know it yet, making some non-regression tests just impossible to write for me.
If you're interested in WeasyPrint, including in its quality, I'll be really happy to spend some time fixing the bugs you report (even on January 1st), reading your pull requests, merging them and answering your questions. I'd love to see WeasyPrint become better. I'll spend time writing code and tests for free. But I won't be the person writing a test each time a bug is found.
Fix#325 and shouldn't reopen #288. Now that fac5ee9 fixes line-cutting
bug when drawing, we can use a much lower relative tolerance inspired
from PEP 485 (1e-9 instead of 1e-3).
Tests have been added with random values, as results highly depend on
the version of Pango used and on hinting properties depending on the
system used to launch the tests. They are probably longer than required,
but they try hard to prevent #288 and #325 from coming back.