Re: Query for unknown font with spacing=mono returns sans-serif font

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

 



Speaking of your example, the problem there is RFont3 isn't a known
font for your system and fontconfig doesn't also know what it is and
what the generic family they are.  if RFont3 is the monospaced font,
the proper fix here would be to have a config file like:

<alias>
  <family>RFont3</family>
  <default><family>monospace</family></default>
</alias>

Or do they have different spacing with one family name?

On Tue, Nov 9, 2021 at 9:12 PM Christian Weiske <cweiske@xxxxxxxxxx> wrote:
>
> Hello,
>
>
> Could someone please have a look at this problem?
>
>
> Am Sat, 16 Oct 2021 22:02:58 +0200
> schrieb Christian Weiske <cweiske@xxxxxxxxxx>:
>
> > Hello,
> >
> >
> > Some PDFs use monspaced fonts but do not embed them. The german bank
> > "Volksbank" is one of those (they use "RFont0" up to "RFont8", and
> > their meaning is different from file to file, i.e. RFont3 may be
> > monospaced in one file, but normal spaced in the next. So no hard
> > mapping possible here).
> >
> > poppler queries fontconfig, by setting the name
> > and the spacing=mono flag.
> > (https://gitlab.freedesktop.org/poppler/poppler/-/issues/1152)
> > Unfortunately, fontconfig returns the default sans-serif font (On
> > Debian unstable and Ubuntu 20.04):
> >
> > > $ fc-match RFont3:spacing=mono
> > > DejaVuSans.ttf: "DejaVu Sans" "Book"
> >
> >
> > Shouldn't fontconfig return a monospaced font if an unknown font name
> > is requested and the mono spacing flag is set?
> >
> > I managed to fix that with the following user configuration:
> > ----
> > <?xml version='1.0'?>
> > <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> > <fontconfig>
> >     <match target="pattern">
> >      <test name="spacing">
> >       <int>100</int>
> >      </test>
> >      <edit name="family" mode="prepend">
> >       <string>monospace</string>
> >      </edit>
> >     </match>
> > </fontconfig>
> > ----
> >
> > > $ fc-match RFont3:spacing=mono
> > > DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
> >
> > But I think that I should not need to do that manually.
> >
> >
> > There is an issue about "CourierStd" which was solved by adding an
> > alias from CourierStd to Courier, but which also would be solved by
> > respecting the monospace flag as shown above.
> > (https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/262)
> >
> >
> > Should I open a bug report?
> > If yes, on https://gitlab.freedesktop.org/fontconfig/fontconfig/
> > or is this more a distribution problem, and I should report this to
> > Debian?
> >
>
>
> --
> Regards/Mit freundlichen Grüßen
> Christian Weiske
>
> -=≡ Geeking around in the name of science since 1982 ≡=-



-- 
Akira TAGOH




[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux