|
From: | Andrej Lojdl |
Subject: | Re: GSoC project - LaTeX/TeX |
Date: | Wed, 10 Jul 2013 21:12:12 +0200 |
On Tue, Jul 9, 2013 at 1:19 PM, Andrej Lojdl <address@hidden> wrote:
2013/6/28 Ben Abbott <address@hidden>
can be read from EPS file, and so on...For converting we can use many different programs proposed by Ben. And I want to thank him for his help. But more or less they aresame as this combination. If some of them have any new functionality, it needs additional dependencies. I will mention them here ifaccidentally missed a good functionality.- textogif [http://www.fourmilab.ch/webtools/textogif/]- tex2im [http://www.nought.de/tex2im.html]- tex2image [http://dean.serenevy.net/code/projects/tex2image]My understanding is that all of these work in a similar manner to your solution.latex default.texdvips default.dvi -o -E default.epsconvert +adjoin -antialias -transparent $transparentcolor -density $resolution [...] default.eps default.pngConvert includes many options that are either needed or are useful for full Matlab compatibility.-border geometry surround image with a border of color-bordercolor color border color-background color background color-transparent-color color-density geometry horizontal and vertical density of the imageGhostscript provides for dual resolution (-rnumber1xnumber2), and its pngalpha driver allows the background color to be specified, but I don't think it can handle the border color, linewidth, etc.
BenI didn't post on maintainers list for quite time now. And there are some problemswith my project so maybe it's best to ask here. I believe there are others interestedin this project and maybe can help me. For more information on how my project isprogressing take a look at http://latexmarkup.blogspot.com/ .So there are programs for reading string, transforming it to TEX file, then troughsome additional programs finally to PNG image. Information about bounding boxNext step is to implement this functions directly to Octave source code, and here myproblems start. Here are methods of interest for this part of project:- text::properties::update_text_extent - computes bounding box and use use text_to_pixelsmethod for further processing- opengl_renderer::text_to_pixels ( and generaly others text_to_pixels) - transform theinput text to image and store it under pixels value- opengl_renderer::draw_text - use pixels value from text objects and sends it to OpenGL( glps_renderer::draw_text - does something similar but for printing and currently I'm focusedto on screen rendering )If I understood how OpenGL functions work, this method use glBitmap to place bitmap image on plotand glDrawPixels to write a image to this placeholder on final plot.Now when here is small overview what's happening, here are the questions bugging my:1. When user set interpreter parameter to "latex", all text should be rendered trough LaTeX,so there should be some code doing this ( there already exist code but it's just a proof of modeloutside Octave code ) and that text will never use ft_renderer ( freetype library ). Where shouldthis code by implemented?The "interpreter" property is defined at the text object level. So there's a need for some dispatch mechanism (or abstraction layer) to use the right text renderer, depending on the value of interpreter property. At the moment, the text object uses a fixed ft_render member, but this will have to be changed. Just think a bit about it and come back with a draft plan we can discuss about.2. Should there be some entry point looking at interpreter value and directing rendering oftext to LaTeX system if needed?See answer above.3. Octave computes bounding box, but with LaTeX we can get bounding box from EPS file.So this value extracted from EPS file should just be stored to bounding box in text::properties::update_text_extent ?Yes. Computing the bbox will be part of the rendering process.4. How to store rendered image to pixels value in opengl_renderer::text_to_pixels method?AFAIK this method is only used to render tickmark texts. And there's no need to have LaTeX support for those (not 100% sure, though). At the moment, the rasterized version of tickmark texts is not cached.Michael.
[Prev in Thread] | Current Thread | [Next in Thread] |