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         kSinhaleseAIScript = 18,
00140         kBurmeseAIScript = 19,
00141         kKhmerAIScript = 20,
00142         kThaiAIScript = 21,
00143         kLaotianAIScript = 22,
00144 
00145         kSimplifiedChineseAIScript = 25,
00146         kEastEuropeanRomanAIScript = 29,
00147         kSymbolAIScript = 32,
00148         kEmojiAIScript,
00149         kTurkishAIScript = 81,
00150         kBalticAIScript = 85
00151 } AIFaceScript;
00152 
00154 enum AIMojiZumeType {
00155         kMojiZumeNone,
00156         kMojiZumeGXTrueType,
00157         kMojiZumePageMakerJ,
00158         kMojiZumeSfntATM
00159 };
00160 
00162 struct AIFontStyle {
00164         AIFontKey fontKey;
00166         enum AIFaceFormat format;
00168         enum AIFaceEncoding encoding;
00170         enum AIFaceScript script;
00172         AIBoolean originalEncoding;
00174         AIBoolean familyInstalled;
00176         AIBoolean strikeInstalled;
00178         AIBoolean fauxedInstalled;
00180         AIBoolean isCID;
00182         enum AIMojiZumeType     mojiZumeType;
00184         AIBoolean isOTF;
00186         AIBoolean isBitmapFont;
00188         AIBoolean isOCF;
00190         AIBoolean isATC;
00192         AIBoolean isMultipleMaster;
00193 };
00194 
00196 enum AIMetricOrientation {
00197         kAIUnknownMetricOrientation = 0,
00198         kAIHorizontalMetricOrientation,
00199         kAIVerticalMetricOrientation
00200 };
00201 
00203 struct AIFontMetrics {
00205         AIReal leading;
00207         AIReal ascent;
00209         AIReal descent;
00211         AIRealRect bbox;
00212 };
00213 
00215 typedef enum AITextOrientation {
00216         kHorizontalTextOrientation,
00217         kVerticalTextOrientation
00218 } AITextOrientation;
00219 
00220 
00222 enum AIFontTechnology {
00223         kAIUnknownFontTechnology = 0,
00224         kAIAnyFontTechnology,
00225 
00226         kAIAdobeFontTechnology = 100,
00227         kAITrueTypeFontTechnology
00228 };
00229 
00230 
00231 /*******************************************************************************
00232  **
00233  **     Suite
00234  **
00235  **/
00236 
00237 
00264 struct AIFontSuite {
00265 
00272         AIAPI AIErr (*CountFonts)( ai::int32 *count );
00273 
00280         AIAPI AIErr (*IndexFontList)( ai::int32 index, AIFontKey *fontKey );
00281 
00287         AIAPI AIErr (*CountTypefaces)( ai::int32 *count );
00288 
00295         AIAPI AIErr (*IndexTypefaceList)( ai::int32 index, AITypefaceKey *typeFaceKey );
00296         
00302         AIAPI AIErr (*CountTypefaceStyles)( AITypefaceKey typeface, ai::int32 *count );
00303 
00310         AIAPI AIErr (*IndexTypefaceStyleList)( AITypefaceKey typeface, ai::int32 index, AIFontKey *fontKey );
00311 
00318         AIAPI AIErr (*TypefaceAndStyleFromFontKey)(AIFontKey theKey, AITypefaceKey *typefaceResult, ai::int16 *styleResult);
00319 
00328         AIAPI AIErr (*FindFont)(const char *postscriptName, enum AIFontTechnology fontTechnology, AIFaceScript script,
00329                         AIBoolean substituteFlag, AIFontKey *result);
00330         
00335         AIAPI AIErr (*FindMacFontFromMacFontRef)(AIMacFontRef macFontRef, AIFontKey *result);
00336 
00338         AIAPI AIErr (*FindWinFont)(AILOGFONTA *logFont, AIFontKey *result);
00339         
00345         AIAPI AIErr (*GetMacFontRef)(AIFontKey fontKey, AIMacFontRef& macFontRef);
00346 
00354         AIAPI AIErr (*GetSystemFontName)(AIFontKey fontKey, char *result, ai::int16 maxName);
00355 
00362         AIAPI AIErr (*SetCharWidths)(AIFontKey fontKey, AIReal *charWidths);
00363 
00364         // Accessing various attributes of a font...except the name...that's different
00365 
00370         AIAPI AIErr (*GetFontInfo)( AIFontKey font, struct AIFontStyle *result);
00371 
00376         AIAPI AIErr (*GetFontMetrics)( AIFontKey font, struct AIFontMetrics *result);
00377 
00388         AIAPI AIErr (*GetGlyphDimensions)( AIFontKey font, AIGlyphID glyphID, enum AIMetricOrientation orientation,
00389                         AIReal *hResult, AIReal *vResult);
00390 
00401         AIAPI AIErr (*GetCharDimensions)( AIFontKey font, const char *charPtr, enum AIMetricOrientation orientation,
00402                         AIReal *hResult, AIReal *vResult);
00403 
00408         AIAPI AIErr (*GetDefaultFont)( AIFaceScript script, AIFontKey *result);
00409 
00410         // Various ways to get the name of a font
00411 
00419         AIAPI AIErr (*GetFullFontName)( AIFontKey font, char *fontName, ai::int16 maxName );
00420 
00429         AIAPI AIErr (*GetPostScriptFontName)( AIFontKey fontKey, char* postScriptFontName, ai::int16 maxName );
00430 
00437         AIAPI AIErr (*GetFontStyleName)( AIFontKey font, char *styleName, ai::int16 maxName );
00438 
00447         AIAPI AIErr (*GetFontFamilyUIName)( AIFontKey font, char *familyName, ai::int16 maxName );
00448 
00457         AIAPI AIErr (*GetFontStyleUIName)( AIFontKey font, char *styleName, ai::int16 maxName );
00458 
00465         AIAPI AIErr (*GetTypefaceName)( AITypefaceKey typeface, char *name, ai::int16 maxName );
00466 
00474         AIAPI AIErr (*GetUserFontName)( AIFontKey font, char *userfontName, ai::int16 maxName );
00475 
00484         AIAPI AIErr (*GetUserFontUIName)( AIFontKey font, char *userfontName, ai::int16 maxName );
00485 
00486 
00493         AIAPI AIErr (*FontFromFontKey)(AIFontKey font, FontRef *result);
00494 
00500         AIAPI AIErr (*FontKeyFromFont)(FontRef font, AIFontKey *result);
00501 
00506         AIAPI AIErr (*GetFontIsSubstituted)(AIFontKey fontKey, AIBoolean& outIsSubstituted);
00507 
00508         // The following methods deal with accessing alternate glyph information
00509 
00521         AIAPI AIErr (*GetGlyphSet)(AIFontKey theFont, ai::int32 otFeature, AIGlyphSet *result);
00522 
00525         AIAPI AIErr (*ReleaseGlyphSet)(AIGlyphSet theSet);
00526 
00532         AIAPI AIErr (*CountGlyphs)(AIGlyphSet theSet, int *glyphCountResult);
00533 
00540         AIAPI AIErr (*GetGlyphInfo)(AIGlyphSet theSet, ai::int32 glyphIndex, AIGlyphInfo *glyphInfoResult);
00541 
00548         AIAPI AIErr (*GlyphIDToIndex)(AIGlyphSet theSet, AIGlyphID glyphID, int *glyphIndexResult);
00549 
00561         AIAPI AIErr (*GetOTFeatures)(AIFontKey theFont, ai::int32 *featureList, ai::int32 *featureCount);
00562 
00581         AIAPI ai::int32  (*GetGlyphsForFeatureAccessInfo)(ai::int32 theFeature, AIFontKey fontKey, AIBoolean existFlag,
00582                         AIGlyphSet *glyphSet);
00583 
00588         AIAPI AIErr (*GetFontInstance)(AIGlyphSet glyphSetOpaque, AIFontInst **result);
00589 
00594         AIAPI AIErr (*GetGlyphID)(AIGlyphInfo glyphInfo, AIGlyphID *result);
00595 
00600         AIAPI AIErr (*GetAlternateGlyphs)(AIGlyphInfo glyphInfo, AIGlyphSet *result);
00601 
00613         AIAPI AIErr (*GetGlyphOTFeatures)(AIGlyphInfo glyphInfo, const char **otFeatures, ai::int32 *otFeatureCount,
00614                         ai::int32 **otFeatureIndex);
00615 
00635         AIAPI AIErr (*GetGlyphUnicodeValue)(AIGlyphID mGlyphID, AIFontKey fontKey, const char *desiredOTFeature,
00636                         ASUnicode *theChar, int *resultLength, char **otFeatures, ai::int32 *otFeatureCount, ai::int32 **otFeatureIndex);
00637 
00642         AIAPI AIErr (*GetGlyphFontKey)(AIGlyphInfo theGlyphInfo, AIFontKey *result);
00643 
00648         AIAPI AIErr (*GetGlyphAlternateCount)(AIGlyphInfo theGlyphInfo, int *result);
00649 
00655         AIAPI AIErr (*GetUndefinedGlyphID)(AIGlyphSet theSet, AIGlyphID *undefinedGlyphIDResult);
00656 
00663         AIAPI AIBoolean (*HasUndefinedGlyph)(AIGlyphSet theSet);
00664 
00668         AIAPI AIErr (*ImportCompositeFonts)(const ai::FilePath &source);
00669 
00683         AIAPI AIErr (*ConvertCharacterToGlyphID) ( AIFontKey fontKey, const char* ch, ai::int32 srcLen,
00684                                                                                            enum AIMetricOrientation orientation, AIGlyphID* glyphID );
00685 
00698         AIAPI AIErr (*ConvertUnicodeToGlyphID) ( AIFontKey fontKey, const ASUnicode* ch, ai::int32 srcLen,
00699                                                                                          enum AIMetricOrientation orientation, AIGlyphID* glyphID );
00700 
00710         AIAPI AIErr (*GetUserFontUINameUnicode)( AIFontKey fontKey, ASUnicode* userfontName, ai::int32 maxName );
00711 
00721         AIAPI AIErr (*GetFontFamilyUINameUnicode)( AIFontKey fontKey, ASUnicode* familyName, ai::int32 maxName );
00722 
00732         AIAPI AIErr (*GetFontStyleUINameUnicode)( AIFontKey fontKey, ASUnicode* styleName, ai::int32 maxName );
00733 
00734         // New for Illustrator 12.0
00735 
00745         AIAPI AIErr (*GetICFBox) ( AIFontKey fontKey, AIRealRect& icfBox );
00746 
00747         // New for Illustrator 13.0
00748 
00755         AIAPI AIErr (*GetVersionString) ( AIFontKey fontKey, ai::UnicodeString& versionString );
00756 
00769         AIAPI AIErr (*GetFontFilePathCount) ( AIFontKey fontKey, ai::uint32& count );
00770 
00786         AIAPI AIErr (*GetNthFilePath) ( AIFontKey fontKey, ai::uint32 n, ai::FilePath& filePath );
00787 
00796         AIAPI AIErr (*GetNumATCComponents) ( AIFontKey fontKey, ai::uint32& count );
00797 
00809         AIAPI AIErr (*GetNthATCComponent) ( AIFontKey fontKey, ai::uint32 n, AIFontKey& componentFontKey );
00810 
00819         AIAPI AIErr (*GetUserFontNameUnicode) (AIFontKey fontKey, ai::UnicodeString& name,
00820                 AIBoolean native);
00821 
00830         AIAPI AIErr (*GetFontFamilyNameUnicode) (AIFontKey fontKey, ai::UnicodeString& name,
00831                 AIBoolean native);
00832 
00841         AIAPI AIErr (*GetFontStyleNameUnicode) (AIFontKey fontKey, ai::UnicodeString& name,
00842                 AIBoolean native);
00843 
00862         AIAPI AIErr (*GetIdeoEmBox) ( AIFontKey fontKey, AIRealRect& ideoEmBox );
00863 
00874         AIAPI AIErr (*GetCloselyMatchingFontStyle) (AITypefaceKey old_Family, short* old_Style, AITypefaceKey new_Family, short* new_Style);
00875 
00882         AIAPI AIErr (*IndexTypefaceListSortedByDefaultScript)(AITypefaceKey* typeface, ai::int32 index);
00883 
00884         AIAPI AIErr (*GetTypefaceUnicodeMenuName)(AITypefaceKey typeface, ai::UnicodeString& typefaceName);
00885 };
00886 
00887 
00890 #define kAICurrentLanguageChangedNotifier    "AI Current Language Changed Notifier"
00891 
00892 #define kAIMEFontSuite                  "AI ME Font Suite"
00893 #define kAIMEFontSuiteVersion1  AIAPI_VERSION(1)
00894 #define kAIMEFontSuiteVersion           kAIMEFontSuiteVersion1
00895 #define kAIMEFontVersion                        kAIMEFontSuiteVersion
00896 
00897 typedef struct {
00898 
00911                         AIAPI AIErr (*GetGlyphSet)(AIFontKey theFont, int AILanguage, ai::int32 otFeature, AIGlyphSet *result);
00924                         AIAPI AIErr (*GetOTFeatures)(AIFontKey theFont, int AILanguage, ai::int32 *featureList, ai::int32 *featureCount);
00925 
00945                         AIAPI ai::int32  (*GetGlyphsForFeatureAccessInfo)(ai::int32 theFeature, AIFontKey fontKey, int AILanguage, AIBoolean existFlag,
00946                                         AIGlyphSet *glyphSet);
00967                         AIAPI AIErr (*GetGlyphUnicodeValue)(AIGlyphID mGlyphID, AIFontKey fontKey, int AILanguage, const char *desiredOTFeature,
00968                                         ASUnicode *theChar, int *resultLength, char **otFeatures, ai::int32 *otFeatureCount, ai::int32 **otFeatureIndex);
00973                         AIAPI int (*GetCurrentLanguage)();
00974 
00980                         AIAPI int (*SLOLanguageToAILanguage)(ATE::Language sloLang);
00981 
00987                         AIAPI AIErr (*GetGlyphLanguage)(AIGlyphInfo glyphInfo, int *result);
00988 } AIMEFontSuite;
00989 
00990 #include "AIHeaderEnd.h"
00991 
00992 #endif // __AIFont__


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