Problem with FontID in 6.2

I am trying to use the various Pf* functions to get information about the
font a widget has set, like a label or text box. I have come across the
following…

If I use…

PtGetResource( ABW_txtNewLine, Pt_ARG_TEXT_FONT, &FontString, 0);
PfQueryFontInfo( FontString, &info);

The info stucture (FontQueryInfo) has a 0 for size, no matter what the size
is set to. For example if I set the font in the widget to 10 point, bold,
(in builder), then query it everything seems set correctly but the size.

The next thing I tried was to use the

FontIDStruct = PfDecomposeStemToID( info.font );

Trying to use FontIDStruct->ulSize, for example, results in a compile error
about an undefined type “__TS_FONT_ID” and a complaint about a forward
declaration of same. Examining the 6.1 and 6.2 include files (Pf.h) I see
that there is a bit of a difference…

IN 6.1 you have defined…

typedef struct _TS_FONT_ID
{ uint32_t ulFlags;
uint32_t ulSize;
uint32_t ulSpare[8];
uchar_t * pucStem;
uchar_t * pucDescription;
uchar_t * pucSpare[2];
} FontID;


Whereas in 6.2…

typedef struct _TS_FONT_ID FontID;

I realize that if I parse out the font name string from the Pt_ARG_TEXT_FONT
resources I can get most of the information, but I figured that if the API
could do it, why waste the effort.
I am using 6.2SE.


Thanks

Vince Bednarz

Vince Bednarz <vbednarz@neo.rr.com> wrote:

I am trying to use the various Pf* functions to get information about the
font a widget has set, like a label or text box. I have come across the
following…

If I use…

PtGetResource( ABW_txtNewLine, Pt_ARG_TEXT_FONT, &FontString, 0);
PfQueryFontInfo( FontString, &info);

The info stucture (FontQueryInfo) has a 0 for size, no matter what the size
is set to. For example if I set the font in the widget to 10 point, bold,
(in builder), then query it everything seems set correctly but the size.

Yes, this indicates that it is a scalable font.

The next thing I tried was to use the

FontIDStruct = PfDecomposeStemToID( info.font );

Trying to use FontIDStruct->ulSize, for example, results in a compile error
about an undefined type “__TS_FONT_ID” and a complaint about a forward
declaration of same. Examining the 6.1 and 6.2 include files (Pf.h) I see
that there is a bit of a difference…

The structure was never documented for this reason.
You can use routine PfFontSize() to retrieve the point size,
which is available in 6.1 and 6.2 versions.

Regards.

IN 6.1 you have defined…

typedef struct _TS_FONT_ID
{ uint32_t ulFlags;
uint32_t ulSize;
uint32_t ulSpare[8];
uchar_t * pucStem;
uchar_t * pucDescription;
uchar_t * pucSpare[2];
} FontID;



Whereas in 6.2…

typedef struct _TS_FONT_ID FontID;

I realize that if I parse out the font name string from the Pt_ARG_TEXT_FONT
resources I can get most of the information, but I figured that if the API
could do it, why waste the effort.
I am using 6.2SE.



Thanks

Vince Bednarz