<div dir="ltr"><div><div><div>Hi Sylvain,<br><br></div>   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.<br>
<br></div>   Regards<br><br></div>      Vincent<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-28 9:49 GMT+01:00 Sylvain Henry <span dir="ltr"><<a href="mailto:hsyl20@gmail.com" target="_blank">hsyl20@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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?<br>
<br>From <a href="http://projects.haskell.org/diagrams/doc/manual.html#text" target="_blank">http://projects.haskell.org/diagrams/doc/manual.html#text</a><br>
<br>> Text objects take up no space!<br><br>> 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.<br>

> 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<br>

<br>> 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).<br>

<br>Cheers<br>Sylvain<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-28 9:13 GMT+01:00 Vincent Berthoux <span dir="ltr"><<a href="mailto:vincent.berthoux@gmail.com" target="_blank">vincent.berthoux@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div><div><div><div><div>Hello Haskellers,<br><br></div>  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.<br>


<br>FontyFruity:<br></div>  * hackage : <a href="http://hackage.haskell.org/package/FontyFruity" target="_blank">http://hackage.haskell.org/package/FontyFruity</a><br></div>  * Github : <a href="https://github.com/Twinside/FontyFruity" target="_blank">https://github.com/Twinside/FontyFruity</a><br>


<br></div>Rasterific:<br></div>  * hackage : <a href="http://hackage.haskell.org/package/Rasterific" target="_blank">http://hackage.haskell.org/package/Rasterific</a><br></div>  * Github : <a href="https://github.com/Twinside/Rasterific" target="_blank">https://github.com/Twinside/Rasterific</a><br>


<br></div>   Regards<span><font color="#888888"><br><br></font></span></div><span><font color="#888888">       Vincent<br></font></span></div>
<br></div></div>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>