•  Back 
  •  Protocols 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File13.5  Font protocol                                                TOS

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) attri- 
butes 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)

     Bit 12 was introduced with Revision 5.

   . 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] = (!nolink [Size]) in 1/65536 point (fix31)
          msg[5]   = (!nolink [Rotation]) angle in 1/10-degree (0-3599)
          msg[6]   = Slope in 1/10-degree (-1800 - 1800)
          msg[7]   = Width and kerning:
                     Bit 15:    (!nolink [Pair kerning])
                     Bit 13/14: (!nolink [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

     But for passive support of the Font protocol, an evaluation of 
     the above-named FONT_CHANGED and XFONT_CHANGED messages suffices.

     Negative values in msg[6/7] or a zero in msg[4/5] mean that this 
     parameter is not required, is not to be set, or has not yet been 
     set.

          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