[poppler] Support for CJK fonts in postscript / on Windows platforms

Albert Astals Cid aacid at kde.org
Fri Mar 2 11:14:44 PST 2012


El Dilluns, 27 de febrer de 2012, a les 09:25:03, Thomas Freitag va escriure:
> Am 26.02.2012 23:04, schrieb Albert Astals Cid:
> > El Diumenge, 26 de febrer de 2012, a les 08:44:09, Thomas Freitag va 
escriure:
> >> Hi,
> > 
> > Hi, it would be you really cool if you configured your Visual Studio with
> > the poppler [crazy] indentation settings, it's getting harder and harder
> > to read/diff/apply your patches :-/
> 
> Sorry, I'll try. Should be only GlobalParamsWin.cc, which I edited in
> Visual Studio, isn't it?

No, the other was wrong too, poppler has a very weird indenting pattern and is 
difficult to get right, it's basically 2 spaces for each indentation but when 
you have 8 spaces it gets replaced with a tab character

> 
> >> I implemented a patch which supports CJK fonts in the postscript output
> >> device and on Windows platforms in general. It consists mainly of three
> >> parts:
> >> 
> >> 1. Adapt bug fix for bug 11413 to the postscript device
> >> 2. A small bug fix when locateFont doesn't find a suitable font and
> >> returns a null pointer
> >> 3. CJK substitute implementation on WIndows platforms.
> >> 
> >> to 1.:
> >> Adapting the implementation of the bug fix for splash and cairo to the
> >> postscript device was quite easy. But my first proofs of the output with
> >> ghostscript 8.71 shows some regressions where the CJK chars have a
> >> smaller height than the default square of the font. But the "48" in the
> >> output of bug-poppler11413.pdf which is set in a "normal" font but
> >> rotated was at the right position. Then I stepped to ghostscript 9.04,
> >> and now the CJK chars were shown correctly, but the 48 was positioned
> >> wrong. But because of these different tests I think that it is still a
> >> problem in ghostscript when using a mix of CJK fonts and "normal" fonts.
> >> BTW, also Acrobat X distiller has problems with the position of the "48"!
> > 
> > I understand this applies to non-windows too, right?
> 
> Yes, point 1 and 2 applies to all platforms (even if 2 probably only
> happens if don't using fonfconfig, so just under Windows)

So what's the difference i should see when running in linux? The outputted ps 
file having a different rendering for CJK files?

Albert

> 
> Thomas
> 
> > Albert
> > 
> >> to 2.:
> >> On my first tests with PDF which uses non embedded CJK fonts on Windows
> >> I got crashes. Reason for it was that GlobalParamWin returns Helvetica,
> >> which is not a CID font, but locateFont accepts here only CID fonts and
> >> therefore returns a NULL pointer. I first fixed that and then decided to
> >> return as default MS Mincho if a CID font is expected.
> >> 
> >> to 3.:
> >> When You install ghostscript on WIndows You're able to switch on CJK
> >> support. This will create a  cidfmap file in the gs-lib directory. The
> >> ps file which creates it (mkcidfm.ps) runs over the windows font
> >> directory and tries to create a suitable substitution table for missing
> >> CJK fonts. The cidfmap file is more or less PDF like, so it's quite easy
> >> to parse it with our parser and create a substitution table in
> >> GlobalParamsWin and use that table. But I expect it in the poppler data
> >> dir instead of searching for ghostscript installation. If it is not
> >> there, it always returns the default CID font of point 2.
> >> You can either copy it from the gs lib directory or create it with the
> >> ghostscript tool calling
> >> 
> >> gswin32c -q -dBATCH -sFONTDIR=<windows font directory>
> >> -sCIDFMAP=<popper data dir>/cidfmap mkcidfm.ps
> >> 
> >> To clearify the format of cidfmap I attach the file produced on my
> >> installation. Keep care: I have not a default windows installation with
> >> windows on c:/windows, my windows installation is on drive f!
> >> 
> >> Cheers,
> >> Thomas
> > 
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > .
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list