Nicolas Mailhot
2020-Mar-30 10:12 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
Le lundi 30 mars 2020 ? 15:24 +1300, Paul Murrell a ?crit :> 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.Thanks for looking at it! But, really, there is no such thing as a Symbol font on Linux anymore. Symbol is pre-unicode thinking. Most modern general-purpose unicode fonts will include every codepoint Symbol ever shipped, and fontconfig will fallback gracefully when that?s not the case (unless your fontconfig integration is broken). Just use the sans-serif or monospace fontconfig defaults. You don?t need Symbol, or OpenSymbol, or any special font setup. Symbol?s codepoint coverage is laughable by 2020?s UTF-8 standards. Symbol << Normal Unicode font (DejaVu*) << Special math fonts (STIX2) I you do advanced math stuff, you may need a special math font like STIX, but that?s lights years more advanced than Symbol, and a general purpose font like DejaVu has been shipping a MATH block for several years now Regards, -- Nicolas Mailhot
Paul Murrell
2020-Mar-30 21:14 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
Hi On 30/03/20 11:12 pm, Nicolas Mailhot wrote:> Le lundi 30 mars 2020 ? 15:24 +1300, Paul Murrell a ?crit : >> 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. > > Thanks for looking at it! > > But, really, there is no such thing as a Symbol font on Linux anymore. > Symbol is pre-unicode thinking. Most modern general-purpose unicode > fonts will include every codepoint Symbol ever shipped, and fontconfig > will fallback gracefully when that?s not the case (unless your > fontconfig integration is broken).Yep, the "symbol" font is an (outdated) R "plotmath" concept, but one that would take a fair bit of surgery to remove. R plotmath converts certain R expressions (in certain contexts) to code points in the Adobe Symbol Encoding (ASM), but for cairo-based devices, those are converted to UTF8 code points.> Just use the sans-serif or monospace fontconfig defaults. You don?t > need Symbol, or OpenSymbol, or any special font setup.Agreed. I got reasonable coverage from DejaVu Sans and FreeSerif. There are still a number of ASM code points that are not covered though, for example, ... F8EB E6 # LEFT PAREN TOP # parenlefttp (CUS) F8EC E7 # LEFT PAREN EXTENDER # parenleftex (CUS) F8ED E8 # LEFT PAREN BOTTOM # parenleftbt (CUS) Even OpenSymbol is missing a few (though perhaps not very common ones) ... F8E5 60 # RADICAL EXTENDER # radicalex (CUS) F8E6 BD # VERTICAL ARROW EXTENDER # arrowvertex (CUS) F8E7 BE # HORIZONTAL ARROW EXTENDER # arrowhorizex (CUS) F6DA D2 # REGISTERED SIGN SERIF # registerserif (CUS) F6D9 D3 # COPYRIGHT SIGN SERIF # copyrightserif (CUS) F6DB D4 # TRADE MARK SIGN SERIF # trademarkserif (CUS) F8E8 E2 # REGISTERED SIGN SANS SERIF # registersans (CUS) F8E9 E3 # COPYRIGHT SIGN SANS SERIF # copyrightsans (CUS) F8EA E4 # TRADE MARK SIGN SANS SERIF # trademarksans (CUS)> Symbol?s codepoint coverage is laughable by 2020?s UTF-8 standards.Right, but there are still code points that are apparently not common in fonts with a very broad Unicode coverage. I did find a TrueType font that I could add a Unicode cmap to that gave complete coverage pretty much all by itself, but it is not distributable.> Symbol << Normal Unicode font (DejaVu*) << Special math fonts (STIX2) > > I you do advanced math stuff, you may need a special math font like > STIX, but that?s lights years more advanced than Symbol, and a general > purpose font like DejaVu has been shipping a MATH block for several > years nowSure. One way to look at the new 'symbolfamily' argument is that it allows us to tell R that the "symbol" font is just a normal font (for cairo-based graphics devices). 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/
Nicolas Mailhot
2020-Mar-30 22:50 UTC
[Rd] Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
Le mardi 31 mars 2020 ? 10:14 +1300, Paul Murrell a ?crit :> Hi > > On 30/03/20 11:12 pm, Nicolas Mailhot wrote: > > Le lundi 30 mars 2020 ? 15:24 +1300, Paul Murrell a ?crit : > > > 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. > > > > Thanks for looking at it! > > > > But, really, there is no such thing as a Symbol font on Linux > > anymore. > > Symbol is pre-unicode thinking. Most modern general-purpose unicode > > fonts will include every codepoint Symbol ever shipped, and > > fontconfig > > will fallback gracefully when that?s not the case (unless your > > fontconfig integration is broken). > > Yep, the "symbol" font is an (outdated) R "plotmath" concept, but > one > that would take a fair bit of surgery to remove. R plotmath > converts > certain R expressions (in certain contexts) to code points in the > Adobe > Symbol Encoding (ASM), but for cairo-based devices, those are > converted > to UTF8 code points. > > > Just use the sans-serif or monospace fontconfig defaults. You don?t > > need Symbol, or OpenSymbol, or any special font setup. > > Agreed. I got reasonable coverage from DejaVu Sans and FreeSerif. > There are still a number of ASM code points that are not covered > though, > for example, ... > > F8EB E6 # LEFT PAREN TOP # parenlefttp (CUS) > F8EC E7 # LEFT PAREN EXTENDER # parenleftex (CUS) > F8ED E8 # LEFT PAREN BOTTOM # parenleftbt (CUS) > > Even OpenSymbol is missing a few (though perhaps not very common > ones) ...All the F8* codepoints are in the private use area. That means you can?t rely on them existing in standard unicode fonts You need to use correct Unicode values for things to work: Ux239? for parenthesis, brackets https://www.unicode.org/charts/PDF/U2300.pdf> F8E6 BD # VERTICAL ARROW EXTENDER # arrowvertex (CUS) > F8E7 BE # HORIZONTAL ARROW EXTENDER # arrowhorizex (CUS)and 23AF/23D0 for arrow extensions (though arrow font support seems messy, probably because it sees little use; it?s a pity R comes so late to the party, those are just lines, it would have been trivial to get them into DejaVu before the project gone dormant). GFS NeoHellenic (Math block) seems complete but it?s not a common font family.> F6DA D2 # REGISTERED SIGN SERIF # registerserif (CUS) > F6D9 D3 # COPYRIGHT SIGN SERIF # copyrightserif (CUS) > F6DB D4 # TRADE MARK SIGN SERIF # trademarkserif (CUS) > F8E8 E2 # REGISTERED SIGN SANS SERIF # registersans (CUS) > F8E9 E3 # COPYRIGHT SIGN SANS SERIF # copyrightsans (CUS) > F8EA E4 # TRADE MARK SIGN SANS SERIF # trademarksans (CUS)Those are useless nowadays, just use normal registered/copyright/trademark codepoints, and a font in the wished style (serif sans serif, whatever looks nice to you) Regards -- Nicolas Mailhot
Seemingly Similar Threads
- [FORGED] Re: 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?
- [FORGED] Re: Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?
- Plotmath on Fedora 31 broken with with pango >= 1.44 - workarounds?