Paul Murrell
2010-Jul-04 00:17 UTC
[R] PDFfontNumber bugs in devPS.c (Re: plain text in Chinese can not be set)
Hi Thanks very much for the report, diagnosis, and patch! I have implemented your fix in the development version of R. Paul Jinsong Zhao wrote:> On 2010-7-1 15:24, Jinsong Zhao wrote: >> Read the source again more carefully. I think I get the solution: >> >> Change the following line in PDFfontNumber function in devPS.c: >> >> num = 1000 + (cidfontIndex - 1)*5 + 1 + face; >> to >> num = 1000 + (cidfontIndex - 1)*5 + face; >> >> It appears two times in the function. >> >> However, I don't know how to compile the whole R distribution on Windows >> platform. Would anyone here like to give a test? Thanks in advance! >> >> Regards, >> Jinsong > > I have compiled R 2.11.1 on a Linux machine, and confirmed that > PDFfontNumber function in devPS.c (grDevices library) has a bug, which > causes the plain face of CID fonts cannot be accessed when CID fonts > were used together with default font family in pdf(). > > the following is the patch. > > --- devPS_orig.c Sun Apr 25 06:10:04 2010 > +++ devPS.c Fri Jul 02 09:46:55 2010 > @@ -7267,7 +7267,7 @@ > * Use very high font number for CID fonts to avoid > * Type 1 fonts > */ > - num = 1000 + (cidfontIndex - 1)*5 + 1 + face; > + num = 1000 + (cidfontIndex - 1)*5 + face; > else { > /* > * Check whether the font is loaded and, if not, > @@ -7303,7 +7303,7 @@ > } else /* (isCIDFont(family, PDFFonts)) */ { > if (addPDFDeviceCIDfont(cidfontfamily, pd, > &cidfontIndex)) { > - num = 1000 + (cidfontIndex - 1)*5 + 1 + face; > + num = 1000 + (cidfontIndex - 1)*5 + face; > } else { > cidfontfamily = NULL; > > Regards, > Jinsong-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/
Seemingly Similar Threads
- PDFfontNumber bugs in devPS.c (Re: plain text in Chinese can not be set)
- plain text in Chinese can not be set
- A patch for extending pdf device to embed popup text and web links
- rgb to cmyk conversion is wrong in src/library/grDevices/src/devPS.c (PR#11509)
- "Too many raster images" in devPS.c