groff
[Top][All Lists]
Advanced

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

Re: build system: devpdf/download regression


From: Deri
Subject: Re: build system: devpdf/download regression
Date: Wed, 22 Jun 2022 21:30:25 +0100

On Wednesday, 22 June 2022 14:48:24 BST Ingo Schwarze wrote:
> Hello Deri,
> 
> Deri wrote on Wed, Jun 22, 2022 at 01:07:34AM +0100:
> > I've tracked down the problem. The configure flag --with-urw-fonts-dir
> > was not being used when searching for fonts for the default foundry,
> > just when searching for the U foundry. This is why the U- fonts were
> > correctly populated but some of the default fonts errored. The ones
> > which errored were the ones which were not part of the pdf base fonts,
> > i.e. you can't use them without the font being included in the pdf.
> > 
> > I have also included /usr/local/share/fonts/ghostscript as one of the
> > static paths to search. As I discover different places that systems
> > place the fonts I add them to the list.
> 
> Thanks for investigating and improving all that!
> 
> At http://schwarze.bsd.lv/tmp/urw/ , i've added some new files
> built from the latest git including your improvements (as well as
> some unrelated ones that Branden committed in the meantime):
> 
> http://schwarze.bsd.lv/tmp/urw/git_build/3_build_220622_d55157d3.txt
> http://schwarze.bsd.lv/tmp/urw/git_build/3_build_220622_d55157d3_diff.txt
> 
> Several warnings have gone away, and several additional font
> descriptions appear to be built now (AB, ABI, AI, ...).
> 
> http://schwarze.bsd.lv/tmp/urw/ports_build/4_build_220622_d55157d3.txt
> http://schwarze.bsd.lv/tmp/urw/ports_build/4_build_220622_d55157d3_diff.txt
> http://schwarze.bsd.lv/tmp/urw/ports_build/6_PLIST_diff.txt

Hi Ingo,

The git build now looks Ok.

> I think one issue remains.  When building from git, i do get the U-*
> font description files.  But when building from a tarball using the
> ports framework, i still don't: only A*, B*, H*, N*, P*; and Z*
> descriptions appear now in addition to those i got beforem but no U-*.

I think I have sussed what might be happening. In the port build the standard 
fonts get built because of the addition of /usr/local/share/fonts/ghostscript 
to the Foundry file yesterday. None of the U fonts get built because this make 
rule deletes half the foundry file before BuildFoundries is run:-

font/devpdf/Foundry: $(devpdf_srcdir)/Foundry.in
        $(AM_V_at)$(MKDIR_P) $(top_builddir)/font/devpdf/
if HAVE_URW_FONTS
        $(AM_V_GEN)sed "s|[@]urwfontsdir[@]|$(urwfontsdir)|" \
          $(devpdf_srcdir)/Foundry.in >$@
else
        $(AM_V_GEN)sed "/BEGIN URW/,/END URW/d" \
          $(devpdf_srcdir)/Foundry.in >$@
endif

So if HAVE_URW_FONTS is not set when configure is run the U- fonts will not be 
created. When configure is run the part which is meant to check for the 
presence of the URW fonts, starts with:-

  groff_have_urw_fonts=no
  if test "$AWK" != missing && test "$GHOSTSCRIPT" != missing
  then

So it does not even do the tests if ghostscript is set to missing, which I 
believe is the case with the port version. So even if you supply the URW fonts 
directory to configure this directory is not tested and HAVE_URW_FONTS remains 
false. If ghostscript is missing it should just not run gs -h as part of 
collecting paths to search, but still do the search on the remaining paths.

> Those files below http://schwarze.bsd.lv/tmp/urw/
> of which i did not upload new versions did not change.
> 
> > So you shouldn't need the --with-urw-fonts-dir flag any more.
> 
> To make things work without --with-urw-fonts-dir, i need the
> additional patch shown below.  Otherwise, ./configure won't
> find them, and BuildFoundries comes too late to fix that.
> Do you think i should commit and push that additional patch?

I think the tests for awk and ghostscript need to just apply to the line which 
uses those programs, not the whole section, but the patch is good.

> It's hardly ideal to have this path written out verbatim at two
> independent places: we just experienced how it *will* get out of
> sync.  But let's improve one thing at a time.

I did add a --check flag to the BuildFoundries program, which checked for all 
the required fonts and returned an exit status, but I hadn't really thought it 
through, a bit of chicken and egg situation! I suspect a new file containing 
possible paths which BuildFoundries accesses, or the configure test pulls the 
paths from Foundry.in rather than having them hard coded.

> > Please let me know if this fixes the problem. I noticed that you have
> > ghostscript 9.55 on your system, please could you do:-
> > 
> > ls /usr/local/share/ghostscript/9.55.0/Resource/Init /usr/local/share/
> > ghostscript/9.55.0/lib /usr/local/share/ghostscript/9.55.0/Resource/Font
> > /usr/ local/share/ghostscript/fonts /usr/local/share/fonts.
> > 
> > And send me the results. Sometimes they subtly change the names of the
> > fonts which ghostscript uses and I have to add the alternative names. If
> > you can't find the fonts it can mean they have baked the fonts in what
> > they call %rom% so they are not available as real files.
> 
> http://schwarze.bsd.lv/tmp/urw/ls_out.txt
> http://schwarze.bsd.lv/tmp/urw/pkg_info_out.txt

Since the fonts don't appear in any of the directories yielded by "gs -h" 
means that the person porting ghostscript for your system decided to use the 
option to have the fonts embedded in the gs executable (%rom%) rather than as 
separate font files. I'm not sure if there is much advantage with modern 
hardware. Here's a chap asking where the font files have gone:-

https://stackoverflow.com/questions/38331893/ghostscript-fonts-folder-removed-from-later-versions

Cheers 

Deri

> Paths containing "Resource/Init" or "Resource/Font" don't appear to exist
> anywhere on my system.  Paths containing "Resource/Init" don't even
> exist anywhere in the OpenBSD ports tree, and "Resource/Font" only
> in the following place, but that seems unrelated to me:
> 
>   package: p5-PDF-API2-2.043
>   pkgpath: textproc/p5-PDF-API2
>   content: /usr/local/libdata/perl5/site_perl/PDF/API2/Resource/Font
> 
> Yours,
>   Ingo
> 
> 
> diff --git a/m4/groff.m4 b/m4/groff.m4
> index 8740ce10c..6f43f956e 100644
> --- a/m4/groff.m4
> +++ b/m4/groff.m4
> @@ -288,10 +288,8 @@ AC_DEFUN([GROFF_URW_FONTS_PATH], [
>  ])
> 
>  # Check availability of URW fonts in the search path given by 'gs -h'
> -# supplemented with
> -# /usr/share/fonts/type1/gsfonts/:/opt/local/share/fonts/urw-fonts
> -# (where font/devpdf/Foundry.in expects them), or in the custom
> -# directory passed to 'configure'.
> +# supplemented with the paths where font/devpdf/Foundry.in expects them,
> +# or in the custom directory passed to 'configure'.
> 
>  AC_DEFUN([GROFF_URW_FONTS_CHECK], [
>    AC_REQUIRE([GROFF_AWK_PATH])
> @@ -301,8 +299,13 @@ AC_DEFUN([GROFF_URW_FONTS_CHECK], [
>    then
>      AC_MSG_CHECKING([for URW fonts in Type 1/PFB format])
>      _list_paths=`$GHOSTSCRIPT -h | $AWK 'BEGIN { found = 0 } /Search path:/
> { found = 1 } /^[ ]*\// { print $'0' }'| tr : ' '` -   
> _list_paths="$_list_paths /usr/share/fonts/type1/gsfonts/ \
> -      /opt/local/share/fonts/urw-fonts/"
> +    _list_paths="$_list_paths \
> +      /usr/share/fonts/type1/gsfonts/ \
> +      /usr/share/fonts/default/Type1/ \
> +      /usr/share/fonts/default/Type1/adobestd35/ \
> +      /usr/share/fonts/type1/urw-base35/ \
> +      /opt/local/share/fonts/urw-fonts/ \
> +      /usr/local/share/fonts/ghostscript/"
>      if test -n "$urwfontsdir"
>      then
>        _list_paths="$ _list_paths $urwfontsdir"







reply via email to

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