Mac OS 9
QuickdrawText.h File Reference

Quickdraw Text Interfaces. More...

#include <MacTypes.h>
#include <MixedMode.h>
#include <IntlResources.h>

Go to the source code of this file.

Data Structures

struct  FontInfo
 

Macros

#define NewStyleRunDirectionUPP(userRoutine)
 
#define DisposeStyleRunDirectionUPP(userUPP)   DisposeRoutineDescriptor(userUPP)
 
#define InvokeStyleRunDirectionUPP(styleRunIndex, dirParam, userUPP)
 
#define NewStyleRunDirectionProc(userRoutine)    NewStyleRunDirectionUPP(userRoutine)
 
#define CallStyleRunDirectionProc(userRoutine, styleRunIndex, dirParam)    InvokeStyleRunDirectionUPP(styleRunIndex, dirParam, userRoutine)
 

Typedefs

typedef short JustStyleCode
 
typedef short TruncCode
 
typedef SInt8 StyledLineBreakCode
 
typedef struct FontInfo FontInfo
 
typedef short FormatOrder[1]
 
typedef FormatOrder * FormatOrderPtr
 
typedef void * dirParam
 

Enumerations

enum  { leftCaret = 0 , rightCaret = -1 , kHilite = 1 }
 
enum  { smLeftCaret = 0 , smRightCaret = -1 , smHilite = 1 }
 
enum  {
  onlyStyleRun = 0 , leftStyleRun = 1 , rightStyleRun = 2 , middleStyleRun = 3 ,
  smOnlyStyleRun = 0 , smLeftStyleRun = 1 , smRightStyleRun = 2 , smMiddleStyleRun = 3
}
 
enum  { truncEnd = 0 , truncMiddle = 0x4000 , smTruncEnd = 0 , smTruncMiddle = 0x4000 }
 
enum  {
  notTruncated = 0 , truncated = 1 , truncErr = -1 , smNotTruncated = 0 ,
  smTruncated = 1 , smTruncErr = -1
}
 
enum  { smBreakWord = 0 , smBreakChar = 1 , smBreakOverflow = 2 }
 
enum  { tfAntiAlias = 1 << 0 , tfUnicode = 1 << 1 }
 
enum  { uppStyleRunDirectionProcInfo = 0x00000390 }
 

Functions

OSStatus StandardGlyphs (void *dataStream, ByteCount size)
 
