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

German Language Modified Vowels in Hershey Font



Folks,

Harald von der Osten-Woldenburg asked this question the
other day:

(1) the german language uses modified vowels (some strange letters...).
Is there really no chance to come along with them in the IDL's
font-libraries? I mean "ae", "ue" etc

I replied that I thought this was not possible with
the Hershey character set. (And I had to resort to
specious historical arguments to make my case, if
you recall.)

Well, as someone who really, really should know
what he is talking about pointed out to me, I was
wrong about this. :-(

Wrong, but not exactly at fault. It turns out that
the Hershey character set has *many* more characters
in it than those of us who work on Windows machines
and/or read the IDL documentation know about.

The standard way to find out how to create a character
in IDL is to use the Showfont command. For example,
if I want to see the standard default Duplex Roman
character set, I would type this:

   IDL> Showfont, 3 'Duplex Roman'

But, here is the interesting thing, if I do this on
a Windows machine I see 96 characters. If I do it on
an UNIX machine I see 224 characters! The on-line
documentation shows the Windows version of the 
character set. So there may be many more of you
besides me who don't know of the richness of the
Hershey character set.

(In fact, the question "How many characters are there
in the Hershey Duplex Roman character set?" was the
qualifying question for next year's nominees to the 
IDL Expert Programmers Association. The fact that
no one got it right was what caused the all-expenses-
paid Winter meeting in Aspen to be canceled.)

It turns out that there is a bug in the Showfont
command that causes file values to be read incorrectly.
You can fix it yourself if you like. Find this line
in the showfont.pro file in the lib sub-directory:

   openr, unit, /GET_LUN, $
      filepath('hersh1.chr', subdir=['resource', 'fonts'])

Modify the line to add a SWAP_IF_LITTLE_ENDIAN keyword, like this:

   openr, unit, /GET_LUN, $
      filepath('hersh1.chr', subdir=['resource', 'fonts']), $
      SWAP_IF_LITTLE_ENDIAN=1

Now re-compile and you will see all 224 characters on your
machine for sure.

   IDL> Showfont, 3 'Duplex Roman'

And what you will notice is that there are any number
of characters that can be important in the German
language (as well as many others). And in particular,
you will find the modified vowels, umlauts, etc. that
Harald was asking about. 

So, for example, to write the AE character, you
might do something like this:

   IDL> ae = String(198B)
   IDL> XYOutS, 0.5, 0.5, /Normal, Align=0.5, ae, Size=3

I'll leave it as an exercise for the reader to discover
how I converted the octal values in the Showfont 
illustration to a decimal number. :-)

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155