wch / fontcm

Computer Modern font package for R
24 stars 3 forks source link

ring(A) produces A without ring #3

Open khouli opened 9 years ago

khouli commented 9 years ago

Hello, thanks for making this. I just tried using ring(A) in ggplot2 with the CM font and got an unadorned A. This is snippet that produced that:

expression(paste("Standard Deviation (", ring(A), ")"))

Is ring() supported by fontcm? Thanks.

wch commented 9 years ago

It seems to work for me:

library(ggplot2)
library(extrafont)

pdf("ggplot_cm.pdf", width=4, height=4)

ggplot(mtcars, aes(wt, mpg)) + geom_point() +
  theme(text = element_text(size=16, family="CM Roman")) +
  xlab(expression(paste("Standard Deviation (", ring(A), ")")))

dev.off()
embed_fonts("ggplot_cm.pdf", outfile="ggplot_cm.pdf")
khouli commented 9 years ago

I tried exactly what you posted. It looks like I was mistaken about it not working at all but I do get this weirdness:

computer modern ring(A)

(R didn't report any errors -- it seemed happy with the "CM Roman" font family.)

wch commented 9 years ago

This is what the PDF looks like for me on Ubuntu Linux 14.04. I took a screenshot because apparently it's not possible to add a PDF to these comments.

image

What platform are you on, and what viewer are you using?