Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Gavin Simpson-3
Dear list

On Fedora 31 the pango library has recently updated to version >= 1.44
and in doing so has switched to using the HarfBuzz library (from
FreeType) and dropped Adobe Type 1 font support. This causes problems
with plotmath as all bar one of the glyphs doesn't render (see
attached PNG image if it makes it through the list filters - if not I
have shared a copy via my google drive:
https://drive.google.com/file/d/1llFqKHD7LFKzQbVuq6sibY1UizRn7xxS/view?usp=sharing
)

I'm not the only person who has come across this, e.g.
https://stackoverflow.com/q/60656445/429846 and the resulting reported
bug on the RedHat Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1815128

Beyond switching to  `type = 'Xlib'`, has anyone worked around this
issue on a Fedora 31 or later system?

Thanks in advance

Gavin

--
Gavin Simpson, PhD

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

plotmath-issue.png (29K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Iñaki Ucar
On Wed, 25 Mar 2020 at 01:14, Gavin Simpson <[hidden email]> wrote:

>
> Dear list
>
> On Fedora 31 the pango library has recently updated to version >= 1.44
> and in doing so has switched to using the HarfBuzz library (from
> FreeType) and dropped Adobe Type 1 font support. This causes problems
> with plotmath as all bar one of the glyphs doesn't render (see
> attached PNG image if it makes it through the list filters - if not I
> have shared a copy via my google drive:
> https://drive.google.com/file/d/1llFqKHD7LFKzQbVuq6sibY1UizRn7xxS/view?usp=sharing
> )
>
> I'm not the only person who has come across this, e.g.
> https://stackoverflow.com/q/60656445/429846 and the resulting reported
> bug on the RedHat Bugzilla:
> https://bugzilla.redhat.com/show_bug.cgi?id=1815128
>
> Beyond switching to  `type = 'Xlib'`, has anyone worked around this
> issue on a Fedora 31 or later system?

Adding [hidden email] to CC. A workaround is to avoid using PS fonts
for symbols. If you run the following, you'll see

$ fc-match Symbol
StandardSymbolsPS.t1: "Standard Symbols PS" "Regular"

So let's change this. Install a TTF symbol font, such as Symbola:

$ sudo dnf install gdouros-symbola-fonts

Then add the following to /etc/fonts/local.conf (system-wide) or
~/.fonts.conf (just for your user):

<fontconfig>
<match target="pattern">
 <test name="family"><string>Symbol</string></test>
 <edit name="family" mode="prepend" binding="same">
   <string>Symbola</string>
 </edit>
</match>
</fontconfig>

Now you should see this:

$ fc-match Symbol
Symbola.ttf: "Symbola" "Regular"

and symbols should render correctly.

Iñaki

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

R devel mailing list
Le mercredi 25 mars 2020 à 11:28 +0100, Iñaki Ucar a écrit :
> On Wed, 25 Mar 2020 at 01:14, Gavin Simpson <[hidden email]>
> wrote:

Hi,

> Adding [hidden email] to CC. A workaround is to avoid using PS
> fonts for symbols.

PS fonts are dead mid-term everywhere, and already forbidden in new
Fedora font packages (because we are somewhat leading edge, but not as
much as people think)
https://docs.fedoraproject.org/en-US//packaging-guidelines/FontsPolicy/#_font_file_formats

PS font users need to switch to OpenType fonts or work with their
prefered font upstream to convert in modern well supported formats
(font format wars have endend last millenium, even before the browser
wars ended, it’s long past time to deprecate the losers).

That’s normal IT format obsolescence.


That being said, that’s not what is happening here.

R brought this all on itself by hardcoding a Windows-only “Symbol” font
family name in its default conf. Linux systems are UTF-8 by default for
~20 years now, they don’t need the forcing of magic font families to
handle symbols not present in the 8-bit legacy Windows encodings.

