Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #3529 > unrolled thread

dvi.ps

Started bynews@zzo38computer.org.invalid
First post2020-06-04 16:50 -0700
Last post2020-06-05 20:13 -0700
Articles 9 — 4 participants

Back to article view | Back to comp.lang.postscript


Contents

  dvi.ps news@zzo38computer.org.invalid - 2020-06-04 16:50 -0700
    Re: dvi.ps luser droog <luser.droog@gmail.com> - 2020-06-04 18:16 -0700
      Re: dvi.ps news@zzo38computer.org.invalid - 2020-06-04 19:50 -0700
        Re: dvi.ps luser droog <luser.droog@gmail.com> - 2020-06-04 23:57 -0700
    Re: dvi.ps ken <ken@spamcop.net> - 2020-06-05 08:02 +0100
      Re: dvi.ps news@zzo38computer.org.invalid - 2020-06-05 10:07 -0700
        Re: dvi.ps ken <ken@spamcop.net> - 2020-06-05 18:29 +0100
    Re: dvi.ps Peter Flynn <peter@silmaril.ie> - 2020-06-05 22:53 +0100
      Re: dvi.ps news@zzo38computer.org.invalid - 2020-06-05 20:13 -0700

#3529 — dvi.ps

Fromnews@zzo38computer.org.invalid
Date2020-06-04 16:50 -0700
Subjectdvi.ps
Message-ID<1591312531.bystand@zzo38computer.org>
I have some questions about use of TeX with PostScript. One of my
questions is if there is a way to automatically decide which METAFONT
mode is needed based on the contents of the page device dictionary? (I
can add a command-line argument to override this and specify it by
yourself instead, but a default should also be needed. I can also add a
command-line argument to not render any text on the page; this can be
used if you want to render the text using a separate program.) Of course
resolution can be figured easily enough, and that can be used for the
purpose of pixel rounding and other purposes (and also to find .pk files
with the extension given the resolution, if you are just given a directory
name rather than using kpsewhich).

My intention is mainly that TeX can be used for text, and then you can
use PostScript for diagrams, but you could also use PostScript codes to
decide how the DVI file is processed in other ways too.

For a diagram, you could for example write \special{(fig1.ps) run} in your
TeX file, and then when that special is encountered, it will execute the
contents of the PostScript file fig1.ps, which presumably draws a diagram
(and it would have access to any fonts used in the document; in addition
to the TeX fonts, the diagram could also use PostScript fonts if wanted;
furthermore, if you needed to pass other information from TeX, then you
could add that to the beginning of the special text so that they will be
on the operand stack and available for the PostScript code to use).

When I have something, then I will post it, although my initial question
still stands; I want to know if it is even possible to determine it
automatically in this way (assuming that you used -sDEVICE= to select the
proper kind of output device that you are using). (If not, then it isn't
too bad; I can just require it to be specified manually, which I would
allow even if automatic is possible too, anyways.)

(Note that I use Plain TeX; I do not use LaTeX.)

-- 
This signature intentionally left blank.
(But if it has these words, then actually it isn't blank, isn't it?)

[toc] | [next] | [standalone]


#3530

Fromluser droog <luser.droog@gmail.com>
Date2020-06-04 18:16 -0700
Message-ID<ee4987f9-796d-43c9-ad11-cb6f8ee60ba9o@googlegroups.com>
In reply to#3529
On Thursday, June 4, 2020 at 6:51:01 PM UTC-5, ne...@zzo38computer.org.invalid wrote:
> I have some questions about use of TeX with PostScript. 

I'm not sure I understand your question, but it seems to have more
to do with TeX than with PostScript. You might try asking at 
tex.stackexchange.com.

[toc] | [prev] | [next] | [standalone]


#3531

Fromnews@zzo38computer.org.invalid
Date2020-06-04 19:50 -0700
Message-ID<1591325008.bystand@zzo38computer.org>
In reply to#3530
luser droog <luser.droog@gmail.com> wrote:
> On Thursday, June 4, 2020 at 6:51:01 PM UTC-5, ne...@zzo38computer.org.invalid wrote:
> > I have some questions about use of TeX with PostScript. 
> 
> I'm not sure I understand your question, but it seems to have more
> to do with TeX than with PostScript. You might try asking at 
> tex.stackexchange.com.

