[R-SIG-Mac] pdf font issue for square bracket

David Winsemius dw|n@em|u@ @end|ng |rom comc@@t@net
Wed Jun 3 16:55:17 CEST 2020


On 6/3/20 6:40 AM, Koenker, Roger W wrote:
> If someone could advise me on how to get the “]” and “(“ characters to look
> remotely like they should in the following code, I would be eternally grateful.
> Having experimented with pdf.options() and the vfont option for text() I’m at
> a loss.  Rather than “]” I see only a black rectangle.


Somehow one of your your default system font has become corrupted 
probably the "Times" instance. You can often fix this by examining the 
font in Font Book.app. You often find that there is a duplicate instance 
of a system installed font and that deleting the offending instance 
withing Font Book.app will cure the problem. Look  first at the "serif" 
entry to postscriptFonts():

names( postscriptFonts() )

postscriptFonts()[ "serif" ]

-- 

David.

>
>> sessionInfo()
> R version 3.6.2 Patched (2019-12-12 r77564)
> Platform: x86_64-apple-darwin15.6.0 (64-bit)
> Running under: macOS Mojave 10.14.6
>
> # PDF Font issue for "]"
> v <- c(-0.59103110,0.02659437,-1.51655310,-1.36265335,
>         1.17848916,-0.93415132,1.32360565,0.62491779,-0.04572296,-1.00412058)
> y <- c(1,1,1,0,1,0,1,0,1,0)
> pdf("One.pdf", height = 2, width = 7)
> plot(v[y==1],sample(c(-1,1),sum(y),replace = TRUE), type = "n",
>       axes = FALSE,  xlim = range(v),xlab = "", ylab = "")
> text(v[y==1],rep(0,sum(y)), "]", cex = 2)
> abline(h = 0)
> text(v[y==0],rep(0,n-sum(y)), "(", cex = 2, col=2)
> segments(c(vo[1]-0.1,vo)[klmax],c(0,0),c(vo[1]-0.1,vo)[klmax+1],c(0,0),
> 	 col = 2, lwd = 2)  # (use right end point to represent interval)
> dev.off()
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list