[Haskell-cafe] [ANN] Rasterific & FontyFruity

Vincent Berthoux vincent.berthoux at gmail.com
Fri Feb 28 09:07:03 UTC 2014

Hi Sylvain,

   It should be possible, but in order to get the extent of a text element,
you need the point size and the DPI of your output medium. Please, don't
hesitate to fill a ticket on the github page.



2014-02-28 9:49 GMT+01:00 Sylvain Henry <hsyl20 at gmail.com>:

> Awesome! Would it be possible to use FontyFruity to remove the limitations
> of Text in Diagrams (see below)? Is there something missing in Rasterific
> to render SVG?
> From http://projects.haskell.org/diagrams/doc/manual.html#text
> > Text objects take up no space!
> > The main reason for this is that computing the size of some text in a
> given font is rather complicated, and diagrams cannot (yet) do it natively.
> The cairo backend can do it (see below) but we don't want to tie diagrams
> to a particular backend.
> > The second reason is that font size is handled similarly to line width,
> so the size of a text object cannot be known at the time of its creation
> anyway! (Future versions of ``diagrams`` may include some sort of
> constraint-solving engine to be able to handle this sort of situation, but
> don't hold your breath.) Font size is treated similarly to line width for a
> similar reason: we often want disparate text elements to be the same size,
> but those text elements may be part of subdiagrams that have been
> transformed in various ways. Note: I wish this were true, but currently it
> isn't. At some future date when we do an overhaul of this stuff and
> introduce units, perhaps users can choose which behavior they want. --
> byorgey 20 Nov 2013
> > Note, however, that the cairo backend includes a module
> Diagrams.Backend.Cairo.Text with functions for querying font and text
> extents, and creating text diagrams that take up an appropriate amount of
> space. So it is possible to have automatically-sized text objects, at the
> cost of being tied to the cairo backend and bringing IO into the picture
> (or being at peace with some probably-justified uses of unsafePerformIO).
> Cheers
> Sylvain
> 2014-02-28 9:13 GMT+01:00 Vincent Berthoux <vincent.berthoux at gmail.com>:
>> Hello Haskellers,
>>   I'm pleased to announce two new packages, whom work hand in hand:
>> FontyFruity, a truetype file parser, and Rasterific a vector drawing
>> engine. This two libraries enable us to generate pictures without the need
>> of an external C library, and saving them to a file or directly send them
>> over the network.
>> FontyFruity:
>>   * hackage : http://hackage.haskell.org/package/FontyFruity
>>   * Github : https://github.com/Twinside/FontyFruity
>> Rasterific:
>>   * hackage : http://hackage.haskell.org/package/Rasterific
>>   * Github : https://github.com/Twinside/Rasterific
>>    Regards
>>        Vincent
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140228/b370d9ab/attachment.html>

More information about the Haskell-Cafe mailing list