<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>This patch is from xpdf-3.00, fixed display cjk fonts which
not embedded in pdf file (need xpdf cjk language package).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>diff -Naur poppler-0.3.3.orig/poppler/CharCodeToUnicode.h
poppler-0.3.3/poppler/CharCodeToUnicode.h<BR>---
poppler-0.3.3.orig/poppler/CharCodeToUnicode.h 2005-03-04
03:46:00.000000000 +0800<BR>+++
poppler-0.3.3/poppler/CharCodeToUnicode.h 2005-07-06 20:23:08.000000000
+0800<BR>@@ -66,6 +66,10 @@<BR> // Map a CharCode to
Unicode.<BR> int mapToUnicode(CharCode c, Unicode *u, int
size);<BR> <BR>+ // Return the mapping's length, i.e., one more than
the max char<BR>+ // code supported by the mapping.<BR>+ CharCode
getLength() { return mapLen; }<BR>+<BR> private:<BR> <BR>
void parseCMap1(int (*getCharFunc)(void *), void *data, int nBits);<BR>diff
-Naur poppler-0.3.3.orig/poppler/SplashOutputDev.cc
poppler-0.3.3/poppler/SplashOutputDev.cc<BR>---
poppler-0.3.3.orig/poppler/SplashOutputDev.cc 2005-03-04 03:46:01.000000000
+0800<BR>+++ poppler-0.3.3/poppler/SplashOutputDev.cc 2005-07-06
20:12:12.000000000 +0800<BR>@@ -502,7 +502,11 @@<BR> double m11,
m12, m21, m22, w1, w2;<BR> SplashCoord mat[4];<BR> char
*name;<BR>- int c, substIdx, n, code;<BR>+// int c, substIdx, n,
code;<BR>+ CharCodeToUnicode *ctu;<BR>+ Unicode uBuf[8];<BR>+
int c, substIdx, n, code, cmap;<BR>+ dfp = NULL;<BR> <BR>
needFontUpdate = gFalse;<BR> font = NULL;<BR>@@ -546,7 +550,7
@@<BR> } else if (!(fileName =
gfxFont->getExtFontFile()))
{<BR> <BR> // look for a display font
mapping or a substitute font<BR>- dfp =
NULL;<BR>+// dfp =
NULL;<BR> if (gfxFont->isCIDFont())
{<BR> if (((GfxCIDFont *)gfxFont)->getCollection())
{<BR> dfp = globalParams-><BR>@@ -652,10 +656,54
@@<BR>
}<BR> break;<BR>
case fontCIDType2:<BR>+/*<BR> n =
((GfxCIDFont
*)gfxFont)->getCIDToGIDLen();<BR>
codeToGID = (Gushort *)gmalloc(n *
sizeof(Gushort));<BR> memcpy(codeToGID,
((GfxCIDFont
*)gfxFont)->getCIDToGID(),<BR> n *
sizeof(Gushort));<BR>+*/<BR>+ codeToGID =
NULL;<BR>+ n =
0;<BR>+ if (dfp) {<BR>+ // create a
CID-to-GID mapping, via Unicode<BR>+ if ((ctu = ((GfxCIDFont
*)gfxFont)->getToUnicode())) {<BR>+ if ((ff =
FoFiTrueType::load(fileName->getCString()))) {<BR>+
// look for a Unicode cmap<BR>+ for (cmap = 0; cmap <
ff->getNumCmaps(); ++cmap) {<BR>+ if
((ff->getCmapPlatform(cmap) == 3 &&<BR>+
ff->getCmapEncoding(cmap) == 1) ||<BR>+
ff->getCmapPlatform(cmap) == 0)
{<BR>+ break;<BR>+
}<BR>+ }<BR>+ if (cmap <
ff->getNumCmaps()) {<BR>+ // map CID
-> Unicode -> GID<BR>+ n =
ctu->getLength();<BR>+ codeToGID =
(Gushort *)gmalloc(n *
sizeof(Gushort));<BR>+ for (code = 0; code
< n; ++code) {<BR>+ if (ctu->mapToUnicode(code, uBuf, 8) >
0) {<BR>+ codeToGID[code] = ff->mapCodeToGID(cmap,
uBuf[0]);<BR>+ } else {<BR>+ codeToGID[code] =
0;<BR>+ }<BR>+
}<BR>+ }<BR>+ delete
ff;<BR>+ }<BR>+ ctu->decRefCnt();<BR>+ } else
{<BR>+ error(-1, "Couldn't find a mapping to Unicode for font
'%s'",<BR>+ gfxFont->getName() ?
gfxFont->getName()->getCString()<BR>+
: "(unnamed)");<BR>+ }<BR>+ } else
{<BR>+ if (((GfxCIDFont *)gfxFont)->getCIDToGID()) {<BR>+ n
= ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();<BR>+ codeToGID =
(Gushort *)gmalloc(n * sizeof(Gushort));<BR>+ memcpy(codeToGID,
((GfxCIDFont *)gfxFont)->getCIDToGID(),<BR>+ n *
sizeof(Gushort));<BR>+ }<BR>+
}<BR> if (!(fontFile =
fontEngine->loadTrueTypeFont(<BR>
id,<BR>
fileName->getCString(),</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> </DIV></FONT></BODY></HTML>