octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text properties and FTGL


From: John Swensen
Subject: Re: Text properties and FTGL
Date: Tue, 28 Oct 2008 15:54:07 -0400


On Oct 28, 2008, at 1:44 PM, John W. Eaton wrote:


You might also look at the way the Emacs preview-latex mode works.
That doesn't rely on any special toolkit or widget (other than Emacs
ability to embed images in an Emacs buffer).  So we should be able to
do this in a reasonably portable way.  I would not want to link it too
closely to a particular toolkit or widget.

jwe

I downloaded the source code for preview latex and skimmed through their documentation and it looks like they do essentially a similar thing. They run the latex code through one of the many TeX variants (depending on configuration) and then draw it directly into the buffer. I'm not sure exactly how they draw it into the buffer, but that part is really the hangup for us. Also, theirs also takes a bit of time and works in the background.

So, even though I should not be considered an expert on this, I think the following might be the way to go:

1) Use tex/latex/pdflatex to convert from an equation string to a dvi/ ps/pdf 2) Find a less platform/toolkit specific method of converting from pdf to a OpenGL texture
3) Draw the texture as one would expect
Since even poppler isn't dependent on a particular toolkit (it is in fact derived from the Xpdf codebase) maybe it will be as simple as make a new output device for poppler which renders to OpenGL. It already renders to a GDK pixbuf and a QT QPixMap. That being said, I once again iterate that I know very little about OpenGL and exactly how hard that might be. Can an openGL texture kindof be treated as a pixel buffer? If so, maybe the little extra won't be too hard?

There was an alternate route that I started to go down at the start of this and it was
1) .tex to .ps
2) Use pstoedit to convert to an SVG
3) Tried to get a library called svgl (intended for use from python, but since it is a C++ compiled extension it might be easy to incorporate) to render the output to OpenGL. I had problems with this method also, as pstoedit didn't seem to render equations to SVG properly.

John Swensen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]