[Q] fonts and encodings

Boris Gaertner Boris.Gaertner at gmx.net
Tue Oct 19 20:38:57 UTC 2004


From:  <JanBKrejci at gmail.com>

> So the question is: where do I get UTF-8 encoded font containing
> ISO-8859-2 characters (free mscore ttf?) and how do I load it into Squeak?
>

I do not have a really easy solution, but some hints may help.

1. A free font:
Mark Leisher is the creator of a free BDF font 'ClearlyU' with more
than 8000 Unicode glyphs. His homepage is
http://crl.nmsu.edu/~mleisher/cu.html
but the link to his font is currently broken.
Have a look at:
http://lists.debian.org/debian-i18n/2001/10/msg00024.html


This is archivated mail and the message gives four links:
The two http links are both broken, but the ftp links work.
It should be possible to download the ClearlyU via ftp.

Doing that, you should obtain a font file named
cu12.bdf (size of the uncompressed file: 1324 KBytes)

To load this file into an image, file in the change set
UnicodeFont.4.cs  that is attached to this mail.

Copy the file cu12.bdf  into the working directory of
your Squeak and evaluate this expression:

 UnicodeFont loadLargeFont: 'CU-' fromBDF: 'cu12.bdf'.

Evaluation will take quite a while and during evaluation
you will see glyphs in the top left corner of the Squeak
window. (the header of the bdf file is copied into
the Transcript window)

This will add 86 new StrikeFonts into your image.
The names of these Fonts are
'CU-', <two-digit page number>, '-NewYork'
The <two-digit page number> is the high byte of the
Unicode value. Consequently the font
'CU-04-NewYork' contains glyphs for codepoints
u0400 to u04FF.

To look at the glyphs, you may wish to load the
MorphicFontEditor from SqueakMap. It works for
the current Squeak 3.8


You cannot immediately use these strike fonts for
several reasons; the most unpleasant one being that
all these fonts use the same stop conditions that give
special treatment to glyphs at page positions
16r01 (anchor), 16r09 (tab)
16r0D (cr) 16r20 (space)

I think what you want to do at this moment is to create a
StrikeFont with all characters of ISO- 8859-2.
This should be doable with the font editor. You can
make a copy of CU-00-NewYork and copy the characters
for ISO-8859-2 from the pages CU-01 and CU-02

Final hints:
You may wish to backup your image and your changes
before you try all this.

You will note that the font selection utility is
unable to handle the names of more fonts than is
can display. To delete unwanted fonts, you can
use  something like:

 (TextConstants keys select: [:k | (k copyFrom: 1 to: 2) = 'CU'])
   do: [:k | TextConstants removeKey: k]


---------------------------------
In principle, it should be possible to load all glyphs of
ClearlyU into one StrikeFont with a
SparseLargeTable as xTable. To do that, you
have first to file in BDFFontReaderFix.1.cs
With that fix, you can evaluate:


StrikeFont
 newFromEFontBDFFile: 'cu12.bdf'
  name: 'ClearlyU' startRange: 16r1 endRange: 16rFFFF.

Note that a startRange of 16r0 will bring up the debugger.

I cannot tell you right now how we can use such a
large font. The MorphicFontEditor is currently
unable to show such fonts and I think that the
character scanners are also unable to use them.

However, when you store the font somewhere, you
can access and display single characters:

  | fnt |
  fnt := <a font like the above one>.
 (fnt characterFormAt: (MultiCharacter value: 16r410))
  displayAt: 10 at 10 .


-----------------------------------------------

For those who want to experiment with TTF fonts,
here is a link to a free font:
http://home.att.net/~jameskass
The font Code2000 contains a total of 62981 glyphs for
50711 Unicode codepoints!
I have not tried to use this font with Squeak 3.8,
but perhaps others may wish to play with this font.
Note that this font cannot be viewed with the
Morphic font editor, which is for strike fonts only.


I hope this helps, but it may as well create more
problems than it solves.

Greetings, Boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnicodeFont.4.cs
Type: application/octet-stream
Size: 16083 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20041019/a943bd7a/UnicodeFont.4.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BDFFontReaderFix.1.cs
Type: application/octet-stream
Size: 825 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20041019/a943bd7a/BDFFontReaderFix.1.obj


More information about the Squeak-dev mailing list