Forum archive 2000-2006

Jan-Åke Larsson - The -D option of dvipng

Jan-Åke Larsson - The -D option of dvipng

by Arnold Pizer -
Number of replies: 0
inactiveTopicThe -D option of dvipng topic started 3/16/2004; 3:30:34 AM
last post 3/19/2004; 6:01:24 PM
userJan-Åke Larsson - The -D option of dvipng  blueArrow
3/16/2004; 3:30:34 AM (reads: 1290, responses: 7)
This is the author of dvipng speaking....

I am thinking about changing the behaviour of the -D option to specify the output resolution rather than the present base resolution (which is scaled by the shrinkfacktor to the output resolution). This would make the behaviour more similar to that of dvips and more transparent to new users.

At the same time I will add code so that it will not be necessary to give a metafont mode to make the fonts render. For those who want to select the metafont mode I'll add a --bdpi switch so that this can be done without errors.

This means that the old-style dvipng call would change from e.g.

     dvipng -D 600 -Q 6 -mode ljfour test.dvi

to
 
     dvipng -D 100 -bdpi 600 -Q 6 -mode ljfour test.dvi

or, if the metafont mode is not really important to you:

     dvipng -D 100 test.dvi

I understand that some WeBWorK users even use the -x switch to adjust the output resolution. This would not be necessary anymore if I do the intended change.

So: after the change, the -D switch would be consistent with the dvips -D switch, and it would be much simpler to choose a certain resolution. Unfortunately, everyone that upgrades would need to change the dvipng call. Opinions?

Jan-Åke

<| Post or View Comments |>


userSam Hathaway - Re: The -D option of dvipng  blueArrow
3/16/2004; 10:28:35 AM (reads: 1448, responses: 0)
This seems fine to me. We only call dvipng in one place in WeBWorK, so it would be easy for us to make the change.

<| Post or View Comments |>


userJan-Åke Larsson - Re: The -D option of dvipng  blueArrow
3/18/2004; 5:43:02 AM (reads: 1467, responses: 1)
Do people (sysadmins of WeBWorK servers) generally change the call themselves, or is this done by the WeBWorK devel crew? (And which group does Samuel speak for?)

Would it be good or bad if I make dvipng bail out if -mfmode is given without -bdpi?

<| Post or View Comments |>


userJohn Jones - Re: The -D option of dvipng  blueArrow
3/18/2004; 9:02:29 AM (reads: 1436, responses: 0)
I think most WeBWorK administrators are able to change the call themselves, especially with instructions on what to change and where it is.  If (or when) someone upgrades one, but not both, of WeBWorK and dvipng and they get a mismatch in the dvipng call, they are likely to post here.

On

Would it be good or bad if I make dvipng bail out if -mfmode is given without -bdpi?

I think it would be better if dvipng did not bail out.  An imperfect image is better than none.

John

<| Post or View Comments |>


userSam Hathaway - Re: The -D option of dvipng  blueArrow
3/18/2004; 11:43:17 AM (reads: 1681, responses: 0)
I'm one of the developers of WeBWorK. I work under Mike Gage and Arnie Pizer.

In WeBWorK 2, the arguments given to dvipng is defined in the file lib/WeBWorK/PG/ImageGenerator.pm in the PG pacakge. In WeBWorK 1, the call is in the main WeBWorK configuration file (lib/Global.pm).

I think individual users monkey around with the arguments to some degree, but most just leave it alone.

<| Post or View Comments |>


userJan-Åke Larsson - Re: The -D option of dvipng  blueArrow
3/18/2004; 12:13:49 PM (reads: 1438, responses: 0)

Just wondering how many bug reports I'll get. If only developers knew how to change the call, I'd tend to get more bug reports. Lots, I guess.

If I don't make dvipng bail out on -mfmode without -bdpi, one might end up with a lot of empty spaces in the output image. Hmmm.

Ah well. Must go now. I'll write some more tomorrow.

<| Post or View Comments |>


userJohn Jones - Re: The -D option of dvipng  blueArrow
3/19/2004; 11:12:45 AM (reads: 1571, responses: 0)
I think bug reports for actual bugs should go to you, but questions about integration of dvipng with WeBWorK should (and probably would) end up here.

On -mfmode without -bdpi, empty images are probably as bad as no images at all.  I was assuming that some default would be used which would lead to images which might not be the right size.

John

<| Post or View Comments |>


userJan-Åke Larsson - Re: The -D option of dvipng  blueArrow
3/19/2004; 6:01:24 PM (reads: 1512, responses: 0)
Ummm. Correct. You would get lots of "mktexpk warning: mismatched mode and base resolution, ignoring mode", and an image that is probably way too large. Ok, it might be better to just output a warning when using --mfmode without --bdpi.

This would be the relevant RELEASE info:

This release changes the -D (resolution) option to specify the
_output_resolution_ rather than the previous _base_resolution_.
Changing output resolution from the default 100 dpi will now only need
the -D option, as dvipng now calculates the required magnification and
thus can render PK fonts suitable for any output resolution. There is
no need anymore to specify by hand the base resolution, the Metafont
mode, the quality, and the magnification.

If you really want to use a Metafont mode different from the default
`cx' mode, the separate --bdpi option is used for specifying the
corresponding base resolution.

In short, choosing the output resolution has become simple even when
using PK fonts (but remember, the created PK fonts are normally cached
on disk).


<| Post or View Comments |>