Find another strange thing
inspect "TextStyle defaultFont", in Squeak 3 (3.8,3.9,3.10), it was display as StrikeFontSet, but in Squeak 4, it was display as StrikeFont.
Also for the inputIntepreter, it work in 3.8, 3.9, but doesn't work in 3.10, any suggestion on how to debug such kind of method?
For InputIntepreter
'From Squeak3.10.2 of ''5 June 2008'' [latest update: #7179] on 30 January 2011 at 4:58:28 pm'! KeyboardInputInterpreter subclass: #WinGB2312InputInterpreter instanceVariableNames: 'converter' classVariableNames: '' poolDictionaries: '' category: 'Multilingual-TextConversion'! !WinGB2312InputInterpreter methodsFor: 'all' stamp: '1 1/30/2011 16:55'! initialize converter := CNGBTextConverter new. ! ! !WinGB2312InputInterpreter methodsFor: 'all' stamp: 'yo 6/20/2006 11:11'! nextCharFrom: sensor firstEvt: evtBuf | firstCharacter secondCharacter peekEvent char1Value keyValue pressType type stream multiCharacter | keyValue := evtBuf third. pressType := evtBuf fourth. pressType = EventKeyDown ifTrue: [type := #keyDown]. pressType = EventKeyUp ifTrue: [type := #keyUp]. pressType = EventKeyChar ifTrue: [type := #keystroke]. char1Value := (Character value: keyValue) macToSqueak asciiValue. (char1Value > 16rA0 and: [char1Value < 16rF8]) ifFalse: [ ^ keyValue asCharacter. ]. peekEvent := sensor peekEvent. peekEvent ifNotNil: [ pressType := peekEvent fourth. ]. "peekEvent printString displayAt: 0@0." (peekEvent notNil and: [(peekEvent at: 4) = EventKeyDown]) ifTrue: [sensor nextEvent. peekEvent := sensor peekEvent. peekEvent ifNotNil: [ pressType := peekEvent fourth. ]. ]. (type = #keystroke and: [peekEvent notNil and: [(peekEvent at: 1) = EventTypeKeyboard and: [(peekEvent at: 4) = EventKeyChar]]]) ifTrue: [ firstCharacter := char1Value asCharacter. secondCharacter := (peekEvent at: 3) asCharacter macToSqueak. stream := ReadStream on: (String with: firstCharacter with: secondCharacter). multiCharacter := converter nextFromStream: stream. multiCharacter isCharacter ifTrue: [ multiCharacter isOctetCharacter ifFalse: [ sensor nextEvent ]. ]. ^ multiCharacter. ]. ^ keyValue asCharacter. ! ! 在 2011年1月30日 下午2:14,Eric ericqiu@gmail.com写道:
Were you able to inspect the decoded character values? If the decoding is right then the issue is with fonts. See isFontAvailable and installFont methods in LanguageEnvironment to see how to load language-specific fonts
on
startup. GreekEnvironment and JapaneseEnvironment classes depend on such external font files.
The decoding is correct, for example, a chinese character ‘中', the UTF8
decoding is 25185837, but the dispaly in the workspace is ??, I inpsect on : (SimplifiedChineseEnvironment new) isFontAvailable, it return false to me.
and i run following to installFont: (Locale isoLanguage: 'zh') languageEnvironment fontDownload. seems not font support on the net, any suggestion on how could i got the font for chinese?
And also i have read the chinese support codes developed by Yo, it does work on Squeak 3,8 and 3,9, but it doesn't work on 4.1, I don't understanding what the different feature on Squeak4.1 on Language support side?
Subbu