[Q] How to unload a TrueType font

Boris Gaertner Boris.Gaertner at gmx.net
Thu Jun 10 08:29:53 UTC 2004

"Martin Drautzburg" <martin.drautzburg at web.de> asked:

> I am playing with TrueType fonts for writing music. I load them with
> the fileList. 
Credibly with the option "install ttf style"

> How can I undo the loading of a TrueType font ?
Fonts are stored in the the pool dictionary
TextConstants. TextConstants contains not only
fonts, but also names for various constants.
To find the fonts, you have to keep in mind that
a font is stored as instances of  TextStyle.
Now you can do this:

TextConstants keys
  select: [:key | (TextConstants  at: key) class = TextStyle]

This answers a Set with the names of all installed fonts.
Here you should find what you installed. To remove it,
simply evaluate

  TextConsants removeKey: <aSymbol>

 This should help.

Greetings, Boris

More information about the Squeak-dev mailing list