[Q] Strikefont - characterToGlyphMap (MacRoman vs. Windows encoding)

Hannes Hirzel hannes.hirzel.squeaklist at bluewin.ch
Wed Apr 23 13:58:11 UTC 2003


Hi all

I understand that every bitmap font in Squeak may have its own encoding.
The class Strikefont has an instance variable characterToGlyphMap which
is set in the method
createCharacterToGlyphMap to standard values.

	| map |
	map _ Array new: 256.
	0 to: minAscii - 1 do:[:i| map at: i + 1 put: maxAscii + 1].
	minAscii to: maxAscii do:[:i| map at: i + 1 put: i].
	maxAscii + 1 to: 255 do:[:i| map at: i + 1 put: maxAscii + 1].
	^map

With a font utility I loaded the Windows Verdana font (encoded in
Windows CP 1252) in an image. However as the Squeak image has MacRoman
encoding as it's standard the upper ASCII character do not display
properly.

My question: Does somebody have the code for a method defining a
characterToGlyphMap which remaps the glyphs encoded for Windows for the
Mac encoding. Or is this already in the code somewhere?

Thanks in advance

Hannes



More information about the Squeak-dev mailing list