[3.8beta-6375][Bug][m17n] Displaying Greek alpha, beta, gamma.
Hannes Hirzel
hirzel at spw.unizh.ch
Tue Nov 16 10:04:48 UTC 2004
Hi
I want to find out which fonts contained in the 3.8beta image can display
Greek letters .
So far I didn't succeed.
What did I do?
I took the code snippet of Boris Gaertner (font survey, swiki:
http://minnow.cc.gatech.edu/squeak/364) and adaptet it so that it works in
3.8beta-6375.
| fontFamilies textStream string
currentFont fontSizes selectedFont |
fontFamilies := (StrikeFont familyNames
reject: [:symbol |
symbol == #DefaultTextStyle
| (symbol == #DefaultFixedTextStyle)
]).
string := 'The quick brown fox jumps over the lazy sleeping dog'.
textStream := TextStream on: (Text new: 5000).
fontFamilies do:
[:symbol | | fa |
currentFont := TextStyle named: symbol.
fa := currentFont fontArray.
fontSizes := fa collect: [:fnt | fnt height].
fontSizes do:
[:s |
selectedFont := StrikeFont familyName: symbol
size: s.
textStream withAttribute:
(TextFontReference toFont: selectedFont)
do: [textStream nextPutAll: symbol asString, ':',
string; cr].
].
textStream cr.
].
"textStream inspect" "works in both cases, the problem is below".
Workspace new
contents: textStream contents;
openLabel: 'Font survey:'
This works fine.
However when I choose a string with Unicode characters in it (let's say
Greek alpha, beta, gamma) then I get a Walkback (actually even an
emergency evaluator).
Replace in the snippet above
string := 'abc ', 945 asCharacter asString, "Greek alpha"
946 asCharacter asString, "Greek beta"
947 asCharacter asString. "Greek gamma".
and reevaluate it.
The I get an emergency evaluator. The expected behavior would be that it
works as above and that the fonts which do not have the Greek letters just
show boxes instead.
Any help how this can be fixed is appreciated and many thanks in advance.
Hannes
More information about the Squeak-dev
mailing list
|