[Chart] Fwd: [diagrams] Re: [GSoC 2013] Progress - Porting Charts to Diagrams

Jan Bracker jan.bracker at googlemail.com
Wed Jul 31 15:10:38 BST 2013


A short update on my font issues:

I created a test case to see the sizing differences between SVGFonts and
cairo [0]. There I finally found out what the issue was. As it seems SVG
fonts and the cairo font API use different definitions of terms like ascent
and descent. I adjusted the metric calculations in the diagrams backend so
it mostly fits the semantics that cairo has [1]. There still is a minor
difference in the font size and the descent. I suspect the size difference
is due to different rendering techniques (hinting vs. plain paths). I can't
see why the descents are different, but I do not see that as a problem.

The quality issue isn't that big anymore either. With the adjusted font
size you can actually read what SVGFonts outputs quite well. You will
notice the difference, but it is not an important issue anymore.

But the performance of SVGFonts is notably worse compared to using cairo.

[0]:
https://github.com/jbracker/haskell-chart/commit/c1ca610455de49d56b8239c4fdc72a1bb021c3d4
[1]:
https://github.com/jbracker/haskell-chart/commit/392cc6852f910451b96f545f4f86fbb16aa771bb


2013/7/29 Jan Bracker <jan.bracker at googlemail.com>

> Hello everybody,
>
> here the latest progress on the project:
>
> - While using SVGFonts I fixed a few minor bugs in it.
> - The "ToRenderable" type class is reintroduced, because the type
> complications are not there anymore.
> - Some clean up and more specific documentation (especially paths).
> - Switched from data-default to data-default-class.
> - Standard alignment functions are not provided instead of redifined in
> each backend.
> - Updated the diagrams backend to use the HEAD of diagrams instead of the
> hackage version.
> - All my work until 25th of July has been merged into the main charts repo!
> - Worked on the font support in the diagrams backend. This works well now.
> - Included standard fonts in the diagrams backend package. This also
> includes additional versions to support bold and italic fonts.
>
> The current head is "stable", except for the text metrics [1]. I figured
> out the metrics. Some issues I still have:
>
> - For some reason SVGFonts seems to be rendering fonts of same size
> considerably smaller then cairo. Not sure what the reason is. Going to
> double check on this.
> - One of the tests is still missing some lines.
> - Quality of font rendering is notably worse with SVGFonts. I do not think
> this can really be improved except by adding native text rendering to
> diagrams (+ font metrics). Though, when using sans-serif and monospace
> fonts quality is acceptable (Adobe seems to be doing good work with
> Source Sans Pro and Source Code Pro). Maybe I will check for an alternative
> serif font, though it will be hard to beat the character support of Linux
> Libertine.
>
> Greetings
> Jan
>
> [1]:
> https://github.com/jbracker/haskell-chart/tree/e01257cda11d9832ac9a3c7af424c02bd83cb1a2
>
>
> 2013/7/23 Stephen Tetley <stephen.tetley at gmail.com>
>
>> Hi Jan
>>
>> In the PostScript world, glyph metrics are given as 1/1000 of a point
>> size. One would hope SVG might follow this lead.
>>
>> Although out-of-date in the TrueType world, the AFM spec from Adobe is a
>> readable (and skimmable) introduction to glyph metrics and still a
>> worthwhile reference.
>>
>> http://partners.adobe.com/public/developer/en/font/5004.AFM_Spec.pdf
>>
>> Best wishes
>>
>> Stephen
>>
>> On 23 July 2013 11:07, Jan Bracker <jan.bracker at googlemail.com> wrote:
>>
>>>
>>>
>>> Aside of that I also noticed that the text metric information in
>>> SVGFonts are not given in device coordinates. Am I right in assuming they
>>> are given in 1000em, because the value "units-per-em" says 1000? If that is
>>> right I will try to dig my way through the textSVG' function to find out
>>> how to convert that into device coordinates.
>>>
>>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/chart/attachments/20130731/37044b79/attachment.htm>


More information about the Chart mailing list