[squeak-dev] Problem with #applyTransitions in Language Translator

karl ramberg karlramberg at gmail.com
Wed Feb 22 07:42:45 UTC 2012


On Wed, Feb 22, 2012 at 4:47 AM, Chris Muller <asqueaker at gmail.com> wrote:
> There appears to be a corruption in Squeak's font structure for
> special-characters.
>
> The #fallbackFont of the StrikeFont refers back to the original
> StrikeFont, leading to endless recursion and locking up your image.
> This script identifies the fonts with wrong pointers:
>
>  StrikeFont allInstances select: [ : e | (e fallbackFont respondsTo:
> #baseFont) and: [ e fallbackFont baseFont == e ] ]
>
> StrikeFont>>#widthOf: aCharacter -- if the aCharacter is a special
> character it will ask the #fallbackFont for widthOf: aCharacter, which
> turns around and asks it's #baseFont, which happens to be the original
> StrikeFont.
>
> The problem occurs when the fallbackFont is not already set.  So this
> appears to be a bug with StrikeFont>>#fallbackFont.
>
> Do any of the font experts know a proper fix?
>
>

We have a fix for this issue in the Etoys.image.

I just copy paste from a mail...,

Karl

  ----- Method: FixedFaceFont>>fontSize: (in category 'accessing') -----
  fontSize: aNumber
+ |font|
+ font := (StrikeFont familyName: baseFont familyName size: aNumber)
shallowCopy.
+ font fallbackFont: nil.
+ self baseFont: font!
- self baseFont: (StrikeFont familyName: baseFont familyName size:
aNumber) copy!

I
>
> 2012/2/20 강진오 <jinoh67 at gmail.com>:
>> Hi.
>>
>> I have a problem with my language translator.
>>
>> When I press [apply] button on my language translator,
>>
>> My Squeak was lacked and got a lot of memory and CPU.
>>
>> I restarted and executed that action with new process.
>>
>> Even though the priority of it was the lowest (10),
>>
>> It started to make my Squeak to be slow.
>>
>> I suspended it and traced the stack.
>>
>> It was the loop of:
>>
>> StrikeFont>>widthOf:
>>
>> FixedFaceFont>>widthOf:
>>
>> StrikeFont>>widthOf:
>>
>> FixedFaceFont>>widthOf:
>>
>> StrikeFont>>widthOf:
>>
>> FixedFaceFont>>widthOf:
>>
>> StrikeFont>>widthOf:
>>
>> FixedFaceFont>>widthOf:
>>
>>>>
>> There was limit to view all stack trace,
>>
>> So I created new process that trace suspended stack trace.
>>
>> But I couldn’t find the root.
>>
>> What happened to my Squeak?
>>
>>
>>
>>
>


More information about the Squeak-dev mailing list