Re: eqn sqrt and pdf?

2020-03-02 Thread Ralph Corderoy
Hi Deri,

> Is the download file expected to be immutable?

If it's shipped inside the package then yes, so that debsums(1) can test
it hasn't been changed.  Ditto with other packaging formats AIUI.

> How do packagers deal with configuration files which are intended to
> be editable by users?

A ...local file that's also read, or more often these days a download.d
directory where each file within it at the top level is processed in a
defined order.  See run-parts(8) for an example.

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-03-02 Thread Tadziu Hoffmann


> Is the download file expected to be immutable? There are
> instructions how to add fonts to groff, which involves
> changing the download file. How do packagers deal with
> configuration files which are intended to be editable by
> users?

I recommend having your personal groff font folder independent of
the packaging system, and setting GROFF_FONT_PATH accordingly.





Re: eqn sqrt and pdf?

2020-03-02 Thread Deri
On Sunday, 1 March 2020 17:40:59 GMT Colin Watson wrote:
> Thanks, but this is unlikely to be a very helpful approach for files
> built as part of distribution-managed packages, where the shipped files
> are normally expected to be immutable (for example, checksumming the
> installed files would fail after doing that kind of thing).
> 
> It would be preferable to make the download file independent of the
> ghostscript version, if possible.  If that isn't possible, I'll need to
> figure out some way to annotate the implied dependency in my packages'
> metadata, in order that we can know when we need to rebuild groff.

Is the download file expected to be immutable? There are instructions how to 
add fonts to groff, which involves changing the download file. How do 
packagers deal with configuration files which are intended to be editable by 
users?

Cheers 

Deri





Re: eqn sqrt and pdf?

2020-03-02 Thread Marc Chantreux
Hello,

> > > you fixed this by seding the download file which doesn't exist in the
> > > debian distro.
> 
> Not so:
> 
>   $ dpkg -L groff | grep download
>   /usr/share/groff/1.22.4/font/devpdf/download

oops… sorry i missed it and thanks for letting me know.

> process.  I hadn't noticed that before.  Do please file a Debian bug
> report.

done!

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952922

thank you so much for taking care.

regards

marc



Re: eqn sqrt and pdf?

2020-03-01 Thread Ralph Corderoy
Hi Deri,

> The "*" just means that the font does not need to be included in the pdf,
> unless the -e flag was given to gropdf, i.e. it is one of the base fonts.

Thanks.  That's not in the gropdf(1) I have here.  It does say `filename
is searched for using the same mechanism that is used for groff font
metric files' and so I thought it might be to do with that and went
searching `info groff | less'.

Using `*' as a prefix clashes a bit with my suggestion of allowing it to
be a glob.  Perhaps if the `download' file is having an overhaul then
its format should change to have more fields, e.g.

foundry  font  path  flags

Where flags can contain an `e' if it's only for embedding all fonts,
and a `*' if path is to be globbed for exactly one match.

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-03-01 Thread Deri
On Sunday, 1 March 2020 18:13:00 GMT Ralph Corderoy wrote:
> Why do some of the filenames in my gropdf's download file start with
> ‘*/usr/share’ rather than the star-less version?


The "*" just means that the font does not need to be included in the pdf, 
unless the -e flag was given to gropdf, i.e. it is one of the base fonts.

Cheers 

Deri





Re: eqn sqrt and pdf?

2020-03-01 Thread Ralph Corderoy
Hi Tadziu,

> Aren't the ghostscript fonts in /usr/share/fonts/type1/gsfonts/ or
> /usr/share/fonts/ghostscript/ (depending on the distribution)
> independent of the ghostscript version?

Here, on Arch Linux, I have

/usr/share/fonts/gsfonts/URWGothic-Book.otf
/usr/share/ghostscript/9.27/Resource/Font/URWGothic-Book

devpdf's download refers to the second.  They have different content.

URWGothic-Book.otf: OpenType font data
URWGothic-Book: PostScript Type 1 font text (URWGothic-Book 1.00)

Why do some of the filenames in my gropdf's download file start with
‘*/usr/share’ rather than the star-less version?

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-03-01 Thread Tadziu Hoffmann


> It would be preferable to make the download file independent
> of the ghostscript version, if possible.

Aren't the ghostscript fonts in /usr/share/fonts/type1/gsfonts/
or  /usr/share/fonts/ghostscript/ (depending on the distribution)
independent of the ghostscript version?





Re: eqn sqrt and pdf?

2020-03-01 Thread Colin Watson
On Sun, Mar 01, 2020 at 12:27:47PM +, Deri wrote:
> The download file is created by the program BuildFoundries which used to be 
> left in the font/devpdf/util directory after install, no longer. Perhaps this 
> ought to be installed in the bin directory during install. If the ghostscript 
> version changes then you could cd into the the font/devpdf directory and run 
> BuildFoundries.

Thanks, but this is unlikely to be a very helpful approach for files
built as part of distribution-managed packages, where the shipped files
are normally expected to be immutable (for example, checksumming the
installed files would fail after doing that kind of thing).

It would be preferable to make the download file independent of the
ghostscript version, if possible.  If that isn't possible, I'll need to
figure out some way to annotate the implied dependency in my packages'
metadata, in order that we can know when we need to rebuild groff.

-- 
Colin Watson   [cjwat...@debian.org]



Re: eqn sqrt and pdf?

2020-03-01 Thread Ralph Corderoy
Hi Colin,

> > > /usr/share/ghostscript/9.27/Resource/Font/StandardSymbolsPS
...
> Apparently the current ghostscript version at build time gets built
> into /usr/share/groff/1.22.4/font/devpdf/download by way of groff's
> build process.
...
> For ongoing purposes, we may want to look at figuring out how to avoid
> encoding the version in font/devpdf/download.

Allow a glob and error if the number of matches is not one?  I'd guess
no current path has glob meta-characters, but if that's thought a risk
then some marker to indicate this entry wants glob expansion would be
needed.

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-03-01 Thread Deri
On Sunday, 1 March 2020 09:36:53 GMT Colin Watson wrote:
> > > * troff should use the current version of ghostscript
> > 
> > I'd guess so.
> > 
> > Debian's groff maintainer, Colin Watson, is a subscriber here, and may
> > pipe up soon.
> 
> Apparently the current ghostscript version at build time gets built into
> /usr/share/groff/1.22.4/font/devpdf/download by way of groff's build
> process.  I hadn't noticed that before.  Do please file a Debian bug
> report.  For stable update purposes, a simple rebuild will suffice.  For
> ongoing purposes, we may want to look at figuring out how to avoid
> encoding the version in font/devpdf/download.

The download file is created by the program BuildFoundries which used to be 
left in the font/devpdf/util directory after install, no longer. Perhaps this 
ought to be installed in the bin directory during install. If the ghostscript 
version changes then you could cd into the the font/devpdf directory and run 
BuildFoundries. One caveat, the program will need tweaking to preserve any 
custom changes made to the download file which have nothing to do with the 
location of the ghostscript or URW fonts.





Re: eqn sqrt and pdf?

2020-03-01 Thread Colin Watson
On Sat, Feb 29, 2020 at 06:41:16PM +, Ralph Corderoy wrote:
> Hi Marc,
> > locate -bei StandardSymbolsPS
> > /usr/share/ghostscript/9.27/Resource/Font/StandardSymbolsPS
> >
> > you fixed this by seding the download file which doesn't exist in the
> > debian distro.

Not so:

  $ dpkg -L groff | grep download
  /usr/share/groff/1.22.4/font/devpdf/download

> > Now i feel this is worth filing 2 bugs on the debian tracker:
> ...
> > * troff should use the current version of ghostscript
> 
> I'd guess so.
> 
> Debian's groff maintainer, Colin Watson, is a subscriber here, and may
> pipe up soon.

Apparently the current ghostscript version at build time gets built into
/usr/share/groff/1.22.4/font/devpdf/download by way of groff's build
process.  I hadn't noticed that before.  Do please file a Debian bug
report.  For stable update purposes, a simple rebuild will suffice.  For
ongoing purposes, we may want to look at figuring out how to avoid
encoding the version in font/devpdf/download.

-- 
Colin Watson   [cjwat...@debian.org]



Re: eqn sqrt and pdf?

2020-02-29 Thread Ralph Corderoy
Hi Marc,

> locate -bei StandardSymbolsPS
> /usr/share/ghostscript/9.27/Resource/Font/StandardSymbolsPS
>
> you fixed this by seding the download file which doesn't exist in the
> debian distro. i can't purge groff as it will uninstall a lot packages
> so what i did is
>
> dpkg-reconfigure -plow groff
> apt reinstall groff
>
> so i worked around:
>
> sudo ln -s /usr/share/ghostscript/9.2{7,6}

Glad you got things sorted.

> Now i feel this is worth filing 2 bugs on the debian tracker:
...
> * troff should use the current version of ghostscript

I'd guess so.

Debian's groff maintainer, Colin Watson, is a subscriber here, and may
pipe up soon.

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-02-28 Thread Marc Chantreux
hello Werner and Deri,

> An alternative to that which compresses even better might be the
> `pdfsizeopt` script.
> 
>   https://github.com/pts/pdfsizeopt

actually the ps2pdf think works as a charm. the final makefile is

math.pdf : math.me
tbl $< |eqn -Tpdf| groff -Tpdf -k -P-e > math
ps2pdf math

as result, i get

4,0K math.me
176K math
8,0K math.pdf

for the moment, 8ko is enough for me to defer dealing with a poorly
packaged python script so i add pdfsizeopt to the todo list.

thank you for your help.

regards
marc



Re: eqn sqrt and pdf?

2020-02-28 Thread Marc Chantreux
hello,

> What distro and version is this, e.g. Ubuntu 18.04.  Is groff from that
> distro, or something you've built?

by experience, sticking on debian stable is the best way to avoid
problems on linux so:

. /etc/os-release && echo $PRETTY_NAME

Debian GNU/Linux 10 (buster)

which groff  |
xargs dpkg -S|
cut -d: -f1  |
xargs dpkg -p|
grep -E '^(Package|Version):'

Package: groff-base
Version: 1.22.2-8

> Note, the Symbol font doesn't have to come from a file called symbol.ttf

i got it as the first fc-match gave me

/usr/share/fonts/truetype/openoffice/opens___.ttf

but i hoped it would "work better" with the "original one".

it actually don't :)

> AIUI so locate(1) might be missing some.

> You could try
> fc-match -af '%{file}\n' Symbol | sed 8q


indeed .. i haven't realize i have so many fonts on my system.

fc-match -af '%{file}\n' Symbol|
grep '\.ttf$'  |
wc -l
489

> Have a look at my recent email on this thread and you'll see I poke
> about /usr/share/groff/1.*/font/devpdf.

grep -wFf <(
printf '%s\n' .EQ 'sqrt a over sqrt c' .EN |
groff -Tpdf -eZ  |
sed -n 's/^C//p' |
sort |
uniq
) /usr/share/groff/1.22.4/font/devpdf/S
radicalex   500,917,0,590   3   96  radicalex
sqrt549,917,38  3   214 radical


> Examine the files `S',
> especially the comments at its start, `download', and `FONT
> INSTALLATION' in gropdf(1).  Consider if re-installing package groff
> would have it examine what Symbol font is availble again.

reading your email, i tried:

troff -Tpdf <<<'\(ra' | gropdf -e | pdffonts -
Failed to open 
'/usr/share/ghostscript/9.26/Resource/Font/StandardSymbolsPS'
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table

and

locate -bei StandardSymbolsPS
/usr/share/ghostscript/9.27/Resource/Font/StandardSymbolsPS

you fixed this by seding the download file which doesn't exist in the
debian distro. i can't purge groff as it will uninstall a lot packages so what i
did is

dpkg-reconfigure -plow groff
apt reinstall groff

so i worked around:

sudo ln -s /usr/share/ghostscript/9.2{7,6}

and now i got

troff -Tpdf <<<'\(ra' | gropdf -e | pdffonts -
name type  encoding emb sub 
uni object ID
 -  --- --- 
--- -
Symbol   Type 1Custom   yes no  
no   5  0

and now the rendering is now ok. Thanks a lot!

Now i feel this is worth filing 2 bugs on the debian tracker:

* /usr/share/fonts/truetype/openoffice/opens___.ttf doesn't render some symbols 
properly
* troff should use the current version of ghostscript

if it's correct, i can fill those bugs and mentionning this thread.

thank you very much!
marc



Re: eqn sqrt and pdf?

2020-02-24 Thread Werner LEMBERG


> After producing the file with -P-e and -Tpdf, if you wish to reduce
> the size of the pdf, use ps2pdf to process the pdf again, this will
> subset the fonts.

An alternative to that which compresses even better might be the
`pdfsizeopt` script.

  https://github.com/pts/pdfsizeopt


Werner



Re: eqn sqrt and pdf?

2020-02-24 Thread Ralph Corderoy
Hi Piotr,

> Now the question, what if we compile with pdfroff ...?  It does not
> support -e option and does not embed Symbol into PDF. Since pdfroff is
> devps-based and internally must be using the ps2pdf

It uses GhostScript's gs(1) to do ps2pdf(1)'s task, yes.

$ grep -nw gs /usr/bin/pdfroff
555:for prog in gs gswin32c gsos2
$

> it may be a matter of inernal tuning of ps2pdf command to make it
> embed all fonts.

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-02-24 Thread Ralph Corderoy
Hi Marc,

>  fc-match -f '%{file}\n' Symbol
>  /usr/share/fonts/truetype/openoffice/opens___.ttf

What distro and version is this, e.g. Ubuntu 18.04.  Is groff from that
distro, or something you've built?

> locate symbol.ttf
> /usr/share/wine/fonts/symbol.ttf

Note, the Symbol font doesn't have to come from a file called symbol.ttf
AIUI so locate(1) might be missing some.

You could try

fc-match -af '%{file}\n' Symbol | sed 8q

and see if any alternatives look interesting.

> cp /usr/share/wine/fonts/symbol.ttf ~/.local/share/fonts
> fc-list|grep symbol
> /home/mc/.local/share/fonts/symbol.ttf: Symbol:style=Regular
>
> and now the problem is different: the higher bar of the sqrt symbol
> is now up to the symbol itself. not the numeric part.

Which sounds like the Symbol font's metrics don't match where it's
drawing because you're pulling in two different Symbol fonts.

Have a look at my recent email on this thread and you'll see I poke
about /usr/share/groff/1.*/font/devpdf.  Examine the files `S',
especially the comments at its start, `download', and `FONT
INSTALLATION' in gropdf(1).  Consider if re-installing package groff
would have it examine what Symbol font is availble again.

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-02-24 Thread Piotr Piatrou
Ranph,

I confirm: in Ubuntu 18.04 and 16.04 the path to Symbol font in 
/devpdf/download is wrong. The path fix indeed results in embedding all fonts 
in case of compilation as

groff -Tpdf -P-e ...

Now the question, what if we compile with pdfroff ...?
It does not support -e option and does not embed Symbol into PDF. Since pdfroff 
is devps-based and internally must be using the ps2pdf, it may be a matter of 
inernal tuning of ps2pdf command to make it embed all fonts.

Piotr

On Mon, 24 Feb 2020 15:46:00 +
Ralph Corderoy  wrote:

> Hi Piotr,
> 
> > A potential problem with GROFF/ghostscript is that it DOES NOT embed
> > the Symbol font even with the -P-e option. I wish the developers could
> > check this.
> 
> groff 1.22.4-1 on Arch Linux.  I tried -e and found groff could no
> longer find the Symbol font to embed.  Investigation showed the fix and
> I now think it does.
> 
> $ troff -Tpdf <<<'\(ra' | gropdf | pdffonts -
> name type  encoding emb sub uni object ID
>  -  --- --- --- -
> Symbol   Type 1Custom   no  no  no   5  0
> $
> $ troff -Tpdf <<<'\(ra' | gropdf -e | pdffonts -
> Failed to open 
> '/usr/share/ghostscript/9.26/Resource/Font/StandardSymbolsPS'
> Syntax Error: Couldn't find trailer dictionary
> Syntax Error: Couldn't find trailer dictionary
> Syntax Error: Couldn't read xref table
> $
> $ pkgfile -v StandardSymbolsPS
> extra/ghostscript 9.27-2
> /usr/share/ghostscript/9.27/Resource/Font/StandardSymbolsPS
> $  $
> $ cd /usr/share/groff/1.22.4/font/devpdf
> $ grep Symbol download
>   Symbol  */usr/share/ghostscript/9.26/Resource/Font/StandardSymbolsPS
> $ sudo sed -i 's,ghostscript/9.26,ghostscript/9.27,' download
> $
> $ troff -Tpdf <<<'\(ra' | gropdf -e | pdffonts -
> name type  encoding emb sub uni object ID
>  -  --- --- --- -
> Symbol   Type 1Custom   yes no  no   5  0
> $
> 
> -- 
> Cheers, Ralph.


-- 
С уважением,
Пётр Петров
Piotr Piatrou  +375 291656636
Институт Физики, Национальная Академия Наук Беларуси



Re: eqn sqrt and pdf?

2020-02-24 Thread Deri
On Monday, 24 February 2020 14:21:26 GMT Marc Chantreux wrote:
> hello,
> 
> > The symbol font is one of the base type 1 fonts which all pdf viewers
> > should support, so the font is not actually embedded in the pdf. You
> > could try adding "- P-e" to the groff command.
> 
> Even if Tadziu told us this is the current recommendation (embed
> everything), i really can't subscribe: it's 24k more per file. so i'll
> keep on trying to fix the readers (and help the others to do so
> eventually).
> 
> regards
> marc


After producing the file with -P-e and -Tpdf, if you wish to reduce the size 
of the pdf, use ps2pdf to process the pdf again, this will subset the fonts.





Re: eqn sqrt and pdf?

2020-02-24 Thread Ralph Corderoy
Hi Piotr,

> A potential problem with GROFF/ghostscript is that it DOES NOT embed
> the Symbol font even with the -P-e option. I wish the developers could
> check this.

groff 1.22.4-1 on Arch Linux.  I tried -e and found groff could no
longer find the Symbol font to embed.  Investigation showed the fix and
I now think it does.