typedef CALLBACK_API (Boolean, StyleRunDirectionProcPtr)(short styleRunIndex
 
typedef STACK_UPP_TYPE (StyleRunDirectionProcPtr) StyleRunDirectionUPP
 
StyleRunDirectionUPP NewStyleRunDirectionUPP (StyleRunDirectionProcPtr userRoutine)
 
void DisposeStyleRunDirectionUPP (StyleRunDirectionUPP userUPP)
 
Boolean InvokeStyleRunDirectionUPP (short styleRunIndex, void *dirParam, StyleRunDirectionUPP userUPP)
 
short Pixel2Char (Ptr textBuf, short textLen, short slop, short pixelWidth, Boolean *leadingEdge)
 
short Char2Pixel (Ptr textBuf, short textLen, short slop, short offset, short direction)
 
short PixelToChar (Ptr textBuf, long textLength, Fixed slop, Fixed pixelWidth, Boolean *leadingEdge, Fixed *widthRemaining, JustStyleCode styleRunPosition, Point numer, Point denom)
 
short CharToPixel (Ptr textBuf, long textLength, Fixed slop, long offset, short direction, JustStyleCode styleRunPosition, Point numer, Point denom)
 
void DrawJustified (Ptr textPtr, long textLength, Fixed slop, JustStyleCode styleRunPosition, Point numer, Point denom)
 
void MeasureJustified (Ptr textPtr, long textLength, Fixed slop, Ptr charLocs, JustStyleCode styleRunPosition, Point numer, Point denom)
 
Fixed PortionLine (Ptr textPtr, long textLen, JustStyleCode styleRunPosition, Point numer, Point denom)
 
void HiliteText (Ptr textPtr, short textLength, short firstOffset, short secondOffset, OffsetTable offsets)
 
void DrawJust (Ptr textPtr, short textLength, short slop)
 
void MeasureJust (Ptr textPtr, short textLength, short slop, Ptr charLocs)
 
Fixed PortionText (Ptr textPtr, long textLength)
 Determine how to distribute the slop value for a line. More...
 
long VisibleLength (Ptr textPtr, long textLength)
 
void GetFormatOrder (FormatOrderPtr ordering, short firstFormat, short lastFormat, Boolean lineRight, StyleRunDirectionUPP rlDirProc, Ptr dirParam)
 
void TextFont (short font)
 Select font for subsequent text drawing. More...
 
 TextFace (bold|italic)
 Select a style for subsequent text drawing. More...
 
 TextFace (thePort->txFace|bold)
 
 TextFace (thePort->txFace &~bold)
 
 TextFace (0)
 
void TextMode (short mode)
 Set text-drawing transfer mode. More...
 
void TextSize (short size)
 Set the point size for subsequent text drawing. More...
 
void SpaceExtra (Fixed extra)
 Space out text for left/right justification. More...
 
void DrawChar (CharParameter ch)
 
void DrawString (ConstStr255Param s)
 
void MacDrawText (const void *textBuf, short firstByte, short byteCount)
 
short CharWidth (CharParameter ch)
 
short StringWidth (ConstStr255Param s)
 
short TextWidth (const void *textBuf, short firstByte, short byteCount)
 
void MeasureText (short count, const void *textAddr, void *charLocs)
 
void GetFontInfo (FontInfo *info)
 
void CharExtra (Fixed extra)
 Space to widen all text characters, excluding space band. More...
 
void StdText (short count, const void *textAddr, Point numer, Point denom)
 
short StdTxMeas (short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info)
 
StyledLineBreakCode StyledLineBreak (Ptr textPtr, long textLen, long textStart, long textEnd, long flags, Fixed *textWidth, long *textOffset)
 
short TruncString (short width, Str255 theString, TruncCode truncWhere)
 
short TruncText (short width, Ptr textPtr, short *length, TruncCode truncWhere)
 
void drawstring (const char *s)
 
short stringwidth (const char *s)
 
void stdtext (short count, const void *textAddr, const Point *numer, const Point *denom)
 

Variables

The condense and extend variations change the spacing between characters to an arbitrary value set by the Font Manager Another way to compress expand text is to call SetFScaleDisable and use a smaller or larger font You may use SpaceExtra for spacing control
 
g
 
e as an aid in displaying right justified text</pre > *par Copyright
 

Detailed Description

Quickdraw Text Interfaces.

Introduced In: Mac OS 8.5
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1983-2001 by Apple Computer, Inc., all rights reserved.

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Macro Definition Documentation

◆ InvokeStyleRunDirectionUPP

#define InvokeStyleRunDirectionUPP (   styleRunIndex,
  dirParam,
  userUPP 
)
Value:
(Boolean) CALL_TWO_PARAMETER_UPP((userUPP), uppStyleRunDirectionProcInfo, \
(styleRunIndex), (dirParam))
unsigned char Boolean
Definition: MacTypes.h:318

◆ NewStyleRunDirectionProc

#define NewStyleRunDirectionProc (   userRoutine)     NewStyleRunDirectionUPP(userRoutine)

support for pre-Carbon UPP routines: New...Proc and Call...Proc

◆ NewStyleRunDirectionUPP

#define NewStyleRunDirectionUPP (   userRoutine)
Value:
(StyleRunDirectionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), \
uppStyleRunDirectionProcInfo, \
GetCurrentArchitecture())
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)

pascal 1_byte Func(2_bytes, 4_bytes)

Typedef Documentation

◆ JustStyleCode

typedef short JustStyleCode

type for styleRunPosition parameter in PixelToChar etc.

◆ TruncCode

typedef short TruncCode

Type for truncWhere parameter in TruncString, TruncText

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
leftCaret 

CharToPixel directions

rightCaret 

Place caret for left block

kHilite 

Place caret for right block

◆ anonymous enum

anonymous enum
Enumerator
smRightCaret 

Place caret for left block - obsolete

smHilite 

Place caret for right block - obsolete

◆ anonymous enum

anonymous enum
Enumerator
onlyStyleRun 

Constants for styleRunPosition argument in PortionLine, DrawJustified, MeasureJustified, CharToPixel, and PixelToChar.

