[comp.os.os2] Questions About PM Programming

lima@nixsin.UUCP (Arthur Lim) (12/14/89)

I have some questions regarding PM programming which I hope you (reading this
article) can help me solve. I need these answer to implement an application
in PM.

1) Is it possible to implement blinking characters in PM (Not in AVIO)? 
   If so, how? 

2) In QuickHelp and the manuals, there is one font attribute 
   FATTR_SEL_NEGATIVE which in not defined in the header files. However,
   FATTR_SEL_BOLD is defined but not documented (it works too). Is  the
   negative attribute implemented ? If it is, what is it's value ? Are 
   there any attributes not documented, not defined but implemented 
   (like double underlining) ?

Thanks in advance for any hints and soultions. (Pls post to this newsgroup
as I believe it would be of interest to most readers)

 
-- 
----------------------------------------------------
Arthur Lim  Nixdorf Regional HQ Pte Ltd, Singapore
!usa: mcvax!unido!nixpbe!lim.sin
usa : uunet!philabs!linus!nixbur!lim.sin

alistair@microsoft.UUCP (Alistair BANKS) (12/27/89)

In article <645@nixsin.UUCP> lima@nixsin.UUCP (Arthur Lim) writes:
>I have some questions regarding PM programming which I hope you (reading this
>article) can help me solve. I need these answer to implement an application
>in PM.
>
>1) Is it possible to implement blinking characters in PM (Not in AVIO)? 
>   If so, how? 
Blinking characters are not a primitive in PM and so must be implemented
by a time-triggered rectangle inversion routine.

>
>2) In QuickHelp and the manuals, there is one font attribute 
>   FATTR_SEL_NEGATIVE which in not defined in the header files. However,
>   FATTR_SEL_BOLD is defined but not documented (it works too). Is  the
>   negative attribute implemented ? If it is, what is it's value ? Are 
>   there any attributes not documented, not defined but implemented 
>   (like double underlining) ?
>
>Thanks in advance for any hints and soultions. (Pls post to this newsgroup
>as I believe it would be of interest to most readers)

Below are all references to FATTR in the 1.2 toolkit header files - I also had
a look at the 'undocumented' header files and found no reference to the above, so
I guess it was wrong, and has now gone away for good.

The rest is the quickhelp section from the 1.2 PM Toolkit.


Alistair Banks
OS/2 Group
Microsoft

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

[D:\pmtk120\include]grep -y FATTR *.h                                           
os2def.h:/* values of fsSelection field of FATTRS structure */                  
os2def.h:#define FATTR_SEL_ITALIC       0x0001                                  
os2def.h:#define FATTR_SEL_UNDERSCORE   0x0002                                  
os2def.h:#define FATTR_SEL_OUTLINE      0x0008          /* Hollow Outline Font */                                                                               
os2def.h:#define FATTR_SEL_STRIKEOUT    0x0010                                  
os2def.h:#define FATTR_SEL_BOLD         0x0020                                  
os2def.h:/* values of fsType field of FATTRS structure */                       
os2def.h:#define FATTR_TYPE_KERNING     0x0004                                  
os2def.h:#define FATTR_TYPE_MBCS        0x0008                                  
os2def.h:#define FATTR_TYPE_DBCS        0x0010                                  
os2def.h:#define FATTR_TYPE_ANTIALIASED 0x0020                                  
os2def.h:/* values of fsFontUse field of FATTRS structure */                    
os2def.h:#define FATTR_FONTUSE_NOMIX         0x0002                             
os2def.h:#define FATTR_FONTUSE_OUTLINE       0x0004                             
os2def.h:#define FATTR_FONTUSE_TRANSFORMABLE 0x0008                             
os2def.h:typedef struct _FATTRS {       /* fat */                               
os2def.h:} FATTRS;                                                              
os2def.h:typedef FATTRS far *PFATTRS;                                           
pmavio.h:USHORT APIENTRY VioCreateLogFont(PFATTRS pfat, LONG lcid, PSTR8 pstr8Name,                                                                             
pmgpi.h:                               , PFATTRS pfatAttrs );                   
pmgpi.h:BOOL  APIENTRY GpiQueryDefAttrs( HPS hps, LONG lPrimType, ULONG flAttrMask                                                                              
pmgpi.h:BOOL  APIENTRY GpiSetDefAttrs( HPS hps, LONG lPrimType, ULONG flAttrMask                                                                                
pmtypes.h:#define DTYP_FATTRS           ((SHORT)75)                             
pmtypes.h:#define DTYP_PFATTRS          ((SHORT)(-75))                          
pmwin.h:        USHORT  afAttribute;                                            

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
typedef struct _FATTRS {    /* fat */
    USHORT  usRecordLength;
    USHORT  fsSelection;
    LONG    lMatch;
    CHAR    szFacename[FACESIZE];
    USHORT  idRegistry;
    USHORT  usCodePage;
    LONG    lMaxBaselineExt;
    LONG    lAveCharWidth;
    USHORT  fsType;
    USHORT  fsFontUse;
} FATTRS;

The FATTRS structure specifies the attributes of the logical font to be
created by the VioCreateLogFont or GpiCreateLogFont function.

Field                 Description
----------------------------------------------------------------------------
usRecordLength        Specifies the length of the structure.

fsSelection           Specifies one or more character attributes. This field
                      can be any combination of the following values:

                      Value                 Meaning
                      ------------------------------------------------------
                      FATTR_SEL_ITALIC      Specifies italic characters.

                      FATTR_SEL_OUTLINE     Specifies an outline font.

                      FATTR_SEL_STRIKEOUT   Specifies strikeout characters.

                      FATTR_SEL_UNDERSCORE  Specifies underscored
                                            characters.

                      FATTR_SEL_BOLD        Specifies bold characters.

lMatch                Specifies the match number for a specific font. The
                      VioQueryFonts and GpiQueryFonts functions return a
                      unique match number for each font. When this number is
                      specified in the lMatch field, the specified font is
                      used. If the lMatch field is zero, the system
                      determines which font gives the best mapping to the
                      required attributes.

szFacename[FACESIZE]  Specifies the typeface name of the font.

idRegistry            Specifies the registry number of the font.

usCodePage            Specifies the code-page identifier of the font.

lMaxBaselineExt       Specifies the sum of the maximum ascender and
                      descender values for a font.

lAveCharWidth         Specifies the average width of a character in a font.
                      This value is obtained by multiplying the width of
                      each lowercase letter by a weighted factor, adding the
                      results for all of the letters in the alphabet, and
                      dividing by 1000. The factor corresponds to the
                      frequency of use for a particular letter. For example,
                      the letter e appears frequently in text while the
                      letter q does not; therefore, the factor assigned to
                      e would be greater than the factor assigned to q.

fsType                Specifies the type of the font. This field can include
                      one or more of the following values:

                      Value                   Meaning
                      ------------------------------------------------------
                      FATTR_TYPE_KERNING      Specifies a kerned font.

                      FATTR_TYPE_MBCS         Specifies a multiple-byte
                                              character-set font.

                      FATTR_TYPE_DBCS         Specifies a double-byte
                                              character-set font.

                      FATTR_TYPE_ANTIALIASED  Specifies an anti-aliased
                                              font.

fsFontUse             Specifies how the font is related to the character
                      attributes. This field can be any combination of the
                      following values:

                      Value                        Meaning
                      ------------------------------------------------------
                      FATTR_FONTUSE_NOMIX          The application cannot
                                                   mix text and graphics.

                      FATTR_FONTUSE_OUTLINE        Requests an outline
                                                   font.

                      FATTR_FONTUSE_TRANSFORMABLE  Requests a transformable
                                                   font.

See Also

GpiCreateLogFont, GpiQueryFonts, VioCreateLogFont, VioQueryFonts

----------------------------------------------------------------------------

MS-OS/2 version 1.2 changes

FATTR_TYPE_FIXED can no longer be specified for the fsType field. The
following new constants can be specified for fsType:

Value                   Meaning
----------------------------------------------------------------------------
FATTR_TYPE_MBCS         Specifies a multiple-byte character-set font.

FATTR_TYPE_DBCS         Specifies a double-byte character-set font.

FATTR_TYPE_ANTIALIASED  Specifies an anti-aliased font.

FATTR_SEL_OUTLINE can be specified for the fsSelection field.

Corrections

The FATTR_SEL_HOLLOW constant did not exist in the include files. A new

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -