Carbon


ControlFontStyleRec

Header: Controls.h

struct ControlFontStyleRec {
    SInt16 flags; 
    SInt16 font; 
    SInt16 size; 
    SInt16 style; 
    SInt16 mode; 
    SInt16 just; 
    RGBColor foreColor; 
    RGBColor backColor;
};
typedef ControlFontStyleRec ControlFontStylePtr;

Field descriptions

flags

A value specifying which fields of the structure should be applied to the control; see “Mac OS 8.5 Control Font Style Flag Constant” and “Control Font Style Flag Constants”. If none of the flags in the flags field of the structure are set, the control uses the system font unless the control variant kControlUsesOwningWindowsFontVariant has been specified, in which case the control uses the window font.

font

If the kControlUseFontMask bit is set, then this field contains a value specifying the ID of the font family to use. If this bit is not set, then the system default font is used. A meta font constant can be specified instead; see “Meta Font Constants”.

size

If the kControlUseSizeMask bit is set, then this field contains a value specifying the point size of the text. If the kControlAddSizeMask bit is set, this value will represent the size to add to the current point size of the text. A meta font constant can be specified instead; see “Meta Font Constants”.

style

If the kControlUseFaceMask bit is set, then this field contains a value specifying which styles to apply to the text. If all bits are clear, the plain font style is used. The bit numbers and the styles they represent are bold (0), italic (1), underline (2), outline (3), shadow (4), condensed (5), and extended (6).

mode

If the kControlUseModeMask bit is set, then this field contains a value specifying how characters are drawn in the bit image. See Inside Macintosh: Imaging With QuickDraw for a discussion of transfer modes.

just

If the kControlUseJustMask bit is set, then this field contains a value specifying text justification. Possible values are teFlushDefault (0), teCenter (1), teFlushRight (-1), and teFlushLeft (-2).

foreColor

If the kControlUseForeColorMask bit is set, then this field contains an RGB color value to use when drawing the text.

backColor

If the kControlUseBackColorMask bit is set, then this field contains an RGB color value to use when drawing the background behind the text. In certain text modes, background color is ignored.

You can use the ControlFontStyleRec type to specify a control’s font. You pass a pointer to the control font style structure in the inStyle parameter of SetControlFontStyle to specify a control’s font. If none of the flags in the flags field of the structure are set, the control uses the system font unless the control variant kControlUsesOwningWindowsFontVariant has been specified, in which case the control uses the window font. The ControlFontStyleRec type is available with Appearance Manager 1.0 and later.

Note that if you wish to specify the font for controls in a dialog box, you should use a dialog font table resource, which is automatically read in by the Dialog Manager.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)