leftStyleRun 

This is the only style run on the line

rightStyleRun 

This is leftmost of multiple style runs on the line

middleStyleRun 

This is rightmost of multiple style runs on the line

smOnlyStyleRun 

There are multiple style runs on the line and this is neither the leftmost nor the rightmost.

smLeftStyleRun 

obsolete

smRightStyleRun 

obsolete

smMiddleStyleRun 

obsolete

◆ anonymous enum

anonymous enum
Enumerator
truncEnd 

Constants for truncWhere argument in TruncString and TruncText

truncMiddle 

Truncate at end

smTruncEnd 

Truncate in middle

smTruncMiddle 

Truncate at end - obsolete

◆ anonymous enum

anonymous enum
Enumerator
notTruncated 

Constants for TruncString and TruncText results

truncated 

No truncation was necessary

truncErr 

Truncation performed

smNotTruncated 

General error

smTruncated 

No truncation was necessary - obsolete

smTruncErr 

Truncation performed - obsolete

◆ anonymous enum

anonymous enum

QuickTime3.0

Enumerator
tfAntiAlias 

Constants for txFlags (which used to be the pad field after txFace)

Function Documentation

◆ CALLBACK_API()

typedef CALLBACK_API ( Boolean  ,
StyleRunDirectionProcPtr   
)

FormatStatus was moved to TextUtils.i OffsetTable moved to IntlResources.i

◆ Char2Pixel()

short Char2Pixel ( Ptr  textBuf,
short  textLen,
short  slop,
short  offset,
short  direction 
)

Char2Pixel()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ CharExtra()

void CharExtra ( Fixed  extra)

Space to widen all text characters, excluding space band.

CharExtra specifies how much additional width to give all characters .
extrais a Fixed value, specifying the average number of pixels and
fractional pixels to be added to each non-space character
Returns
none
Note
This modifies the charExtra field of the current CGrafPort structure. The
initial value of this field is 0, but both positive and negative number can be
used. This is a cGrafPort-specific procedure and has no effect when used in
conjunction with an old-style grafPort.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ CharToPixel()

short CharToPixel ( Ptr  textBuf,
long  textLength,
Fixed  slop,
long  offset,
short  direction,
JustStyleCode  styleRunPosition,
Point  numer,
Point  denom 
)

CharToPixel()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ CharWidth()

short CharWidth ( CharParameter  ch)

CharWidth()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DisposeStyleRunDirectionUPP()

void DisposeStyleRunDirectionUPP ( StyleRunDirectionUPP  userUPP)

DisposeStyleRunDirectionUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DrawChar()

void DrawChar ( CharParameter  ch)

DrawChar()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DrawJust()

void DrawJust ( Ptr  textPtr,
short  textLength,
short  slop 
)

DrawJust()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ DrawJustified()

void DrawJustified ( Ptr  textPtr,
long  textLength,
Fixed  slop,
JustStyleCode  styleRunPosition,
Point  numer,
Point  denom 
)

DrawJustified()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ drawstring()

void drawstring ( const char *  s)

drawstring()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ DrawString()

void DrawString ( ConstStr255Param  s)

DrawString()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetFontInfo()

void GetFontInfo ( FontInfo info)

GetFontInfo()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetFormatOrder()

void GetFormatOrder ( FormatOrderPtr  ordering,
short  firstFormat,
short  lastFormat,
Boolean  lineRight,
StyleRunDirectionUPP  rlDirProc,
Ptr  dirParam 
)

GetFormatOrder()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ HiliteText()

void HiliteText ( Ptr  textPtr,
short  textLength,
short  firstOffset,
short  secondOffset,
OffsetTable  offsets 
)

HiliteText()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InvokeStyleRunDirectionUPP()

Boolean InvokeStyleRunDirectionUPP ( short  styleRunIndex,
void *  dirParam,
StyleRunDirectionUPP  userUPP 
)

InvokeStyleRunDirectionUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ MacDrawText()

void MacDrawText ( const void *  textBuf,
short  firstByte,
short  byteCount 
)

[Mac]DrawText()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ MeasureJust()

void MeasureJust ( Ptr  textPtr,
short  textLength,
short  slop,
Ptr  charLocs 
)

MeasureJust()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ MeasureJustified()

