Dear R users, I run R-2.9.2 on the Snow Leopard 10.6.1 OS system. The default language of the OS is english. I want to plot a very simple graph with Korean letters on a quartz() device, but it fails. Korean Letters appear as being squares. The same command works fine in Windows systems. My question is how can I draw or typeset Korean letters in quartz() device on SL OS? Best regards, Donghyun Oh
Korean in quartz() device.
3 messages · Dong-hyun Oh, Brian Ripley, Ei-ji Nakama
On Fri, 30 Oct 2009, Dong-hyun Oh wrote:
Dear R users, I run R-2.9.2 on the Snow Leopard 10.6.1 OS system. The default language of the OS is english. I want to plot a very simple graph with Korean letters on a quartz() device, but it fails. Korean Letters appear as being squares.
We don't have a reproducible example, but this usually indicates that the font you are using does not contain the glyphs you are requesting.
The same command works fine in Windows systems.
Unlikely, as quartz() does not exist on Windows, and on the windows() the font selection is crucial for CJK glyphs. How about the X11() device?
My question is how can I draw or typeset Korean letters in quartz() device on SL OS?
Probably, select a suitable font. If you can prepare a reproducible example (see the posting guide) we may be able to help further. Please use \uxxxx or put the example on a website, as mailers frequent mangle non-ASCII content or attachments.
Best regards, Donghyun Oh
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi
You can write the following in "~/.Rprofile".
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
setHook(packageEvent("grDevices", "onLoad"),
function(...){
if(capabilities("aqua"))
grDevices::quartzFonts(
sans =grDevices::quartzFont(rep("AppleGothic",4)),
serif=grDevices::quartzFont(rep("AppleMyungjp",4)))
grDevices::pdf.options(family="Korea1")
grDevices::ps.options(family="Korea1")
}
)
attach(NULL, name = "KoreaEnv")
assign("familyset_hook",
function() {
macfontdevs=c("quartz","quartz_off_screen")
devname=strsplit(names(dev.cur()),":")[[1L]][1]
if (capabilities("aqua") &&
devname %in% macfontdevs)
par(family="sans")
},
pos="KoreaEnv")
setHook("plot.new", get("familyset_hook", pos="KoreaEnv"))
setHook("persp", get("familyset_hook", pos="KoreaEnv"))
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
familyset_hook is a claptrap method.
There were no italics in Japanese, but there were two weight fonts.
I don't know good Korean font, choose a good font, please.
2009/10/30 Dong-hyun Oh <oh.donghyun77 at gmail.com>:
Dear R users, I run R-2.9.2 on the Snow Leopard 10.6.1 OS system. The default language of the OS is english. I want to plot a very simple graph with Korean letters on a quartz() device, but it fails. Korean Letters appear as being squares. The same command works fine in Windows systems. My question is how can I draw or typeset Korean letters in quartz() device on SL OS? Best regards, Donghyun Oh
_______________________________________________ R-SIG-Mac mailing list R-SIG-Mac at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-mac
EI-JI Nakama <nakama (a) ki.rim.or.jp> "\u4e2d\u9593\u6804\u6cbb" <nakama (a) ki.rim.or.jp>