[Top][All Lists]

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

Re: [groff] hyphen, minus sign and hyphen-minus

From: Pali Rohár
Subject: Re: [groff] hyphen, minus sign and hyphen-minus
Date: Mon, 28 May 2018 09:39:35 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi! I will look at PS and react later, for now just DVI part:

On Monday 28 May 2018 02:48:09 Ingo Schwarze wrote:
> > I looked deeply at DVI output and basically \- is printed in DVI as
> > glyph with index 0 from font cmsy10. Looking at cmsy10.pfb Type1 font
> > file and there is "dup 0 /minus put" which means that this character is
> > mathematical minus with Unicode code point U+2212.
> That could well be the same effect as for PostScript.  I don't have
> the slightest idea how the dvi file format works (even though i used
> LaTeX a lot in the past).  Is the wish "i want to print hyphen-minus"
> reasonable for dvi?  It might be just as meaningless as for PostScript
> with the default TR font.

In DVI file is written name of the tex font metric (tfm) and glyph index
(0..255) from this font metric. DVI file just specify how output would
look like (which glyphs are selected). Doing copy+paste (selection) of
glyph and assigning Unicode code points depends on external font file
(or DVI driver).

If you are using bitmap fonts (pk) then this range is mapped by default
to U+00..U+FF characters. In pdfTeX (version from this year!) when doing
direct PDF output and not DVI, it is possible to assign custom mapping

If you are using vector Type1 fonts then mapping table is in font
itself. So basically font says which Unicode code point should be used
when doing copy+paste. Usage of TrueType or OpenType fonts is similar
(plus there is needed to provide encoding vector). In pdfTeX when doing
direct PDF output again it is possible to assign custom mapping table
via \pdfglyphtounicode pdfTeX primitive.

LaTeX would do lot of steps automatically, so basically for users these
steps are fully invisible.

DVI file produced by -Tdvi for \- character uses glyph with index 0 from
font cmsy10. cmsy10 is vector font in format Type1 available in the file
cmsy10. And on index 0 is glyph named "/minus" which has by Adobe
assigned Unicode code point U+2212.

So how can be this fixed? Find some preinstalled TeX vector Type1 font
which some glyph looks like hyphen and its name has assigned by Adobe
Unicode code point U+002D. And use it instead of cmsy10/0 for \- when
producing man page.

Seems there is missing "override" for grodvi that it should change \-
to hyphen-minus when generating manpages. As cmsy10 is TeX font for
typesetting mathematical glyphs, like in non-manpage-mode of troff where
\- is defined as minus sign.

See glyphs in cmsy10 font:

Pali Rohár

reply via email to

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