[Cuis-dev] making a font a package requirement

ken.dickey at whidbey.com ken.dickey at whidbey.com
Sun Aug 18 13:41:26 PDT 2024


On 2024-08-18 12:20, Mark Volkmann via Cuis-dev wrote:

> I created a package that depends on having the KurintoSans font 
> installed.
> I can do that by opening the World menu and selecting Preferences ... 
> Load all TrueTypeFonts.
> But is there a way I can cause that font to be installed automatically 
> when my package is installed?

Yes.  If you look at 
Cuis-Smalltalk-Dev/Packages/Features/Color-Extras.pck.st you can find 
class methods
   #prePackageInstall
and
   #postPackageInstall

To use these, you need to subclass CodePackage
E.g.
   CodePackage subclass: #ColorExtrasPackage

Look at the code in Color-Extras.pck.st to see how to set this up.

In your #prePackageInstall, you will want something like:

   TrueTypeFontFamily readAllTrueTypeFontsIn: (DirectoryEntry 
trueTypeFontsDirectory / 'KurintoSans').


HTH,
-KenD



More information about the Cuis-dev mailing list