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 name revert to default after image restart and won't use name provided. #672

Open
rvillemeur opened this issue Dec 17, 2024 · 4 comments
Labels

Comments

@rvillemeur
Copy link
Contributor

rvillemeur commented Dec 17, 2024

Using this script to display Emoji from 'Noto Color Emoji'. The first time, you get a grid of Emoji (hopefully in color).
image

Save and close the image. Reopen it and re-execute the script, you'll get
image

It look like it will default to Source Sans Pro (the default one in Bloc)

image

image

Behavior reproduced using Pharo 12, Windows 11 or Linux Fedora 41

| container |
container := BlElement new
				 border: (BlBorder paint: Color red width: 1);
				 background: (Color white);
				 layout: BlFlowLayout horizontal;
				 constraintsDo: [ :c |
					 c horizontal matchParent.
					 c vertical fitContent ].

"Noto Color Emoji has 2668 different glyph"

16r1F600 to: 16r1F64F do: [ :each |
	| elt |
	elt := BlTextElement text: ((Unicode value: each) asRopedText
					fontSize: 40;
					fontName: 'Noto Color Emoji').
	elt
		padding: (BlInsets all: 5);
		border: (BlBorder paint: Color black width: 1).

	container addChild: elt ].

"container openInNewSpace."
^ container

Reseting and scanning for system font doesn't change the behavior
image

@rvillemeur
Copy link
Contributor Author

after a fresh install of bloc
image

after image restart
image

Updating the font from system doesn't solve the problem

@tinchodias
Copy link
Collaborator

Yes, this is not only for Noto Color Emoji. Example with other font:

Load the testing fonts with this script:

"
AeFontManager resetGlobalInstance.
AeFontManager globalInstance scanDirectory: AeFilesystemResources fontsDirectory
"

Then inspect this:

| text |
text := 'office' asRopedText
			        fontSize: 40;
			        fontName: 'Inria Serif';
			yourself.
BlTextElement text: text.

Then Save&Close, and reopen the image. The inspected form will look as with default font (Source Sans Pro), instead of Intia Serif, until you re-scan the tests fontDirectory.

@tinchodias
Copy link
Collaborator

tinchodias commented Jan 15, 2025

@rvillemeur my idea to fix this issue is changing the font manager to automatically reload fonts on image startup. The user would have System Settings to be able to:

  • disable that automatic reload,
  • manage what are the directories to scan
  • which is the default font and default code font (now hardcoded).

I commented details of this idea in Alexandrie's issue 31.

@rvillemeur
Copy link
Contributor Author

Add @Ducasse, If I remember well, font handling was a challenge in previous version of Pharo (and still is in some scenario). He may have some concern to share, given Bloc/Alexandrie is the future graphical stack.

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

No branches or pull requests

2 participants