Technical Q&As


GXTY 02 - QuickDraw GX and GXConvertQDFont (1-May-95)


Q I have a few questions concerning the processing provided by GXConvertQDFont:

1. According to the documentation, the basic style settings (plain, bold, and italic) should not cause font-conversion problems, but other, more complex styles may not convert as easily or accurately. Is this font-dependent?

2. I tried changing the styles of two fonts, Times and Parisian. Times accepted the new style setting during conversion, but Parisian did not. My application should be able to take any system-installed font and update the layout shape with the selected font, as well as update the basic style (plain, bold, italic, bold/italic). When the style did not convert, the GXConvertQDFont routine returned the style I gave it as the "extra style bits." How is the use of this routine different from converting a QD pict of the text with the font and style to a QDGX layout shape?

3. I'm currently using GXConvertQDFont, but I previously used the QD to QDGX conversion hack using GXConvertPICTToShape. At first, the description of GXConvertQDFont in its documentation sounded like a better approach than what I was using, but now I am not sure. What advice can you give me on this issue? I need to set the font and style on a layout shape based on a QD representation given to me.

A GXConvertQDFont() sets the style using as much information about the QD font and styleBits as it can without creating a textFace. StyleBits returned by GXConvertQDFont() can be ignored, or your application can convert them to a textFace (i.e., algorithmic stylings). In other words, GXConvertQDFont finds the best font it can, but it is up to your application to do the rest.

In your examples, Times worked correctly, since there are fonts for bold, italic, and bold-italic. If Parisian is available in only one style, and you asked for bold, GXConvertQDFont would return the bold styleBit set. However, if you do the conversion with GXConvertPICTToShape, the resulting shape is the best possible representation of the QD text. With GXConvertPICTToShape, the text shape may include textFaces.

Technical Q&As
Previous Question | Contents | Next Question