Re: Unable to generate glyphs for chinese letters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, 13 March 2024 13:25:51 GMT Alejandro Colomar wrote:
> Hi Deri,
> 
> I've noticed another similar issue, this time with Chinese.
> 
> I see chinese letters in the bookmarks, but they don't appear in the
> PDF body.  If I read the manual page in the terminal, I do see them.
> When generating the PDF, I get a bunch of warnings about special
> characters not defined.
> 
> 
> See the page head(1):
> 
> 	$ MANWIDTH=64 man ./man/zh_CN/man1/chage.1 | head -n4
> 	CHAGE(1)                 User Commands                CHAGE(1)
> 
> 	名称
> 	     chage - 更改用户密码过期信息
> 
> And here's how I generated the pages:
> 
> $ pwd
> /home/alx/src/linux/man-pages/man-pages/shadow
> $ MANDIR=~/src/shadow/shadow/build/man
> $ pdfdir=.tmp
> $ GROFFBINDIR=/opt/local/gnu/groff/deri-gropdf-ng/bin
> $ PRECONV=$GROFFBINDIR/preconv
> $ PIC=$GROFFBINDIR/pic
> $ TBL=$GROFFBINDIR/tbl
> $ EQN=$GROFFBINDIR/eqn
> $ TROFF=$GROFFBINDIR/troff
> $ GROPDF=$GROFFBINDIR/gropdf
> $ make_book()
> 
> > {
> > make build-book PRECONV=$PRECONV PIC=$PIC TBL=$TBL EQN=$EQN TROFF=$TROFF
> > GROPDF=$GROPDF "$@"; }
> 
> $ make_book_lang()
> 
> > {
> > _LMB=$pdfdir/shadow-HEAD_$1.pdf; make_book MANDIR=$MANDIR/$1 _LMB=$_LMB;
> > }
> 
> $ make_book MANDIR=$MANDIR _LMB=$pdfdir/shadow-HEAD.pdf
> MKDIR		.tmp/
> Build		.tmp/shadow-HEAD.pdf
> $ make_book_lang da
> Build		.tmp/shadow-HEAD_da.pdf
> $ make_book_lang de
> Build		.tmp/shadow-HEAD_de.pdf
> /opt/local/gnu/groff/deri-gropdf-ng/bin/troff:newusers.8:44: warning [p 1,
> 2.8i]: cannot break line $ make_book_lang fr
> Build		.tmp/shadow-HEAD_fr.pdf
> $ make_book_lang it
> Build		.tmp/shadow-HEAD_it.pdf
> $ make_book_lang pl
> Build		.tmp/shadow-HEAD_pl.pdf
> $ make_book_lang ru
> Build		.tmp/shadow-HEAD_ru.pdf
> /opt/local/gnu/groff/deri-gropdf-ng/bin/gropdf:chage.1: warning:
> Font 'Tinos (TINOR)' has 2639 glyphs
> You would see a noticeable speedup if you install the perl module Inline::C
> 
> $ make_book_lang sv
> Build		.tmp/shadow-HEAD_sv.pdf
> $ make_book_lang uk
> Build		.tmp/shadow-HEAD_uk.pdf
> /opt/local/gnu/groff/deri-gropdf-ng/bin/gropdf:chage.1: warning:
> Font 'Tinos (TINOR)' has 2639 glyphs
> You would see a noticeable speedup if you install the perl module Inline::C
> 
> $ make_book_lang zh_CN
> Build		.tmp/shadow-HEAD_zh_CN.pdf
> /opt/local/gnu/groff/deri-gropdf-ng/bin/troff:chage.1:33: warning: special
> character 'u540D' not defined
> /opt/local/gnu/groff/deri-gropdf-ng/bin/troff:chage.1:33: warning: special
> character 'u79F0' not defined
> /opt/local/gnu/groff/deri-gropdf-ng/bin/troff:chage.1:34: warning: special
> character 'u66F4' not defined
> /opt/local/gnu/groff/deri-gropdf-ng/bin/troff:chage.1:34: warning: special
> character 'u6539' not defined
> 
> [ And a bunch of similar warnings... ]
> 
> 
> Cheers,
> Alex

Hi Alex,

The chinese glyphs are present in the bookmarks because you are using my 
branch. :-) They are missing in the text because you don't have a font 
installed which contains those glyphs.

You can download a patch from here:-

http://chuzzlewit.co.uk/chinese.patch.gz

It is too large for email, it contains the UnifontMedium font which contains 
the Chinese glyphs, typographically it is not the best font, a proper type 1 
font which contains CJK glyphs would be better, also it does not do bold 
glyphs.

Gunzip the file then use git apply. There will be two new files in the devpdf 
directory which should be added to git.

Cheers 

Deri








[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux