00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 #ifndef INC_ATMFONTS
00105 #define INC_ATMFONTS
00106
00107
00108 #include "fontbase.h"
00109
00110
00111 class CharDescription;
00112 class DocCoord;
00113
00115
00117
00118
00119 #define XSATM_GetUtilVersion 1
00120 #define XSATM_ATMProperlyLoaded 2
00121 #define XSATM_ATMGetVersion 3
00122 #define XSATM_ATMGetOutline 4
00123 #define XSATM_ATMForceExactWidth 5
00124 #define XSATM_ATMBeginFontChange 6
00125 #define XSATM_ATMEndFontChange 7
00126 #define XSATM_ATMForceFontChange 8
00127 #define XSATM_ATMFontStatus 9
00128 #define XSATM_ATMAddFont 10
00129 #define XSATM_ATMRemoveFont 11
00130
00131
00132 #define MinVer_GetVersion 0x0100
00133 #define MinVer_ProperlyLoaded 0x0100
00134 #define MinVer_GetOutline 0x0100
00135 #define MinVer_ForceExactWidth 0x0101
00136 #define MinVer_BeginFontChange 0x0205
00137 #define MinVer_EndFontChange 0x0205
00138 #define MinVer_ForceFontChange 0x0300
00139 #define MinVer_FontStatus 0x0205
00140 #define MinVer_AddFont 0x0205
00141 #define MinVer_RemoveFont 0x0205
00142
00143
00144 typedef BOOL (FAR PASCAL *LPFNMYCLOSEPATH) (LPSTR lpData);
00145 typedef BOOL (FAR PASCAL *LPFNMYMOVETO) (LPATMFixedPoint lpFixPnt, LPSTR lpData);
00146 typedef BOOL (FAR PASCAL *LPFNMYLINETO) (LPATMFixedPoint lpFixPnt, LPSTR lpData);
00147 typedef BOOL (FAR PASCAL *LPFNMYCURVETO) (LPATMFixedPoint lpFixPnt0,
00148 LPATMFixedPoint lpFixPnt1,
00149 LPATMFixedPoint lpFixPnt2,
00150 LPSTR lpData);
00151
00152 typedef WORD (FAR *LPFNATMPROPERLYLOADED)(void);
00153
00154 typedef WORD (FAR *LPFNATMGETUTILVERSION)(void);
00155
00156 typedef WORD (FAR *LPFNATMGETVERSION)(void);
00157
00158 typedef INT32 (FAR *LPFNATMGETOUTLINE)( HDC hDC,
00159 unsigned char c,
00160 LPATMFixedMatrix lpMatrix,
00161 LPFNMYMOVETO lpProcMoveTo,
00162 LPFNMYLINETO lpProcLineTo,
00163 LPFNMYCURVETO lpProcCurveTo,
00164 LPFNMYCLOSEPATH lpProcClosePath,
00165 LPSTR lpData);
00166
00167 typedef BOOL (FAR *LPFNATMFORCEEXACTWIDTH)(void);
00168
00169 typedef INT32 (FAR *LPFNATMFONTSTATUS)(LPSTR lpMenuName,
00170 WORD style,
00171 LPSTR lpMetricsFile,
00172 LPSTR lpFontFile);
00173
00174 typedef INT32 (FAR *LPFNATMADDFONT)(LPSTR lpMenuName,
00175 WORD style,
00176 LPSTR lpMetricsFile,
00177 LPSTR lpFontFile);
00178
00179 typedef INT32 (FAR *LPFNATMREMOVEFONT)(LPSTR lpMenuName, WORD style);
00180
00181 typedef INT32 (FAR *LPFNATMBEGINFONTCHANGE)();
00182 typedef INT32 (FAR *LPFNATMENDFONTCHANGE)();
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195 class ATMFont : public FontBase
00196 {
00197 CC_DECLARE_DYNCREATE(ATMFont)
00198
00199 public:
00200 ATMFont();
00201 ~ATMFont();
00202
00203 virtual FontClass GetFontClass() { return FC_ATM; };
00204 virtual void Dump();
00205 };
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 class ATMFontMan : public CCObject
00220 {
00221 CC_DECLARE_DYNCREATE(ATMFontMan)
00222
00223 friend class OILFontMan;
00224
00225
00226 public:
00227 ATMFontMan();
00228
00229
00230 public:
00231 static BOOL InitDLL();
00232 static BOOL InitLib();
00233 static void EnumAllFonts(OILEnumFonts* pClass);
00234
00235 static INT32 FontStatus(TCHAR *pMenuName, WORD Style, TCHAR *lpMetricsFile, TCHAR *lpFontFile);
00236 static INT32 InstallFont(TCHAR *pMenuName, WORD Style, TCHAR *lpMetricsFile, TCHAR *lpFontFile);
00237 static INT32 DeInstallFont(TCHAR *pMenuName, WORD Style);
00238 static BOOL ForceExactWidth();
00239
00240 static OUTLINETEXTMETRIC *GetOutlineTextMetric(LOGFONT *pLogFont) { return NULL; }
00241
00242 private:
00243 static BOOL CacheNamedFont(String_64* pFontName);
00244 static BOOL CacheCompatibleFont(String_64* pFontName);
00245 static void ValidateCache();
00246 static void FindClosestFont();
00247 static ATMFont* CreateNewFont(String_64* pFontName);
00248 static INT32 GetUtilVersion() { return ATMUtilVersion; }
00249 static INT32 GetVersion() { return ATMVersion; }
00250 static BOOL GetCharOutline( CharDescription& ChDesc,
00251 DocCoord** ppCoords,
00252 PathVerb** ppVerbs,
00253 UINT32* pNumCoords,
00254 CDC* pDC);
00255
00256
00257 private:
00258 static HINSTANCE GetATMDLL();
00259 static BOOL IsOkToCall();
00260 static BOOL CorrectVersion(INT32 version);
00261
00262
00263 static INT32 ThunkProperlyLoaded();
00264 static INT32 ThunkGetVersion();
00265 static INT32 ThunkGetUtilVersion();
00266
00267 private:
00268
00269 static INT32 LibProperlyLoaded();
00270 static INT32 LibGetVersion();
00271
00272
00273
00274 static HINSTANCE DLLHandle;
00275
00276
00277 typedef WORD (FAR PASCAL * PFN_ATMProperlyLoaded)(void);
00278 typedef WORD (FAR PASCAL * PFN_ATMGetVersion)(void);
00279
00280 typedef INT32 (FAR PASCAL * PFN_ATMGetOutline)( HDC hDC,
00281 unsigned char c,
00282 LPATMFixedMatrix lpMatrix,
00283 LPFNMYMOVETO lpProcMoveTo,
00284 LPFNMYLINETO lpProcLineTo,
00285 LPFNMYCURVETO lpProcCurveTo,
00286 LPFNMYCLOSEPATH lpProcClosePath,
00287 LPSTR lpData);
00288
00289 typedef BOOL (FAR PASCAL * PFN_ATMForceExactWidth)(void);
00290 typedef WORD (FAR PASCAL * PFN_ATMBeginFontChange)(void);
00291 typedef WORD (FAR PASCAL * PFN_ATMEndFontChange)(void);
00292 typedef WORD (FAR PASCAL * PFN_ATMForceFontChange)(void);
00293
00294 typedef INT32 (FAR PASCAL * PFN_ATMFontStatus)( LPSTR lpMenuName,
00295 WORD style,
00296 LPSTR lpMetricsFile,
00297 LPSTR lpFontFile);
00298 typedef INT32 (FAR PASCAL * PFN_ATMAddFont)( LPSTR lpMenuName,
00299 WORD style,
00300 LPSTR lpMetricsFile,
00301 LPSTR lpFontFile);
00302 typedef INT32 (FAR PASCAL * PFN_ATMRemoveFont)( LPSTR lpMenuName, WORD style);
00303
00304
00305
00306
00307 static PFN_ATMProperlyLoaded pfnATMProperlyLoaded;
00308 static PFN_ATMGetVersion pfnATMGetVersion;
00309 static PFN_ATMGetOutline pfnATMGetOutline;
00310 static PFN_ATMForceExactWidth pfnATMForceExactWidth;
00311 static PFN_ATMBeginFontChange pfnATMBeginFontChange;
00312 static PFN_ATMEndFontChange pfnATMEndFontChange;
00313 static PFN_ATMForceFontChange pfnATMForceFontChange;
00314 static PFN_ATMFontStatus pfnATMFontStatus;
00315 static PFN_ATMAddFont pfnATMAddFont;
00316 static PFN_ATMRemoveFont pfnATMRemoveFont;
00317
00318
00319
00320 static LPFNATMPROPERLYLOADED pfnXSATMProperlyLoaded;
00321
00322 static LPFNATMGETOUTLINE pfnXSATMGetOutline;
00323 static LPFNATMFORCEEXACTWIDTH pfnXSATMForceExactWidth;
00324 static LPFNATMBEGINFONTCHANGE pfnXSATMBeginFontChange;
00325 static LPFNATMENDFONTCHANGE pfnXSATMEndFontChange;
00326
00327 static LPFNATMFONTSTATUS pfnXSATMFontStatus;
00328 static LPFNATMADDFONT pfnXSATMAddFont;
00329 static LPFNATMREMOVEFONT pfnXSATMRemoveFont;
00330
00331 private:
00332 static INT32 BeginFontChange();
00333 static INT32 AddFont(TCHAR *pMenuName, WORD Style, TCHAR *lpMetricsFile, TCHAR *lpFontFile);
00334 static INT32 RemoveFont(TCHAR *pMenuName, WORD Style);
00335 static INT32 EndFontChange();
00336
00337 private:
00338 static BOOL FAR PASCAL EXPORT MyClosePath(LPSTR lpData);
00339 static BOOL FAR PASCAL EXPORT MyMoveTo(LPATMFixedPoint lpFixPnt, LPSTR lpData);
00340 static BOOL FAR PASCAL EXPORT MyLineTo(LPATMFixedPoint lpFixPnt, LPSTR lpData);
00341 static BOOL FAR PASCAL EXPORT MyCurveTo(LPATMFixedPoint lpFixPnt1,
00342 LPATMFixedPoint lpFixPnt2,
00343 LPATMFixedPoint lpFixPnt3,
00344 LPSTR lpData);
00345
00346
00347 private:
00348 static BOOL ATMRunning;
00349 static INT32 ATMVersion;
00350 static INT32 ATMUtilVersion;
00351
00352 static BOOL UseThunking;
00353 };
00354
00355
00356
00357
00358
00359
00360 INT32 APIENTRY ATMFontMan_CallBackCacheNamedFont(ENUMLOGFONT FAR* lpelf,
00361 NEWTEXTMETRIC FAR* lpntm,
00362 INT32 FontType,
00363 LPARAM lParam);
00364 INT32 APIENTRY ATMFontMan_CallBackValidateFont(ENUMLOGFONT FAR* lpelf,
00365 NEWTEXTMETRIC FAR* lpntm,
00366 INT32 FontType,
00367 LPARAM lParam);
00368 INT32 APIENTRY ATMFontMan_CallBackDispatchFont(ENUMLOGFONT FAR* lpelf,
00369 NEWTEXTMETRIC FAR* lpntm,
00370 INT32 FontType,
00371 LPARAM lParam);
00372 INT32 APIENTRY ATMFontMan_CallBackFindClosestFont(ENUMLOGFONT FAR* lpelf,
00373 NEWTEXTMETRIC FAR* lpntm,
00374 INT32 FontType,
00375 LPARAM lParam);
00376 #endif