void MeasureJustified ( Ptr  textPtr,
long  textLength,
Fixed  slop,
Ptr  charLocs,
JustStyleCode  styleRunPosition,
Point  numer,
Point  denom 
)

MeasureJustified()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ MeasureText()

void MeasureText ( short  count,
const void *  textAddr,
void *  charLocs 
)

MeasureText()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NewStyleRunDirectionUPP()

StyleRunDirectionUPP NewStyleRunDirectionUPP ( StyleRunDirectionProcPtr  userRoutine)

NewStyleRunDirectionUPP()

Non-Carbon CFM: available as macro/inline
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ Pixel2Char()

short Pixel2Char ( Ptr  textBuf,
short  textLen,
short  slop,
short  pixelWidth,
Boolean leadingEdge 
)

CALL_NOT_IN_CARBON Pixel2Char()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ PixelToChar()

short PixelToChar ( Ptr  textBuf,
long  textLength,
Fixed  slop,
Fixed  pixelWidth,
Boolean leadingEdge,
Fixed widthRemaining,
JustStyleCode  styleRunPosition,
Point  numer,
Point  denom 
)

CALL_NOT_IN_CARBON PixelToChar()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ PortionLine()

Fixed PortionLine ( Ptr  textPtr,
long  textLen,
JustStyleCode  styleRunPosition,
Point  numer,
Point  denom 
)

PortionLine()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ PortionText()

Fixed PortionText ( Ptr  textPtr,
long  textLength 
)

Determine how to distribute the slop value for a line.

Parameters
textPtra pointer to the text to be justified
The PortionText procedure indicates the correct proportion of justification
to be allocated to given text when compared to other text; used to determine
how to distribute the slop of a line among the style runs on the line
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ SpaceExtra()

void SpaceExtra ( Fixed  extra)

Space out text for left/right justification.

SpaceExtra tells the Font Manager how much additional space to add when
displaying the space character (ASCII 0x20). It can be useful in
fully-justifying text.
extraSpace is a 4-byte Fixed value, specifying the average number of pixels and
fractional pixels to be added to each space character (ASCII 0x32).
Returns
none
Note
SpaceExtra modifies the spExtra field of the current GrafPort structure.
The initial value of this field is 0.
To justify a given text string to a specific line width:
1Use StringWidth to get the unadjusted size of the string.
2Subtract the returned value from the width between the margins; the
difference is the amount of adjustment needed.
3Count the number of spaces in the line.
4Use FixRatio to find the ratio between the results of steps 2 and 3.
5Call SpaceExtra , specifying the ratio returned from step 4.
6Position the pen ( MoveTo ) and draw the text ( DrawString ).
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ StandardGlyphs()

OSStatus StandardGlyphs ( void *  dataStream,
ByteCount  size 
)

new CGrafPort bottleneck ("newProc2") function, used in Unicode Text drawing StandardGlyphs()

Non-Carbon CFM: in QuickDrawText 8.5 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ stdtext()

void stdtext ( short  count,
const void *  textAddr,
const Point numer,
const Point denom 
)

CALL_NOT_IN_CARBON stdtext()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ StdText()

void StdText ( short  count,
const void *  textAddr,
Point  numer,
Point  denom 
)

StdText()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ StdTxMeas()

short StdTxMeas ( short  byteCount,
const void *  textAddr,
Point numer,
Point denom,
FontInfo info 
)

StdTxMeas()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ stringwidth()

short stringwidth ( const char *  s)

stringwidth()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ StringWidth()

short StringWidth ( ConstStr255Param  s)

StringWidth()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ StyledLineBreak()

StyledLineBreakCode StyledLineBreak ( Ptr  textPtr,
long  textLen,
long  textStart,
long  textEnd,
long  flags,
Fixed textWidth,
long *  textOffset 
)

StyledLineBreak()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TextFace()

TextFace ( bold|  italic)

Select a style for subsequent text drawing.

