123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499 |
- {
- File: FontSync.p
-
- Contains: Public interface for FontSync
-
- Version: Technology: Mac OS 9 / Carbon
- Release: Universal Interfaces 3.4.2
-
- Copyright: © 1999-2002 by Apple Computer, Inc., all rights reserved.
-
- Bugs?: For bug reports, consult the following page on
- the World Wide Web:
-
- http://www.freepascal.org/bugs.html
-
- }
- {
- Modified for use with Free Pascal
- Version 200
- Please report any bugs to <[email protected]>
- }
- {$mode macpas}
- {$packenum 1}
- {$macro on}
- {$inline on}
- {$CALLING MWPASCAL}
- unit FontSync;
- interface
- {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
- {$setc GAP_INTERFACES_VERSION := $0200}
- {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
- {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
- {$endc}
- {$ifc defined CPUPOWERPC and defined CPUI386}
- {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
- {$endc}
- {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
- {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
- {$endc}
- {$ifc not defined __ppc__ and defined CPUPOWERPC}
- {$setc __ppc__ := 1}
- {$elsec}
- {$setc __ppc__ := 0}
- {$endc}
- {$ifc not defined __i386__ and defined CPUI386}
- {$setc __i386__ := 1}
- {$elsec}
- {$setc __i386__ := 0}
- {$endc}
- {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
- {$error Conflicting definitions for __ppc__ and __i386__}
- {$endc}
- {$ifc defined __ppc__ and __ppc__}
- {$setc TARGET_CPU_PPC := TRUE}
- {$setc TARGET_CPU_X86 := FALSE}
- {$elifc defined __i386__ and __i386__}
- {$setc TARGET_CPU_PPC := FALSE}
- {$setc TARGET_CPU_X86 := TRUE}
- {$elsec}
- {$error Neither __ppc__ nor __i386__ is defined.}
- {$endc}
- {$setc TARGET_CPU_PPC_64 := FALSE}
- {$ifc defined FPC_BIG_ENDIAN}
- {$setc TARGET_RT_BIG_ENDIAN := TRUE}
- {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
- {$elifc defined FPC_LITTLE_ENDIAN}
- {$setc TARGET_RT_BIG_ENDIAN := FALSE}
- {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
- {$elsec}
- {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
- {$endc}
- {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
- {$setc CALL_NOT_IN_CARBON := FALSE}
- {$setc OLDROUTINENAMES := FALSE}
- {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
- {$setc OPAQUE_UPP_TYPES := TRUE}
- {$setc OTCARBONAPPLICATION := TRUE}
- {$setc OTKERNEL := FALSE}
- {$setc PM_USE_SESSION_APIS := TRUE}
- {$setc TARGET_API_MAC_CARBON := TRUE}
- {$setc TARGET_API_MAC_OS8 := FALSE}
- {$setc TARGET_API_MAC_OSX := TRUE}
- {$setc TARGET_CARBON := TRUE}
- {$setc TARGET_CPU_68K := FALSE}
- {$setc TARGET_CPU_MIPS := FALSE}
- {$setc TARGET_CPU_SPARC := FALSE}
- {$setc TARGET_OS_MAC := TRUE}
- {$setc TARGET_OS_UNIX := FALSE}
- {$setc TARGET_OS_WIN32 := FALSE}
- {$setc TARGET_RT_MAC_68881 := FALSE}
- {$setc TARGET_RT_MAC_CFM := FALSE}
- {$setc TARGET_RT_MAC_MACHO := TRUE}
- {$setc TYPED_FUNCTION_POINTERS := TRUE}
- {$setc TYPE_BOOL := FALSE}
- {$setc TYPE_EXTENDED := FALSE}
- {$setc TYPE_LONGLONG := TRUE}
- uses MacTypes,ATSTypes,Files,Fonts,SFNTTypes,MacErrors;
- {$ALIGN POWER}
- { Matching Options }
- type
- FNSMatchOptions = UInt32;
- FNSMatchOptionsPtr = ^FNSMatchOptions; { when a VAR xx: FNSMatchOptions parameter can be nil, it is changed to xx: FNSMatchOptionsPtr }
- const
- kFNSMatchNames = $00000001; { font names must match }
- kFNSMatchTechnology = $00000002; { scaler technology must match }
- kFNSMatchGlyphs = $00000004; { glyph data must match }
- kFNSMatchEncodings = $00000008; { cmaps must match }
- kFNSMatchQDMetrics = $00000010; { QuickDraw Text metrics must match }
- kFNSMatchATSUMetrics = $00000020; { ATSUI metrics (incl. vertical) must match }
- kFNSMatchKerning = $00000040; { kerning data must match }
- kFNSMatchWSLayout = $00000080; { WorldScript layout tables must match }
- kFNSMatchAATLayout = $00000100; { AAT (incl. OpenType) layout tables must match }
- kFNSMatchPrintEncoding = $00000200; { PostScript font and glyph names and re-encoding vector must match }
- kFNSMissingDataNoMatch = $80000000; { treat missing data as mismatch }
- kFNSMatchAll = $FFFFFFFF; { everything must match }
- kFNSMatchDefaults = 0; { use global default match options }
- {
- * FNSMatchDefaultsGet()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSMatchDefaultsGet: FNSMatchOptions; external name '_FNSMatchDefaultsGet';
- { Version control }
- type
- FNSObjectVersion = UInt32;
- const
- kFNSVersionDontCare = 0;
- kFNSCurSysInfoVersion = 1;
- { No features defined yet. }
- type
- FNSFeatureFlags = UInt32;
- {
- The FontSync library version number is binary-coded decimal:
- 8 bits of major version, 4 minor version and 4 bits revision.
- }
- FNSSysInfoPtr = ^FNSSysInfo;
- FNSSysInfo = record
- iSysInfoVersion: FNSObjectVersion; { fill this in before calling FNSSysInfoGet }
- oFeatures: FNSFeatureFlags;
- oCurRefVersion: FNSObjectVersion;
- oMinRefVersion: FNSObjectVersion;
- oCurProfileVersion: FNSObjectVersion;
- oMinProfileVersion: FNSObjectVersion;
- oFontSyncVersion: UInt16;
- end;
- {
- * FNSSysInfoGet()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- procedure FNSSysInfoGet(var ioInfo: FNSSysInfo); external name '_FNSSysInfoGet';
- { FontSync References }
- type
- FNSFontReference = ^SInt32; { an opaque 32-bit type }
- FNSFontReferencePtr = ^FNSFontReference; { when a var xx:FNSFontReference parameter can be nil, it is changed to xx: FNSFontReferencePtr }
- {
- * FNSReferenceGetVersion()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceGetVersion(iReference: FNSFontReference; var oVersion: FNSObjectVersion): OSStatus; external name '_FNSReferenceGetVersion';
- {
- * FNSReferenceDispose()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceDispose(iReference: FNSFontReference): OSStatus; external name '_FNSReferenceDispose';
- {
- * FNSReferenceMatch()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceMatch(iReference1: FNSFontReference; iReference2: FNSFontReference; iOptions: FNSMatchOptions; oFailedMatchOptions: FNSMatchOptionsPtr): OSStatus; external name '_FNSReferenceMatch';
- {
- * FNSReferenceFlattenedSize()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceFlattenedSize(iReference: FNSFontReference; var oFlattenedSize: ByteCount): OSStatus; external name '_FNSReferenceFlattenedSize';
- {
- * FNSReferenceFlatten()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceFlatten(iReference: FNSFontReference; oFlatReference: UnivPtr; oFlattenedSize: ByteCountPtr): OSStatus; external name '_FNSReferenceFlatten';
- {
- * FNSReferenceUnflatten()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceUnflatten(iFlatReference: UnivPtr; iFlattenedSize: ByteCount; var oReference: FNSFontReference): OSStatus; external name '_FNSReferenceUnflatten';
- { FontSync Profiles }
- const
- kFNSCreatorDefault = 0;
- kFNSProfileFileType = $666E7370 (* 'fnsp' *);
- type
- FNSFontProfile = ^SInt32; { an opaque 32-bit type }
- FNSFontProfilePtr = ^FNSFontProfile; { when a var xx:FNSFontProfile parameter can be nil, it is changed to xx: FNSFontProfilePtr }
- {
- * FNSProfileCreate()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileCreate(const (*var*) iFile: FSSpec; iCreator: FourCharCode; iEstNumRefs: ItemCount; iDesiredVersion: FNSObjectVersion; var oProfile: FNSFontProfile): OSStatus; external name '_FNSProfileCreate';
- {
- * FNSProfileOpen()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileOpen(const (*var*) iFile: FSSpec; iOpenForWrite: boolean; var oProfile: FNSFontProfile): OSStatus; external name '_FNSProfileOpen';
- {
- * FNSProfileCreateWithFSRef()
- *
- * Availability:
- * Non-Carbon CFM: not available
- * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
- * Mac OS X: in version 10.1 and later
- }
- function FNSProfileCreateWithFSRef(const (*var*) iParentDirectory: FSRef; iNameLength: UniCharCount; iName: ConstUniCharPtr; iCreator: FourCharCode; iEstNumRefs: ItemCount; iDesiredVersion: FNSObjectVersion; var oProfile: FNSFontProfile): OSStatus; external name '_FNSProfileCreateWithFSRef';
- {
- * FNSProfileOpenWithFSRef()
- *
- * Availability:
- * Non-Carbon CFM: not available
- * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
- * Mac OS X: in version 10.1 and later
- }
- function FNSProfileOpenWithFSRef(const (*var*) iFile: FSRef; iOpenForWrite: boolean; var oProfile: FNSFontProfile): OSStatus; external name '_FNSProfileOpenWithFSRef';
- {
- * FNSProfileGetVersion()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileGetVersion(iProfile: FNSFontProfile; var oVersion: FNSObjectVersion): OSStatus; external name '_FNSProfileGetVersion';
- {
- * FNSProfileCompact()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileCompact(iProfile: FNSFontProfile): OSStatus; external name '_FNSProfileCompact';
- {
- * FNSProfileClose()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileClose(iProfile: FNSFontProfile): OSStatus; external name '_FNSProfileClose';
- {
- * FNSProfileAddReference()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileAddReference(iProfile: FNSFontProfile; iReference: FNSFontReference): OSStatus; external name '_FNSProfileAddReference';
- {
- * FNSProfileRemoveReference()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileRemoveReference(iProfile: FNSFontProfile; iReference: FNSFontReference): OSStatus; external name '_FNSProfileRemoveReference';
- {
- * FNSProfileRemoveIndReference()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileRemoveIndReference(iProfile: FNSFontProfile; iIndex: UInt32): OSStatus; external name '_FNSProfileRemoveIndReference';
- {
- * FNSProfileClear()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileClear(iProfile: FNSFontProfile): OSStatus; external name '_FNSProfileClear';
- {
- * FNSProfileCountReferences()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileCountReferences(iProfile: FNSFontProfile; var oCount: ItemCount): OSStatus; external name '_FNSProfileCountReferences';
- {
- * FNSProfileGetIndReference()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileGetIndReference(iProfile: FNSFontProfile; iWhichReference: UInt32; var oReference: FNSFontReference): OSStatus; external name '_FNSProfileGetIndReference';
- {
- * FNSProfileMatchReference()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSProfileMatchReference(iProfile: FNSFontProfile; iReference: FNSFontReference; iMatchOptions: FNSMatchOptions; iOutputSize: ItemCount; oIndices: UInt32Ptr; oNumMatches: ItemCountPtr): OSStatus; external name '_FNSProfileMatchReference';
- { Mapping to and from Font Objects }
- {
- * FNSReferenceCreate()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceCreate(iFont: FMFont; iDesiredVersion: FNSObjectVersion; var oReference: FNSFontReference): OSStatus; external name '_FNSReferenceCreate';
- {
- * FNSReferenceMatchFonts()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceMatchFonts(iReference: FNSFontReference; iMatchOptions: FNSMatchOptions; iOutputSize: ItemCount; oFonts: FMFontPtr; oNumMatches: ItemCountPtr): OSStatus; external name '_FNSReferenceMatchFonts';
- { Mapping to and from Font Families }
- {
- * FNSReferenceCreateFromFamily()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceCreateFromFamily(iFamily: FMFontFamily; iStyle: FMFontStyle; iDesiredVersion: FNSObjectVersion; oReference: FNSFontReferencePtr; oActualStyle: FMFontStylePtr): OSStatus; external name '_FNSReferenceCreateFromFamily';
- {
- * FNSReferenceMatchFamilies()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceMatchFamilies(iReference: FNSFontReference; iMatchOptions: FNSMatchOptions; iOutputSize: ItemCount; oFonts: FMFontFamilyInstancePtr; oNumMatches: ItemCountPtr): OSStatus; external name '_FNSReferenceMatchFamilies';
- { UI Support }
- {
- * FNSReferenceGetFamilyInfo()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceGetFamilyInfo(iReference: FNSFontReference; oFamilyName: StringPtr; oFamilyNameScript: ScriptCodePtr; oActualStyle: FMFontStylePtr): OSStatus; external name '_FNSReferenceGetFamilyInfo';
- {
- * FNSReferenceCountNames()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceCountNames(iReference: FNSFontReference; var oNameCount: ItemCount): OSStatus; external name '_FNSReferenceCountNames';
- {
- * FNSReferenceGetIndName()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceGetIndName(iReference: FNSFontReference; iFontNameIndex: ItemCount; iMaximumNameLength: ByteCount; oName: Ptr; oActualNameLength: ByteCountPtr; oFontNameCode: FontNameCodePtr; oFontNamePlatform: FontPlatformCodePtr; oFontNameScript: FontScriptCodePtr; oFontNameLanguage: FontLanguageCodePtr): OSStatus; external name '_FNSReferenceGetIndName';
- {
- * FNSReferenceFindName()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSReferenceFindName(iReference: FNSFontReference; iFontNameCode: FontNameCode; iFontNamePlatform: FontPlatformCode; iFontNameScript: FontScriptCode; iFontNameLanguage: FontLanguageCode; iMaximumNameLength: ByteCount; oName: Ptr; oActualNameLength: ByteCountPtr; oFontNameIndex: ItemCountPtr): OSStatus; external name '_FNSReferenceFindName';
- { Miscellany }
- {
- * FNSEnabled()
- *
- * Availability:
- * Non-Carbon CFM: in FontSyncLib 1.0 and later
- * CarbonLib: in CarbonLib 1.0 and later
- * Mac OS X: in version 10.0 and later
- }
- function FNSEnabled: boolean; external name '_FNSEnabled';
- {$ALIGN MAC68K}
- end.
|