$ troff -Tpdf <<<'\(ra' | gropdf | pdffonts -
name type  encoding emb sub uni object ID
 -  --- --- --- -
Symbol   Type 1Custom   no  no  no   5  0
$
$ troff -Tpdf <<<'\(ra' | gropdf -e | pdffonts -
Failed to open '/usr/share/ghostscript/9.26/Resource/Font/StandardSymbolsPS'
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table
$
$ pkgfile -v StandardSymbolsPS
extra/ghostscript 9.27-2
/usr/share/ghostscript/9.27/Resource/Font/StandardSymbolsPS
$ 

Re: eqn sqrt and pdf?

2020-02-24 Thread Piotr Piatrou
People,

I have the same problem after having upgraded to Ubuntu 18.04. This is entirely 
the viewer's issue: Evince, Zathura somehow lost the Symbol font, whereas Mupdf 
and gv still show everything correctly. So my solution was to switch from the 
standard Evince to Mupdf.

A potential problem with GROFF/ghostscript is that it DOES NOT embed the Symbol 
font even with the -P-e option. I wish the developers could check this.

Another peculiar font problem with GROFF on Ubuntu 18.04: the unicode U-fonts 
disappeared from the devpdf folder though they still exist in the GROFF's 
source code. So, to get back my Cyrillic I had to compile GROFF from the source 
only to pick the U-fonts and put them back to devpdf.

Piotr Piatrou

On Mon, 24 Feb 2020 15:21:26 +0100
Marc Chantreux  wrote:

> hello,
> 
> > The symbol font is one of the base type 1 fonts which all pdf viewers should
> > support, so the font is not actually embedded in the pdf. You could try 
> > adding "-
> > P-e" to the groff command.
> 
> Even if Tadziu told us this is the current recommendation (embed
> everything), i really can't subscribe: it's 24k more per file. so i'll
> keep on trying to fix the readers (and help the others to do so
> eventually).
> 
> regards
> marc
> 
> 


-- 
С уважением,
Пётр Петров
Piotr Piatrou  +375 291656636
Институт Физики, Национальная Академия Наук Беларуси



Re: eqn sqrt and pdf?

2020-02-24 Thread Marc Chantreux
hello,

> The symbol font is one of the base type 1 fonts which all pdf viewers should
> support, so the font is not actually embedded in the pdf. You could try 
> adding "-
> P-e" to the groff command.

Even if Tadziu told us this is the current recommendation (embed
everything), i really can't subscribe: it's 24k more per file. so i'll
keep on trying to fix the readers (and help the others to do so
eventually).

regards
marc





Re: eqn sqrt and pdf?

2020-02-24 Thread Marc Chantreux
> They both probably use a central font service.  On this Arch Linux
> machine, I get
> 
> $ fc-match -f '%{file}\n' Symbol

 fc-match -f '%{file}\n' Symbol
 /usr/share/fonts/truetype/openoffice/opens___.ttf

 dpkg -S /usr/share/fonts/truetype/openoffice/opens___.ttf
 fonts-opensymbol: /usr/share/fonts/truetype/openoffice/opens___.ttf

 LANG= apt show fonts-opensymbol| sed -n '/^Desc/,$p'
Description: OpenSymbol TrueType font
 This package contains the OpenSymbol TrueType font included in
 LibreOffice. This font contains symbols (like fonts as Wingdings(tm)),
 bullets (needed for bullets in LibreOffice) and non-latin character

it's unclear if opensymbol expect to be a drop-in replacement for
symbol.ttf but i guess debian people would be happy to be informed.

also:

locate symbol.ttf
/usr/share/wine/fonts/symbol.ttf
xdg-open /usr/share/wine/fonts/symbol.ttf
dpkg -S /usr/share/wine/fonts/symbol.ttf
fonts-wine: /usr/share/wine/fonts/symbol.ttf

so:

cp /usr/share/wine/fonts/symbol.ttf ~/.local/share/fonts
fc-list|grep symbol
/home/mc/.local/share/fonts/symbol.ttf: Symbol:style=Regular

and now the problem is different: the higher bar of the sqrt symbol
is now up to the symbol itself. not the numeric part.

thanks for helping.
regards
marc



Re: eqn sqrt and pdf?

2020-02-23 Thread Tadziu Hoffmann


> > yet: i'm not sure about what to be fixed.

You can also install an old version of Acrobat reader.
acroread 3 (you can find the rpm online) comes with the
original base 13 fonts (plus Zapf Dingbats), and you can
make fontconfig (assuming that's what zathura and evince
use) find those as well, in order to display PDFs that
do not embed the base 13 fonts.

