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

Create system preferences for AeCanvas options #31

Open
tinchodias opened this issue Apr 12, 2023 · 3 comments
Open

Create system preferences for AeCanvas options #31

tinchodias opened this issue Apr 12, 2023 · 3 comments

Comments

@tinchodias
Copy link
Contributor

For antialiasing and other options that are now set on initialization, only depending on the device scale.

@tinchodias
Copy link
Contributor Author

Same for default fonts on Font manager, I think.

@tinchodias
Copy link
Contributor Author

The following method shows the need of a system setting, so SourceSansPro and SourceCodePro won't be hardcoded anymore. Now... the family names are easy to be added as preference, but slant, weight and stretch present several options. Keep hardcoded normal-normal-normal is the simplest option, of course. I think the best is to offer a list of all available fonts with combinations to the user, the same that is shown by the font manager's inspector. So, the user would first scan font directories, if needed, and finally can select from that list.

AeFontManager>>
globalInstance
	
	^ globalInstance ifNil: [
		| aFace |
		globalInstance := self new
			scanEmbeddedFonts;
			yourself.
			
		aFace := globalInstance
			detectFamilyName: AeSourceSansPro_Regular familyName
			slant: AeFontSlant normal
			weight: AeFontWeight normal
			stretch: AeFontStretch normal
			ifNone: [ self error: 'Shouldn''t happen' ].
		
		globalInstance defaultFace: aFace.

		aFace := globalInstance
			detectFamilyName: AeSourceCodePro_Regular familyName
			slant: AeFontSlant normal
			weight: AeFontWeight normal
			stretch: AeFontStretch normal
			ifNone: [ self error: 'Shouldn''t happen' ].
		
		globalInstance defaultCodeFace: aFace.


		globalInstance ]

@tinchodias
Copy link
Contributor Author

tinchodias commented Jan 14, 2025

In other side (this is another issue but related), the font manager right now doesn't remember what directories where scan from disk.

This means that after the image is opened, from the new session can't automatically rescan the fonts from the previous session (before save&close, for example). We would need that directories to scan and other font manager parameters are stored as a system setting. (See: pharo-graphics/Bloc#672).

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

1 participant