[RkWard-devel] RKWard and other encondings
I. Soumpasis
nono.231 at gmail.com
Thu Feb 15 16:24:24 UTC 2007
2007/2/14, Thomas Friedrichsmeier <thomas.friedrichsmeier at ruhr-uni-bochum.de
>:
>
> On Wednesday 14 February 2007 21:05, I. Soumpasis wrote:
> > Problem is with plugins where the par(family="kerkis") must be set.
>
> Wouldn't it be easier to set the default fonts, instead? I.e.
> getOption("X11fonts")? Then you would not have to specify the family for
> each
> separate plot. For postscript and pdf, apparently the default is to use
> postscript/pdfFonts("Helvetica"), so this could probably be changed
> globally
> as well, if needed.
For postscript/pdffonts, there is no option like getOption(), and I got to
the last resort declaring in Helvetica with the kerkis fonts (greek fonts)
(it is done just for the session). Much better now, having working pdf,
postscript, dev.print. But for now I face problems with dev.copy, and
dev2bitmap, and bitmap. I think the bitmap has a different way to work with
ghostscript, but I will check.
For example, the following example works here (I don't have a "complicated"
> encoding to play with, so instead I chose a different font family):
>
> fnts <- getOption("X11fonts")
> fnts[1] <- "-adobe-palatino-%s-%s-*-*-%d-*-*-*-*-*-*-*"
> options (X11fonts=fnts)
Thanks, this is really helpful!
Then call plot without any family argument:
> plot (1, 1, main="test", xlab="test2")
>
> > By default R can plot with three types of fonts, sans (Helvetica), serif
> > (Times) and mono (Courier), according to Paul Murrell and Brian Ripley.
> > Non-standard fonts in PostScript and PDF graphics. R News, 6(2):41-47,
> May
> > 2006.
> > <http://cran.r-project.org/doc/Rnews/Rnews_2006-2.pdf><
> http://cran.r-projec
> >t.org/doc/Rnews/Rnews_2006-2.pdf>Should we give the user a plot option
> for
> > all plots to choose with what fonts to plot?
>
> Can't do any harm to add this to plot_options. However, we'd probably need
> a
> whole dedicated tool to facilitate font selection, in order to make this
> useful.
It could be done in the future, but I do not know what problems we may face.
if we give a family option to par, and try to print the graph on a device we
can get to some problems. Example:
par(family="sans")
z<-1:10
barplot(z, main="Title", sub="subtitle")
dev.print(device=pdf, file="~/Desktop/print.pdf")
The last works well, but trying Device>Print does not work giving the
message:
Error in dev.copy(device = function (file = ifelse(onefile, "Rplots.ps", :
family 'sans' not included in PostScript device
> Another problem I found is that output window is set to (utf8) enconding
> > and cannot display the iso88597 results right. If I open rk_out.html
> with
> > firefox and set enconding to iso88597 it is displayed properly (see the
> > attached rk_out.html). Is there a way to give a choice to the user to
> > select the enconding view?
>
> Yes. View->Set Encoding (and in theory, it should auto-detect the
> encoding).
> On the other hand, what was the reason again, not to use a UTF-8 locale in
> the first place? Are there no matching fonts available for that?
Sorry about this! Did not see View->Set Encoding. Probably did not moved to
the output so I did not have this option to the view panel. All ok now. No
problem with fonts, the problem was just with encoding.
Regards,
Ilias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20070215/92202373/attachment.html>
More information about the Rkward-devel
mailing list