Adobe.com
Contents Suites Classes Class Index Member Index

AIFont.h

Go to the documentation of this file.
00001 /*
00002  *        Name: AIFont.h
00003  *   $Revision: 1 $
00004  *      Author: Adam Lane
00005  *        Date: 7/10/2002
00006  *     Purpose: Adobe Illustrator Font Suite.
00007  *
00008  * ADOBE SYSTEMS INCORPORATED
00009  * Copyright 1986-2007 Adobe Systems Incorporated.
00010  * All rights reserved.
00011  *
00012  * NOTICE:  Adobe permits you to use, modify, and distribute this file 
00013  * in accordance with the terms of the Adobe license agreement 
00014  * accompanying it. If you have received this file from a source other 
00015  * than Adobe, then your use, modification, or distribution of it 
00016  * requires the prior written permission of Adobe.
00017  *
00018  */
00019 
00020 #ifndef __AIFont__
00021 #define __AIFont__
00022 
00023 /*******************************************************************************
00024  **
00025  **     Imports
00026  **
00027  **/
00028 
00029 #ifndef __AITypes__
00030 #include "AITypes.h"
00031 #endif
00032 
00033 #include "ATETypesDef.h"
00034 #include "IAIFilePath.hpp"
00035 
00036 #include "ATETypes.h"
00037 
00038 
00039 #ifdef __cplusplus
00040 using ATE::FontRef;
00041 #endif
00042 
00043 #include "AIHeaderBegin.h"
00044 
00047 /*******************************************************************************
00048  **
00049  **     Constants
00050  **
00051  **/
00052 
00053 #define kAIFontSuite                    "AI Font Suite"
00054 #define kAIFontSuiteVersion6    AIAPI_VERSION(6)
00055 #define kAIFontSuiteVersion             kAIFontSuiteVersion6
00056 #define kAIFontVersion                  kAIFontSuiteVersion
00057 
00058 
00061 #define kAIBeginImportCompFontNotifier "AI Begin Import CompFont Notifier"
00062 
00064 #define kAIEndImportCompFontNotifier "AI End Import CompFont Notifier"
00065 
00068 #define kCantImportCompFont             '!ICF'
00069 
00071 #define kGlyphNotDefinedErr             '!Gly'
00072 
00073 // Opaque data types
00075 typedef struct __AIFontKey* AIFontKey;
00077 typedef struct _t_AITypefaceKey* AITypefaceKey;
00079 typedef struct _t_AIGlyphSet* AIGlyphSet;
00081 typedef struct _t_AIGlyphInfo* AIGlyphInfo;
00083 typedef struct _t_AIFontInst* AIFontInst;
00085 typedef int AIGlyphID;
00087 typedef unsigned char  AIByteCode;
00089 typedef ai::uint16 AICharCode;
00091 typedef struct _t_AIFaceMetrics* AIFaceMetrics;
00093 typedef struct _t_LOGFONTA* AILOGFONTA;
00094 
00095 typedef ai::uint32 AIMacFontRef;
00096 
00097 // Public data types
00099 typedef enum AIFaceFormat {
00100         kUnknownFormat = -1,
00101         kTypeOneFormat,
00102         kTrueTypeFormat
00103 } AIFaceFormat;
00104 
00106 typedef enum AIFaceEncoding {
00107         kUnknownEncoding = -1,
00108         kDontCareEncoding,
00109         kStandardEncoding,
00110         kSpecialEncoding
00111 } AIFaceEncoding;
00112 
00114 typedef enum AIFaceScript {
00115         kNativeAIScript = -2,
00116         kUnknownAIScript = -1,
00117         kRomanAIScript = 0,
00118         kJapaneseAIScript = 1,
00119         kTraditionalChineseAIScript = 2,
00120         kKoreanAIScript = 3,
00121 
00122         kArabicAIScript = 4,
00123         kHebrewAIScript = 5,
00124 
00125         kGreekAIScript = 6,
00126         kCyrillicAIScript = 7,
00127 
00128         // the script number should be same as in Cool type Script Enum
00129         kDevanagariAIScript = 9,
00130         kGurmukhiAIScript = 10,
00131         kGujaratiAIScript = 11,
00132         kOriyaAIScript = 12,
00133         kBengaliAIScript = 13,
00134         kTamilAIScript = 14,
00135         kTeluguAIScript = 15,
00136         kKannadaAIScript = 16,
00137         kMalayalamAIScript = 17,
00138 
00139         kSimplifiedChineseAIScript = 25,
00140         kEastEuropeanRomanAIScript = 29,
00141         kSymbolAIScript = 32,
00142         kTurkishAIScript = 81,
00143         kBalticAIScript = 85
00144 } AIFaceScript;
00145 
00147 enum AIMojiZumeType {
00148         kMojiZumeNone,
00149         kMojiZumeGXTrueType,
00150         kMojiZumePageMakerJ,
00151         kMojiZumeSfntATM
00152 };
00153 
00155 struct AIFontStyle {
00157         AIFontKey fontKey;
00159         enum AIFaceFormat format;
00161         enum AIFaceEncoding encoding;
00163         enum AIFaceScript script;
00165         AIBoolean originalEncoding;
00167         AIBoolean familyInstalled;
00169         AIBoolean strikeInstalled;
00171         AIBoolean fauxedInstalled;
00173         AIBoolean isCID;
00175         enum AIMojiZumeType     mojiZumeType;
00177         AIBoolean isOTF;
00179         AIBoolean isBitmapFont;
00181         AIBoolean isOCF;
00183         AIBoolean isATC;
00185         AIBoolean isMultipleMaster;
00186 };
00187 
00189 enum AIMetricOrientation {
00190         kAIUnknownMetricOrientation = 0,
00191         kAIHorizontalMetricOrientation,
00192         kAIVerticalMetricOrientation
00193 };
00194 
00196 struct AIFontMetrics {
00198         AIReal leading;
00200         AIReal ascent;
00202         AIReal descent;
00204         AIRealRect bbox;
00205 };
00206 
00208 typedef enum AITextOrientation {
00209         kHorizontalTextOrientation,
00210         kVerticalTextOrientation
00211 } AITextOrientation;
00212 
00213 
00215 enum AIFontTechnology {
00216         kAIUnknownFontTechnology = 0,
00217         kAIAnyFontTechnology,
00218 
00219         kAIAdobeFontTechnology = 100,
00220         kAITrueTypeFontTechnology
00221 };
00222 
00223 
00224 /*******************************************************************************
00225  **
00226  **     Suite
00227  **
00228  **/
00229 
00230 
00257 struct AIFontSuite {
00258 
00265         AIAPI AIErr (*CountFonts)( ai::int32 *count );
00266 
00273         AIAPI AIErr (*IndexFontList)( ai::int32 index, AIFontKey *fontKey );
00274 
00280         AIAPI AIErr (*CountTypefaces)( ai::int32 *count );
00281 
00288         AIAPI AIErr (*IndexTypefaceList)( ai::int32 index, AITypefaceKey *typeFaceKey );
00289         
00295         AIAPI AIErr (*CountTypefaceStyles)( AITypefaceKey typeface, ai::int32 *count );
00296 
00303         AIAPI AIErr (*IndexTypefaceStyleList)( AITypefaceKey typeface, ai::int32 index, AIFontKey *fontKey );
00304 
00311         AIAPI AIErr (*TypefaceAndStyleFromFontKey)(AIFontKey theKey, AITypefaceKey *typefaceResult, ai::int16 *styleResult);
00312 
00321         AIAPI AIErr (*FindFont)(const char *postscriptName, enum AIFontTechnology fontTechnology, AIFaceScript script,
00322                         AIBoolean substituteFlag, AIFontKey *result);
00323         
00328         AIAPI AIErr (*FindMacFontFromMacFontRef)(AIMacFontRef macFontRef, AIFontKey *result);
00329 
00331         AIAPI AIErr (*FindWinFont)(AILOGFONTA *logFont, AIFontKey *result);
00332         
00338         AIAPI AIErr (*GetMacFontRef)(AIFontKey fontKey, AIMacFontRef& macFontRef);
00339 
00347         AIAPI AIErr (*GetSystemFontName)(AIFontKey fontKey, char *result, ai::int16 maxName);
00348 
00355         AIAPI AIErr (*SetCharWidths)(AIFontKey fontKey, AIReal *charWidths);
00356 
00357         // Accessing various attributes of a font...except the name...that's different
00358 
00363         AIAPI AIErr (*GetFontInfo)( AIFontKey font, struct AIFontStyle *result);
00364 
00369         AIAPI AIErr (*GetFontMetrics)( AIFontKey font, struct AIFontMetrics *result);
00370 
00381         AIAPI AIErr (*GetGlyphDimensions)( AIFontKey font, AIGlyphID glyphID, enum AIMetricOrientation orientation,
00382                         AIReal *hResult, AIReal *vResult);
00383 
00394         AIAPI AIErr (*GetCharDimensions)( AIFontKey font, const char *charPtr, enum AIMetricOrientation orientation,
00395                         AIReal *hResult, AIReal *vResult);
00396 
00401         AIAPI AIErr (*GetDefaultFont)( AIFaceScript script, AIFontKey *result);
00402 
00403         // Various ways to get the name of a font
00404 
00412         AIAPI AIErr (*GetFullFontName)( AIFontKey font, char *fontName, ai::int16 maxName );
00413 
00422         AIAPI AIErr (*GetPostScriptFontName)( AIFontKey fontKey, char* postScriptFontName, ai::int16 maxName );
00423 
00430         AIAPI AIErr (*GetFontStyleName)( AIFontKey font, char *styleName, ai::int16 maxName );
00431 
00440         AIAPI AIErr (*GetFontFamilyUIName)( AIFontKey font, char *familyName, ai::int16 maxName );
00441 
00450         AIAPI AIErr (*GetFontStyleUIName)( AIFontKey font, char *styleName, ai::int16 maxName );
00451 
00458         AIAPI AIErr (*GetTypefaceName)( AITypefaceKey typeface, char *name, ai::int16 maxName );
00459 
00467         AIAPI AIErr (*GetUserFontName)( AIFontKey font, char *userfontName, ai::int16 maxName );
00468 
00477         AIAPI AIErr (*GetUserFontUIName)( AIFontKey font, char *userfontName, ai::int16 maxName );
00478 
00479 
00486         AIAPI AIErr (*FontFromFontKey)(AIFontKey font, FontRef *result);
00487 
00493         AIAPI AIErr (*FontKeyFromFont)(FontRef font, AIFontKey *result);
00494 
00499         AIAPI AIErr (*GetFontIsSubstituted)(AIFontKey fontKey, AIBoolean& outIsSubstituted);
00500 
00501         // The following methods deal with accessing alternate glyph information
00502 
00514         AIAPI AIErr (*GetGlyphSet)(AIFontKey theFont, ai::int32 otFeature, AIGlyphSet *result);
00515 
00518         AIAPI AIErr (*ReleaseGlyphSet)(AIGlyphSet theSet);
00519 
00525         AIAPI AIErr (*CountGlyphs)(AIGlyphSet theSet, int *glyphCountResult);
00526 
00533         AIAPI AIErr (*GetGlyphInfo)(AIGlyphSet theSet, ai::int32 glyphIndex, AIGlyphInfo *glyphInfoResult);
00534 
00541         AIAPI AIErr (*GlyphIDToIndex)(AIGlyphSet theSet, AIGlyphID glyphID, int *glyphIndexResult);
00542 
00554         AIAPI AIErr (*GetOTFeatures)(AIFontKey theFont, ai::int32 *featureList, ai::int32 *featureCount);
00555 
00574         AIAPI ai::int32  (*GetGlyphsForFeatureAccessInfo)(ai::int32 theFeature, AIFontKey fontKey, AIBoolean existFlag,
00575                         AIGlyphSet *glyphSet);
00576 
00581         AIAPI AIErr (*GetFontInstance)(AIGlyphSet glyphSetOpaque, AIFontInst **result);
00582 
00587         AIAPI AIErr (*GetGlyphID)(AIGlyphInfo glyphInfo, AIGlyphID *result);
00588 
00593         AIAPI AIErr (*GetAlternateGlyphs)(AIGlyphInfo glyphInfo, AIGlyphSet *result);
00594 
00606         AIAPI AIErr (*GetGlyphOTFeatures)(AIGlyphInfo glyphInfo, const char **otFeatures, ai::int32 *otFeatureCount,
00607                         ai::int32 **otFeatureIndex);
00608 
00628         AIAPI AIErr (*GetGlyphUnicodeValue)(AIGlyphID mGlyphID, AIFontKey fontKey, const char *desiredOTFeature,
00629                         ASUnicode *theChar, int *resultLength, char **otFeatures, ai::int32 *otFeatureCount, ai::int32 **otFeatureIndex);
00630 
00635         AIAPI AIErr (*GetGlyphFontKey)(AIGlyphInfo theGlyphInfo, AIFontKey *result);
00636 
00641         AIAPI AIErr (*GetGlyphAlternateCount)(AIGlyphInfo theGlyphInfo, int *result);
00642 
00648         AIAPI AIErr (*GetUndefinedGlyphID)(AIGlyphSet theSet, AIGlyphID *undefinedGlyphIDResult);
00649 
00656         AIAPI AIBoolean (*HasUndefinedGlyph)(AIGlyphSet theSet);
00657 
00661         AIAPI AIErr (*ImportCompositeFonts)(const ai::FilePath &source);
00662 
00676         AIAPI AIErr (*ConvertCharacterToGlyphID) ( AIFontKey fontKey, const char* ch, ai::int32 srcLen,
00677                                                                                            enum AIMetricOrientation orientation, AIGlyphID* glyphID );
00678 
00691         AIAPI AIErr (*ConvertUnicodeToGlyphID) ( AIFontKey fontKey, const ASUnicode* ch, ai::int32 srcLen,
00692                                                                                          enum AIMetricOrientation orientation, AIGlyphID* glyphID );
00693 
00703         AIAPI AIErr (*GetUserFontUINameUnicode)( AIFontKey fontKey, ASUnicode* userfontName, ai::int32 maxName );
00704 
00714         AIAPI AIErr (*GetFontFamilyUINameUnicode)( AIFontKey fontKey, ASUnicode* familyName, ai::int32 maxName );
00715 
00725         AIAPI AIErr (*GetFontStyleUINameUnicode)( AIFontKey fontKey, ASUnicode* styleName, ai::int32 maxName );
00726 
00727         // New for Illustrator 12.0
00728 
00738         AIAPI AIErr (*GetICFBox) ( AIFontKey fontKey, AIRealRect& icfBox );
00739 
00740         // New for Illustrator 13.0
00741 
00748         AIAPI AIErr (*GetVersionString) ( AIFontKey fontKey, ai::UnicodeString& versionString );
00749 
00762         AIAPI AIErr (*GetFontFilePathCount) ( AIFontKey fontKey, ai::uint32& count );
00763 
00779         AIAPI AIErr (*GetNthFilePath) ( AIFontKey fontKey, ai::uint32 n, ai::FilePath& filePath );
00780 
00789         AIAPI AIErr (*GetNumATCComponents) ( AIFontKey fontKey, ai::uint32& count );
00790 
00802         AIAPI AIErr (*GetNthATCComponent) ( AIFontKey fontKey, ai::uint32 n, AIFontKey& componentFontKey );
00803 
00812         AIAPI AIErr (*GetUserFontNameUnicode) (AIFontKey fontKey, ai::UnicodeString& name,
00813                 AIBoolean native);
00814 
00823         AIAPI AIErr (*GetFontFamilyNameUnicode) (AIFontKey fontKey, ai::UnicodeString& name,
00824                 AIBoolean native);
00825 
00834         AIAPI AIErr (*GetFontStyleNameUnicode) (AIFontKey fontKey, ai::UnicodeString& name,
00835                 AIBoolean native);
00836 
00855         AIAPI AIErr (*GetIdeoEmBox) ( AIFontKey fontKey, AIRealRect& ideoEmBox );
00856 
00867         AIAPI AIErr (*GetCloselyMatchingFontStyle) (AITypefaceKey old_Family, short* old_Style, AITypefaceKey new_Family, short* new_Style);
00868 
00875         AIAPI AIErr (*IndexTypefaceListSortedByDefaultScript)(AITypefaceKey* typeface, ai::int32 index);
00876 
00877         AIAPI AIErr (*GetTypefaceUnicodeMenuName)(AITypefaceKey typeface, ai::UnicodeString& typefaceName);
00878 };
00879 
00880 
00883 #define kAICurrentLanguageChangedNotifier    "AI Current Language Changed Notifier"
00884 
00885 #define kAIMEFontSuite                  "AI ME Font Suite"
00886 #define kAIMEFontSuiteVersion1  AIAPI_VERSION(1)
00887 #define kAIMEFontSuiteVersion           kAIMEFontSuiteVersion1
00888 #define kAIMEFontVersion                        kAIMEFontSuiteVersion
00889 
00890 typedef struct {
00891 
00904                         AIAPI AIErr (*GetGlyphSet)(AIFontKey theFont, int AILanguage, ai::int32 otFeature, AIGlyphSet *result);
00917                         AIAPI AIErr (*GetOTFeatures)(AIFontKey theFont, int AILanguage, ai::int32 *featureList, ai::int32 *featureCount);
00918 
00938                         AIAPI ai::int32  (*GetGlyphsForFeatureAccessInfo)(ai::int32 theFeature, AIFontKey fontKey, int AILanguage, AIBoolean existFlag,
00939                                         AIGlyphSet *glyphSet);
00960                         AIAPI AIErr (*GetGlyphUnicodeValue)(AIGlyphID mGlyphID, AIFontKey fontKey, int AILanguage, const char *desiredOTFeature,
00961                                         ASUnicode *theChar, int *resultLength, char **otFeatures, ai::int32 *otFeatureCount, ai::int32 **otFeatureIndex);
00966                         AIAPI int (*GetCurrentLanguage)();
00967 
00973                         AIAPI int (*SLOLanguageToAILanguage)(ATE::Language sloLang);
00974 
00980                         AIAPI AIErr (*GetGlyphLanguage)(AIGlyphInfo glyphInfo, int *result);
00981 } AIMEFontSuite;
00982 
00983 #include "AIHeaderEnd.h"
00984 
00985 #endif // __AIFont__


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2016 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks