Home > Archive > PostScript > September 2007 > Chinese Fonts in PS
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Chinese Fonts in PS
|
|
| Peter Pippinger 2007-09-05, 7:07 pm |
| Hello NG,
i have installed a chinese Font. The "normal" Text comes out good. But
the Chinese Characters are not to see. Here is my PS:
-----------------
%!PS
0 0 moveto 306 396 lineto
/DFPHeiW3 10 selectfont
(chinese character:) show
(/) show
(\174\163) show
(/) show
<7c73> show
612 792 lineto
stroke
showpage % END OF PROGRAM
-----------------
How do i have to tell chinese Glyphs? It would be great just telling
the Unicode (f. ex. $7c73).
Thanks for any help!
Peter
| |
| LEE Sau Dan 2007-09-06, 8:06 am |
| >>>>> "Peter" =3D=3D Peter Pippinger <peter.pippinger@gmx.de> writes:
Peter> Hello NG, i have installed a chinese Font. The "normal"
Peter> Text comes out good. But the Chinese Characters are not to
Peter> see.=20
...=20
Peter> How do i have to tell chinese Glyphs? It would be great
Peter> just telling the Unicode (f. ex. $7c73).
No, unless your font is encoded with Unicode.
Most fonts are encoded in some national encodings, such as BIG5,
GB-2312, and more. You have to use the same encoding when specifying
characters in the string to the 'show' operator.
It is also possible to directly specify the glyph name using the
'glyphshow' operator. But that's tedious for showing lots of text,
and for Chinese, you'll have a hard time looking up the glyph names.
(Are the glyph 'names' in Chinese Type1 fonts generated from the
native encoding of that font?)
--=20
Lee Sau Dan =A7=F5=A6u=B4=B0 ~=
{@nJX6X~}
E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee
| |
| francois.d.robert@gmail.com 2007-09-06, 8:06 am |
| On Sep 6, 10:36 am, LEE Sau Dan <dan...@informatik.uni-freiburg.de>
wrote:
[color=darkred]
> Peter> How do i have to tell chinese Glyphs? It would be great
> Peter> just telling the Unicode (f. ex. $7c73).
>
> No, unless your font is encoded with Unicode.
>
> Most fonts are encoded in some national encodings, such as BIG5,
> GB-2312, and more. You have to use the same encoding when specifying
> characters in the string to the 'show' operator.
Isn't it possible to either :
a) Reencode the original font (never tried on CID-keyed ones, though)
or
b) Create a Type 0 (composite) font based on the original one and
define the encoding you want
?
| |
| Helge Blischke 2007-09-06, 8:06 am |
| francois.d.robert@gmail.com wrote:
> On Sep 6, 10:36 am, LEE Sau Dan <dan...@informatik.uni-freiburg.de>
> wrote:
>
>
>
>
>
> Isn't it possible to either :
> a) Reencode the original font (never tried on CID-keyed ones, though)
> or
> b) Create a Type 0 (composite) font based on the original one and
> define the encoding you want
> ?
>
There is (or was) a Mozilla version which incorporates,
when printing to a PostScript printer, a PS procedure
to print UTF16 encoded strings.
But I must admit I haven't looked into it very deeply,
just saved it as a possible basis for further research
and developement if needed.
I could forward you what I have dumped if it may be an
option for you.
Helge
--
Helge Blischke
Softwareentwicklung
H.Blischke@acm.org
| |
| LEE Sau Dan 2007-09-06, 7:08 pm |
| >>>>> "francois" =3D=3D francois d robert <francois.d.robert@gmail.com> wri=
tes:
francois> Isn't it possible to either : a) Reencode the original
francois> font (never tried on CID-keyed ones, though) or b)
francois> Create a Type 0 (composite) font based on the original
francois> one and define the encoding you want ?
Yes. You may recode a font. I only have experience with recoding
Type1 fonts, though. Don't know if Type 0 and CID fonts can be
recoded as easily.
But even if you could, please don't forget that there are myriads of
glyphs in a typical Chinese font (unless it is already subsetted).
Recoding them is tedious, unless you have the recoding tables (which
are huge) readily available. That's why I never touch Chinese PS
fonts myself, even though I like hacking Postscript manually (using
Emacs) and Chinese is my native language. In some applications, you
may find it better to embed those encoding conversion tables in your
own programs, and then have your programs generate the font-native
codes directly, rather than doing the hard work in Postscript.
--=20
Lee Sau Dan =A7=F5=A6u=B4=B0 ~=
{@nJX6X~}
E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee
| |
|
| In article <87odgfx3sb.fsf@informatik.uni-freiburg.de>,
danlee@informatik.uni-freiburg.de says...
>
> francois> Isn't it possible to either : a) Reencode the original
> francois> font (never tried on CID-keyed ones, though) or b)
> francois> Create a Type 0 (composite) font based on the original
> francois> one and define the encoding you want ?
>
> Yes. You may recode a font. I only have experience with recoding
> Type1 fonts, though. Don't know if Type 0 and CID fonts can be
> recoded as easily.
You don't 'encode' a CIDFont, nor a type 0. You don't normally use a
CIDFont natively anyway, you normally compose it with a CMap to get a
CIDKeyed instance, a type 0 font.
The CMap, in effect, does the same job as an Encoding, it maps character
codes to glyphs, with the additional wrinkle of allowing you to specify
which code ranges take multiple bytes, and how many.
So its perfectly possible to create a CMap which maps Unicode code
points to glyphs, provided you know the glyph names. The Registry and
Ordering of the CIDFont tells you that, and the CMap also contains a
Registry and Ordering, the two must match.
Adobe do (or did) provide a set of Unicode CMap resources somewhere, and
these will work with fonts which use the appropriate Adobe Registry. For
example the UniCNS-UTF16-H CMap resource maps fonts with a Registry of
'Adobe' and an Ordering of CNS1 (ie Chinese) to UTF16.
As you note, there are an awful lot of glyphs in CJKV fonts, and its not
reasonable to re-encode them, or create your own CMap. Far better to use
an existing CMap, or use a 'standard' encoding for the language.
Note that Latin fonts *are* encoded, they use something similar to
ASCII, so it *looks* like the font just 'understand' the text, but this
is not the case. Similarly, however, if you use one of the 'normal'
character code sets for your CJKV language (Big 5 or Shift-JIS for
example) then the fonts will 'just work'.
Ken
| |
| Peter Pippinger 2007-09-06, 7:08 pm |
| On 6 Sep., 10:36, LEE Sau Dan <dan...@informatik.uni-freiburg.de>
wrote:
[color=darkred]
> Peter> How do i have to tell chinese Glyphs? It would be great
> Peter> just telling the Unicode (f. ex. $7c73).
>
> No, unless your font is encoded with Unicode.
Hello again,
how can i find out, if the font is encoded with Unicode?
Thanks for any help!
Peter
| |
| Jean-François Moine 2007-09-07, 4:18 am |
| Peter Pippinger <peter.pippinger@gmx.de> a skrivas:
> i have installed a chinese Font. The "normal" Text comes out good. But
> the Chinese Characters are not to see. Here is my PS:
[snip]
Did you look at 'cnprint'? I use it in a Tcl script (chinese.tcl - look
at my page) to extract the postscript code of the chinese characters.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
|
|
|
|
|