diff options
author | Robin Watts <robin.watts@artifex.com> | 2014-02-04 10:33:14 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2014-02-04 14:06:52 +0000 |
commit | e80425cb7049c5c097d965e2236cfa751be6d522 (patch) | |
tree | c361cd816b4cfd9150eda133b0440909e973e526 /source/fitz/load-png.c | |
parent | 210ae39dfb7c6793482d92af5b88d335e4ef5f31 (diff) | |
download | mupdf-e80425cb7049c5c097d965e2236cfa751be6d522.tar.xz |
Improve glyph bounding, outlining and SVG output text.
Luiz Henrique de Figueiredo reports that glyphs output from the
SVG device contain 'lumpy' outlines. Investigation reveals that
this is because the current code extracts the outlines from
freetype at unit scale, and then relies on SVG to scale them up.
Unfortunately, freetype insists on working in integer maths, so
any sort of scaling runs the risk of distorting the outlines.
The fix is to change the way we call freetype; we now request an
'UNSCALED' char, and set the required size to be the design size.
We then transform the results in the floating point domain
ourself.
This cures the lumpy outlines, but reveals a second problem,
namely that the bbox given for characters is inaccurate (and
sometimes too small). Investigation shows that this is again
caused by freetypes scaling, so we apply the same trick; ask
for the glyph without scaling (as far as possible), and then
scale the results down.
We also take care to spot the 'ft_hint' flag in the font. If set
this indicates that hinting must be performed to ensure that
the returned outlines are sane. We therefore take note of this
when calculating both bbox and outlines. This means that 'tricky'
fonts such as dynalab ones now render correctly.
This produces many changes in the bitmaps, the vast majority of which
are neutral. The ones that aren't are all progressions.
Diffstat (limited to 'source/fitz/load-png.c')
0 files changed, 0 insertions, 0 deletions