PDFfontNumber bugs in devPS.c (Re: plain text in Chinese can not be set)
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
Jinsong Zhao, Ph.D. College of Resources and Environment Huazhong Agricultural University Wuhan 430070, P.R. China E-mail: jszhao at mail.hzau.edu.cn