Font:
Filter:
Classes | GUI > Accessories

Font

A font object
Location: NOT INSTALLED!

Description

This is the object you pass to other gui objects to set their font name or size.

Class Methods

.new

Arguments:

name

An instance of String. Must coincide with the name of a font on the system. See *availableFonts.

size

An instance of Float.

bold

A Boolean.

italic

A Boolean.

usePointSize

A Boolean. Whether to regard the size argument as point-size - adapting to the screen resolution.

Discussion:

Example:

.availableFonts

Returns:

Array of the available fonts.

.antiAliasing

Arguments:

flag

An instance of Boolean. Default value is false.

.smoothing

Arguments:

flag

An instance of Boolean. Default value is false.

.defaultSansFace

Returns:

The default sans serif face Font.

.defaultSerifFace

Returns:

The default serif face Font.

.defaultMonoFace

Returns:

The default monospace face Font.

.default

The global default Font.

Setting this property is equivalent to Font.setDefault(font). See *setDefault for details.

.setDefault

Sets the global default font. Properties of the font argument will be combined with properties of the default system font, and those of individual views.

Optionally, a class can be given, so only views of that class will be affected.

Note that this will immediately affect any existing views.

Arguments:

font

An instance of Font.

class

A Class (either View or one of its subclasses), or nil.

.sansSerif

Create a new sans serif face Font.

.monospace

Create a new monospace face Font.

.serif

Create a new serif face Font.

Inherited class methods

Instance Methods

.name

Gets/sets the name of the font.

Arguments:

value

An instance of String.

.size

Gets/sets the size of the font. Setting this variable is always considered as setting the -pixelSize, while getting it will return any size set. See -hasPointSize for distinction.

Arguments:

pixelSize

A Float.

.hasPointSize

A Boolean variable indicating whether the -size is regarded as pixel-size (precise amount of pixels), or point-size (adapting to screen resolution). To change this, you need to set the size via -pixelSize or -pointSize.

.pixelSize

Gets or sets the pixel-size of the font. When getting, returns nil if the font has point-size instead. See -hasPointSize for distinction.

Arguments:

Any number, but note that floats will be rounded to integer values when setting pixel-size.

.pointSize

Gets or sets the point-size of the font. When getting, returns nil if the font has pixel-size instead. See -hasPointSize for distinction.

Arguments:

A Float.

.setDefault

Makes this instance of Font the default.

This is equivalent to calling *setDefault with this Font and the given class as arguments.

.storeArgs

(?)

Returns:

an Array, [ name, size ].

.boldVariant

NOTE: On the Cocoa GUI it appends "-Bold" to the name. This is only useful for fonts that have bold variants.

Returns:

Bold variant of the Font.

Inherited instance methods

Examples