2.3 Drawing Classes
2.3.1 bitmap%
2.3.2 bitmap-dc%
2.3.3 brush%
2.3.4 brush-list%
2.3.5 color%
2.3.6 color-database<%>
2.3.7 dc<%>
2.3.8 dc-path%
2.3.9 font%
2.3.10 font-list%
2.3.11 font-name-directory<%>
2.3.12 gl-config%
2.3.13 gl-context<%>
2.3.14 pen%
2.3.15 pen-list%
2.3.16 point%
2.3.17 post-script-dc%
2.3.18 printer-dc%
2.3.19 ps-setup%
2.3.20 region%
On this page:
find-or-create-font
Version: 4.1

font-list% : class?

  superclass: object%

A font-list% object maintains a list of font% objects to avoid repeatedly creating fonts.

A global font list, the-font-list, is created automatically.

(make-object font-list%)  (is-a?/c font-list%)

Creates an empty font list.

(send a-font-list find-or-create-font

 

size

 

 

 

family

 

 

 

style

 

 

 

weight

 

 

 [

underline?

 

 

 

smoothing

 

 

 

size-in-pixels?])

 

  (is-a?/c font%)

  size : (integer-in 1 255)

  

family

 

:

 

(one-of/c 'default 'decorative 'roman 'script

          'swiss 'modern 'symbol 'system)

  style : (one-of/c 'normal 'italic 'slant)

  weight : (one-of/c 'normal 'bold 'light)

  underline? : any/c = #f

  

smoothing

 

:

 

(one-of/c 'default 'partly-smoothed 'smoothed 'unsmoothed)

 

 

 

=

 

'default

  size-in-pixels? : any/c = #f

(send a-font-list find-or-create-font

 

size

 

 

 

face

 

 

 

family

 

 

 

style

 

 

 

weight

 

 

 [

underline

 

 

 

smoothing

 

 

 

size-in-pixels?])

 

  (is-a?/c font%)

  size : (integer-in 1 255)

  face : string?

  

family

 

:

 

(one-of/c 'default 'decorative 'roman 'script

          'swiss 'modern 'symbol 'system)

  style : (one-of/c 'normal 'italic 'slant)

  weight : (one-of/c 'normal 'bold 'light)

  underline : any/c = #f

  

smoothing

 

:

 

(one-of/c 'default 'partly-smoothed 'smoothed 'unsmoothed)

 

 

 

=

 

'default

  size-in-pixels? : any/c = #f

Finds an existing font in the list or creates a new one (that is automatically added to the list). The arguments are the same as for creating a font% instance.