[squeak-dev] The Inbox: TrueType-kfr.52.mcz

karl ramberg karlramberg at gmail.com
Fri Jan 4 16:59:11 UTC 2019


Both ^ must be there for the code to work.
Maybe assigning the block return value to a variable like in the line above
would look less strange.
But then I'm not sure how to do the ensure: file closing.


Cheers,
Karl


On Fri, Jan 4, 2019 at 9:16 AM Nicolas Cellier <
nicolas.cellier.aka.nice at gmail.com> wrote:

>
>
> Le ven. 4 janv. 2019 à 06:57, karl ramberg <karlramberg at gmail.com> a
> écrit :
>
>> Hi,
>> This code is probably wrong.
>> I posted this fix to inbox because I was unsure how all these nested
>> blocks worked.
>>
>> It kind of works now, because the FontImporterTool opens.
>>
>> Best,
>> Karl
>>
>> No, it's good, just remove the extra ^
> I'm not even sure that it does not work, but without it i'm sure that it
> works (i'm thinking of the ensure), so removal can avoid a brainstorm ;)
>
>>
>>
>> On Thu, Jan 3, 2019 at 10:58 PM Nicolas Cellier <
>> nicolas.cellier.aka.nice at gmail.com> wrote:
>>
>>>
>>>
>>> Le jeu. 3 janv. 2019 à 22:34, <commits at source.squeak.org> a écrit :
>>>
>>>> A new version of TrueType was added to project The Inbox:
>>>> http://source.squeak.org/inbox/TrueType-kfr.52.mcz
>>>>
>>>> ==================== Summary ====================
>>>>
>>>> Name: TrueType-kfr.52
>>>> Author: kfr
>>>> Time: 3 January 2019, 10:34:19.705286 pm
>>>> UUID: 248937ad-7e63-4c27-b659-6165fdda9ffe
>>>> Ancestors: TrueType-pre.51
>>>>
>>>> FontImporterTool would not open because 'Noto Color Emoji' error:
>>>> 'File does not have a naming table'.
>>>> Delete the font from FontPaths and continue
>>>>
>>>> =============== Diff against TrueType-pre.51 ===============
>>>>
>>>> Item was changed:
>>>>   ----- Method: TTFileDescription class>>openFontFile:do: (in category
>>>> 'instance creation') -----
>>>>   openFontFile: fontFileName do: aBlock
>>>>         "Open the font with the given font file name"
>>>>         | fontFilePath file |
>>>>         fontFilePath := FontPaths at: fontFileName
>>>>                 ifAbsentPut:[self findFontFile: fontFileName].
>>>>         fontFilePath ifNil:[^nil].
>>>>         file := [FileStream readOnlyFileNamed: fontFilePath] on: Error
>>>> do:[:ex|
>>>>                 "We lost the font; someone might have moved it away"
>>>> +               FontPaths removeKey: fontFileName ifAbsent:[].
>>>> +               ^nil].
>>>> +       [^[aBlock value: file binary]  on: Error do:[:ex|
>>>> +               "Error reading font. Skip it"
>>>> +               FontPaths removeKey: fontFileName ifAbsent:[].
>>>> +               ^nil] ] ensure:[file close].
>>>>
>>> does a ^ works well inside exception handling?
>>> I think that just nil would do the work...
>>>
>>>> +       !
>>>> -               fontFilePath removeKey: fontFileName ifAbsent:[].
>>>> -               ^nil
>>>> -       ].
>>>> -       ^[aBlock value: file binary] ensure:[file close].!
>>>>
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190104/28892e4d/attachment.html>


More information about the Squeak-dev mailing list