Package Name: fonts
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Extensions; use Interfaces.C.Extensions;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Types; use Types;
package Fonts is
--
-- File: Fonts.h
--
-- Contains: Font Manager Interfaces.
--
-- Version: Technology: System 7.5
-- Package: Universal Interfaces 2.1 in ÒMPW LatestÓ on ETO #18
--
-- Copyright: © 1984-1995 by Apple Computer, Inc.
-- All rights reserved.
--
type FMInput is
record
family : Short_Integer;
size : Short_Integer;
face : Style;
needBits : Boolean;
device : Short_Integer;
numer : Point;
denom : Point;
end record;
type FMOutput is
record
errNum : Short_Integer;
fontHandle : Handle;
boldPixels : UInt8;
italicPixels : UInt8;
ulOffset : UInt8;
ulShadow : UInt8;
ulThick : UInt8;
shadowPixels : UInt8;
extra : SInt8;
ascent : UInt8;
descent : UInt8;
widMax : UInt8;
leading : SInt8;
curStyle : SInt8;
numer : Point;
denom : Point;
end record;
type FMOutPtr is Access FMOutput;
type FontRec is
record
fontType : Short_Integer; -- font type
firstChar : Short_Integer; -- ASCII code of first character
lastChar : Short_Integer; -- ASCII code of last character
widMax : Short_Integer; -- maximum character width
kernMax : Short_Integer; -- negative of maximum character kern
nDescent : Short_Integer; -- negative of descent
fRectWidth : Short_Integer; -- width of font rectangle
fRectHeight : Short_Integer; -- height of font rectangle
owTLoc : unsigned_short; -- offset to offset/width table
ascent : Short_Integer; -- ascent
descent : Short_Integer; -- descent
leading : Short_Integer; -- leadint
rowWords : Short_Integer; -- row width of bit image / 2
end record;
type FMetricRec is
record
ascent : Fixed; -- base line to top
descent : Fixed; -- base line to bottom
leading : Fixed; -- leading between lines
widMax : Fixed; -- maximum character width
wTabHandle : Handle; -- handle to font width table
end record;
type FMetricRecPtr is Access FMetricRec;
type FMetricRecHandle is Access FMetricRecPtr;
type WidEntry is
record
widStyle : Short_Integer; -- style entry applies to
end record;
type WidTable is
record
numWidths : Short_Integer; -- number of entries - 1
end record;
type AsscEntry is
record
fontSize : Short_Integer;
fontStyle : Short_Integer;
fontID : Short_Integer; -- font resource ID
end record;
type FontAssoc is
record
numAssoc : Short_Integer; -- number of entries - 1
end record;
type char_Vec_48 is array (0 .. 47) of char;
type StyleTable is
record
fontClass : Short_Integer;
offset : Long_Integer;
reserved : Long_Integer;
indexes : char_Vec_48;
end record;
type NameTable is
record
stringCount : Short_Integer;
baseFontName : Str255;
end record;
type KernPair is
record
kernFirst : char; -- 1st character of kerned pair
kernSecond : char; -- 2nd character of kerned pair
kernWidth : Short_Integer; -- kerning in 1pt fixed format
end record;
type KernEntry is
record
kernStyle : Short_Integer; -- style the entry applies to
kernLength : Short_Integer; -- length of this entry
end record;
type KernTable is
record
numKerns : Short_Integer; -- number of kerning entries
end record;
type WidthTable is
record
tabData : Fixed_Vec_256; -- character widths
tabFont : Handle; -- font record used to build tablh
sExtra : Long_Integer; -- space extra used for table
style : Long_Integer; -- extra due to style
fID : Short_Integer; -- font family ID
fSize : Short_Integer; -- font size request
face : Short_Integer; -- style (face) request
device : Short_Integer; -- device requested
inNumer : Point; -- scale factors requested
inDenom : Point; -- scale factors requested
aFID : Short_Integer; -- actual font family ID for table
fHand : Handle; -- family record used to build up table
usedFam : Boolean; -- used fixed point family widths
aFace : UInt8; -- actual face produced
vOutput : Short_Integer; -- vertical scale output value
hOutput : Short_Integer; -- horizontal scale output value
vFactor : Short_Integer; -- vertical scale output value
hFactor : Short_Integer; -- horizontal scale output value
aSize : Short_Integer; -- actual size of actual font used
tabSize : Short_Integer; -- total size of table
end record;
type Short_Integer_Vec_9 is array (0 .. 8) of Short_Integer;
type Short_Integer_Vec_2 is array (0 .. 1) of Short_Integer;
type FamRec is
record
ffFlags : Short_Integer; -- flags for family
ffFamID : Short_Integer; -- family ID number
ffFirstChar : Short_Integer; -- ASCII code of 1st character
ffLastChar : Short_Integer; -- ASCII code of last character
ffAscent : Short_Integer; -- maximum ascent for 1pt font
ffDescent : Short_Integer; -- maximum descent for 1pt font
ffLeading : Short_Integer; -- maximum leading for 1pt font
ffWidMax : Short_Integer; -- maximum widMax for 1pt font
ffWTabOff : Long_Integer; -- offset to width table
ffKernOff : Long_Integer; -- offset to kerning table
ffStylOff : Long_Integer; -- offset to style mapping table
ffProperty : Short_Integer_Vec_9; -- style property info
ffIntl : Short_Integer_Vec_2; -- for international use
ffVersion : Short_Integer; -- version number
end record;
procedure InitFonts;
pragma Import (C, InitFonts, "InitFonts", "InitFonts");
procedure GetFontName
(familyID : in Short_Integer;
name : access Str255);
pragma Import (C, GetFontName, "GetFontName", "GetFontName");
procedure GetFNum
(name : access Str255;
familyID : access Short_Integer);
pragma Import (C, GetFNum, "GetFNum", "GetFNum");
function RealFont
(fontNum : in Short_Integer;
size : in Short_Integer)
return Boolean;
pragma Import (C, RealFont, "RealFont", "RealFont");
procedure SetFontLock
(lockFlag : in Boolean);
pragma Import (C, SetFontLock, "SetFontLock", "SetFontLock");
function FMSwapFont
(inRec : access FMInput)
return FMOutPtr;
pragma Import (C, FMSwapFont, "FMSwapFont", "FMSwapFont");
procedure SetFScaleDisable
(fscaleDisable : in Boolean);
pragma Import (C, SetFScaleDisable, "SetFScaleDisable", "SetFScaleDisable");
procedure FontMetrics
(theMetrics : in FMetricRecPtr);
pragma Import (C, FontMetrics, "FontMetrics", "FontMetrics");
procedure SetFractEnable
(fractEnable : in Boolean);
pragma Import (C, SetFractEnable, "SetFractEnable", "SetFractEnable");
function GetDefFontSize
return Short_Integer;
pragma Import (C, GetDefFontSize, "GetDefFontSize", "GetDefFontSize");
function IsOutline
(numer : in Point;
denom : in Point)
return Boolean;
pragma Import (C, IsOutline, "IsOutline", "IsOutline");
procedure SetOutlinePreferred
(outlinePreferred : in Boolean);
pragma Import (C, SetOutlinePreferred, "SetOutlinePreferred", "SetOutlinePreferred");
function GetOutlinePreferred
return Boolean;
pragma Import (C, GetOutlinePreferred, "GetOutlinePreferred", "GetOutlinePreferred");
function OutlineMetrics
(byteCount : in Short_Integer;
textPtr : in Void_Ptr;
numer : in Point;
denom : in Point;
yMax : access Short_Integer;
yMin : access Short_Integer;
awArray : in FixedPtr;
lsbArray : in FixedPtr;
boundsArray : in TPRect)
return OSErr;
pragma Import (C, OutlineMetrics, "OutlineMetrics", "OutlineMetrics");
procedure SetPreserveGlyph
(preserveGlyph : in Boolean);
pragma Import (C, SetPreserveGlyph, "SetPreserveGlyph", "SetPreserveGlyph");
function GetPreserveGlyph
return Boolean;
pragma Import (C, GetPreserveGlyph, "GetPreserveGlyph", "GetPreserveGlyph");
function FlushFonts
return OSErr;
pragma Import (C, FlushFonts, "FlushFonts", "FlushFonts");
procedure getfnum
(theName : in Chars_Ptr;
familyID : access Short_Integer);
pragma Import (C, getfnum, "getfnum", "getfnum");
procedure getfnum
(theName : in String;
familyID : access Short_Integer);
procedure getfontname
(familyID : in Short_Integer;
theName : in Chars_Ptr);
pragma Import (C, getfontname, "getfontname", "getfontname");
function GetSysFont
return Short_Integer;
pragma Import (C, GetSysFont, "GetSysFont", "GetSysFont");
function GetAppFont
return Short_Integer;
pragma Import (C, GetAppFont, "GetAppFont", "GetAppFont");
end Fonts;