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: Wed, 29 Oct 2008 00:54:56 -0400


On Oct 29, 2008, at 12:18 AM, Shai Ayal wrote:


1) balhtexml - This is the library used by MediaWiki (same as used by
Wikipedia) to allow people to use LaTeX code inline with the web pages.
They also have a command line tool and a library that could easily be
linked against directly.

I could not find this library on google. Could you provide a line?

Sorry, that is blahtexml (http://gva.noekeon.org/blahtexml/ and 
http://www.mediawiki.org/wiki/Extension:Blahtex)


2) gtkmathviewer - Despite having dependencies on GTK, the "core" of
gtkmathviewer does not depend on GTK and could be ripped out and a simple render to a bitmap/pixmap could be done for inclusion into the OpenGL plots.

This looks nice but renders MathML, not LaTeX
Right, that is why I proposed the two step process of LaTeX to MathML, then MathML to something that can be rendered to the OpenGL plot.



I think in the long run this will look less pretty than the LaTeX output,
but seems simpler and dependent on less stuff.

I don't think we really need to be as pretty as LaTeX - I really think
having a small subset (greek, sub, super) is enough. It seems a wasted
effort to try and re-write LaTeX. If you really need very complex
LaTeX text on your plot, you can always use some ps+TeX trick:
I think we will use gl2ps to get postscript output from our OpenGL
code, and it supports combined ps+latex:

http://www.geuz.org/gl2ps/#tthFtNtAAB

i.e. you get 2 output files files -- a ps file with all the graphics
and a latex file which \includes the graphics and adds the text. This
way, on your hardcopy (but not on-screen) you can have true LaTeX
capabilities.

Shai

I think that small subset should also have \dot, \ddot, \hat, \tilde, and maybe a couple others, since these get used quite frequently.

Would you be averse to having the two options available at compile time? That way, for those with systems where LaTeX and libpoppler are available (whether gtk or QT), we could compile in the support for the full interpreter?

My latest test involved the following process, and while I haven't got it to draw in the Octave OpenGL plot yet, I do have it drawing in an OpenGL window as a texture on the cube
1) Run pdflatex on an equation: e.g.   \dot{x}(t) = Ax(t) + bu(t)
2) Run pdfcrop on the file to cut it down from a full page to just the bounding box
3) Load the resulting PDF with libpoppler and put it into a pixel buffer
4) Transfer the pixel buffer to an OpenGL texture
5) Apply the texture to the side of a cube (I'm assuming I could apply this to a transparent plane also?)

I haven't timed this yet because I am still doing (1)-(2) manually from the command line, but (1)-(2) really only need to be done once. Even (3) only needs to be done once unless some sort of zooming or resizing of the text takes place. Also, libpoppler does the scaling and such before it converts it to a pixmap, so the text looks good even at large and small scales. This process actually seems quite simple and doable to me, and is even a fairly simple process given these libraries are readily available on your platform. I know that all of these are readily available on Linux and OSX, but have no clue about windows.


John



reply via email to

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