QuickDraw GX
Encyclopedia
QuickDraw GX was a replacement for the QuickDraw
(QD) 2D graphics engine
and Printing Manager inside the "classic" Mac OS
. Its underlying drawing platform was a resolution-independent object oriented retained mode
system, making it much easier for programmers to perform common tasks (compared to the original QuickDraw). Additionally, GX added various curve-drawing commands that had been lacking from QD, as well as introducing TrueType
as its basic font system.
While GX certainly addressed many of the problems QD had, by the time it was available most developers had already developed their own solutions to these problems anyway. GX also suffered from causing a number of incompatibilities in existing programs, notably those that had developed their own QD extensions. This, coupled with opposition from an important fraction of the developer market, especially PostScript owner Adobe, and a lack of communication from Apple about the benefits of GX and why users should adopt it, led to the technology being sidelined. QuickDraw GX was eventually "killed" with the purchase of NeXT
and the eventual adoption of the Quartz
imaging model in Mac OS X
, but many of its component features lived on and are now standard in the current Macintosh platform.
(PS) in the desktop publishing
market, a market dominated by Apple. PS included many features not found in QD, notably Bézier curve
s and outline fonts. The entire imaging model was also quite different, being based on a floating point
coordinate system, one whose layout was "flipped" in comparison to QD. The coordinate system itself did not have a "natural resolution" either, whereas QD scaled everything based on 72 dpi
. Developers wishing to make a PostScript-compatible program had to write their own handlers for supporting these functions, and then laboriously convert the QD layout into the PS model. This conversion was fraught with problems, and often broke the WYSIWYG
editing that the Mac had striven for.
coordinate system and a variety of curve drawing commands. The system also included a system for "wrapping" existing PostScript Type 1 fonts into its own internal format, which added bitmap preview versions for quick on-screen rendering. This project later took on an expanded role when Apple and Microsoft
agreed to work together to form an alternative to PostScript fonts, which were extremely expensive, creating the TrueType
effort based on Apple's existing efforts.
Another project, apparently unrelated at first, attempted to address problems with the conversion from QuickDraw into various printer output formats. Whereas developers had earlier been forced to write their own code to convert their QuickDraw on-screen display to PostScript for printing, under the new printer architecture such conversions would be provided by the OS. Additionally the new system was deliberately engineered to be as flexible as possible, supporting not only QD and PS printers, but potentially other standards such as Hewlett Packard's PCL
as well. The system also supported "desktop printers" (printers that appeared as icons on the user's desktop), a long sought-after feature missing from QD, and added improved printing dialogs and controls.
It is not clear when the projects merged, but this was a common theme in Apple at the time. Middle-managers were involved in an intense turf war
for much of the late 80's and early 90's, gathering projects together into "über-projects" that contained enough important code to make them "unkillable". Sadly this often delayed the projects dramatically; one component running behind schedule forced the entire collection to be delayed so they could be released "complete". QuickDraw GX was one such victim, and delays and changes of direction in TrueType and other problems greatly delayed the introduction of GX.
Discussions of GX technology started appearing in various trade magazines around 1992, notably Apple's own develop
. At the time it appeared release was imminent, perhaps late 1992 or early 1993.
later that year. The system was received with a dull thud. The package was large enough to strain the memory of most existing Macintosh
computers of the era, and arguments like "you can now print to PostScript" were less than impressive considering many existing programs had already added such support. Users and developers generally ignored GX, and a "market" for the system simply never appeared.
There appears to be no one reason for GX's failure in the market, but certainly a number of them conspired to lessen its appeal. For one thing, GX was very large, requiring what was then a lot of memory in order to run effectively. Speed was also an issue, limiting it to running only on Macs with a Motorola 68020
or better. Given that the installed Mac base at the time still contained large numbers of 68000 based machines like the Mac Plus, these requirements restricted the number of machines it could run on. When it was first released, one review noted "QuickDraw GX isn't for everyone and requires more RAM than many Macs have to spare."
Additionally, the API for the system was very large, filling several books. Implementing a GX program was no easy feat, even though the development was supposed to be much easier. This was not a problem of the GX architecture itself, but a side effect of the "all inclusive" nature of the system — a problem most Apple products of the era suffered from (see PowerTalk
for instance). As a result, the developer appeal was limited; a lot of effort would be required to use the system in programs, and the resulting application could only run on a subset of the installed base — let alone the upcoming Windows 95
, which was then in the midst of an unprecedented media blitz. The number of GX-based (as opposed to GX-compatible) programs could be counted on one hand.
Additionally, the change in printing systems presented serious real-world issues. While PostScript printing had never been easy, over the years since the release of the original LaserWriter
developers had built up a library of solutions to common problems. With the change in architecture for GX, most of these stopped working. New "GX drivers" were needed for printers as well, and Apple didn't supply drivers for all of their own printers, let alone any third-party ones. Printing problems were endemic, and so difficult to fix that users often gave up on the system in frustration.
User uptake of GX was very close to zero, as was the case for most of the new technologies Apple released in the early 1990s. It might have seen widespread use as a part of the Copland
project, but Copland never launched. Although Apple continued to state GX was the future of graphics on the Mac, by 1995 it was clear they were no longer "pushing" it, frustrating its supporters.
Mac OS 8
dropped support for the GX printing architecture, though the text management and color management architectures survived. Elements of the text management architecture became part of the TrueType Specification and elements of the color management architecture became part of the International Color Consortium
specification. With the advent of Mac OS X, portions of GX live on in Apple Type Services for Unicode Imaging
(ATSUI), and in ColorSync
, whose file format is identical to the original format developed for GX.
This contrasts strongly with the original QuickDraw, where the programmer was responsible for all state changes. For instance, if one were to draw a redBox and then a series of lines, the lines would also appear in red unless the programmer explicitly changed the color first. The advantage to this approach is that it minimizes the number of commands needed to set state; the programmer can organize drawing to draw groups of similarly styled objects at the same time and thereby save time. The disadvantage of this approach is that it is easy to "forget" to change state and end up causing problems, so easy that programmers often saved and restored the complete state before every drawing command, thereby potentially lowering performance.
The drawing state under GX was hierarchical. A default drawing mode was created with every window, as it was under QD, and drawing objects with no other state changes would use these defaults. The programmer could then change state in the objects themselves, as in our redBox example, or alternately change the state of all drawing by setting the state in the window object. GX objects could be easily collected into groups, themselves objects, allowing the state to be set for an entire complex object.
One part of the overall drawing state was the gxMapping. This was a 3-by-3 matrix
which could express arbitrary linear transformation
s in two dimensions, including perspective
distortions. All GX objects had an associated mapping as part of its drawing state, which allowed for things like rotations and translations. Although all of this state was held in the gxMapping for that object, GX also provided "wrapper" commands like "rotate" to make the API simpler to use.
Unlike QuickDraw, QuickDraw GX allowed for fractional coordinates. However, these were fixed-point values, rather than floating-point
. At the time GX was being developed (late 1980s to early 1990s), there was still a significant performance penalty in using floating-point arithmetic.
The GX graphics architecture was built around a number of types of objects which were premade, though a full set of API calls was available for examining and manipulating them:
The GX API also provided hit-testing functions, so that for example if the user clicked on a layout shape in the middle of a ligature
, or in the region between a change of text direction, GX itself would provide the smarts to determine which character position in the original text corresponded to the click.
This distinction was important in that such contextual substitutions occurred at rendering time, without any changes to the source character string. Thus they had no impact on editing or searching of the text. PostScript Type 1 font files have one to one mapping only, and as ligatures are many to one mappings, they can not be inserted into the composition without changing the source character string, for instance, the ligature ffi is placed at the position of capital Y in Adobe font products, and "Adobe Offices" is composed by typing "Adobe O" "Y" "ces". In the layout the character string is broken, and in PDF made from streamed PostScript the characters f+f+i can only be reconstructed, if the name of the glyph follows a glyph naming list.
Contextual substitutions can be controlled by enabling or disabling the composition options of a TrueType GX font in WorldText on the Mac OS 9 CD or in TextEdit in Mac OS X. Fonts commonly have features called "common ligatures" (such as the "fl" example), "rare ligatures" (such as inscriptional ME and MD ligatures), "archaic non-terminal s" (for automatically substituting the letter "s" with the archaic form
that looked more like an "f", except at the ends of words), and even choices between entirely separate sets of glyph designs, such as more and less ornate forms.
The rules for performing contextual substitutions are implemented as state machines built into the font, and interpreted by the LLM Line Layout Manager, the counterpart of the CMM Color Management Module for ColorSync services. Text management in the operating system allowed QuickDraw GX to accept character strings with any mix of writing systems and scripts, and compose the strings automatically, whether the encoding was Unicode 1.0 or 8 bit and 8/16 bit encodings.
Another interesting feature was font "variations," which were the GX equivalent of Adobe's "multiple master
" fonts. Whereas Adobe's fonts required the user explicitly create an "instance" of the font by specifying values for the variation axes before he could use it, GX allowed the user to specify the font directly for a layout style, and then dynamically vary the axis values and immediately observe the effect on the layout of the text.
TrueType GX:
QuickDraw
QuickDraw is the 2D graphics library and associated Application Programming Interface which is a core part of the classic Apple Macintosh operating system. It was initially written by Bill Atkinson and Andy Hertzfeld. QuickDraw still exists as part of the libraries of Mac OS X, but has been...
(QD) 2D graphics engine
2D computer graphics
2D computer graphics is the computer-based generation of digital images—mostly from two-dimensional models and by techniques specific to them...
and Printing Manager inside the "classic" Mac OS
Mac OS
Mac OS is a series of graphical user interface-based operating systems developed by Apple Inc. for their Macintosh line of computer systems. The Macintosh user experience is credited with popularizing the graphical user interface...
. Its underlying drawing platform was a resolution-independent object oriented retained mode
Retained mode
In computing, retained mode rendering is a style for application programming interfaces of graphics libraries, in which the libraries retain a complete model of the objects to be rendered.-Overview:...
system, making it much easier for programmers to perform common tasks (compared to the original QuickDraw). Additionally, GX added various curve-drawing commands that had been lacking from QD, as well as introducing TrueType
TrueType
TrueType is an outline font standard originally developed by Apple Computer in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript...
as its basic font system.
While GX certainly addressed many of the problems QD had, by the time it was available most developers had already developed their own solutions to these problems anyway. GX also suffered from causing a number of incompatibilities in existing programs, notably those that had developed their own QD extensions. This, coupled with opposition from an important fraction of the developer market, especially PostScript owner Adobe, and a lack of communication from Apple about the benefits of GX and why users should adopt it, led to the technology being sidelined. QuickDraw GX was eventually "killed" with the purchase of NeXT
NeXT
Next, Inc. was an American computer company headquartered in Redwood City, California, that developed and manufactured a series of computer workstations intended for the higher education and business markets...
and the eventual adoption of the Quartz
Quartz (graphics layer)
Quartz specifically refers to a pair of Mac OS X technologies, each part of the Core Graphics framework: Quartz 2D and Quartz Compositor. It includes both a 2D renderer in Core Graphics and the composition engine that sends instructions to the graphics card...
imaging model in Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...
, but many of its component features lived on and are now standard in the current Macintosh platform.
Problems with QuickDraw
As the 80s wore on, QuickDraw's architectural limitations began to impose limits on Apple and third-party developers.- All of QuickDraw's public data structures assume a 16-bit integer coordinate space, with no provision for fractional coordinates.
- Adding new features to QuickDraw was extremely difficult due to lack of data hiding in the API. The central data structure in QuickDraw was the GrafPort, a structure with all of the member variables exposed. Worse, the GrafPort structure was designed to be directly embedded in third-party developer data structures, so Apple could not add new variables. Color QuickDraw, introduced in 1987, was a tremendous kludge on top of the original black and white QuickDraw. This increased the complexity of developing color applications for Macs. For example, QuickDraw could not easily support advanced graphics transformations such as rotations and shears, and introducing new data types such as curves was impossible.
- The QuickDraw printing system had been created in an era when printers were attached directly to the machine, so the printer selection system consisted of a program known as Chooser to select which port it was attached to. With the introduction of networked printers — largely through Apple's own efforts — tying the machine to a single printer at the time was an annoyance. Users repeatedly asked for a new system that knew about multiple printers, and displayed them right on the desktop.
PostScript
Compounding these problems was the introduction and widespread use of PostScriptPostScript
PostScript is a dynamically typed concatenative programming language created by John Warnock and Charles Geschke in 1982. It is best known for its use as a page description language in the electronic and desktop publishing areas. Adobe PostScript 3 is also the worldwide printing and imaging...
(PS) in the desktop publishing
Desktop publishing
Desktop publishing is the creation of documents using page layout software on a personal computer.The term has been used for publishing at all levels, from small-circulation documents such as local newsletters to books, magazines and newspapers...
market, a market dominated by Apple. PS included many features not found in QD, notably Bézier curve
Bézier curve
A Bézier curve is a parametric curve frequently used in computer graphics and related fields. Generalizations of Bézier curves to higher dimensions are called Bézier surfaces, of which the Bézier triangle is a special case....
s and outline fonts. The entire imaging model was also quite different, being based on a floating point
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...
coordinate system, one whose layout was "flipped" in comparison to QD. The coordinate system itself did not have a "natural resolution" either, whereas QD scaled everything based on 72 dpi
Dots per inch
Dots per inch is a measure of spatial printing or video dot density, in particular the number of individual dots that can be placed in a line within the span of 1 inch . The DPI value tends to correlate with image resolution, but is related only indirectly.- DPI measurement in monitor...
. Developers wishing to make a PostScript-compatible program had to write their own handlers for supporting these functions, and then laboriously convert the QD layout into the PS model. This conversion was fraught with problems, and often broke the WYSIWYG
WYSIWYG
WYSIWYG is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed onscreen during editing appears in a form closely corresponding to its appearance when printed or displayed as a finished product...
editing that the Mac had striven for.
Creating GX
GX appears to have started in a roundabout fashion, originally as an outline font system that would be added to the Mac OS. Included in the font rendering engine were a number of generally useful extensions, notably a fixed pointFixed-point arithmetic
In computing, a fixed-point number representation is a real data type for a number that has a fixed number of digits after the radix point...
coordinate system and a variety of curve drawing commands. The system also included a system for "wrapping" existing PostScript Type 1 fonts into its own internal format, which added bitmap preview versions for quick on-screen rendering. This project later took on an expanded role when Apple and Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
agreed to work together to form an alternative to PostScript fonts, which were extremely expensive, creating the TrueType
TrueType
TrueType is an outline font standard originally developed by Apple Computer in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript...
effort based on Apple's existing efforts.
Another project, apparently unrelated at first, attempted to address problems with the conversion from QuickDraw into various printer output formats. Whereas developers had earlier been forced to write their own code to convert their QuickDraw on-screen display to PostScript for printing, under the new printer architecture such conversions would be provided by the OS. Additionally the new system was deliberately engineered to be as flexible as possible, supporting not only QD and PS printers, but potentially other standards such as Hewlett Packard's PCL
Printer Command Language
Printer Command Language, more commonly referred to as PCL, is a page description language developed by Hewlett-Packard as a printer protocol and has become a de facto industry standard. Originally developed for early inkjet printers in 1984, PCL has been released in varying levels for thermal,...
as well. The system also supported "desktop printers" (printers that appeared as icons on the user's desktop), a long sought-after feature missing from QD, and added improved printing dialogs and controls.
It is not clear when the projects merged, but this was a common theme in Apple at the time. Middle-managers were involved in an intense turf war
Turf war
According to Wordnet the definition of a turf war is "a bitter struggle for territory or power or control or rights". For example: a turf war erupted between street gangs; the president's resignation was the result of a turf war with the board of directors. In larger companies Turf wars could...
for much of the late 80's and early 90's, gathering projects together into "über-projects" that contained enough important code to make them "unkillable". Sadly this often delayed the projects dramatically; one component running behind schedule forced the entire collection to be delayed so they could be released "complete". QuickDraw GX was one such victim, and delays and changes of direction in TrueType and other problems greatly delayed the introduction of GX.
Discussions of GX technology started appearing in various trade magazines around 1992, notably Apple's own develop
Develop (magazine)
Develop is a monthly trade magazine for the video games industry. Based in Hertford, Hertfordshire, the magazine allows participation by anyone working in the video game industry. Develop is the only European-based website and print magazine aimed exclusively at the development community...
. At the time it appeared release was imminent, perhaps late 1992 or early 1993.
Release and use
GX was initially released in about January 1995, as a separate package. Version 1.1.1 was bundled with System 7.5System 7 (Macintosh)
System 7 is a single-user graphical user interface-based operating system for Macintosh computers. It was introduced on May 13, 1991 by Apple Computer. It succeeded System 6, and was the main Macintosh operating system until it was succeeded by Mac OS 8 in 1997...
later that year. The system was received with a dull thud. The package was large enough to strain the memory of most existing Macintosh
Macintosh
The Macintosh , or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced by Apple's then-chairman Steve Jobs on January 24, 1984; it was the first commercially successful personal computer to feature a mouse and a...
computers of the era, and arguments like "you can now print to PostScript" were less than impressive considering many existing programs had already added such support. Users and developers generally ignored GX, and a "market" for the system simply never appeared.
There appears to be no one reason for GX's failure in the market, but certainly a number of them conspired to lessen its appeal. For one thing, GX was very large, requiring what was then a lot of memory in order to run effectively. Speed was also an issue, limiting it to running only on Macs with a Motorola 68020
Motorola 68020
The Motorola 68020 is a 32-bit microprocessor from Motorola, released in 1984. It is the successor to the Motorola 68010 and is succeeded by the Motorola 68030...
or better. Given that the installed Mac base at the time still contained large numbers of 68000 based machines like the Mac Plus, these requirements restricted the number of machines it could run on. When it was first released, one review noted "QuickDraw GX isn't for everyone and requires more RAM than many Macs have to spare."
Additionally, the API for the system was very large, filling several books. Implementing a GX program was no easy feat, even though the development was supposed to be much easier. This was not a problem of the GX architecture itself, but a side effect of the "all inclusive" nature of the system — a problem most Apple products of the era suffered from (see PowerTalk
Apple Open Collaboration Environment
Apple Open Collaboration Environment, or AOCE , was a collection of messaging-related technologies introduced for the Mac OS in the early 1990s...
for instance). As a result, the developer appeal was limited; a lot of effort would be required to use the system in programs, and the resulting application could only run on a subset of the installed base — let alone the upcoming Windows 95
Windows 95
Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...
, which was then in the midst of an unprecedented media blitz. The number of GX-based (as opposed to GX-compatible) programs could be counted on one hand.
Additionally, the change in printing systems presented serious real-world issues. While PostScript printing had never been easy, over the years since the release of the original LaserWriter
LaserWriter
The LaserWriter was a laser printer with built-in PostScript interpreter introduced by Apple in 1985. It was one of the first laser printers available to the mass market...
developers had built up a library of solutions to common problems. With the change in architecture for GX, most of these stopped working. New "GX drivers" were needed for printers as well, and Apple didn't supply drivers for all of their own printers, let alone any third-party ones. Printing problems were endemic, and so difficult to fix that users often gave up on the system in frustration.
User uptake of GX was very close to zero, as was the case for most of the new technologies Apple released in the early 1990s. It might have seen widespread use as a part of the Copland
Copland (operating system)
Copland was a project at Apple Computer to create an updated version of the Macintosh operating system. It was to have introduced protected memory, preemptive multitasking and a number of new underlying operating system features, yet still be compatible with existing Mac software...
project, but Copland never launched. Although Apple continued to state GX was the future of graphics on the Mac, by 1995 it was clear they were no longer "pushing" it, frustrating its supporters.
Mac OS 8
Mac OS 8
Mac OS 8 is an operating system that was released by Apple Computer on July 26, 1997. It represented the largest overhaul of the Mac OS since the release of System 7, some six years previously. It puts more emphasis on color than previous operating systems...
dropped support for the GX printing architecture, though the text management and color management architectures survived. Elements of the text management architecture became part of the TrueType Specification and elements of the color management architecture became part of the International Color Consortium
International Color Consortium
The International Color Consortium was formed in 1993 by eight industry vendors in order to create a universal color management system that would function transparently across all operating systems and software packages....
specification. With the advent of Mac OS X, portions of GX live on in Apple Type Services for Unicode Imaging
Apple Type Services for Unicode Imaging
The Apple Type Services for Unicode Imaging is the set of services for rendering Unicode-encoded text starting with Mac OS 8.5 and in Mac OS X.It replaced the WorldScript engine for legacy encodings....
(ATSUI), and in ColorSync
ColorSync
ColorSync is Apple Inc's color management API for the Mac OS and Mac OS X.-Version history:Apple developed the original 1.0 version of ColorSync as a Mac-only architecture, which made it into an operating system release in 1993. In the same year, Apple co-founded the International Color Consortium...
, whose file format is identical to the original format developed for GX.
Graphics
QuickDraw GX is based on an object oriented model in which graphics objects are aware of and responsible for their own state. Unlike QuickDraw, there is no universal "state", every drawing command can re-construct the state from data stored within it, or various "parent" objects. For instance, a programmer could build a redBox object that first sets the color to red, and then draws a square. From that point on the program no longer has to explicitly set the color before drawing, the GX system itself will always correctly set the drawing color when asked to draw a redBox, and reset it when finished. Since this state was private, and sent to GX if and when needed, GX theoretically allowed the Mac OS to support protected memory, as state was no longer shared directly between the programs and graphics system.This contrasts strongly with the original QuickDraw, where the programmer was responsible for all state changes. For instance, if one were to draw a redBox and then a series of lines, the lines would also appear in red unless the programmer explicitly changed the color first. The advantage to this approach is that it minimizes the number of commands needed to set state; the programmer can organize drawing to draw groups of similarly styled objects at the same time and thereby save time. The disadvantage of this approach is that it is easy to "forget" to change state and end up causing problems, so easy that programmers often saved and restored the complete state before every drawing command, thereby potentially lowering performance.
The drawing state under GX was hierarchical. A default drawing mode was created with every window, as it was under QD, and drawing objects with no other state changes would use these defaults. The programmer could then change state in the objects themselves, as in our redBox example, or alternately change the state of all drawing by setting the state in the window object. GX objects could be easily collected into groups, themselves objects, allowing the state to be set for an entire complex object.
One part of the overall drawing state was the gxMapping. This was a 3-by-3 matrix
Matrix (mathematics)
In mathematics, a matrix is a rectangular array of numbers, symbols, or expressions. The individual items in a matrix are called its elements or entries. An example of a matrix with six elements isMatrices of the same size can be added or subtracted element by element...
which could express arbitrary linear transformation
Linear transformation
In mathematics, a linear map, linear mapping, linear transformation, or linear operator is a function between two vector spaces that preserves the operations of vector addition and scalar multiplication. As a result, it always maps straight lines to straight lines or 0...
s in two dimensions, including perspective
Perspective (graphical)
Perspective in the graphic arts, such as drawing, is an approximate representation, on a flat surface , of an image as it is seen by the eye...
distortions. All GX objects had an associated mapping as part of its drawing state, which allowed for things like rotations and translations. Although all of this state was held in the gxMapping for that object, GX also provided "wrapper" commands like "rotate" to make the API simpler to use.
Unlike QuickDraw, QuickDraw GX allowed for fractional coordinates. However, these were fixed-point values, rather than floating-point
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...
. At the time GX was being developed (late 1980s to early 1990s), there was still a significant performance penalty in using floating-point arithmetic.
The GX graphics architecture was built around a number of types of objects which were premade, though a full set of API calls was available for examining and manipulating them:
- a gxShape defined the basic geometry of a shape (for example, coordinates of control points for a curve, or the text content of a text object).
- a gxStyle defined elaborations of the basic shape geometry, such as line thickness, cap and join styles, fill pattern and text font.
- a gxInk specified how pixel values were to be computed when rendering the shape: besides specifying a basic color for the shape, this also included an elaborate transfer mode structure that could define a wide variety of functions of the initial and final destination pixel value.
- a gxFont represented a font, either one installed for systemwide use, or one installed on-the-fly by the current application for its own use. API calls allowed the interrogation of the properties of a font, including the determination of what encodings (Unicode, language-specific etc.) it might support.
- a gxProfile was a representation of a ColorSync color profile, used as part of the specification of a color for drawing. GX integrated full support for color matching at all stages of the drawing process, as well as support for non-RGB color specifications (such as HSV, YUVYUVYUV is a color space typically used as part of a color image pipeline. It encodes a color image or video taking human perception into account, allowing reduced bandwidth for chrominance components, thereby typically enabling transmission errors or compression artifacts to be more efficiently...
and CIEInternational Commission on IlluminationThe International Commission on Illumination is the international authority on light, illumination, color, and color spaces...
XYZ). - a gxTransform determined the relationship between the shape and the display device. Besides the Clipping pathClipping pathA clipping path is a closed vector path, or shape, used to cut out a 2D image in image editing software. Anything inside the path will be included after the clipping path is applied; anything outside the path will be omitted from the output...
and the gxMapping that transformed the shape before displaying on the output device, this object also specified hit-testingHit-testingIn computer graphics programming, hit-testing is the process of determining whether a user-controlled cursor intersects a given shape, line, or curve drawn on the screen...
information that controlled responses to user clicks within the area of the shape. - a gxViewDevice represented a block of pixel memory into which drawing would be rendered. This could be an actual on-screen display, or an offscreen block of memory. GX supported all the QuickDrawQuickDrawQuickDraw is the 2D graphics library and associated Application Programming Interface which is a core part of the classic Apple Macintosh operating system. It was initially written by Bill Atkinson and Andy Hertzfeld. QuickDraw still exists as part of the libraries of Mac OS X, but has been...
pixel layouts; this allowed both a GX view device and a QuickDraw GrafPort to point to the same pixels, thereby allowing applications to mix both sets of drawing calls. - a gxViewPort was a logical destination for drawing. A gxTransform could specify a list of more than one of these; the shape would be drawn into all of them in a single GXDrawShape call.
- a gxViewGroup represented the connection between view devices and view ports. Each view port had a gxMapping specifying its relationship to the global coordinate system of the view group; and each view device had a gxMapping that specified its location and the size of its pixels with regard to view group coordinates. There was a single predefined view group which contained all on-screen view devices (and whose view ports effectively corresponded to on-screen windows); applications were free to create their own view groups for off-screen view devices and view ports.
- a gxTag allowed the attachment of arbitrary application-defined information to most of the above object types. Each tag had an OSTypeOSTypeOSType is the name of a four-byte sequence commonly used as an identifier in Mac OS. While the bytes can have any value, they usually display figures characterized in software programs such as those utilized in ASCII or Mac OS Roman character sets.OSType values are used to identify file data...
type code, but there could be multiple tags of the same type attached to the same object.
Shape types
GX shapes could be of various types:- a straight line defined by its end points.
- a rectangle defined by its left, right, upper and lower bounds.
- a polygon defined by a sequence of vertex coordinates.
- a curve shape was a single quadratic Bézier curveBézier curveA Bézier curve is a parametric curve frequently used in computer graphics and related fields. Generalizations of Bézier curves to higher dimensions are called Bézier surfaces, of which the Bézier triangle is a special case....
defined by three control points. - a path shape which was a sequence of quadratic Bézier curveBézier curveA Bézier curve is a parametric curve frequently used in computer graphics and related fields. Generalizations of Bézier curves to higher dimensions are called Bézier surfaces, of which the Bézier triangle is a special case....
s. Each control point had an associated flag indicating whether it was "on-curve" or "off-curve". An on-curve point was a Bézier endpoint, while an off-curve point was a Bézier midpoint. If two successive off-curve points were encountered, then an implicit on-curve point was assumed to lie halfway between them. Two successive on-curve points defined a straight-line segment. - a bitmap shape contained raster data in any of the supported pixel formats.
- a picture shape was a grouping of other shapes (possibly including recursive picture shapes), with the option of specifying additional transformations applying to the whole group.
- the various types of typographic shapes are described in the GX Typography section below.
- additional types which were perhaps not directly useful for drawing, but could be combined with other shapes in geometry calculations: the empty shape (drawing of which did nothing); the point shape consisting of a single point; and the full shape (of infinite extent).
Typography
The typography features of GX were integrated in the form of 3 types of gxShape:- Text shapes were the simplest: these contained a single run of text rendered in a single font style.
- Glyph shapes were a way to use character shapes ("glyphs") as pure geometry, for instance as Clipping pathClipping pathA clipping path is a closed vector path, or shape, used to cut out a 2D image in image editing software. Anything inside the path will be included after the clipping path is applied; anything outside the path will be omitted from the output...
s. - Layout shapes were the most elaborate. These could be divided into multiple runs with different font styles, even different language encodings and text directions. Thus, it was possible to embed a sequence of Arabic text, rendered right-to-left, within an outer sequence of left-to-right Roman text. Layout shapes unleashed the full power of contextual substitutions, kerning, variations and all the other capabilities of TrueType GX fonts. Their main restriction was that they were confined to a single line of text.
The GX API also provided hit-testing functions, so that for example if the user clicked on a layout shape in the middle of a ligature
Ligature (typography)
In writing and typography, a ligature occurs where two or more graphemes are joined as a single glyph. Ligatures usually replace consecutive characters sharing common components and are part of a more general class of glyphs called "contextual forms", where the specific shape of a letter depends on...
, or in the region between a change of text direction, GX itself would provide the smarts to determine which character position in the original text corresponded to the click.
TrueType GX
An important distinction in GX was drawn between a character and a glyph, a distinction also found in the Unicode Standard. A character was an abstract symbol from the character set of a writing system, such as the letter "f" in the writing systems of the Latin script. Whereas a glyph was a specific graphic shape from a particular font, whether the shape represented a single character or a set of characters. Thus, for example, the Hoefler Text font had glyphs to represent the letters "f" and "l". It also had another glyph to represent the ligature "fl", which could be automatically composed (instead of the individual glyphs) wherever the two abstract characters "f" and "l" occurred in sequence in the source text.This distinction was important in that such contextual substitutions occurred at rendering time, without any changes to the source character string. Thus they had no impact on editing or searching of the text. PostScript Type 1 font files have one to one mapping only, and as ligatures are many to one mappings, they can not be inserted into the composition without changing the source character string, for instance, the ligature ffi is placed at the position of capital Y in Adobe font products, and "Adobe Offices" is composed by typing "Adobe O"
Contextual substitutions can be controlled by enabling or disabling the composition options of a TrueType GX font in WorldText on the Mac OS 9 CD or in TextEdit in Mac OS X. Fonts commonly have features called "common ligatures" (such as the "fl" example), "rare ligatures" (such as inscriptional ME and MD ligatures), "archaic non-terminal s" (for automatically substituting the letter "s" with the archaic form
Long s
The long, medial or descending s is a form of the minuscule letter s formerly used where s occurred in the middle or at the beginning of a word, for example "ſinfulneſs" . The modern letterform was called the terminal, round, or short s.-History:The long s is derived from the old Roman cursive...
that looked more like an "f", except at the ends of words), and even choices between entirely separate sets of glyph designs, such as more and less ornate forms.
The rules for performing contextual substitutions are implemented as state machines built into the font, and interpreted by the LLM Line Layout Manager, the counterpart of the CMM Color Management Module for ColorSync services. Text management in the operating system allowed QuickDraw GX to accept character strings with any mix of writing systems and scripts, and compose the strings automatically, whether the encoding was Unicode 1.0 or 8 bit and 8/16 bit encodings.
Another interesting feature was font "variations," which were the GX equivalent of Adobe's "multiple master
Multiple master fonts
Multiple master fonts are an extension to Adobe Systems' Type 1 PostScript fonts, now mostly superseded by the advent of OpenType...
" fonts. Whereas Adobe's fonts required the user explicitly create an "instance" of the font by specifying values for the variation axes before he could use it, GX allowed the user to specify the font directly for a layout style, and then dynamically vary the axis values and immediately observe the effect on the layout of the text.
Developers
- Cary Clark was the architect and technical lead. He had worked on Color QuickDrawQuickDrawQuickDraw is the 2D graphics library and associated Application Programming Interface which is a core part of the classic Apple Macintosh operating system. It was initially written by Bill Atkinson and Andy Hertzfeld. QuickDraw still exists as part of the libraries of Mac OS X, but has been...
, and went on to become an early member of Rocket Science GamesRocket Science GamesRocket Science Games was a video game developer that created games for consoles and computers from 1993 to 1997. The company was responsible for games such as Obsidian, Rocket Jockey, and Loadstar.-History:...
and WebTV. - Michael Fairman
- Keith McGreggor was the manager of the graphics group. He was the primary developer of the color architecture for QuickDraw GX.
- David Van Brink
- Robert Johnson was the resident mathematician for QuickDraw GX.
- Chris Yerba
- Oliver Steele
- Dave Good
- Pablo Fernicola
TrueType GX:
- Sampo Kaasila
- Mike Reed
- Arlo
External links
- QuickDraw GX — Apple's GX documentation on the web