dvipng
[Top][All Lists]
Advanced

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

Re: [Dvipng] Static/dynamic library for dvipng?


From: Alex
Subject: Re: [Dvipng] Static/dynamic library for dvipng?
Date: Thu, 01 Oct 2009 17:37:04 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jan-Åke,

Thanks for your quick reply. It seems I may be best off just using the
program as it currently is - a command-line utility based around the
filesystem.

I am however curious as to how preview-latex manages to accomplish the
task of on-the-fly LaTeX rendering. Since my overall goal is to create
an on-the-fly TeX renderer to integrate into a .NET/C# application, I
would probably want to mimic much of the approach. Unfortunately, there
seems to be minimal information on the workings of preview-latex, and I
suspect the only way to figure out exactly what goes on will be to dig
through the source. If you could however describe the approach in brief,
or point me to a resource, it would be much appreciated.

Regards,
Alex

Jan-Åke Larsson wrote:
> Alex wrote:
>> The next step would seem to be to use the dvipng command-line
>> utility to convert this DVI to a PNG file. This is of course no problem
>> for a GUI app, though somewhat inefficient I might think.
> 
> This is true, but you should remember that the overhead will be there in
> any case, when calling TeX and when dvipng itself calls gs for image
> inclusion.
> 
>> My main question is: is dvipng suitable to be used as a static/dynamic
>> library for inclusion in other programs? (In addition, I would be
>> curious to know whether it is possible to use a library rather than a
>> stdio program for generating the DVI.)
> 
> There are no designed entry points, and above all no stable API. I could
> perhaps design one, implement it, and learn how to release it as a
> library, but I have preciously little time these days.
> 
>> I am presuming that both the DVI generator of TeX and the PNG generator
>> of dvipng are designed to output solely to files. Still, if there is any
>> way of circumventing this and doing things in-memory, that would be
>> useful for me.
> 
> The DVI generator of TeX I do not know much about. I have been thinking
> about named pipes for dvipng but this is a less portable solution.
> 
> The internals of dvipng does do everything in memory. Input of files
> uses mmap for reading, and if mmap is not available, reads in the whole
> file into memory. Output is via libgd in memory as a gdimage and as a
> final step uses a gd function for writing to a file, IIRC there is one
> for in-memory conversion to a PNG. So in principle it would be possible
> to do everything in memory.
> 
>> A final small query: is compiling dvipng for Windows possible (given
>> that it is my primary target platform), or perhaps via cygwin, if that's
>> less painful? Using MiKTeX should make no difference, as I understand.
> 
> Dvipng is included in MiKTeX. And TeXLive under cygwin.
> 
> /JÅ
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJKxNqwAAoJEOqaT4w4/280fDkH/0QGLcj5u/ltN7oEM8ZYK1Er
yvejKu40867We5U59titFBwMTRfzNmxzfoLzUGnSZmY7/kIfAQX/ihkM6Ygq6W3d
y5t7smgV9PEMbO9PpWx6l/Efoh+13/0tkJvFlzumzj9VBrDlEhpaAQGnCpY13MnE
xl9FEqtzA5ognDYrvSMKeXU3hj3te9UdGmEb9u2zyf7k3aiWZbm2H6VfWnojl+fw
1OIWNr0p6hiP45LO0usHuFhZ8EZ7yLQt/X+XOgHwC0eG3r67H9i3lDb/MeEjqlBl
fgibz5WN/doHWt5fV/kQTkxpIiUfF3N7AbnQrxKASIz75Z8SmOx5myVBgIpzrjk=
=oMqx
-----END PGP SIGNATURE-----




reply via email to

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