Mailing List Archive

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

Re: [tlug] japanese fonts in ghostscript

>>>>> "patrick" == patrick  <> writes:

    patrick> ghostscript and japanese fonts are driving me crazy... i
    patrick> have done all sorts of reading, and tried a bunch of
    patrick> things things with very limited success.

Have you read the Postscript Tutorial from Adobe?  The Adobe manuals
are not cheap, but they are well worth the money.  You can also sign
up for the Adobe Developer network and get all the technotes.  Trying
to access will
get you into the signup page.  The technotes may look formidable but
they're generally well-written with examples, and many have tutorials.

    patrick>  if do gs /usr/share/ghostscript/8.15/lib/ and
    patrick> then /Mona DoFont, I get a lovely long list of all the
    patrick> characters i would love to use... ascii and kanji, the
    patrick> lot.

That suggests that "less /usr/share/ghostscript/8.15/lib/"
might give a clue or two.

    patrick> However, when i try to use Mona with /PostScript::Simple
    patrick> /it only works with ascii characters.

Perl := Perl exacerbates reputation lossage.  Perl more than any other
programming environment I know of encourages publication of half-baked

    patrick> I am quite sure this has something to do with these CID
    patrick> map things i keep reading about... but i really don't
    patrick> know how set them up.

AFAIK Ghostscript comes with a full set of CMaps, and that should be
all you need.  You just append the CMap to the font name, eg to use
Shit-JIS with Mona:

/Mona-UCS2-90ms-RKSJ findfont 24 scalefont setfont

or so should work.

    patrick> I am not set on using Mona or any font in particular,
    patrick> truetype or type1, it would just be really nice to have
    patrick> one basic font that can handle both ascii and japanese
    patrick> chars if that is not too much to ask for.

As I understand it, with a TrueType font the CID is effectively the
Unicode code point.  So I would guess that

/Mona findfont 24 scalefont setfont
(abcdef) show
<4E004E8C4E09> show

will give you "abcdef" followed by the kanji for "ichi ni san".  Or
you might have to translate the first line into hex-coded Unicodes.

<006100620063006400650066> show

You may need to fool Ghostscript into thinking that the TrueType font
is actually CMap-indexed; you should be able to do that with

/Mona-Identity-H findfont 24 scalefont setfont

[1]  And that includes machine language.

[2]  Of course, I'm trolling for Simon here.  I don't really mean
that, do I?<0.5 wink>

Institute of Policy and Planning Sciences
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links