Alternatively, try mupdf, which comes with the URW fonts
(the same as those provided with ghostscript), which are
compatible with the base 13 fonts (and although they have
different names, mupdf and ghostscript have builtin tables
to indicate which font replaces which).

Under Linux, you can also install acroread 9.5, which still
does the best PDF rendering.  (But instead of Helvetica it
comes with Arial, which doesn't look as nice.  You can,
however, merge the resources from acroread 3.)





Re: eqn sqrt and pdf?

2020-02-22 Thread Ralph Corderoy
Hi Marc,

> i tried both with zatura and evince

They both probably use a central font service.  On this Arch Linux
machine, I get

$ fc-match -f '%{file}\n' Symbol
/usr/share/fonts/TTF/symbol.ttf
$ pacman -Qo /usr/share/fonts/TTF/symbol.ttf
/usr/share/fonts/TTF/symbol.ttf is owned by windows-fonts 10.1709-1

Use your package manager, or an accompanying web page, to find packages
that contain a filename that might be the Symbol font?

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-02-21 Thread Tadziu Hoffmann



> i didn't know gv can render pdf files and it happens it's
> the only one to render math.pdf the file correctly.

gv uses ghostscript (gs) to render the pages, and ghostscript
provides its own fonts.

> pdffonts math.pdf
> shows that Symbol is not emb. i thought fonts were always
> embeded in pdf files...

Nowadays even Adobe recommends that _all_ fonts be embedded,
but when PDF was first designed, it was expected that every
PDF renderer provide the so-called "base 13" fonts (Times,
Helvetica, and Courier in the usual four variants each,
plus Symbol), so these were not required to be embedded.

> yet: i'm not sure about what to be fixed.

Register all fonts you're using in the "download"
files in devps and devpdf (usually
/usr/share/groff/current/font/dev{ps,pdf}/download).

grops (devps) is okay with

Symbol path/to/Symbol.pfa

but gropdf (devpdf) requires tabs as field separators
(see the gropdf manual page):

Symbolpath/to/Symbol.pfa

where  is an actual tab character.

Replace path/to/Symbol.pfa with the path to the actual
Symbol font on your system.

grops wants .pfa files (which you can create from .pfb files
using pfbtops) and requires _relative_ paths, but for gropdf
the following also appears to work:

Symbol/usr/share/ghostscript/fonts/s05l.pfb

despite that font actually being called "StandardSymL" and
not "Symbol".  (Whether this may cause inconsistencies
later on if you mix it with documents using Adobe's
"Symbol" font I do not know.)





Re: eqn sqrt and pdf?

2020-02-21 Thread Marc Chantreux
John and Deri,

> > What program are you using to preview the PDF?

evince, zathura ... and now gv thanks to Tadziu.

> The symbol font is one of the base type 1 fonts which all pdf viewers should 
> support, so the font is not actually embedded in the pdf.

ok. so i have to fix my readers :)

thanks.

regards
marc



Re: eqn sqrt and pdf?

2020-02-21 Thread Marc Chantreux
hello Tadziu,

> What viewer are you using?

i tried both with zatura and evince

> Does the PDF render okay if you use gv to display it?

i didn't know gv can render pdf files and it happens it's the only one
to render math.pdf the file correctly.

pdffonts math.pdf

name  typeencoding  emb sub uni object ID
- --- - --- --- --- -
SymbolType 1  Customno  no  no   5  0
Times-Italic  Type 1  Customno  no  yes  8  0

shows that Symbol is not emb. i thought fonts were always embeded in pdf
files...

yet: i'm not sure about what to be fixed.

thanks and regards
marc





Re: eqn sqrt and pdf?

2020-02-21 Thread Deri
On Friday, 21 February 2020 15:26:50 GMT John Gardner wrote:
> I can confirm the PDF you've produced is correctly-formed; so this narrows
> the problem down to a missing font (or misconfigured environment).
> 
> What program are you using to preview the PDF?

Marc,

The symbol font is one of the base type 1 fonts which all pdf viewers should 
support, so the font is not actually embedded in the pdf. You could try adding 
"-
P-e" to the groff command. This will embed the symbol font in the pdf, so even 
if the pdf viewer can't find its own symbol font it will use the font which is 
embedded.


Re: eqn sqrt and pdf?

2020-02-21 Thread John Gardner
>
> symbol font is here as i read

 [output clipped]


I can confirm the PDF you've produced is correctly-formed; so this narrows
the problem down to a missing font (or misconfigured environment).

What program are you using to preview the PDF?

On Sat, 22 Feb 2020 at 01:52, Marc Chantreux  wrote:

> hello John and thanks for helping,
>
> On Fri, Feb 21, 2020 at 08:47:18PM +1100, John Gardner wrote:
> > Even without seeing the PDF output, I'd say you have one or more fonts
> > missing from your installation path. Do you have GhostScript installed?
>
> $ aptitude search '~i ~n ghostscript' -F%p%v
> ghostscript9.27~dfsg-2+deb10u3
>
> > Also, you can debug formatted output by calling groff with its -Z switch.
> > You should see something like this
>
> symbol font is here as i read
>
> $ grep -H . math.me && eqn -Tpdf math.me |groff -Z -k -Tpdf
>
> math.me:.EQ
> math.me:sqrt a over sqrt c
> math.me:.EN
> math.me:.\" 1 + x + x sup 2 over 2 + x sup 3 over { 2 * 3 } ;
> math.me:.\" a hat over c tilde ; bold a over bold c ;
> x T pdf
> x res 72000 1 1
> x init
> x F -
> x F /usr/share/groff/1.22.4/tmac/eqnrc
> x F math.me
> p1
> V18788
> H72000
> DFd
> x font 11 S
> f11
> s1
> h1200
> V13070
> md
> Csqrt
> Cradicalex
> h590
> Cradicalex
> x font 38 TI
> f38
> h5230
> V11788
> ta
> f11
> H73495
> v15370
> Csqrt
> Cradicalex
> f38
> h5715
> V25876
> tc
> H73200
> V16188
> Dl 5000 0
> H74280
> Dl 5000 0
> Dl 5000 0
> h1200
> v2600
> n18788 5250
> x trailer
> V792000
> x stop
>
>
> > None that I know of, though it probably wouldn't be too difficult to
> smash
> > together a Perl script to preprocess TeX equations. I'd be interested in
> > knowing if any such preprocessor already exists, however.
>
> I found this:
>
> https://dlmf.nist.gov/LaTeXML/
>
> which led me to this:
>
>
> https://github.com/brucemiller/LaTeXML/blob/master/lib/LaTeXML/MathGrammar
>
> i'll look at it later.
>
> regards
> marc
>
>
>


Re: eqn sqrt and pdf?

2020-02-21 Thread Marc Chantreux
hello John and thanks for helping,

On Fri, Feb 21, 2020 at 08:47:18PM +1100, John Gardner wrote:
> Even without seeing the PDF output, I'd say you have one or more fonts
> missing from your installation path. Do you have GhostScript installed?

$ aptitude search '~i ~n ghostscript' -F%p%v
ghostscript9.27~dfsg-2+deb10u3

> Also, you can debug formatted output by calling groff with its -Z switch.
> You should see something like this

symbol font is here as i read

$ grep -H . math.me && eqn -Tpdf math.me |groff -Z -k -Tpdf

math.me:.EQ
math.me:sqrt a over sqrt c
math.me:.EN
math.me:.\" 1 + x + x sup 2 over 2 + x sup 3 over { 2 * 3 } ;
math.me:.\" a hat over c tilde ; bold a over bold c ;
x T pdf
x res 72000 1 1
x init
x F -
x F /usr/share/groff/1.22.4/tmac/eqnrc
x F math.me
p1
V18788
H72000
DFd
x font 11 S
f11
s1
h1200
V13070
md
Csqrt
Cradicalex
h590
Cradicalex
x font 38 TI
f38
h5230
V11788
ta
f11
H73495
v15370
Csqrt
Cradicalex
f38
h5715
V25876
tc
H73200
V16188
Dl 5000 0
H74280
Dl 5000 0
Dl 5000 0
h1200
v2600
n18788 5250
x trailer
V792000
x stop


> None that I know of, though it probably wouldn't be too difficult to smash
> together a Perl script to preprocess TeX equations. I'd be interested in
> knowing if any such preprocessor already exists, however.

I found this:

https://dlmf.nist.gov/LaTeXML/

which led me to this:

https://github.com/brucemiller/LaTeXML/blob/master/lib/LaTeXML/MathGrammar

i'll look at it later.

regards
marc





Re: eqn sqrt and pdf?

2020-02-21 Thread Tadziu Hoffmann



> (I do notice the bar above the c ends before the bar
> over the a.)

That is probably because in most italic fonts the "a" is
slightly wider than the "c".  If I use Courier-Oblique on
my system, the situation is reversed, because although both
characters have the same nominal width, the "c" has a larger
italic correction than the "a".


By the way, if you like your fraction bar to extend a bit
beyond the numerator and denominator, you can

  set over_hang 10

within EQ/EN.





Re: eqn sqrt and pdf?

2020-02-21 Thread Tadziu Hoffmann



> eqn |groff ; ps2pdf14
> 
> the ps rendering is fine but the pdf one got the same issue.