TextFace selects the test-style variation(s) (bold, italic, underline, etc.)
for the current GrafPort .
newStyle is an integer value (declared as an enum with a typedef of Style). A
value 0 indicates a "plain" unmodified version of the current font.
You can use bit-manipulation operations to combine any of the
following styles using the constants defined in Quickdraw.h:
bold1increased width on vertical strokes
italic2slanted toward the right
underline 4underscored, with breaks on descending letters
outline 8outlined
shadow 16Shadowed (outlined, heavier on right bottom)
condense 32less space between characters
extend64more space between characters
Returns
none
Note
TextFace modifies the txFace field of the current GrafPort . It is initially
set to 0 (plain text). The variation you select affects all subsequent text
drawing and text measuring.
You can read the current style setting by accessing the txFace field of the
current GrafPort :
curStyle = thePort -> txFace;
Here are some examples of usage:
TextFace ( bold ); /* set to bold 

◆ TextFont()

void TextFont ( short  font)

Select font for subsequent text drawing.

TextFont sets the txFont field of the current GrafPort . Subsequent text
drawing will use the specified font.
fontNois a font number. The following Standard Fonts are available as
system-defined constants:
systemFont 0System default font; "Chicago"
applFont 1default application font; initially "Geneva"
newYork 2
geneva3
monaco 4
venice5
london6
athens7
sanFran 8
toronto 9
cairo 11
losAngeles 12
times20These are all
helvetica 21 designed for
courier 22  use on the
symbol 23   LaserWriter
mobile 24
See Standard Fonts for a graphic depiction of these fonts. Use
GetFNum if you know the font's name, but not its number.
Returns
none
Note
Be sure to call InitFonts (once, early in the program, after InitGraf and
before InitWindows ). This ensures that the Font Manager is properly
initialized for text drawing.
The initial value for txFont is 0, specifying the system font, Chicago. You
can read the current value from the GrafPort structure:
curFont = thePort->txFont;
The appearance of the text is also affected by the txFace, txSize, and txMode
fields of the current GrafPort . Refer to TextFace , TextMode , and
TextSize .
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TextMode()

void TextMode ( short  mode)

Set text-drawing transfer mode.

TextMode selects the bit-transfer mode to be used in subsequent
text-drawing. Used for writing white characters on a black background, etc.
newMode selects the transfer mode. It must be one of the " srcXxx" modes.
Use one of the following constants, as defined in Quickdraw.h :
srcCopy 0overwrite background entirely
srcOr1overwrite where character is black
srcXor 2invert where character is black
srcBic3force white where character is black
notSrcCopy 4invert character, then srcCopy
notSrcOr 5invert character, then srcOr
notSrcXor 6invert character, then srcXor
notSrcBic 7invert character, then srcBic
Returns
none
Note
TextMode changes the txMode field of the current GrafPort structure.
See Transfer Modes  for a graphical representation of the effects of the
various modes.
The default mode is srcOr, which causes characters to be drawn over the
background, while allowing the background pattern to show through in the
empty parts of each letter.
The original Mac toolbox supported only srcOr, srcXor, and srcBic.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TextSize()

void TextSize ( short  size)

Set the point size for subsequent text drawing.

TextSize selects the size, in points, for subsequently-drawn text.
newSize is the desired size, in typographical points. Values from 1 to 127
are allowed. A value of 0 specifies the system font size (12 points).
Returns
none
Note
TextSize sets the txSize field of the current GrafPort structure. The
initial value is 0, specifying the system font size (12-point).
If the font used in subsequent text drawing is not available in size points,
the Font Manager will use a font it does have, scaling it to the desired size.
Such "scaled" fonts have a jagged look to them. See SetFScaleDisable for
more information font scaling.
You may use SetFScaleDisable to space text as if it were a different
point size, while continuing to use a “real” (unscaled) font.
To see if an unscaled version of a font exists as a system resource, use
GetFNum to learn its font reference number, then call RealFont .
A typographical point is approximately 1/72 of an inch; very nearly the
size of a pixel on the Mac screen.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TextWidth()

short TextWidth ( const void *  textBuf,
short  firstByte,
short  byteCount 
)

TextWidth()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TruncString()

short TruncString ( short  width,
Str255  theString,
TruncCode  truncWhere 
)

TruncString()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ TruncText()

short TruncText ( short  width,
Ptr  textPtr,
short *  length,
TruncCode  truncWhere 
)

TruncText()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ VisibleLength()

long VisibleLength ( Ptr  textPtr,
long  textLength 
)

CALL_NOT_IN_CARBON VisibleLength()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later