[Pharo-project] Scalable fonts

Schwab,Wilhelm K bschwab at anest.ufl.edu
Sun Apr 10 01:35:11 CEST 2011


I needed to create "big" text for annotating images and found that only certain sizes were available.  That led me to

  http://forum.world.st/additional-font-size-td3206897.html

I ended up adding the following to my code:

	FreeTypeFontProvider current families isEmpty ifTrue:[
		FreeTypeFontProvider current updateFromSystem.
	].
	aFont := LogicalFont familyName: 'DejaVu Sans Mono' pointSize:100.

It seems to work.  Is there a better way to do it?  Should there be any helper methods in LogicalFont to do this type of thing?  A lazy LogicalFont class>>loadSystemFonts would be less invasive than setting the preference to load fonts on startup, since it could be triggered as needed and cost nothing otherwise.

I am thinking of LogicalFont mostly because I learned to look there a long time ago, so it is the first place I go for fonts.

Bill




More information about the Pharo-project mailing list