If the Postscript renders fine, your problem may be with the
PS to PDF conversion or with your PDF viewer.  What viewer
are you using?  Does the PDF render okay if you use gv
(or gsview on Windows) to display it?

Check if the output of

  pdffonts 

(from the poppler-tools package) contains a line similar to

  name   type encoding  emb sub uni  object  ID
  -
  TPTBSA+Symbol  Type 1C  Customyes yes no   10  0

(where the first six characters of the font name are random).





Re: eqn sqrt and pdf?

2020-02-21 Thread Ralph Corderoy
Hi Marc,

> I try to get a correct rendering for this simple eqn
>
> .EQ
> sqrt a over sqrt c
> .EN

With groff 1.22.4-1 and ghostscript 9.27-1 on Arch Linux, I ran

printf '%s\n' .EQ 'sqrt a over sqrt c' .EN |
groff -Tpdf -e >eq.pdf
printf '%s\n' .EQ 'sqrt a over sqrt c' .EN |
groff -Tps -e >eq.ps
ps2pdf eq.ps eq.ps.pdf

All three outputs looks similar and correct.  (I do notice the bar above
the c ends before the bar over the a.)

> first i tried
>
> eqn -Tpdf|groff -Tpdf
>
> and noticed that the begin of the square root symbol is replaced by a
> rectangle that goes down to the bottom of the symbol.

Sounds like a PDF font problem.

> also i tried
>
> eqn |groff ; ps2pdf14
>
> the ps rendering is fine but the pdf one got the same issue.

Again, PDF font.

Passing -Z to groff has it print the ditroff instead of using the given
typesetting backend.

printf '%s\n' .EQ 'sqrt a over sqrt c' .EN |
groff -Tpdf -eZ

I see, adding line numbers,

 4  x F /usr/share/groff/1.22.4/tmac/eqnrc
10  x font 11 S
16  Csqrt
17  Cradicalex
19  Cradicalex
20  x font 38 TI
24  ta
28  Csqrt
29  Cradicalex
33  tc

Their definitions here in -Tpdf's S font.

$ egrep 'sqrt|radicalex' /usr/share/groff/1.22.4/font/devpdf/S
radicalex   500,917,0,590   3   96  radicalex
sqrt549,917,38  3   214 radical
$ 

What OS and distro are you on?  groff version?  Is your document more
complex and you're altering the font?

(Please reply to the list.)

-- 
Cheers, Ralph.



Re: eqn sqrt and pdf?

2020-02-21 Thread John Gardner
Hi Marc,

Even without seeing the PDF output, I'd say you have one or more fonts
missing from your installation path. Do you have GhostScript installed?

Also, you can debug formatted output by calling groff with its -Z switch.
You should see something like this:

$ eqn -Tpdf | groff -Tpdf -Z
x T pdf
x res 72000 1 1
x init
x F /usr/local/share/groff/1.22.4/tmac/eqnrc
x F -
p1
V18788
H72000
DFd
x font 11 S
f11
s1
…


If you don't see a line that looks like `x font 11 S` (referring to the
"Symbol" font that contains special characters like square-root symbols),
then it's more than a simple font-installation issue.

also: i think the TeX math syntax is much more pleasant than the eqn one.
> is there a performance/simplicity reason to that?


Possibly the latter; eqn(1) predates TeX by several years, so if history
had've been different, maybe eqn would've been modelled off a subset of TeX
syntax instead. (Though I'm no fan of TeX, I do agree that its equations
are much nicer to read and write than eqn markup. It's literally the only
thing I like about the TeX system).

is there something like a tex2eqn so i can maintain tex equations instead
> of eqn ones?


None that I know of, though it probably wouldn't be too difficult to smash
together a Perl script to preprocess TeX equations. I'd be interested in
knowing if any such preprocessor already exists, however.

On Fri, 21 Feb 2020 at 19:46, Marc Chantreux  wrote:

> hello people,
>
> I try to get a correct rendering for this simple eqn
>
> .EQ
> sqrt a over sqrt c
> .EN
>
> first i tried
>
> eqn -Tpdf|groff -Tpdf
>
> and noticed that the begin of the square root symbol is replaced by a
> rectangle that goes down to the bottom of the symbol.
>
> also i tried
>
> eqn |groff ; ps2pdf14
>
> the ps rendering is fine but the pdf one got the same issue.
>
> for the moment i have a very limited knowledge about troff, ps and pdf.
> can someone please help me?
>
> also: i think the TeX math syntax is much more pleasant than the eqn
> one. is there a performance/simplicity reason to that? if not so:
> is there something like a tex2eqn so i can maintain tex equations
> instead of eqn ones?
>
> regards,
> marc
>
>