[Cuis-dev] learning about fonts

Mark Volkmann r.mark.volkmann at gmail.com
Sat Jul 20 10:55:51 PDT 2024


Thanks Ken!
Is there a shorter way to just get the "default" font?

On Sat, Jul 20, 2024 at 12:39 PM <ken.dickey at whidbey.com> wrote:

> On 2024-07-20 10:30, Mark Volkmann via Cuis-dev wrote:
>
> > - get a list of all the installed fonts
> > - get an instance of a given font with a specific point size
> >
> > Can someone share how to do those?
>
> Sure.  The UI-MetaProperties package -- soon to be renamed
> UI-VisualMetaProperties has code to "edit" a font.
>
> The code (copied below) first sets a font and then its size.
>
> I suspect you can further unravel from this thread..  ;^)
>
>         props at: #acceptsFont
>                     put: (MetaProperty
>                                 kind: AbstractFont
>                                 editProc: [ :morph :metaProp :menuItem |
>                                         | oldFont fontFamily fontSize
> newFont |
>                                         oldFont := menuItem propertyValue.
>                                         fontSize := oldFont pointSize.
>                                         fontFamily := FontFamily
> promptUser.
>                                         fontSize := FontFamily
> promptUserForSize: fontSize fontFamily:
> fontFamily.
>                                         newFont := fontFamily atPointSize:
> fontSize.
>                                         newFont ifNotNil: [ :f | menuItem
> propertyValue: f. morph
> redrawNeeded ] ]  ).
>
> Good on ya,
> -KenD
>


-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240720/db30a30b/attachment.htm>


More information about the Cuis-dev mailing list