![]() |
FNSProfileOpen |
||||
Header: | FontSync.h | Carbon status: | Supported | |
Opens an existing font profile for use.
OSStatus FNSProfileOpen ( const FSSpec *iFile, Boolean iOpenForWrite, FNSFontProfile *oProfile );
A pointer to the font profile file that you wish to open.
A flag indicating whether the profile file is read/write or read-only. Pass true to allow read/write access. This is necessary if the profile is going to be editable.
On return, a pointer to a reference to the open font profile.
A result code. The result code kFNSBadProfileVersionErr indicates that a font profile has an unsupported format version. This may indicate that the profile is valid, but created by a later version of FontSync, or that the profile is truly invalid. The result code kFNSInvalidProfileErr indicates that a profile does not have a valid structure. Memory Manager errors indicate that you did not have enough memory available in your heap. FNSProfileOpen may return File Manager errors.
The FNSProfileOpen function opens an already-existing font profile (that is, one that contains font references). If you want to make the font profile editable, pass true in the iOpenForWrite parameter. FNSProfileOpen will not open an empty profile created by the function FNSProfileCreate.
Font profiles are housed in a file. FontSync attempts to moderate access to this file. Ideally, it tries to either allow many readers or exactly one writer but not both. The Mac OS File Manager does not allow this kind of exclusion on local volumes, so it may still be possible for someone to get write access to a profile when there are active readers. Rather than complicating the implementation to work around this limitation, FontSync profile files are treated like most document files. That is, the caller is responsible for making sure this does not occur. If the user wishes to modify a profile, your application should make a copy of the file, modify the copy, and swap file names when done. This has the added benefit of preserving the original profile if an error leaves the new profile invalid.
Available beginning with FontSync 1.0.
Supported in Carbon. Available in Carbon 1.0.2 and later when Font Sync 1.0 or later is present.
© 2000 Apple Computer, Inc. (Last Updated 7/13/2000)