Description of the Font protocol, Revision 5
Minimal support of this protocol consists in the evaluation of the FONT_CHANGED message. Programs that support one of the (GDOS) attributes text angle, text width, kerning, text slope or the setting of the text size in 1/65536 points should also support the XFONT_CHANGED message, which offers additional information.
With the message FONT_SELECT the font-selector can also be called up by the application. During this the currently set attributes can be passsed as well.
If the application also supports the XAcc-2 protocol, then it can also reveal easily the FONT_ACK confirmation message, and search for font selectors in memory even without an environmental variable.
FONT_CHANGED message:
Message from the font-selector to an application that the font
and/or character attributes (size, colour and effects) in one or more
windows of the application should be changed. If the target
application contains in its extended XAcc name the identifier
'XFontAck' then this message has to be replied to with a FONT_ACK
message. Otherwise the support for this message is optional.
Negative values in msg[6/7] or zero in msg[4/5] represents no
change.
msg[0] = FONT_CHANGED (0x7a18) msg[1] = apID msg[2] = 0 msg[3] = Handle of the affected window, or negative value if the font for all windows should be changed. msg[4] = Font ID, or 0 msg[5] = Font size in points (>0) or pixels (<0) or zero for no change msg[6] = Font colour msg[7] = Effects: Bit 0: Bold Bit 1: Light Bit 2: Italics Bit 3: Underlined Bit 4: Outlined Bit 5: Shadowed Bit 6: Inverse Bit 12: 1=Font is monospaced; 0=unknown (remaining bits are reserved)
XFONT_CHANGED message:
Convey extended (GDOS) attributes. This message is optional and
is sent before the FONT_CHANGED message, i.e. these values may
be set only when the FONT_CHANGED message arrives and has the same
sender (compare with msg[1]!). This avoids duplicated redraws and/or
errors.
The FONT_CHANGED message contains the size, rounded to a point
value, i.e. programs that do not support XFONT_CHANGED can use this
value.
Font-selectors as a rule only understand this message when one
of the conveyed attributes differs from the normal value!
msg[0] = XFONT_CHANGED (0x7a1b) msg[1] = apID msg[2] = 0 msg[3/4] = Size in 1/65536 point (fix31) msg[5] = Rotation angle in 1/10-degree (0-3599) msg[6] = Slope in 1/10-degree (-1800 - 1800) msg[7] = Width and kerning: Bit 15: Pair kerning Bit 13/14: Track kerning mode (0-3) Bit 0-12: Width in points In C: typedef struct { unsigned int pair : 1; unsigned int track : 2; unsigned int width : 13; } VECTOR_INFO;
FONT_SELECT message:
With this message one can call a font-selector containing in its
extended XAcc name the identifier 'XFontAck' that is present in
memory. If the application and/or the font-selector does not support
the XAcc-2 protocol, then one can still search for the contents of the
(AES) environmental variable 'FONTSELECT'. In some cases this
variable may contain several names (separated by semicolons), where
the names optionally may include the path and file extender, so that
under multitasking one can load the font-selector in parallel.
Examples:
setenv FONTSELECT=FONT_PAL;FONT_SEL setenv FONTSELECT=C:\FONTSEL\FONT_SEL.APP;C:\FONTSEL\FONT_PAL.APP
msg[0] = FONT_SELECT (0x7a19) msg[1] = apID msg[2] = 0 msg[3] = Handle of the window whose font is to be set, or a negative value if the font in all windows of the application is to be changed msg[4] = Font ID, or 0 msg[5] = Font size in points (>0) or pixels (<0), or zero if the parameter is not required (see above) msg[6] = Font colour msg[7] = Effects (see above)
FONT_ACK message:
Inform the font-selector about whether the FONT_CHANGED message
could be evaluated, or the font attributes could be set.
msg[0] = FONT_ACK (0x7a1a) msg[1] = apID msg[2] = 0 msg[3] = TRUE (1): Message was evaluated FALSE (0): Message was ignored msg[4-7] = 0 (reserved)
See also: xFSL interface MagiC font-selection