My question has to do with both TeX and PostScript, which is why I
cross-posted to both newsgroups. (I do not use Stack Exchange, nor do I
use Google Groups (although I can see that you do use Google Groups;
maybe Google Groups doesn't have cross-posting).) Maybe someone on
comp.text.tex will answer later.

-- 
This signature intentionally left blank.
(But if it has these words, then actually it isn't blank, isn't it?)

[toc] | [prev] | [next] | [standalone]


#3532

Fromluser droog <luser.droog@gmail.com>
Date2020-06-04 23:57 -0700
Message-ID<f003fa71-8a80-46d5-8198-0a0c6a79aaa3o@googlegroups.com>
In reply to#3531
On Thursday, June 4, 2020 at 9:50:28 PM UTC-5, ne...@zzo38computer.org.invalid wrote:
> luser droog <luser.droog@gmail.com> wrote:
> > On Thursday, June 4, 2020 at 6:51:01 PM UTC-5, ne...@zzo38computer.org.invalid wrote:
> > > I have some questions about use of TeX with PostScript. 
> > 
> > I'm not sure I understand your question, but it seems to have more
> > to do with TeX than with PostScript. You might try asking at 
> > tex.stackexchange.com.
> 
> My question has to do with both TeX and PostScript, which is why I
> cross-posted to both newsgroups. (I do not use Stack Exchange, nor do I
> use Google Groups (although I can see that you do use Google Groups;
> maybe Google Groups doesn't have cross-posting).) Maybe someone on
> comp.text.tex will answer later.
> 

My mistake. GG doesn't support creating cross-posts and I'd have to dig
into the headers to notice it. 

[toc] | [prev] | [next] | [standalone]


#3533

Fromken <ken@spamcop.net>
Date2020-06-05 08:02 +0100
Message-ID<MPG.3943fe427ea8ce659898b2@usenet.plus.net>
In reply to#3529
In article <1591312531.bystand@zzo38computer.org>, 
news@zzo38computer.org.invalid says...
> 
> I have some questions about use of TeX with PostScript. One of my
> questions is if there is a way to automatically decide which METAFONT
> mode is needed based on the contents of the page device dictionary?

I don't know what 'METAFONT mode' means, it doesn't have any meaning in 
PostScript.


> When I have something, then I will post it, although my initial 
question
> still stands; I want to know if it is even possible to determine it
> automatically in this way 

And what is 'it' ?

> (assuming that you used -sDEVICE= to select the
> proper kind of output device that you are using). 

That's Ghostscript usage, not PostScript.


> too bad; I can just require it to be specified manually, which I would
> allow even if automatic is possible too, anyways.)

I'm afraid I really don't know what it is you are actually asking. As 
luser droog said perhaps you'll have more luck with a TeX news group, I 
can't see where PostScript has any bearing on your explanation or 
question.


		Ken

[toc] | [prev] | [next] | [standalone]


#3541

Fromnews@zzo38computer.org.invalid
Date2020-06-05 10:07 -0700
Message-ID<1591370305.bystand@zzo38computer.org>
In reply to#3533
ken <ken@spamcop.net> wrote:
> In article <1591312531.bystand@zzo38computer.org>, 
> news@zzo38computer.org.invalid says...
> > 
> > I have some questions about use of TeX with PostScript. One of my
> > questions is if there is a way to automatically decide which METAFONT
> > mode is needed based on the contents of the page device dictionary?
> 
> I don't know what 'METAFONT mode' means, it doesn't have any meaning in 
> PostScript.

OK, perhaps it will be helpful to explain it, I suppose.

> And what is 'it' ?

The METAFONT mode, of course. METAFONT modes are just names, although they
are used to compile fonts for a specific printer, and each METAFONT mode
defines the following parameters (in addition to some others which are not
relevant to PostScript, that I am not mentioning here):

* The resolution (already seen in the page device dictionary).

* A "blacker" parameter, to correct stems and so on for devices which
would otherwise make them too light.

* A "fillin" parameter, to correct the darkness of diagonal lines.

* A "o_correction" parameter, to "overshoot" curves beyond the baseline
and x-height, such as that of the letter "o". They say this causes it to
look better at high resolutions, while low resolutions should avoid this.

For example, the METAFONT mode for Xerox 8790 or 4045 (at 600dpi) uses
blacker=1, fillin=0.1, and o_correction=0.9. Not having worked with this
many printers, I don't know it exactly, although I should want to ensure
high quality output for any printer, if possible. (There are also METAFONT
modes for printers with a much higher resolution than that, too.)

(Also, to clarify: This PostScript code is meant to run on the computer,
not on the printer. This allows it to access external files (such as the
font files, and external files for diagrams), to use the fill level 3
PostScript features, to use Ghostscript features, etc. You would then
rasterize it and send it to the printer. If you do have a PostScript
printer, you could use Ghostscript's PostScript output mode to convert
the output of the PostScript program into level 2 PostScript.)

Perhaps I can also mention that these fonts are bitmap fonts; METAFONT
compiles a vector description of the font (using a complete programming
language) into a bitmap font, with hinting, with the parameters mentioned,
with parameters specific to the font (so that you can get many styles of
text just by adjusting the parameters), and with a full programming
language, into the font bitmaps and a font metric file.

Although most users seem not to want bitmap fonts, I am one of the users
who does want to use bitmap fonts. (Bitmap fonts probably are not useful
if you want PDF output, but in my case, PDF isn't what I wanted.)

> I'm afraid I really don't know what it is you are actually asking. As 
> luser droog said perhaps you'll have more luck with a TeX news group, I 
> can't see where PostScript has any bearing on your explanation or 
> question.

As I previously explained, I already did that (I cross-posted). But where
PostScript has any bearing on the question is the PostScript page device
dictionary, as I mentioned. So, in other words, to answer my question
would probably require a knowledge of both METAFONT (which is usually used
with TeX, although it is actually a separate prorgam) and PostScript.

If my question has no answer, that is fine; I can just make it manually
specified only; although it may be good to figure it out automatically.

The reason I am using PostScript at all is mainly in order to include
diagrams in the document; those would presumably be written using
PostScript code. (It may also be helpful to embed PostScript code in the
document to do other stuff such as setting colours, changing how the rest
of the DVI file will be processed, etc. Your PostScript code for the
diagram might also be passed parameters from TeX, such as the amount of
stretching, in case your diagram includes parts which should be vertically
stretched, too. If I am making a document without diagrams, then I would
just use dvipbm instead; no need to deal with PostScript.)

I prefer to avoid PDF; DVI is just a better format in many ways, and then
another program would rasterize the DVI file; this could be done using a
program written in C, Pascal, etc. However, PostScript is still good for
diagrams and such thing like that, so instead of using C, I am considering
to use PostScript to implement this rasterization. So, DVI should be used
for the main text of the document, and PostScript for diagrams (with the
PostScript code embedded in the DVI file; if they are external then you
can just write something like "(fig1.ps) run" and that will cause it to
execute the PostScript file fig1.ps when that point is reached).

Rasterizing a DVI file does involve more than just fonts; it also involves
rounding pixel positions and dealing with drifting properly. See DVItype
for details of this algorithm (implemented in Pascal).

-- 
This signature intentionally left blank.
(But if it has these words, then actually it isn't blank, isn't it?)

[toc] | [prev] | [next] | [standalone]


#3542

Fromken <ken@spamcop.net>
Date2020-06-05 18:29 +0100
Message-ID<MPG.394491438e5373a69898b6@usenet.plus.net>
In reply to#3541
In article <1591370305.bystand@zzo38computer.org>, 
news@zzo38computer.org.invalid says...
 
> > I'm afraid I really don't know what it is you are actually asking. As 
> > luser droog said perhaps you'll have more luck with a TeX news group, I 
> > can't see where PostScript has any bearing on your explanation or 
> > question.
> 
> As I previously explained, I already did that (I cross-posted). But where
> PostScript has any bearing on the question is the PostScript page device
> dictionary, as I mentioned. So, in other words, to answer my question
> would probably require a knowledge of both METAFONT (which is usually used
> with TeX, although it is actually a separate prorgam) and PostScript.

To be honest, I don't really see how anything in the page device 
dictionary could have any real bearing, since this is apparently all 
decided in TeX.

If you can describe what information you want I can tell you whether its 
likely to be available, and how, but I don't really see how anything in 
the PostScript environment has a lot of bearing. If you insist on using 
bitmap fonts, then the resolution matters, certainly, beyond that 
possibly the default transfer fucntion (which is in the graphics state, 
not the page device dictionary) 
 
> If my question has no answer, that is fine; I can just make it manually
> specified only; although it may be good to figure it out automatically.

As I say I can't see how you can determine much of this from PostScript. 
Part of the point of PostScript is that you are shielded from device-
specific decisions.


		Ken

[toc] | [prev] | [next] | [standalone]


#3544

FromPeter Flynn <peter@silmaril.ie>
Date2020-06-05 22:53 +0100
Message-ID<hjvt67Fu5pfU1@mid.individual.net>
In reply to#3529
On 05/06/2020 00:50, news@zzo38computer.org.invalid wrote:
> I have some questions about use of TeX with PostScript. One of my
> questions is if there is a way to automatically decide which METAFONT
> mode is needed based on the contents of the page device dictionary?

The METAFONT mode is used with Type 3 (bitmap) fonts to specify how many 
dots per inch (horizontally and vertically) are needed for the current 
output device (ie phototypesetter, graphic display terminal, etc). If a 
Type 3 font (in METAFONT terms, a .mf file creating a .gf file) is 
needed and a bitmap (a .nnnnpk file) does not yet exist for the 
requested resolution, METAFONT will be called to generate it. As most 
output devices nowadays have resolutions so far in excess of anything 
whose dots your eyes can reasonably be expected to resolve, the METAFONT 
mode is largely obsolescent: at some stage, TeX distributions set to 
some default value like HP LaserJet 600×600 but I think nowadays 
METAFONT has a setting called 'modeless' (I may be wrong on this: it's 
been many decades since I needed to know, and texmf.cnf is singularly 
unforthcoming).

People do still use Postscript — some printers still have platemaking 
equipment whose RIP only accepts Postscript — but most output is now 
PDF. Type 3 fonts are still very much around, but with a few elderly 
exceptions, font technology in print production has long moved on. A 
number of popular numeric and drawing packages still apparently produce 
EPS output (my old favourite stats package, P-Stat, among them), but 
it's easy to convert the EPS to PDF for embedding in a [La]TeX document.

> My intention is mainly that TeX can be used for text, and then you
> can use PostScript for diagrams, but you could also use PostScript
> codes to decide how the DVI file is processed in other ways too.

It's certainly possible.

> For a diagram, you could for example write \special{(fig1.ps) run} 
[snip]

You certainly could.

> When I have something, then I will post it, although my initial question
> still stands; I want to know if it is even possible to determine it
> automatically in this way (assuming that you used -sDEVICE= to select the
> proper kind of output device that you are using). (If not, then it isn't
> too bad; I can just require it to be specified manually, which I would
> allow even if automatic is possible too, anyways.)

The value is probably stored somewhere but I don't know where.

Peter

[toc] | [prev] | [next] | [standalone]


#3546

Fromnews@zzo38computer.org.invalid
Date2020-06-05 20:13 -0700
Message-ID<1591400691.bystand@zzo38computer.org>
In reply to#3544
Peter Flynn <peter@silmaril.ie> wrote:
> .............................................................. As most 
> output devices nowadays have resolutions so far in excess of anything 
> whose dots your eyes can reasonably be expected to resolve, the METAFONT 
> mode is largely obsolescent: at some stage, TeX distributions set to 
> some default value like HP LaserJet 600×600 but I think nowadays 
> METAFONT has a setting called 'modeless' (I may be wrong on this: it's 
> been many decades since I needed to know, and texmf.cnf is singularly 
> unforthcoming).

OK, then that is a good default, and I suppose that answers my question;
there is then no need to deal with METAFONT modes (unless the user
explicitly specifies one); it already knows the resolution, so it can
just use the resolution alone to determine which file to load.

I cannot find a "modeless" setting in my computer (I looked in modes.mf,
which lists the modes, and texmf.cnf, which doesn't seem to mention the
METAFONT modes at all), and mktexpk just says mismatched mode. I looked at
the code for mktexpk; it is a shell script; it seems that "modeless" is
only for PostScript fonts, and is not for fonts made using METAFONT. It
also looks like it executes METAFONT to determine if the mode matches; if
it doesn't match, tries to guess using a hard-coded table. Although, it
seem like easily enough to add a "modeless" option for METAFONT-based
fonts into mktexpk (there are a few possible ways to do this, but in all
cases you would skip the check at the beginning in modeless mode for if
the mode and DPI does not match).

But maybe the version I have is old, and the new version does have such a
"modeless" setting that would do what would be needed if the user has not
specified any METAFONT mode.

> People do still use Postscript — some printers still have platemaking 
> equipment whose RIP only accepts Postscript — but most output is now PDF.

OK. I did not know that, but Ghostscript has the ability to output
level 2 PostScript (as well as PDF), so you can use that if you need that.

> A number of popular numeric and drawing packages still apparently produce 
> EPS output (my old favourite stats package, P-Stat, among them), but 
> it's easy to convert the EPS to PDF for embedding in a [La]TeX document.

OK, although I don't use EPS, nor those programs, nor LaTeX, nor pdfTeX.
If I need graphics made from data from another program, I will generally
instead write a program in PostScript to read that file and plot the data.
But EPS works too if that is what you are using.

-- 
This signature intentionally left blank.
(But if it has these words, then actually it isn't blank, isn't it?)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web