[R] How to read jpeg image with russian font in R?

David Winsemius dwinsemius at comcast.net
Thu Nov 22 19:32:45 CET 2012


On Nov 21, 2012, at 11:21 PM, Manish Gupta wrote:

> Hi,
>
> I m working on R and read one image with russian font using readjpeg()
> function and write it on pdf (using grid). But russian text is not  
> visible
> on pdf. How can i fix my pblm?

You are working with two different plotting paradigms. pdf and ps are  
vector formats and do encode the text as individual characters. But  
jpeg is a lossy bitmap format, so text is not separately encoded as  
characters.
>
> Regards <http://r.789695.n4.nabble.com/file/n4650417/pointer.jpg>
> library(JPEG)

There is a package named 'jpeg" so I'm wondering if you are unaware  
the case in naming objects in R is enforced?

-- 
David.
> library(grid)
> pdf("out.pdf" , width = 6.6 ,height = 4.2,family= "URWHelvetica",
> encoding="KOI8-R")
> a<-readJPEG("ArrowImage")    # name of arrow
> grid.newpage()
> pushViewport(viewport(width=0.9, height=0.9))
> pushViewport(viewport(yscale=c(0,0), xscale=c(0,1), x=0, y=0,  
> width=0.15,
> height=1.0, just=c("left", "bottom")))
> grid.raster(a, y=unit(ypos.img, "native"))
> popViewport()
> popViewport()
> dev.off()
>
> Regards
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-to-read-jpeg-image-with-russian-font-in-R-tp4650417.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list