Please, in any widely-available Japanese font, how does one show horizontally the glyphs for the three unicode characters 6CC9 5341 6BB5? Variations on the below just don't seem to work produce anything useful (either the font is missing and become Courier, or the log file reports %%[ Error: invalidfont; OffendingCommand: glyphshow ]%%).
In article <1192108571.887657.154...@v3g2000hsg.googlegroups.com>, jdawise...@gmail.com says...
> Please, in any widely-available Japanese font, how does one show > horizontally the glyphs for the three unicode characters 6CC9 5341 > 6BB5?
CJKV fonts can't be explained that easily. Firstly it depends on what kind of font you have. You will either have an OCF font (type 0) or a CIDFont.
If you have an OCF font it is already encoded with some appropriate encoding, such as Shift-JIS. You need to convert your Unicode code points into Shift-JIS to use it. You cannot use the Unicode code points directly.
If you have a CIDFont, then you must first create a type 0 (OCF) font from it, by composing it with a suitable CMap. There are a number available, but there is a caveat; the CMap must match the CIDFont. Both the CMap and the CIDFont have a Registry and Ordering, the values in the CMap must match the values in the CIDFont for the two to be compatible.
Assuming you have CMaps compatible with your fonts, then you select the most suitable and compose it with your CIDFont using composefont. Presumably if you are using Unicode code points you will want one of the Unicode CMaps, probably a UCS2 CMap.
> Variations on the below just don't seem to work produce anything > useful (either the font is missing and become Courier, or the log file > reports %%[ Error: invalidfont; OffendingCommand: glyphshow ]%%).
This looks like the reault of composing a font called AquaKana with an Adobe-Japan1-0 CMap, but it could just be a font name. How did you arrive at this name ?
Note that all the references to AquaKana I can find suggest this is an OpenType font. PostScript doesn't support OpenType directly. Some interpreters can load an OpenType font as if it were a CIDFont, some may load it as a type 0 font. So the next question is what PostScript interpreter you are using ?
Given that you haven't used the CIDFont resource, it seems pretty unlikely that the result of this will be a CIDFont.
> /uni6CC9 glyphshow
What result do you get trying this ? If the font is a CIDFont then you cannot use a name to reference a glyph, you must use a CID. I'm not certain what error that will generate, I suspect an invalidfont error.
If the font is a type 0 font then you *will* get an invalidfont (see PLRM, glyphshow, p602) as you cannot use glyphshow with a type 0 font.
So whatever the font type, I would expect this to fail with an invalidfont error.
Speculation; let's assume that what you have here is a type 0 font, lets further assume that it is already composed with a suitable CMap for Unicode code points. In this case, replacing the line:
/Uni6CC9 glyphshow
with:
<6CC9> show
should probably work. I suspect it will render something that way anyway.
If this is a type 0 font then any CIDs for which there is no glyph defined will simply render as a /.notdef, so a simple program could be written to draw pages of glyphs by running in a loop from 0x0000 to 0xffff. I'm assuming that these are 16-bit Unicode code points.
I realise I'm not being totally helpful here, but none of this is simple, and without a lot more information about your environment, its not really possible to give explicit instruction.
100 600 moveto /AquaKana-Adobe-Japan1-0 48 selectfont <6CC9> show
distills, but contains only a crossed rectangle, which is probably the /.notdef representation.
What's wanted is the simplest possible way to mark those three glyphs, in any sensible Japanese font that my Mac is likely to have. AquaKana... was chosen as the alphabetically first from amongst the those containing the string "Japan" that were output by: (*) {=} 255 string /Font resourceforall I don't particularly like or dislike it, and am willing to use any other (indeed, I don't even know what it looks like).
jdaw1 <jdawise...@gmail.com> wrote: >What's wanted is the simplest possible way to mark those three >glyphs, in any sensible Japanese font that my Mac is likely to have. >AquaKana... was chosen as the alphabetically first from amongst the >those containing the string "Japan" that were output by: >(*) {=} 255 string /Font resourceforall >I don't particularly like or dislike it, and am willing to use any >other (indeed, I don't even know what it looks like)
Since you know nothing about this font, it seems unlikely you could use it effectively. This sort of random approach doesn't seem likely to succeed.
Did you install Japanese support for Distiller? If so, it will have installed a CIDFont resource and suitable CMap for it, and by examining these you should be able to get started. Note that it is unlikely to be set up to use Unicode. ---------------------------------------- Aandi Inston Please support usenet! Post replies and follow-ups, don't e-mail them.
OK, stop there. This is (or more accurately, was) intended to be a sake example for my usual PostScript project, www.jdawiseman.com/papers/trivia/glasses.html (which leads to www.jdawiseman.com/papers/trivia/glasses.ps). So what's wanted is (was) something that little expertise can make work on most machines and most ps->pdf converters. That clearly isn't happening: Japanese clearly requires detailed knowledge of fonts, and of the strokes of which characters are composed. That's more than I'm willing to assume of myself or my users.
As always on this forum, help has been prompt and expert: thank you again. Though, as happens sometimes, that help says that PostScript is showing its age. It isn't young anymore.
Perhaps what I should have said is that, if there isn't a Kanji equivalent to /Times-Roman (present and working the same almost everywhere), then, in a very real and legally binding sense, this isn't a good plan.
In article <1192143458.124272.184...@t8g2000prg.googlegroups.com>, jdawise...@gmail.com says...
> (which leads to www.jdawiseman.com/papers/trivia/glasses.ps). So > what's wanted is (was) something that little expertise can make work > on most machines and most ps->pdf converters. That clearly isn't > happening: Japanese clearly requires detailed knowledge of fonts, and > of the strokes of which characters are composed. That's more than I'm > willing to assume of myself or my users.
Not really the case. You do expect your users to know ASCII ? Well the Japanese (and other) Encoding systems are simply the equivalent. You can't realistically use a CJKV font unless you know what the characters are, any more than you can use a Latin font without knowing the Latin alphabet.
You can check the CIDFont resources on a PostScript device to see if it has a Kanji font available. If not then you have to stop, much the same as you would do on a Western computer (Yes, I know they usually have a font which can do nearly all languages, but even that is new).
If you find any CIDFonts, then you can check the Registry to see if they are compatible with the language you want to use (eg Japan1). If so, then you can either:
1) Check the available CMaps to see if there is one that suits your needs and has an appropriate Registry and Ordering.
2) Create your own CMap, though this requires some knowledge of the Ordering.
The assumption you are making which is at least partially invalid is that a PostScript interpreter running on an operating system has acc ess to the OS fonts, and can use them. In practice this will be true for pretty much any modern interpreter, the problem you have is in knowing how to do so.
You tried to use a /Font resource, that must therefore be an already composed type 0 font, or an OCF, or a latin font. You can use those, but only if you know how they are encoded. Note that, as you are probably already aware, you often need to re-encode a Latin font to use it....
If you instead tried using a CIDFont you might have more succcess.
If the user is going to access a font solely through glyph names and glyphshow, no, not really. Obviously if strings are being entered as strings then the encoding becomes important. But I print an /aring only via that name, never via a particular encoding that might hold on my Mac but not on your PC.
Meanwhile, I will try to find out whether there is a Kanji CIDFont on my Mac.
jdaw1 <jdawise...@gmail.com> wrote: >> You do expect your users to know ASCII ?
>If the user is going to access a font solely through glyph names and >glyphshow, no, not really. Obviously if strings are being entered as >strings then the encoding becomes important. But I print an /aring >only via that name, never via a particular encoding that might hold on >my Mac but not on your PC.
But glyphshow is not applicable to CID fonts, you need to know the CID. This is substantially worse than using show with a known encoding.
>Meanwhile, I will try to find out whether there is a Kanji CIDFont on >my Mac.
The only good one to use in an example is the one which will have come with Distiller if you have the Far Eastern fonts installed. There is a sort of universal font in Japanese printers, as I understand it. There were some Adobe tech notes about this many years ago. ---------------------------------------- Aandi Inston Please support usenet! Post replies and follow-ups, don't e-mail them.
jdaw1 <jdawise...@gmail.com> wrote:. >Meanwhile, I will try to find out whether there is a Kanji CIDFont on >my Mac.
Just a point to emphasise: this IS hard. Really hard. Of course, people in Japan have the advantage of familiarity and motivation.
To give you an idea of the complexities you potentially face, consider the book "CJKV Information Processing". This book by Ken Lunde is essential reading if you want to understand how Chinese, Japanese, Korean or Vietnamese are represented. I realise you are looking for a shortcut, but it's worth pointing out that this book has over 1000 pages. It does not cover PostScript at quite the detail level you would require, but has six pages on PostScript, including a page on how to get this working in GhostScript.
Despite having worked with PostScript for a decade, and despite having written an interpreter, I still consider your question hard.
---------------------------------------- Aandi Inston Please support usenet! Post replies and follow-ups, don't e-mail them.
This isn't useful if it isn't at least moderately easy. And it surely isn't. I am now quite sure that this isn't sufficiently easy to be worthwhile. Enough of your time has been wasted on this: let's stop. Thank you again.