|
From: | John Swensen |
Subject: | Re: Text properties and FTGL |
Date: | Fri, 31 Oct 2008 13:09:40 -0400 |
On Oct 31, 2008, at 2:25 AM, Abdelrazak Younes wrote:
Hello, On 31/10/2008 03:02, John Swensen wrote:So I have done a few tests, probably in a very naive way, about rendering LaTeX strings to OpenGL. I think it is going to be prohibitively slow. Using the following code, even a simple equation took about 0.6 seconds. Maybe there is a faster way of doing this. I searched around and couldn't find a way to link against a library for rendering LaTeX code.Did you have a look at latexpreview? http://preview-latex.sourceforge.net/manual/This is IMHO the perfect solution for embedded LateX snippets. You can see how we are using that within LyX:http://wiki.lyx.org/LyX/InstantPreview Hope this helps, Abdel.
This is essentially what my most recent test does. It generates a very simple .tex file with the equation included, runs it through pdflatex, runs it through pdfcrop (which is a script calling ghostscript) to cut it down to just the equation bounding box, and then use poppler to render it to an in-memory bitmap. I then draw it to OpenGL. From everything I have read and a quick glance at preview- latex sources, this appears to be essentially the same process.
Any suggestions on getting the steps of running pdflatex and pdfcrop to go faster? Currently it seems to be taking too long for this to be a feasible solution if there are more than 1 or 2 equations in text on a given figure.
John Swensen
[Prev in Thread] | Current Thread | [Next in Thread] |