Well, Achim you were almost exactly correct.&nbsp; I have a functional function interface in about half an hour&#39;s worth of work.&nbsp; I have one question, which is how to create a Ptr to four CFloats on the fly, pass them to the bounding box functions, and then come back out with a [Float]<br>
<br>My prototype looks like this:<br>foreign import ccall unsafe &quot;ftglGetFontBBox&quot; fgetFontBBox :: Font -&gt; CString -&gt; Ptr CFloat -&gt; IO ()<br><br>the ptr to cfloat should be a float[4], which is modified inside the original C function.<br>
<br><div class="gmail_quote">On Fri, Jun 20, 2008 at 1:16 AM, Achim Schneider &lt;<a href="mailto:barsoap@web.de">barsoap@web.de</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">&quot;Jefferson Heard&quot; &lt;<a href="mailto:jefferson.r.heard@gmail.com">jefferson.r.heard@gmail.com</a>&gt; wrote:<br>
<br>
&gt; I&#39;ve been looking for awhile now for a simple way to get truetype<br>
&gt; fonts into my visualizations so I can abandon the hideous GLUT fonts<br>
&gt; and make things that look like they were developed in the 1990s<br>
&gt; instead of back in the days of TRON. &nbsp;I found FTGL, but I&#39;m mostly a<br>
&gt; Haskell developer these days, and resent having to go back to C just<br>
&gt; to write a simple application.<br>
&gt;<br>
&gt; So I was wondering if anyone had ever wrapped the FTGL library in<br>
&gt; Haskel FFI or whether those out there who are experts on the FFI<br>
&gt; think at first glance it should be readily wrappable by a rank<br>
&gt; amateur at FFI such as myself.<br>
&gt;<br>
&gt; <a href="http://ftgl.sourceforge.net/docs/html/" target="_blank">http://ftgl.sourceforge.net/docs/html/</a><br>
&gt;<br>
</div></div>Using the FFI is generally straight forward, as long as you can live<br>
with using the IO monad and the C code uses objects (well,<br>
pointers to structs passed as first argument, where&#39;s the<br>
difference...).<br>
<br>
Things only depend on the purity of the C code and how high-level you<br>
want your interface to be. In this case, I estimate half an hour if<br>
you&#39;re a fast typist. That includes the time needed to read the FFI<br>
docs.<br>
<br>
--<br>
(c) this sig last receiving data processing entity. Inspect headers for<br>
past copyright information. All rights reserved. Unauthorised copying,<br>
hiring, renting, public performance and/or broadcasting of this<br>
signature prohibited.<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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>
</blockquote></div><br><br clear="all"><br>-- <br>I try to take things like a crow; war and chaos don&#39;t always ruin a picnic, they just mean you have to be careful what you swallow.<br><br>-- Jessica Edwards