• dvi.ps

    From news@zzo38computer.org.invalid@21:1/5 to All on Thu Jun 4 16:50:58 2020
    XPost: comp.text.tex

    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?)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From luser droog@21:1/5 to ne...@zzo38computer.org.invalid on Thu Jun 4 18:16:41 2020
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From news@zzo38computer.org.invalid@21:1/5 to luser droog on Thu Jun 4 19:50:24 2020
    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?)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From luser droog@21:1/5 to ne...@zzo38computer.org.invalid on Thu Jun 4 23:57:20 2020
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ken@21:1/5 to All on Fri Jun 5 08:02:00 2020
    XPost: comp.text.tex

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From news@zzo38computer.org.invalid@21:1/5 to ken on Fri Jun 5 10:07:03 2020
    XPost: comp.text.tex

    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?)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ken@21:1/5 to All on Fri Jun 5 18:29:12 2020
    XPost: comp.text.tex

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Flynn@21:1/5 to news@zzo38computer.org.invalid on Fri Jun 5 22:53:09 2020
    XPost: comp.text.tex

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From news@zzo38computer.org.invalid@21:1/5 to Peter Flynn on Fri Jun 5 20:13:08 2020
    XPost: comp.text.tex

    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?)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From news@zzo38computer.org.invalid@21:1/5 to All on Wed Aug 19 16:45:12 2020
    XPost: comp.text.tex

    Basically, dvi.ps is an alternative to dvips and dvipdf. One difference is
    that dvi.ps is meant to run the PostScript program on the computer, not on
    the printer (it is unlikely any printer will execute it, but you can make
    the output from it in whatever format you need, for use with a printer, or
    for other purposes). There are many other differences too.

    I wrote a DVI program with PostScript. Probably many improvements could be made, but you can see what it is so far if you want to do. (This program
    may be helpful if you want to use TeX and PostScript codes together.)

    Download: http://zzo38computer.org/prog/dvi_ps.zip
    (Documentation is also included)

    Please post comment if you have improved it, found a mistake, questions, complaints, etc. (You might also find a use to use parts of this program
    in other programs, such as the PK font loading, in case you like to use
    PK fonts in PostScript. This program is public domain.)

    (One possible improvement would be to add a command to load and interpret
    TFM files, in order that you can use ligatures/kerning in text which is
    inside of diagrams which are not produced with TeX. Another possible improvement would be to add an option to set the METAFONT mode to use,
    and possibly a way to try to determine it automatically by the use of
    the page device dictionary somehow, if it is possible. There are probably
    a lot more possibilities, too; I can think of some, but not all.)

    PostScript is good for graphics, while TeX (I prefer Plain TeX myself,
    although many people use LaTeX) and DVI are good for text. So, now we
    can use both (although it can't use PostScript codes to affect the
    decisions made in TeX, unless you make multiple passes).

    (Is there any version of METAFONT which can produce PK files directly
    rather than needing first GF and then converted to PK?)

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ross Presser@21:1/5 to ne...@zzo38computer.org.invalid on Fri Aug 21 10:37:49 2020
    On Wednesday, August 19, 2020 at 7:46:24 PM UTC-4, ne...@zzo38computer.org.invalid wrote:

    (Is there any version of METAFONT which can produce PK files directly
    rather than needing first GF and then converted to PK?)

    It appears not. However,
    https://linux.die.net/man/1/maketexpk
    says it can make a PK file from the Metafont source, rather than needing the GF

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)