Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font update broken when currently used fonts are deleted #48

Open
lxsang opened this issue Aug 24, 2022 · 4 comments
Open

Font update broken when currently used fonts are deleted #48

lxsang opened this issue Aug 24, 2022 · 4 comments

Comments

@lxsang
Copy link
Owner

lxsang commented Aug 24, 2022

There is a problem on Pharo 10 I think: I temporarily removed all DejaVu*.ttf files from my ~/Library/Fonts folder, then loaded the ‘master’ branch in a new Pharo 10 image; I got an error #members was sent to nil in StFontChooserPresenter>>#updateWithFont:.

Originally posted by @Rinzwind in #46 (comment)

@lxsang
Copy link
Owner Author

lxsang commented Dec 12, 2022

@Rinzwind maybe this problem is related to the commit fee29a6 ?

@Rinzwind
Copy link
Collaborator

It’s related yes, but the commit does not fully fix the error. Scenario in which it still occurs:

  • Make sure you do not already have ‘DejaVu Sans Mono’ in any of the directories used by FreeTypeFontProvider>>#updateFontsFromSystem (temporarily remove it if necessary)
  • Open a new Pharo 10 image and load PTerm
  • Disconnect the network (disable Wi-Fi, …) so that the download of ‘DejaVuSansMono.ttf’ in the next step fails
  • Open ‘Terminal’

⇒ A MessageNotUnderstood (#members was sent to nil) is signaled in StFontChooserPresenter>>#updateWithFont:

@lxsang
Copy link
Owner Author

lxsang commented Sep 25, 2023

@Rinzwind can i close this issue? Normally, we should not have this problem after the PR #57

@Rinzwind
Copy link
Collaborator

The error should no longer occur in the scenario that I gave above. But it might still be a good idea to take into account that the error would still occur in #selectFontUsingFontChooser whenever the initial font for the chooser does not exist, like in:

FontChooser openWithTitle: 'Font?'
	initialFont: (LogicalFont familyName: 'Foo Bar Baz Qux' pointSize: 10)
	onAcceptDo: #inspect

In #selectFontUsingFontChooser, that can be taken into account by using this for the initial font I think:

(self hasFont: font) ifTrue: [ font ] ifFalse: [ StandardFonts codeFont ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants