Ticket #4604 (closed defect: fixed)

Opened 7 years ago

Last modified 5 years ago

Font not preserved on project save/reload

Reported by: lukego Owned by: etoys
Priority: normal Milestone: Future Release
Component: etoys-activity Version: Development build as of this date
Keywords: Cc: jg, bert
Action Needed: never set Verified: no
Deployments affected: Blocked By:
Blocking:

Description

I'm losing my choice of font when I save and reload a project. The steps to reproduce are: 1. Drag&drop to import Devnew.ttf (devanagari font, attached) 2. Create a text morph from the objects box. 3. Switch font of text morph to DevanagariNew. 4. Save project to file. 5. Load project from file. In the loaded project the text is no longer in DevanagariNew font.

Attachments

Devnew.ttf Download (74.8 KB) - added by lukego 7 years ago.
Devanagari truetype font

Change History

Changed 7 years ago by lukego

Devanagari truetype font

  Changed 7 years ago by jg

  • milestone changed from Never Assigned to Future Release

  Changed 7 years ago by jg

This will make etoys very painful to use for many scripts. Probably worth fixing sooner rather than later...

follow-up: ↓ 4   Changed 7 years ago by bert

  • cc jg added

Well ... embedding fonts in etoys projects gets us into all sorts of interesting problems, probably more legal than technical.

One thing that should come with Pango support (#4011) is that we at least can use all fonts installed on the system - although that severely limits the cross-platformness of projects.

in reply to: ↑ 3 ; follow-up: ↓ 5   Changed 7 years ago by lukego

Replying to bert:

Well ... embedding fonts in etoys projects gets us into all sorts of interesting problems, probably more legal than technical.

To clarify: the issue is that even if the font is present in the image it won't be preserved through saving and reloading the project (in the same image). So embedding the font in the project shouldn't be necessary for the solution, it'd be enough to find the right font in the image when loading the project.

in reply to: ↑ 4 ; follow-up: ↓ 6   Changed 7 years ago by bert

Replying to lukego:

To clarify: the issue is that even if the font is present in the image it won't be preserved through saving and reloading the project (in the same image).

I don't quite understand. Drag-and-drop of the TTF into the image does not mean it gets installed permanently into the image. We are not saving the image normally. So when resuming a project using that font, the image will be fresh and not have the font anymore.

in reply to: ↑ 5 ; follow-up: ↓ 7   Changed 7 years ago by lukego

Replying to bert:

I don't quite understand. Drag-and-drop of the TTF into the image does not mean it gets installed permanently into the image. We are not saving the image normally. So when resuming a project using that font, the image will be fresh and not have the font anymore.

The trouble is that saving and then loading the project does not preserve the font choice, even though the font is present in the image at both times. Try the steps!

in reply to: ↑ 6   Changed 7 years ago by lukego

I should add that I'm using the XO image on a Macintosh with the Squeakland VM and saving/loading the project via the World menu.

  Changed 7 years ago by korakurider

  • cc bert added

How interesting, I can reproduce this along with the Luke's report. Here is the precise steps that I reproduced it:

1. start EToys image (with Win32 VM for me) 2. drag-n-drop DevNew.ttf onto EToys. 3. create TextMorph 4. choose DevnagariNew in menu of TextMorph, then the morph is shown in that font. 5. open classic navigator 6. save the project 7. without quitting Etoys (NOTE image still holding the TTF at this point), load the project, then the TextMorph is shown in Accuny font.

follow-up: ↓ 10   Changed 7 years ago by lukego

Workaround: Evaluate 'TTCFont registerAll' after installing the font and creating a TextMorph that uses the font. This workaround is fine for me!

The problem as I see it is that drag-and-drop font installation doesn't do sufficient registration because TTCFont>>familyName:pointSize:emphasis: won't find the font.

The "project load/save" symptom is because the reference to the font is serialized as a DiskProxy that will call TTCFont>>familyName:pointSize:emphasis: at loading time and fail to find the font.

in reply to: ↑ 9   Changed 7 years ago by ohshima

Replying to lukego:

Workaround: Evaluate 'TTCFont registerAll' after installing the font and creating a TextMorph that uses the font. This workaround is fine for me!

That sounds like a proper fix!

  Changed 6 years ago by ScottWallace

  • next_action set to never set

Tracking of this issue transferred to JIRA:

 http://jira.immuexa.com/browse/SQ-63

  Changed 6 years ago by ScottWallace

Tracking of this issue transferred to JIRA:

 http://jira.immuexa.com/browse/SQ-63

  Changed 6 years ago by ScottWallace

Correction:

Tracking of this item has been transferred to the Squeakland tracker:

 http://tracker.squeakland.org/browse/SQ-63

  Changed 5 years ago by bert

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.