|
View:
New views
16 Messages
—
Rating Filter:
Alert me
|
|
|
hardcopy support for gl-render and the fltk_backendHi
I attach a changeset which adds postscript output to the fltk backend, based on the gl-renderer and the gl2ps library (http://www.geuz.org/gl2ps). This changeset is relatively big because the gl2ps library is distributed as 2 files - gl2ps.c and gl2ps.h which need to be included in the distribution of the project using it. There is no binary library. to use : backend("fltk"); plot(randn(1e3,1)); print("test.eps") Limitations (which I will try to fix in the future): 1. no support for images 2. only supports the postscript core fonts Helvetica, Times-Roman, Courier, Symbol, ZapfDingbats (defaults to Helvetica) 3. no support for bold/italic fonts 4. outputs only eps Shai |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn 10/13/2009 10:43 AM, Shai Ayal wrote:
> Limitations (which I will try to fix in the future): > This is a GREAT step forward! Thanks very much Shai. One thing to add to the limitations: 5. No TeX interpretation. This will be important for many users. > 4. outputs only eps > This is not too serious since simple ghostscript scripts can do most translations. Matlab uses ghostscript for this purpose. Michael |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Tue, Oct 13, 2009 at 8:18 PM, Michael D. Godfrey
<godfrey@...> wrote: >> >> 4. outputs only eps >> > > This is not too serious since simple ghostscript > scripts can do most translations. Matlab uses > ghostscript for this purpose. I think that even the current print.m does this (use gs to convert from eps) for gnuplot. It just has to be adapted for use with all backends Shai |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn 10/13/2009 12:17 PM, Shai Ayal wrote:
> I think that even the current print.m does this (use gs to convert > from eps) for gnuplot. It just has to be adapted for use with all > backends > Right. And, it can be used for other output formats. Michael |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Tue, Oct 13, 2009 at 7:43 PM, Shai Ayal <shaiay@...> wrote:
> Hi > > I attach a changeset which adds postscript output to the fltk backend, > based on the gl-renderer and the gl2ps library > (http://www.geuz.org/gl2ps). > This changeset is relatively big because the gl2ps library is > distributed as 2 files - gl2ps.c and gl2ps.h which need to be included > in the distribution of the project using it. There is no binary > library. I just got word (on the gl2ps mailing list) that gl2ps has been accepted to debian (although I still can't install it with apt-get), and I see it is already in the fedora repositories, so maybe the gl2ps repositories can be dropped soon? sHAI |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn 13-Oct-2009, Michael D. Godfrey wrote:
| One thing to add to the limitations: | | 5. No TeX interpretation. The simple TeX interpretation used by the gnuplot backend is done in a .m file, so perhaps this code could be used as is and shared among multiple backends, or translated to C++ (and also shared)? jwe |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn 10/17/2009 10:47 AM, John W. Eaton wrote:
> On 13-Oct-2009, Michael D. Godfrey wrote: > > | One thing to add to the limitations: > | > | 5. No TeX interpretation. > > The simple TeX interpretation used by the gnuplot backend is done in a > .m file, so perhaps this code could be used as is and shared among > multiple backends, or translated to C++ (and also shared)? > > jwe Right. This is a good first step. I will try to learn more about more complete solutions. Michael |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Sun, Oct 18, 2009 at 5:53 AM, Michael D Godfrey
<godfrey@...> wrote: > On 10/17/2009 10:47 AM, John W. Eaton wrote: >> >> On 13-Oct-2009, Michael D. Godfrey wrote: >> >> | One thing to add to the limitations: >> | >> | 5. No TeX interpretation. >> >> The simple TeX interpretation used by the gnuplot backend is done in a >> .m file, so perhaps this code could be used as is and shared among >> multiple backends, or translated to C++ (and also shared)? >> >> jwe > > Right. This is a good first step. I will try to learn more about > more complete solutions. No to discourage anyone but gnuplot supports all the elements needed for nice math typesettings (e.g. super & subscript), "all" that is needed is a translation from TeX to gnuplot. There is nothing equivalent in postscript and/or gl2ps which just know how to "render" strings of a fixed font and size, so the problem might be bigger ... Shai |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn 10/17/2009 09:38 PM, Shai Ayal wrote:
> No to discourage anyone but gnuplot supports all the elements needed > for nice math typesettings (e.g. super& subscript), "all" that is > needed is a translation from TeX to gnuplot. There is nothing > equivalent in postscript and/or gl2ps which just know how to "render" > strings of a fixed font and size, so the problem might be bigger ... > > Shai Well, you are right. In any case it would be good to work toward a complete solution that allows full TeX/LaTeX. It may be that learning from Asymptote is a place to start. Asymptote is on SourceForge. It provides "LaTeX typesetting of labels," so it might be useful to look at how they do it. It also claims to be "inspired by MetaPost..." I have used MetaPost quite a bit and it is very useful and well done. The Asymptote URL is: http://asymptote.sourceforge.net/ Michael |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Sun, Oct 18, 2009 at 5:38 AM, Shai Ayal <shaiay@...> wrote:
> No to discourage anyone but gnuplot supports all the elements needed > for nice math typesettings (e.g. super & subscript), "all" that is > needed is a translation from TeX to gnuplot. There is nothing > equivalent in postscript and/or gl2ps which just know how to "render" > strings of a fixed font and size, so the problem might be bigger ... You might want to have a look at the gl2ps code shipped with JHandles. This is a modified version that can do some additional formatting (like subscript or superscripts) and produce corresponding PS code. Michael. |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Sun, Oct 18, 2009 at 10:02 AM, Michael Goffioul
<michael.goffioul@...> wrote: > On Sun, Oct 18, 2009 at 5:38 AM, Shai Ayal <shaiay@...> wrote: >> No to discourage anyone but gnuplot supports all the elements needed >> for nice math typesettings (e.g. super & subscript), "all" that is >> needed is a translation from TeX to gnuplot. There is nothing >> equivalent in postscript and/or gl2ps which just know how to "render" >> strings of a fixed font and size, so the problem might be bigger ... > > You might want to have a look at the gl2ps code shipped with JHandles. > This is a modified version that can do some additional formatting > (like subscript or superscripts) and produce corresponding PS code. Can this be done w/o additional work in the renderer -- i.e. only by using the new PS macros in the modified gl2ps, or do you need to implement some sort of a simple TeX interpreter as you do in SimpleTextEngine.java? Shai |
|
|
Re: hardcopy support for gl-render and the fltk_backend
On 10/18/2009 01:30 PM, Shai Ayal wrote:
If it is easy to handle PS (or PDF) code for text strings you could consider just running pdflatex on the string (with suitable header and trailer) and use the resulting PDF. Michael |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Sun, Oct 18, 2009 at 9:30 PM, Shai Ayal <shaiay@...> wrote:
> Can this be done w/o additional work in the renderer -- i.e. only by > using the new PS macros in the modified gl2ps, or do you need to > implement some sort of a simple TeX interpreter as you do in > SimpleTextEngine.java? I guess it is imaginable to process something like: a_{12}+x^2*\theta_1 entirely in PS, but I guess it can be a little bit tedious. What I did is to re-use the visitor pattern I had implemented for normal rendering to split a string into elements and add the PS code to render those elements. Michael. |
|
|
Re: hardcopy support for gl-render and the fltk_backendOn Mon, Oct 19, 2009 at 10:08 AM, Michael Goffioul
<michael.goffioul@...> wrote: > On Sun, Oct 18, 2009 at 9:30 PM, Shai Ayal <shaiay@...> wrote: >> Can this be done w/o additional work in the renderer -- i.e. only by >> using the new PS macros in the modified gl2ps, or do you need to >> implement some sort of a simple TeX interpreter as you do in >> SimpleTextEngine.java? > > I guess it is imaginable to process something like: > a_{12}+x^2*\theta_1 entirely in PS, but I guess it can be a little > bit tedious. What I did is to re-use the visitor pattern I had implemented > for normal rendering to split a string into elements and add the PS code > to render those elements I agree it doesn't make sense to try and implement this in PS. There was also talk once of rendering text with LaTeX (I think Michael wrote the text rendering engine anticipating we would use LaTeX to produce bitmaps). In any case there is still quite an amount of work to be done before we have TeX support. I suggest the changeset be committed meanwhile. Shai |
|
|
Re: hardcopy support for gl-render and the fltk_backend
On 10/20/2009 01:39 AM, Shai Ayal wrote:
I agree with this. There is a lot to use and test in this update.In any case there is still quite an amount of work to be done before we have TeX support. I suggest the changeset be committed meanwhile. The TeX/LaTeX feature will take some thought and time to implement. I would encourage some careful thought about how to do this right before any "quick fix." |
|
|
hardcopy support for gl-render and the fltk_backendOn 13-Oct-2009, Shai Ayal wrote:
| I attach a changeset which adds postscript output to the fltk backend, | based on the gl-renderer and the gl2ps library | (http://www.geuz.org/gl2ps). | This changeset is relatively big because the gl2ps library is | distributed as 2 files - gl2ps.c and gl2ps.h which need to be included | in the distribution of the project using it. There is no binary | library. | to use : | backend("fltk"); plot(randn(1e3,1)); print("test.eps") | | Limitations (which I will try to fix in the future): | 1. no support for images | 2. only supports the postscript core fonts Helvetica, Times-Roman, | Courier, Symbol, ZapfDingbats (defaults to Helvetica) | 3. no support for bold/italic fonts | 4. outputs only eps I made some additional changes (mostly style fixes plus adapting to the new build system) and checked in this patch. Thanks, jwe |
| Free embeddable forum powered by Nabble | Forum Help |