The actual effect of this conf is not the selection of font files with
special and unusual symbols. It is to priorize fonts that match the
"Symbol" magic name. And those fonts are few and crumbling on Linux
systems, because no one has needed to bother with them since Linux
switched to UTF-8 last millenium.

Just stop using “Symbol” in R and things will work a lot better.
Alternatively, prepare to maintain the “Symbol” aliasing stack in
fontconfig (and fight with wine for it), because *no* *one* *else*
*cares* about this legacy Windows-specific stuff.


Fontconfig upstream already told this to R users in its own issue
tracker.


Regards,

--
Nicolas Mailhot

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Gavin Simpson-3
In reply to this post by Iñaki Ucar
Thanks Iñaki, that worked a treat.

Gavin

On Wed, 25 Mar 2020 at 04:28, Iñaki Ucar <[hidden email]> wrote:

>
> On Wed, 25 Mar 2020 at 01:14, Gavin Simpson <[hidden email]> wrote:
> >
> > Dear list
> >
> > On Fedora 31 the pango library has recently updated to version >= 1.44
> > and in doing so has switched to using the HarfBuzz library (from
> > FreeType) and dropped Adobe Type 1 font support. This causes problems
> > with plotmath as all bar one of the glyphs doesn't render (see
> > attached PNG image if it makes it through the list filters - if not I
> > have shared a copy via my google drive:
> > https://drive.google.com/file/d/1llFqKHD7LFKzQbVuq6sibY1UizRn7xxS/view?usp=sharing
> > )
> >
> > I'm not the only person who has come across this, e.g.
> > https://stackoverflow.com/q/60656445/429846 and the resulting reported
> > bug on the RedHat Bugzilla:
> > https://bugzilla.redhat.com/show_bug.cgi?id=1815128
> >
> > Beyond switching to  `type = 'Xlib'`, has anyone worked around this
> > issue on a Fedora 31 or later system?
>
> Adding [hidden email] to CC. A workaround is to avoid using PS fonts
> for symbols. If you run the following, you'll see
>
> $ fc-match Symbol
> StandardSymbolsPS.t1: "Standard Symbols PS" "Regular"
>
> So let's change this. Install a TTF symbol font, such as Symbola:
>
> $ sudo dnf install gdouros-symbola-fonts
>
> Then add the following to /etc/fonts/local.conf (system-wide) or
> ~/.fonts.conf (just for your user):
>
> <fontconfig>
> <match target="pattern">
>  <test name="family"><string>Symbol</string></test>
>  <edit name="family" mode="prepend" binding="same">
>    <string>Symbola</string>
>  </edit>
> </match>
> </fontconfig>
>
> Now you should see this:
>
> $ fc-match Symbol
> Symbola.ttf: "Symbola" "Regular"
>
> and symbols should render correctly.
>
> Iñaki



--
Gavin Simpson, PhD

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Iñaki Ucar
In reply to this post by R devel mailing list
On Wed, 25 Mar 2020 at 12:25, Nicolas Mailhot
<[hidden email]> wrote:

>
> <snip>
>
> R brought this all on itself by hardcoding a Windows-only “Symbol” font
> family name in its default conf. Linux systems are UTF-8 by default for
> ~20 years now, they don’t need the forcing of magic font families to
> handle symbols not present in the 8-bit legacy Windows encodings.
>
> The actual effect of this conf is not the selection of font files with
> special and unusual symbols. It is to priorize fonts that match the
> "Symbol" magic name. And those fonts are few and crumbling on Linux
> systems, because no one has needed to bother with them since Linux
> switched to UTF-8 last millenium.
>
> Just stop using “Symbol” in R and things will work a lot better.
> Alternatively, prepare to maintain the “Symbol” aliasing stack in
> fontconfig (and fight with wine for it), because *no* *one* *else*
> *cares* about this legacy Windows-specific stuff.

So, in the light of Nicolas' input (thanks!), I think that font
selection should be fixed upstream in R. I'd be happy to put all this
together in R's bugzilla, but I don't have an account. Could someone
please invite me?

Iñaki

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Paul Murrell-2
Hi

Thanks for your input on this Iñaki and Nicolas.

I am starting testing an R fix for this problem today.

As suggested, the plan is to allow the R user to specify a font family
other than "symbol" for plotmath output (or, more generally, in R
parlance, for 'font=5' or 'fontface=5') on a Cairo-based graphics device.

Paul


On 27/03/20 11:30 pm, Iñaki Ucar wrote:

> On Wed, 25 Mar 2020 at 12:25, Nicolas Mailhot
> <[hidden email]> wrote:
>>
>> <snip>
>>
>> R brought this all on itself by hardcoding a Windows-only “Symbol” font
>> family name in its default conf. Linux systems are UTF-8 by default for
>> ~20 years now, they don’t need the forcing of magic font families to
>> handle symbols not present in the 8-bit legacy Windows encodings.
>>
>> The actual effect of this conf is not the selection of font files with
>> special and unusual symbols. It is to priorize fonts that match the
>> "Symbol" magic name. And those fonts are few and crumbling on Linux
>> systems, because no one has needed to bother with them since Linux
>> switched to UTF-8 last millenium.
>>
>> Just stop using “Symbol” in R and things will work a lot better.
>> Alternatively, prepare to maintain the “Symbol” aliasing stack in
>> fontconfig (and fight with wine for it), because *no* *one* *else*
>> *cares* about this legacy Windows-specific stuff.
>
> So, in the light of Nicolas' input (thanks!), I think that font
> selection should be fixed upstream in R. I'd be happy to put all this
> together in R's bugzilla, but I don't have an account. Could someone
> please invite me?
>
> Iñaki
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?

Iñaki Ucar
Thanks, Paul. I've created a bug report to keep track of this
(https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17748), and taken
the liberty of adding you to CC. We'll need to cherry-pick the fix for
R 3.6.3 in Fedora 31.

Iñaki

On Sun, 29 Mar 2020 at 21:15, Paul Murrell <[hidden email]> wrote:

>
> Hi
>
> Thanks for your input on this Iñaki and Nicolas.
>
> I am starting testing an R fix for this problem today.
>
> As suggested, the plan is to allow the R user to specify a font family
> other than "symbol" for plotmath output (or, more generally, in R
> parlance, for 'font=5' or 'fontface=5') on a Cairo-based graphics device.
>
> Paul
>
>
> On 27/03/20 11:30 pm, Iñaki Ucar wrote:
> > On Wed, 25 Mar 2020 at 12:25, Nicolas Mailhot
> > <[hidden email]> wrote:
> >>
> >> <snip>
> >>
> >> R brought this all on itself by hardcoding a Windows-only “Symbol” font
> >> family name in its default conf. Linux systems are UTF-8 by default for
> >> ~20 years now, they don’t need the forcing of magic font families to
> >> handle symbols not present in the 8-bit legacy Windows encodings.
> >>
> >> The actual effect of this conf is not the selection of font files with
> >> special and unusual symbols. It is to priorize fonts that match the
> >> "Symbol" magic name. And those fonts are few and crumbling on Linux
> >> systems, because no one has needed to bother with them since Linux
> >> switched to UTF-8 last millenium.
> >>
> >> Just stop using “Symbol” in R and things will work a lot better.
> >> Alternatively, prepare to maintain the “Symbol” aliasing stack in
> >> fontconfig (and fight with wine for it), because *no* *one* *else*
> >> *cares* about this legacy Windows-specific stuff.
> >
> > So, in the light of Nicolas' input (thanks!), I think that font
> > selection should be fixed upstream in R. I'd be happy to put all this
> > together in R's bugzilla, but I don't have an account. Could someone
> > please invite me?
> >
> > Iñaki
> >
> > ______________________________________________
> > [hidden email] mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >



--
Iñaki Úcar

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel