Skip to content
Prev 31337 / 63424 Next

Italics in svg output display as bold (PR#13463)

Yan Wong-3 wrote:
At this point I should note that I can see this on Windows XP as well. Using
R 2.8.1 (CRAN binary version)  and version 1.4-4 of Cairo from CRAN (windows
binary).

It doesn't seem specific to SVG, I can reproduce it with pdf or png as well.
On R-SIG-Mac, Simon Urbanek wrote:
<https://stat.ethz.ch/pipermail/r-sig-mac/2009-January/005816.html>
The following testcase tends to show the contrary:

library(Cairo)
Cairo("plot.png", width=7, height=7, units="cm", dpi=100)
plot.new()
par(family="Arial")
text(0.5,0.4,labels=expression(italic("This should be in italics")))
text(0.5,0.6,labels=expression(bold("This should be in bold")))
dev.off()

The text that should be in italics is in bold, and vice versa. This makes me
think Cairo actually finds both italics and bold, but gets confused
somewhere...

I tried replacing Arial by Times or Tahoma, or removing the call to par(),
but italics and bold are always reversed (with the correct family used).