Iñaki Ucar
2020-Mar-30 09:43 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
On Mon, 30 Mar 2020 at 04:24, Paul Murrell <paul at stat.auckland.ac.nz> wrote:> > Hi > > I have created an R branch that contains a potential fix ... > > https://svn.r-project.org/R/branches/R-symfam/ > > This allows, for example, ... > > cairo_pdf(symbolfamily="OpenSymbol") > > ... to specify that the OpenSymbol family should be used as the "symbol" > font (e.g., for "plotmath") in R.Will this be a default on Linux? Or are you planning any mechanism (env variable, option...) to make it the default? Because, otherwise, as pango is updated across distributions, R graphics will be "broken" by default unless the user explicitly calls the graphics device in that way to set that option, which I would say is uncommon. I?aki> This is just a separate branch for now because, while I have tested it > under Unbuntu 18.04 and Fedora 31, I cannot even build R for Windows > (right now) or Mac (ever) and I do not want to drop a bomb on R-devel at > this stage of the release process for R 4.0.0. > > The attached file contains at least an outline of steps required to do a > minimal test if anyone wants to try the fix on Linux. > > cc'ing Simon and Jeroen in case they are able to help with checking that > this builds and works on Mac and/or Windows. > > NOTEs: > - 'symbolfamily' can only be specified when a graphics device is opened, > and it is then fixed for that device. > - on Windows, for cairo-based devices, the "symbol" font is still > hard-coded as "Standard Symbols L" > > > Paul > > On 30/03/20 8:15 am, Paul Murrell 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 > >> <nicolas.mailhot at laposte.net> 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 > >> > >> ______________________________________________ > >> R-devel at r-project.org mailing list > >> https://stat.ethz.ch/mailman/listinfo/r-devel > >> > > -- > Dr Paul Murrell > Department of Statistics > The University of Auckland > Private Bag 92019 > Auckland > New Zealand > 64 9 3737599 x85392 > paul at stat.auckland.ac.nz > http://www.stat.auckland.ac.nz/~paul/-- I?aki ?car On Mon, 30 Mar 2020 at 04:24, Paul Murrell <paul at stat.auckland.ac.nz> wrote:> > Hi > > I have created an R branch that contains a potential fix ... > > https://svn.r-project.org/R/branches/R-symfam/ > > This allows, for example, ... > > cairo_pdf(symbolfamily="OpenSymbol") > > ... to specify that the OpenSymbol family should be used as the "symbol" > font (e.g., for "plotmath") in R. > > This is just a separate branch for now because, while I have tested it > under Unbuntu 18.04 and Fedora 31, I cannot even build R for Windows > (right now) or Mac (ever) and I do not want to drop a bomb on R-devel at > this stage of the release process for R 4.0.0. > > The attached file contains at least an outline of steps required to do a > minimal test if anyone wants to try the fix on Linux. > > cc'ing Simon and Jeroen in case they are able to help with checking that > this builds and works on Mac and/or Windows. > > NOTEs: > - 'symbolfamily' can only be specified when a graphics device is opened, > and it is then fixed for that device. > - on Windows, for cairo-based devices, the "symbol" font is still > hard-coded as "Standard Symbols L" > > Paul > > On 30/03/20 8:15 am, Paul Murrell 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 > >> <nicolas.mailhot at laposte.net> 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 > >> > >> ______________________________________________ > >> R-devel at r-project.org mailing list > >> https://stat.ethz.ch/mailman/listinfo/r-devel > >> > > -- > Dr Paul Murrell > Department of Statistics > The University of Auckland > Private Bag 92019 > Auckland > New Zealand > 64 9 3737599 x85392 > paul at stat.auckland.ac.nz > http://www.stat.auckland.ac.nz/~paul/-- I?aki ?car
Paul Murrell
2020-Mar-30 20:41 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
Hi On 30/03/20 10:43 pm, I?aki Ucar wrote:> On Mon, 30 Mar 2020 at 04:24, Paul Murrell <paul at stat.auckland.ac.nz> wrote: >> >> Hi >> >> I have created an R branch that contains a potential fix ... >> >> https://svn.r-project.org/R/branches/R-symfam/ >> >> This allows, for example, ... >> >> cairo_pdf(symbolfamily="OpenSymbol") >> >> ... to specify that the OpenSymbol family should be used as the "symbol" >> font (e.g., for "plotmath") in R. > > Will this be a default on Linux? Or are you planning any mechanism > (env variable, option...) to make it the default? Because, otherwise, > as pango is updated across distributions, R graphics will be "broken" > by default unless the user explicitly calls the graphics device in > that way to set that option, which I would say is uncommon.Good question. Currently, for x11() (and png() etc) the default is taken from X11.options(). So it is possible to set this default for a session, or even for an installation via one of the ?Startup mechanisms (e.g., an R_HOME/etc/Rprofile.site file). For svg(), cairo_pdf(), and cairo_ps(), the default is hard-coded in the function arguments, but I *think* they are used less as default graphics devices. Another option would be to try to detect Fedora and set the default X11.options() differently there. Two problems: I am not sure there is a reliable R code chunk for detecting Fedora (sessionInfo()$running?) let alone Fedora >= 30; what to set the default to? (just has to be a font with a good Unicode coverage that is pretty much guaranteed to be in a default Fedora install). Paul> I?aki > >> This is just a separate branch for now because, while I have tested it >> under Unbuntu 18.04 and Fedora 31, I cannot even build R for Windows >> (right now) or Mac (ever) and I do not want to drop a bomb on R-devel at >> this stage of the release process for R 4.0.0. >> >> The attached file contains at least an outline of steps required to do a >> minimal test if anyone wants to try the fix on Linux. >> >> cc'ing Simon and Jeroen in case they are able to help with checking that >> this builds and works on Mac and/or Windows. >> >> NOTEs: >> - 'symbolfamily' can only be specified when a graphics device is opened, >> and it is then fixed for that device. >> - on Windows, for cairo-based devices, the "symbol" font is still >> hard-coded as "Standard Symbols L" >> >> >> Paul >> >> On 30/03/20 8:15 am, Paul Murrell 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 >>>> <nicolas.mailhot at laposte.net> 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 >>>> >>>> ______________________________________________ >>>> R-devel at r-project.org mailing list >>>> https://stat.ethz.ch/mailman/listinfo/r-devel >>>> >> >> -- >> Dr Paul Murrell >> Department of Statistics >> The University of Auckland >> Private Bag 92019 >> Auckland >> New Zealand >> 64 9 3737599 x85392 >> paul at stat.auckland.ac.nz >> http://www.stat.auckland.ac.nz/~paul/ > > >-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Iñaki Ucar
2020-Mar-30 21:12 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
On Mon, 30 Mar 2020 at 22:41, Paul Murrell <paul at stat.auckland.ac.nz> wrote:> > Hi > > On 30/03/20 10:43 pm, I?aki Ucar wrote: > > On Mon, 30 Mar 2020 at 04:24, Paul Murrell <paul at stat.auckland.ac.nz> wrote: > >> > >> Hi > >> > >> I have created an R branch that contains a potential fix ... > >> > >> https://svn.r-project.org/R/branches/R-symfam/ > >> > >> This allows, for example, ... > >> > >> cairo_pdf(symbolfamily="OpenSymbol") > >> > >> ... to specify that the OpenSymbol family should be used as the "symbol" > >> font (e.g., for "plotmath") in R. > > > > Will this be a default on Linux? Or are you planning any mechanism > > (env variable, option...) to make it the default? Because, otherwise, > > as pango is updated across distributions, R graphics will be "broken" > > by default unless the user explicitly calls the graphics device in > > that way to set that option, which I would say is uncommon. > > Good question. Currently, for x11() (and png() etc) the default is > taken from X11.options(). So it is possible to set this default for a > session, or even for an installation via one of the ?Startup mechanisms > (e.g., an R_HOME/etc/Rprofile.site file). > > For svg(), cairo_pdf(), and cairo_ps(), the default is hard-coded in the > function arguments, but I *think* they are used less as default graphics > devices. > > Another option would be to try to detect Fedora and set the default > X11.options() differently there. Two problems: I am not sure there is > a reliable R code chunk for detecting Fedora (sessionInfo()$running?) > let alone Fedora >= 30; what to set the default to? (just has to be a > font with a good Unicode coverage that is pretty much guaranteed to be > in a default Fedora install).As per Nicolas' comment (I failed to include him in CC in my last email, and he's not in this list, sorry for that) any font installed by default would have good symbol coverage, so there's really no need to set a different font for symbols. According again to Nicolas (he's one of the font experts in Fedora), the "sans-serif" or "monospace" fontconfig defaults would work out of the box, and if a symbol is not available, fontconfig should fallback gracefully to another font. So maybe instead of a new "symbolfamily" argument, maybe it's better to just use the "family" for all characters, including symbols, on Linux, and fontconfig should take care of everything (if I understood correctly your explanation, Nicolas; please correct me if I'm wrong). -- I?aki ?car
Martin Maechler
2020-Mar-31 19:24 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
>>>>> Paul Murrell >>>>> on Tue, 31 Mar 2020 09:41:30 +1300 writes:> Hi > On 30/03/20 10:43 pm, I?aki Ucar wrote: >> On Mon, 30 Mar 2020 at 04:24, Paul Murrell <paul at stat.auckland.ac.nz> wrote: >>> >>> Hi >>> >>> I have created an R branch that contains a potential fix ... >>> >>> https://svn.r-project.org/R/branches/R-symfam/ >>> >>> This allows, for example, ... >>> >>> cairo_pdf(symbolfamily="OpenSymbol") >>> >>> ... to specify that the OpenSymbol family should be used as the "symbol" >>> font (e.g., for "plotmath") in R. >> >> Will this be a default on Linux? Or are you planning any mechanism >> (env variable, option...) to make it the default? Because, otherwise, >> as pango is updated across distributions, R graphics will be "broken" >> by default unless the user explicitly calls the graphics device in >> that way to set that option, which I would say is uncommon. > Good question. Currently, for x11() (and png() etc) the default is > taken from X11.options(). So it is possible to set this default for a > session, or even for an installation via one of the ?Startup mechanisms > (e.g., an R_HOME/etc/Rprofile.site file). > For svg(), cairo_pdf(), and cairo_ps(), the default is hard-coded in the > function arguments, but I *think* they are used less as default graphics > devices. > Another option would be to try to detect Fedora and set the default > X11.options() differently there. Two problems: I am not sure there is > a reliable R code chunk for detecting Fedora (sessionInfo()$running?) > let alone Fedora >= 30; Yes, sessionInfo()$running is sufficient for both *and* there's a faster way in latest R versions, as I had the same need and found sessionInfo() should be modularized here, and so we have the 'osVersion' variable since R 3.6.0 ----------------------------------------> osVersion[1] "Fedora 30 (Thirty)"> find("osVersion")[1] "package:utils">---------------------------------------- {it is put into utils at package load time} > what to set the default to? (just has to be a > font with a good Unicode coverage that is pretty much guaranteed to be > in a default Fedora install). > Paul >> I?aki >> >>> This is just a separate branch for now because, while I have tested it >>> under Unbuntu 18.04 and Fedora 31, I cannot even build R for Windows >>> (right now) or Mac (ever) and I do not want to drop a bomb on R-devel at >>> this stage of the release process for R 4.0.0. >>> >>> The attached file contains at least an outline of steps required to do a >>> minimal test if anyone wants to try the fix on Linux. >>> >>> cc'ing Simon and Jeroen in case they are able to help with checking that >>> this builds and works on Mac and/or Windows. >>> >>> NOTEs: >>> - 'symbolfamily' can only be specified when a graphics device is opened, >>> and it is then fixed for that device. >>> - on Windows, for cairo-based devices, the "symbol" font is still >>> hard-coded as "Standard Symbols L" >>> >>> >>> Paul >>> >>> On 30/03/20 8:15 am, Paul Murrell 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 >>>>> <nicolas.mailhot at laposte.net> 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 >>>>> >>>>> ______________________________________________ >>>>> R-devel at r-project.org mailing list >>>>> https://stat.ethz.ch/mailman/listinfo/r-devel >>>>> >>> >>> -- >>> Dr Paul Murrell >>> Department of Statistics >>> The University of Auckland >>> Private Bag 92019 >>> Auckland >>> New Zealand >>> 64 9 3737599 x85392 >>> paul at stat.auckland.ac.nz >>> http://www.stat.auckland.ac.nz/~paul/ >> >> >> > -- > Dr Paul Murrell > Department of Statistics > The University of Auckland > Private Bag 92019 > Auckland > New Zealand > 64 9 3737599 x85392 > paul at stat.auckland.ac.nz > http://www.stat.auckland.ac.nz/~paul/ > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Maybe Matching Threads
- Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
- Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
- Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
- Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
- Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?