ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

QuickDraw GX 'ptyp' Page Size Calc


Important for all Apple Printing and Graphics Developers:

The information in this Technical Q & A is still relevant up to and including Mac OS 7.6 with QuickDraw GX 1.1.5. Beginning with the release of Mac OS 8.0, however, Apple plans to deliver a system which incorporates QuickDraw GX graphics and typography only. QuickDraw GX printer drivers and GX printing extensions will not be supported in Mac OS 8.0 or in future Mac OS releases. Apple's goal is to simplify the user experience of printing by unifying the Macintosh graphic and printing architectures and standardizing on the classic Printing Manager.

For details on Apple's official announcement, refer to </dev/technotes/gxchange.html>

Q: The following code is from one of the sample GX drivers for a 'ptyp' resource. How are the hex numbers derived from the inch numbers for page and paper sizes? For example, what does 8.10667 inches have to do with the number 0x0247AE18?

resource gxPaperTypeType ( gxPrintingDriverBaseID + 1, "US Letter",
kResAttributes ) {

   "US Letter",

   /* page rectangle */
   0x00000000, /* 0.0 */
   0x00000000, /* 0.0 */
   0x0247AE18, /* 8.10667 */
   0x0308A3DC, /* 10.7867 */

   /* paper rectangle */
   0xFFF1D70C, /* -0.196666 */
   0xFFF870A8, /* -0.104999 */
   0x0255D70C, /* 8.30333 */
   0x031070A8, /* 10.895 */

   usLetterBase,
   kCreatorType,

   inch,
   etc.

A: The hex numbers represent pixels, and the values within the comments are in inches. Let's take a look at a piece of the gxPaperTypeType you sent:

   0x0247AE18, /* 8.10667 */

0x0247AE18 translates to 583.68005 pixels. When you divide 583.68005 by 72, you get 8.1066674 -- the same value as the comment.

[May 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.