ATMFontMan Class Reference

A static class to allow access to Type 1 fonts. There are few functions in this class which should be called directly. The OILFontMan provides the generic interface of font calls within this application. More...

#include <atmfonts.h>

Inheritance diagram for ATMFontMan:

CCObject SimpleCCObject List of all members.

Public Member Functions

 ATMFontMan ()
 Default constructor.

Static Public Member Functions

static BOOL InitDLL ()
 Determine whether we can make further calls to the Adobe Type Manager.
static BOOL InitLib ()
 Determine whether we can make further calls to the Adobe Type Manager Notes: Implemented for the ATM for Windows NT4.
static void EnumAllFonts (OILEnumFonts *pClass)
 Give the kernel a way of enumerating fonts itself.
static INT32 FontStatus (TCHAR *pMenuName, WORD Style, TCHAR *lpMetricsFile, TCHAR *lpFontFile)
 This routine determines whether or not a given font is currently installed and/or in use by ATM. It should be called prior to installing a new font. If the return value is ATM_FONTINUSE, then no attempt should be made to install the font.
static INT32 InstallFont (TCHAR *pMenuName, WORD Style, TCHAR *lpMetricsFile, TCHAR *lpFontFile)
 See ATMFontMan::AddFont for details.
static INT32 DeInstallFont (TCHAR *pMenuName, WORD Style)
 See ATMFontMan::RemoveFont for details.
static BOOL ForceExactWidth ()
 This routine causes the 'next' call for creating a font to create a font without adjusting the width data for the screen.
static OUTLINETEXTMETRICGetOutlineTextMetric (LOGFONT *pLogFont)

Private Types

typedef unsigned char c
typedef unsigned char LPATMFixedMatrix lpMatrix
typedef unsigned char LPATMFixedMatrix
LPFNMYMOVETO 
lpProcMoveTo
typedef unsigned char LPATMFixedMatrix
LPFNMYMOVETO LPFNMYLINETO 
lpProcLineTo
typedef unsigned char LPATMFixedMatrix
LPFNMYMOVETO LPFNMYLINETO
LPFNMYCURVETO 
lpProcCurveTo
typedef unsigned char LPATMFixedMatrix
LPFNMYMOVETO LPFNMYLINETO
LPFNMYCURVETO LPFNMYCLOSEPATH 
lpProcClosePath
typedef unsigned char LPATMFixedMatrix
LPFNMYMOVETO LPFNMYLINETO
LPFNMYCURVETO LPFNMYCLOSEPATH
LPSTR 
lpData
typedef WORD style
typedef WORD LPSTR lpMetricsFile
typedef WORD LPSTR LPSTR lpFontFile
typedef WORD style
typedef WORD LPSTR lpMetricsFile
typedef WORD LPSTR LPSTR lpFontFile
typedef WORD style

Private Member Functions

typedef WORD (FAR PASCAL *PFN_ATMProperlyLoaded)(void)
typedef WORD (FAR PASCAL *PFN_ATMGetVersion)(void)
typedef INT32 (FAR PASCAL *PFN_ATMGetOutline)(HDC hDC
typedef BOOL (FAR PASCAL *PFN_ATMForceExactWidth)(void)
typedef WORD (FAR PASCAL *PFN_ATMBeginFontChange)(void)
typedef WORD (FAR PASCAL *PFN_ATMEndFontChange)(void)
typedef WORD (FAR PASCAL *PFN_ATMForceFontChange)(void)
typedef INT32 (FAR PASCAL *PFN_ATMFontStatus)(LPSTR lpMenuName
typedef INT32 (FAR PASCAL *PFN_ATMAddFont)(LPSTR lpMenuName
typedef INT32 (FAR PASCAL *PFN_ATMRemoveFont)(LPSTR lpMenuName

Static Private Member Functions

static BOOL CacheNamedFont (String_64 *pFontName)
 This function attempts to cache a font of the ATM variety.
static BOOL CacheCompatibleFont (String_64 *pFontName)
 This function attempts to cache a font of the ATM variety. It is called as a second pass function after CacheNamedFont() has tried to cache the actual font. From here we can perform several actions to attempt to construct the font if it is an instance of a multiple master.
static void ValidateCache ()
 This function attempts to recache a font of the ATM variety.
static void FindClosestFont ()
 Attempts to search the list of installed fonts, looking for a match.
static ATMFontCreateNewFont (String_64 *pFontName)
 This function attempts to create a font instance and will be called by the font manager when new fonts are added.
static INT32 GetUtilVersion ()
static INT32 GetVersion ()
static BOOL GetCharOutline (CharDescription &ChDesc, DocCoord **ppCoords, PathVerb **ppVerbs, UINT32 *pNumCoords, CDC *pDC)
 Get the path associated with a given character.
static HINSTANCE GetATMDLL ()
 Returns the instance handle of the ATM DLL, or NULL if the DLL is not running.
static BOOL IsOkToCall ()
 Determine whether we can make further calls to the Adobe Type Manager.
static BOOL CorrectVersion (INT32 version)
 This routine can be used by our OIL layer functions needing to call ATM provided functions. The problem is there are likely to be many versions of ATM out there, and new functions obviously appear in later versions. So it is recommended that you check the running ATM version to make sure the function was actually implemented in this version. See ATM.h for all function versions. NOTE all the functions we call should have MinVer_<functionname> defines in the header.
static INT32 ThunkProperlyLoaded ()
 Determine whether we can make further calls to the Adobe Type Manager This call has been in the ATM from version 1.00 so there's no need to check it.
static INT32 ThunkGetVersion ()
 The version number of the currently running ATM.
static INT32 ThunkGetUtilVersion ()
 Returns the version number of our ATM thunking layer support DLL.
static INT32 LibProperlyLoaded ()
 Determine whether we can make further calls to the Adobe Type Manager This call has been in the ATM from version 1.00 so there's no need to check it.
static INT32 LibGetVersion ()
 The version number of the currently running ATM.
static INT32 BeginFontChange ()
 Starts a series of font change operations consisting of calls to the rotuines ATMAddFont and ATMRemoveFont. Must be called before calling ATMAddFont or ATMRemoveFont.
static INT32 AddFont (TCHAR *pMenuName, WORD Style, TCHAR *lpMetricsFile, TCHAR *lpFontFile)
 This routine makes a newly installed font available to ATM.
static INT32 RemoveFont (TCHAR *pMenuName, WORD Style)
 This call makes a font inaccessible to ATM. Any subsequent requests to ATM for this font will fail.
static INT32 EndFontChange ()
 Finishes a series of font change operations consisting of calls to the rotuines ATMAddFont and ATMRemoveFont. Call this function after font changes are completed, or your font changes may not take effect.
static BOOL FAR PASCAL EXPORT MyClosePath (LPSTR lpData)
static BOOL FAR PASCAL EXPORT MyMoveTo (LPATMFixedPoint lpFixPnt, LPSTR lpData)
static BOOL FAR PASCAL EXPORT MyLineTo (LPATMFixedPoint lpFixPnt, LPSTR lpData)
static BOOL FAR PASCAL EXPORT MyCurveTo (LPATMFixedPoint lpFixPnt1, LPATMFixedPoint lpFixPnt2, LPATMFixedPoint lpFixPnt3, LPSTR lpData)

Static Private Attributes

static HINSTANCE DLLHandle = NULL
static PFN_ATMProperlyLoaded pfnATMProperlyLoaded = NULL
static PFN_ATMGetVersion pfnATMGetVersion = NULL
static PFN_ATMGetOutline pfnATMGetOutline = NULL
static PFN_ATMForceExactWidth pfnATMForceExactWidth = NULL
static PFN_ATMBeginFontChange pfnATMBeginFontChange = NULL
static PFN_ATMEndFontChange pfnATMEndFontChange = NULL
static PFN_ATMForceFontChange pfnATMForceFontChange = NULL
static PFN_ATMFontStatus pfnATMFontStatus = NULL
static PFN_ATMAddFont pfnATMAddFont = NULL
static PFN_ATMRemoveFont pfnATMRemoveFont = NULL
static LPFNATMPROPERLYLOADED pfnXSATMProperlyLoaded = NULL
static LPFNATMGETOUTLINE pfnXSATMGetOutline = NULL
static LPFNATMFORCEEXACTWIDTH pfnXSATMForceExactWidth = NULL
static LPFNATMBEGINFONTCHANGE pfnXSATMBeginFontChange = NULL
static LPFNATMENDFONTCHANGE pfnXSATMEndFontChange = NULL
static LPFNATMFONTSTATUS pfnXSATMFontStatus = NULL
static LPFNATMADDFONT pfnXSATMAddFont = NULL
static LPFNATMREMOVEFONT pfnXSATMRemoveFont = NULL
static BOOL ATMRunning = FALSE
static INT32 ATMVersion = 0
static INT32 ATMUtilVersion = 0
static BOOL UseThunking = TRUE

Friends

class OILFontMan

Detailed Description

A static class to allow access to Type 1 fonts. There are few functions in this class which should be called directly. The OILFontMan provides the generic interface of font calls within this application.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/95

Definition at line 219 of file atmfonts.h.


Member Typedef Documentation

typedef unsigned char ATMFontMan::c [private]
 

Definition at line 281 of file atmfonts.h.

typedef unsigned char LPATMFixedMatrix LPFNMYMOVETO LPFNMYLINETO LPFNMYCURVETO LPFNMYCLOSEPATH LPSTR ATMFontMan::lpData [private]
 

Definition at line 281 of file atmfonts.h.

typedef WORD LPSTR LPSTR ATMFontMan::lpFontFile [private]
 

Definition at line 299 of file atmfonts.h.

typedef WORD LPSTR LPSTR ATMFontMan::lpFontFile [private]
 

Definition at line 295 of file atmfonts.h.

typedef unsigned char LPATMFixedMatrix ATMFontMan::lpMatrix [private]
 

Definition at line 281 of file atmfonts.h.

typedef WORD LPSTR ATMFontMan::lpMetricsFile [private]
 

Definition at line 299 of file atmfonts.h.

typedef WORD LPSTR ATMFontMan::lpMetricsFile [private]
 

Definition at line 295 of file atmfonts.h.

typedef unsigned char LPATMFixedMatrix LPFNMYMOVETO LPFNMYLINETO LPFNMYCURVETO LPFNMYCLOSEPATH ATMFontMan::lpProcClosePath [private]
 

Definition at line 281 of file atmfonts.h.

typedef unsigned char LPATMFixedMatrix LPFNMYMOVETO LPFNMYLINETO LPFNMYCURVETO ATMFontMan::lpProcCurveTo [private]
 

Definition at line 281 of file atmfonts.h.

typedef unsigned char LPATMFixedMatrix LPFNMYMOVETO LPFNMYLINETO ATMFontMan::lpProcLineTo [private]
 

Definition at line 281 of file atmfonts.h.

typedef unsigned char LPATMFixedMatrix LPFNMYMOVETO ATMFontMan::lpProcMoveTo [private]
 

Definition at line 281 of file atmfonts.h.

typedef WORD ATMFontMan::style [private]
 

Definition at line 302 of file atmfonts.h.

typedef WORD ATMFontMan::style [private]
 

Definition at line 299 of file atmfonts.h.

typedef WORD ATMFontMan::style [private]
 

Definition at line 295 of file atmfonts.h.


Constructor & Destructor Documentation

ATMFontMan::ATMFontMan  ) 
 

Default constructor.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/09/95

Definition at line 214 of file atmfonts.cpp.

00215 {
00216 }


Member Function Documentation

INT32 ATMFontMan::AddFont TCHAR pMenuName,
WORD  Style,
TCHAR lpMetricsFile,
TCHAR lpFontFile
[static, private]
 

This routine makes a newly installed font available to ATM.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
The lpMenuName contains the Windows name of the font. [INPUTS] The style parameter contains none, one or both of the flags ATM_ITALIC and ATM_BOLD. The lpMetricsFile contains the full pathname to the .pfm file for the font. The lpFontFile contains the full pathname to the .pfb file for the font.
- [OUTPUTS]
Returns:
Successful return values are: ATM_NOERR
Failure return values are: ATM_INVALIDFONT Invalid font format. ATM_PATHTOOLONG At least one path is too long. ATM_BADFONTTYPE The font is uncompressed. ATM_BADSTYLE The style parameter has bad bits! ATM_NOROOM Can't add to internal tables. ATM_NOFONT At least one path doesn't point to the correct file. ATM_BADMENUNAME Missing or invalid menu name given. ATM_FONTINUSE The paths and menu name specify an existing font which is in use by ATM.

Definition at line 832 of file atmfonts.cpp.

00833 {
00834     // Are we on Windows 95 and hence require the thunking DLL?
00835     // This should be the default case
00836     if (UseThunking)
00837     {
00838         const HINSTANCE hLib = ExtraDLLs[ ATM_Util_DLL ];
00839         // if our DLL is not up then return FALSE.
00840         if (!hLib)
00841             return ATM_NOTRUNNING;
00842 
00843         // If we haven't got the correct version then we cannot call it.
00844         if (!CorrectVersion(MinVer_AddFont))
00845             return ATM_NOTSUPPORTED;
00846 
00847         // do some dynamic linking to the DLL
00848         if (pfnXSATMAddFont == NULL)
00849             return ATM_NOTRUNNING;
00850 
00851         return (INT32) ((INT8) (   (*pfnXSATMAddFont)(pMenuName, Style, lpMetricsFile, lpFontFile)  ));
00852     }
00853 
00854     // We must be on NT where we have a real DLL
00855     if (pfnATMAddFont == NULL)
00856         return ATM_NOTRUNNING;
00857 
00858     return (INT32) ((INT8) (   (*pfnATMAddFont)(pMenuName, Style, lpMetricsFile, lpFontFile)  ));
00859 }

INT32 ATMFontMan::BeginFontChange  )  [static, private]
 

Starts a series of font change operations consisting of calls to the rotuines ATMAddFont and ATMRemoveFont. Must be called before calling ATMAddFont or ATMRemoveFont.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:

Definition at line 649 of file atmfonts.cpp.

00650 {
00651     // Are we on Windows 95 and hence require the thunking DLL?
00652     // This should be the default case
00653     if (UseThunking)
00654     {
00655         const HINSTANCE hLib = ExtraDLLs[ ATM_Util_DLL ];
00656         // if our DLL is not up then return FALSE.
00657         if (!hLib)
00658             return ATM_NOTRUNNING;
00659 
00660         // If we haven't got the correct version then we cannot call it.
00661         if (!CorrectVersion(MinVer_BeginFontChange))
00662             return ATM_NOTSUPPORTED;
00663 
00664         if (pfnXSATMBeginFontChange == NULL)
00665             return ATM_NOTRUNNING;
00666 
00667         return (INT32)((INT8)(*pfnXSATMBeginFontChange)());
00668     }
00669 
00670     // We must be on NT where we have a real DLL
00671     if (pfnATMBeginFontChange == NULL)
00672         return ATM_NOTRUNNING;
00673 
00674     return (BOOL)(*pfnATMBeginFontChange)();
00675 }

typedef ATMFontMan::BOOL FAR PASCAL *  PFN_ATMForceExactWidth  )  [private]
 

BOOL ATMFontMan::CacheCompatibleFont String_64 pFontName  )  [static, private]
 

This function attempts to cache a font of the ATM variety. It is called as a second pass function after CacheNamedFont() has tried to cache the actual font. From here we can perform several actions to attempt to construct the font if it is an instance of a multiple master.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/9/95
Parameters:
pFontName = a pointer to a fontname to find and cache [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 313 of file atmfonts.cpp.

00314 {
00315 
00316     // search for an underscore in the font
00317     INT32 pos = pFontName->Sub(String_32("_"),0,0);
00318     if (pos==-1)
00319         return FALSE;
00320 
00321     // pos is position of first _ character, is there a digit next?
00322     TCHAR digit = (*pFontName)[pos+1];
00323     if (!StringBase::IsNumeric(digit))
00324         return FALSE;
00325 
00326     String_64 MultiMaster;
00327     pFontName->Left(&MultiMaster, pos);
00328 
00329     // now we need to know whether this font exists.
00330     return FALSE;
00331 }

BOOL ATMFontMan::CacheNamedFont String_64 pFontName  )  [static, private]
 

This function attempts to cache a font of the ATM variety.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/9/95
Parameters:
pFontName = a pointer to a fontname to find and cache [INPUTS]
- [OUTPUTS]
Returns:
-

Definition at line 279 of file atmfonts.cpp.

00280 {
00281     CDC Screen;                                         // and create a new one
00282     if (Screen.CreateIC(TEXT("DISPLAY"), 0, 0, 0))
00283     {   
00284         FontManager* pFontMan = GetApplication()->GetFontManager();
00285         ERROR2IF(pFontMan == NULL,FALSE,"NULL FontManager ptr");
00286         pFontMan->ClearTempFont();
00287         EnumFontFamilies(Screen.m_hDC,
00288                          NULL,
00289                          (FONTENUMPROC) ATMFontMan_CallBackCacheNamedFont,
00290                          (LPARAM)pFontName);
00291         Screen.DeleteDC();
00292         return pFontMan->TempFontValid();
00293     }
00294     return FALSE;
00295 }

BOOL ATMFontMan::CorrectVersion INT32  version  )  [static, private]
 

This routine can be used by our OIL layer functions needing to call ATM provided functions. The problem is there are likely to be many versions of ATM out there, and new functions obviously appear in later versions. So it is recommended that you check the running ATM version to make sure the function was actually implemented in this version. See ATM.h for all function versions. NOTE all the functions we call should have MinVer_<functionname> defines in the header.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
version = the version number to check against [INPUTS] lo byte = minor version hi byte = major version
Returns:
TRUE if the running version of ATM is new enough to use FALSE if not

Definition at line 470 of file atmfonts.cpp.

00471 {
00472     return (version <= ATMVersion);
00473 }

ATMFont * ATMFontMan::CreateNewFont String_64 pFontName  )  [static, private]
 

This function attempts to create a font instance and will be called by the font manager when new fonts are added.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/9/95

Definition at line 391 of file atmfonts.cpp.

00392 {
00393     ATMFont *pFont = new ATMFont;
00394     if (pFont==NULL)
00395         return NULL;
00396     if (!pFont->Initialise(pFontName))
00397     {
00398         delete pFont;
00399         return NULL;
00400     }
00401     return pFont;
00402 }

INT32 ATMFontMan::DeInstallFont TCHAR pMenuName,
WORD  Style
[static]
 

See ATMFontMan::RemoveFont for details.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/9/95

Definition at line 1142 of file atmfonts.cpp.

01143 {
01144     INT32 err = BeginFontChange();
01145 
01146     if (err==ATM_NOERR)
01147         err = RemoveFont(pMenuName, Style);
01148 
01149     EndFontChange();
01150 
01151     return err;
01152 }

INT32 ATMFontMan::EndFontChange  )  [static, private]
 

Finishes a series of font change operations consisting of calls to the rotuines ATMAddFont and ATMRemoveFont. Call this function after font changes are completed, or your font changes may not take effect.

static INT32 ATMFontMan::EndFontChange()

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:

Definition at line 695 of file atmfonts.cpp.

00696 {
00697     // Are we on Windows 95 and hence require the thunking DLL?
00698     // This should be the default case
00699     if (UseThunking)
00700     {
00701         const HINSTANCE hLib = ExtraDLLs[ ATM_Util_DLL ];
00702         // if our DLL is not up then return FALSE.
00703         if (!hLib)
00704             return ATM_NOTRUNNING;
00705 
00706         // If we haven't got the correct version then we cannot call it.
00707         if (!CorrectVersion(MinVer_EndFontChange))
00708             return ATM_NOTSUPPORTED;
00709 
00710         if (pfnXSATMEndFontChange == NULL)
00711             return ATM_NOTRUNNING;
00712 
00713         return (INT32)((INT8)(*pfnXSATMEndFontChange)());
00714     }
00715 
00716     // We must be on NT where we have a real DLL
00717     if (pfnATMEndFontChange == NULL)
00718         return ATM_NOTRUNNING;
00719 
00720     return (BOOL)(*pfnATMEndFontChange)();
00721 }

void ATMFontMan::EnumAllFonts OILEnumFonts pClass  )  [static]
 

Give the kernel a way of enumerating fonts itself.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/9/95

Definition at line 253 of file atmfonts.cpp.

00254 {
00255     CDC Screen;
00256     if (Screen.CreateIC(TEXT("DISPLAY"), 0, 0, 0))
00257     {
00258         EnumFontFamilies(Screen.m_hDC,
00259                          NULL,
00260                          (FONTENUMPROC) ATMFontMan_CallBackDispatchFont,
00261                          (LPARAM)pClass);
00262         Screen.DeleteDC();
00263     }
00264 }

void ATMFontMan::FindClosestFont  )  [static, private]
 

Attempts to search the list of installed fonts, looking for a match.

Author:
Andy_Hayward (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/08/96

Definition at line 367 of file atmfonts.cpp.

00368 {
00369     CDC Screen;
00370     if (Screen.CreateIC(TEXT("DISPLAY"), 0, 0, 0))
00371     {
00372         EnumFontFamilies(Screen.m_hDC,
00373                          NULL,
00374                          (FONTENUMPROC) ATMFontMan_CallBackFindClosestFont,
00375                          NULL);
00376         Screen.DeleteDC();
00377     }
00378 }

INT32 ATMFontMan::FontStatus TCHAR pMenuName,
WORD  Style,
TCHAR lpMetricsFile,
TCHAR lpFontFile
[static]
 

This routine determines whether or not a given font is currently installed and/or in use by ATM. It should be called prior to installing a new font. If the return value is ATM_FONTINUSE, then no attempt should be made to install the font.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
The lpMenuName contains the Windows name of the font. [INPUTS] The style parameter contains none, one or both of the flags ATM_ITALIC and ATM_BOLD. The lpMetricsFile contains the full pathname to the .pfm file for the font. The lpFontFile contains the full pathname to the .pfb file for the font.
- [OUTPUTS]
Returns:
Successful return values are: ATM_FONTINUSE The paths and menu name specify an existing font which is in use by ATM. ATM_FONTPRESENT The paths and menu name specify an existing font which is NOT in use. ATM_FONTDIFFERENT The font, as specified by its menu name and styles, exists but its data files are different from those specified by lpMetricsFile & lpFontFile parameters. ATM_FONTABSENT There is no such font installed.
Failure return values are: ATM_PATHTOOLONG At least one path is too long. ATM_BADFONTTYPE The font is uncompressed. ATM_BADSTYLE The style parameter has bad bits! ATM_NOFONT At least one path doesn't point to the correct file. ATM_BADMENUNAME Missing or invalid menu name given.

Definition at line 769 of file atmfonts.cpp.

00770 {
00771     // Are we on Windows 95 and hence require the thunking DLL?
00772     // This should be the default case
00773     if (UseThunking)
00774     {
00775         const HINSTANCE hLib = ExtraDLLs[ ATM_Util_DLL ];
00776         // if our DLL is not up then return FALSE.
00777         if (!hLib)
00778             return ATM_NOTRUNNING;
00779 
00780         // If we haven't got the correct version then we cannot call it.
00781         if (!CorrectVersion(MinVer_FontStatus))
00782             return ATM_NOTSUPPORTED;
00783 
00784         if (pfnXSATMFontStatus == NULL)
00785             return ATM_NOTRUNNING;
00786 
00787         return (INT32)((INT8)(*pfnXSATMFontStatus)(pMenuName, Style, lpMetricsFile, lpFontFile));
00788     }
00789 
00790     // We must be on NT where we have a real DLL
00791     if (pfnATMFontStatus == NULL)
00792         return ATM_NOTRUNNING;
00793 
00794     return (INT32)((INT8)(*pfnATMFontStatus)(pMenuName, Style, lpMetricsFile, lpFontFile));
00795 }

BOOL ATMFontMan::ForceExactWidth  )  [static]
 

This routine causes the 'next' call for creating a font to create a font without adjusting the width data for the screen.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the call is successful, FALSE otherwise.

Definition at line 608 of file atmfonts.cpp.

00609 {
00610     // Are we on Windows 95 and hence require the thunking DLL?
00611     // This should be the default case
00612     if (UseThunking)
00613     {
00614         // If we haven't got the correct version then we cannot call it.
00615         if (!CorrectVersion(MinVer_ForceExactWidth))
00616             return FALSE;
00617 
00618         if (pfnXSATMForceExactWidth == NULL)
00619             return FALSE;
00620 
00621         return (BOOL)(*pfnXSATMForceExactWidth)();
00622     }
00623 
00624     // We must be on NT where we have a real DLL
00625     if (pfnATMForceExactWidth == NULL)
00626         return FALSE;
00627 
00628     return (BOOL)(*pfnATMForceExactWidth)();
00629 }

HINSTANCE ATMFontMan::GetATMDLL  )  [static, private]
 

Returns the instance handle of the ATM DLL, or NULL if the DLL is not running.

static HINSTANCE ATMFontMan::GetATMDLL()

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Returns:
the hInst instance of the ATM dll. NULL if the DLL has not been loaded or cannot be called due to error

Definition at line 433 of file atmfonts.cpp.

00434 {
00435     if (!IsOkToCall())
00436         return NULL;
00437 
00438     // Are we on Windows 95 and hence require the thunking DLL?
00439     // This should be the default case
00440     if (UseThunking)
00441         return ExtraDLLs[ ATM_Util_DLL ];
00442 
00443     // We must be on NT where we have a real DLL
00444     return DLLHandle;
00445 }

BOOL ATMFontMan::GetCharOutline CharDescription ChDesc,
DocCoord **  ppCoords,
PathVerb **  ppVerbs,
UINT32 pNumCoords,
CDC pDC
[static, private]
 

Get the path associated with a given character.

> static BOOL ATMFontMan::GetCharOutline(CharDescription& ChDesc, DocCoord** ppCoords, PathVerb** ppVerbs, UINT32* pNumCoords, CDC* pDC)

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/9/95
Parameters:
ChDesc = description of char [INPUTS] pDC = (possible) pointer to a DC (for optimisation) defaults to NULL
ppCoords = pointer to path coords buffer [OUTPUTS] ppVerbs = pointer to path verbs buffer pNumCoords = number of elements in path
Returns:
FALSE if unable to generate the character outline

Definition at line 938 of file atmfonts.cpp.

00943 {
00944     LPFNMYMOVETO    lpMyMoveTo      = NULL;
00945     LPFNMYLINETO    lpMyLineTo      = NULL;
00946     LPFNMYCURVETO   lpMyCurveTo     = NULL;
00947     LPFNMYCLOSEPATH lpMyClosePath   = NULL;
00948 
00949     ATMFixedMatrix  tMatrix = { ATMINTTOFIXED(1),0,0,ATMINTTOFIXED(1),0,0 };
00950     INT32           result;
00951     char            renderchar;
00952     WCHAR           wchar;
00953     CFont           hFont, *pOldFont;
00954     LOGFONT         CharLogFont;
00955     BOOL            LocalDC=FALSE;
00956 
00957     // Check some input parameters
00958     ERROR2IF(ppCoords==NULL,FALSE,"ATMFontMan::GetCharOutline pCoords==NULL");
00959     ERROR2IF(ppVerbs==NULL,FALSE,"ATMFontMan::GetCharOutline ppVerbs==NULL");
00960     ERROR2IF(pNumCoords==NULL,FALSE,"ATMFontMan::GetCharOutline pNumCoords==NULL");
00961 
00962     // Check we can call the ATM first
00963     const HINSTANCE hLib = GetATMDLL();
00964     if (!hLib)
00965         return FALSE;
00966     
00967     // Do we need to create a local DC?
00968     LocalDC=(pDC==NULL);
00969     if (LocalDC)
00970     {
00971         pDC=new CDC;
00972         ERROR2IF(pDC==NULL,FALSE,"ATMFontMan::GetCharOutline() - failed to create DC");
00973         if (pDC->CreateCompatibleDC(NULL)==FALSE)
00974         {
00975             delete pDC;
00976             pDC=NULL;
00977             ERROR2(FALSE,"ATMFontMan::GetCharOutline() - CreateCompatibleDC() failed");
00978         }
00979     }
00980 
00981     // get the character to render.
00982     // we limit the character if we are trying to get a unicode char as ATM GetOutline
00983     // takes a char. This happens to be a signed which is a bit rampant but it seems
00984     // ATM can cope with -97 given as a character code and maps it correctly
00985     wchar = ChDesc.GetCharCode();
00986     renderchar = (char)(UnicodeManager::UnicodeToMultiByte(wchar));
00987 
00988     // fill the log font description
00989     if (!TextManager::GetLogFontFromCharDescriptor(pDC, ChDesc, &CharLogFont))
00990         goto OutlineError;
00991 
00992     // Values from ATM docs (Jonathan 10/2000)
00993     CharLogFont.lfHeight        = -1;
00994     CharLogFont.lfWidth         = 0;
00995     CharLogFont.lfEscapement    = 0;
00996 
00997     // now stick it in our CFont object
00998     if (!hFont.CreateFontIndirect(&CharLogFont))
00999         goto OutlineError;
01000 
01001     // Select the font into the CDC
01002     pOldFont = pDC->SelectObject(&hFont);
01003     if (pOldFont==NULL)
01004         goto OutlineError;
01005 
01006     // Make Proc instances
01007     lpMyMoveTo      = MakeProcInstance(ATMFontMan::MyMoveTo, AppInst);
01008     lpMyLineTo      = MakeProcInstance(ATMFontMan::MyLineTo, AppInst);
01009     lpMyCurveTo     = MakeProcInstance(ATMFontMan::MyCurveTo, AppInst);
01010     lpMyClosePath   = MakeProcInstance(ATMFontMan::MyClosePath, AppInst);
01011 
01012     // Set our path cache to 0
01013     OILFontMan::InitialiseOutlineCache();
01014     
01015     // Are we on Windows 95 and hence require the thunking DLL?
01016     // This should be the default case
01017     if (UseThunking)
01018     {
01019         if (pfnXSATMGetOutline)
01020             result = (*pfnXSATMGetOutline)( pDC->GetSafeHdc(),
01021                                            renderchar,
01022                                            &tMatrix,
01023                                            lpMyMoveTo,
01024                                            lpMyLineTo,
01025                                            lpMyCurveTo,
01026                                            lpMyClosePath,
01027                                            NULL);
01028     }
01029     else
01030     {
01031         if (pfnATMGetOutline)
01032             result = (*pfnATMGetOutline)( pDC->GetSafeHdc(),
01033                                            renderchar,
01034                                            &tMatrix,
01035                                            lpMyMoveTo,
01036                                            lpMyLineTo,
01037                                            lpMyCurveTo,
01038                                            lpMyClosePath,
01039                                            NULL);
01040     }
01041 
01042 /*
01043     switch (result)
01044     {
01045         case ATM_NOERR:         TRACE( _T("Normal return\n"));                          break;
01046         case ATM_INVALIDFONT:   TRACE( _T("Font not consistent\n"));                        break;
01047         case ATM_CANTHAPPEN:    TRACE( _T("Some kind of internal error\n"));                break;
01048         case ATM_BADMATRIX:     TRACE( _T("Matrix inverse undefined\n"));               break;
01049         case ATM_MEMORY:        TRACE( _T("Out of memory\n"));                          break;
01050         case ATM_NOTSUPPORTED:  TRACE( _T("Running ATM does not support this call\n")); break;
01051         case ATM_NOTRUNNING:    TRACE( _T("ATM is not running\n"));                     break;
01052         case ATM_FILLORDER:     TRACE( _T("Inconsitent fill calls\n"));                 break;
01053         case ATM_CANCELLED:     TRACE( _T("Client halted operation\n"));                    break;
01054         case ATM_NOCHAR:        TRACE( _T("No outline for char code in font\n"));       break;
01055         case ATM_BADPROC:       TRACE( _T("Bad callback proc address\n"));              break;
01056         case ATM_CANTDRAW:      TRACE( _T("Error in imaging a bad rop?\n"));                break;
01057         case ATM_BADPARM:       TRACE( _T("Bad parameter passed in\n"));                    break;
01058         case ATM_SELECTED:      TRACE( _T("See ATMSelectObject\n"));                        break;
01059         case ATM_SELECTERROR:   TRACE( _T("See ATMSelectObject\n"));                        break;
01060         default:                TRACE( _T("ATM call returned unknown error result\n")); break;
01061     }   
01062 */
01063 
01064 
01065     // Matt 5/12/2000
01066     // Temporary Bodge-Fix for ATM Fonts Problem...
01067     // If the result of the font outline caching is 'Cancelled' then we change it to 'NoErr' and remove the
01068     // dodgy cache info for this character...
01069     // On some configurations of WinNT4 with ATM4 Deluxe, entering the 'Space' (UNICODE 32)
01070     // character causes it to throw this 'cancelled' error... THIS IS INTENDED AS A TEMPORARY FIX
01071     // UNTIL WE FIND THE REAL PROBLEM!!!
01072     if (result == ATM_CANCELLED)
01073     {
01074         result = ATM_NOERR;
01075         OILFontMan::InitialiseOutlineCache();
01076     }
01077 
01078 
01079 
01080     pDC->SelectObject(pOldFont);
01081 
01082     // delete any allocated dc
01083     if (LocalDC && pDC!=NULL)
01084     {
01085         delete pDC;
01086         pDC=NULL;
01087     }
01088 
01089     // Tell our path cache its all over
01090     OILFontMan::FinaliseOutlineCache();
01091 
01092     // return the resulting array details.
01093     if (result==0)
01094     {
01095         (*pNumCoords) = OILFontMan::GetOutlineCache(ppCoords,ppVerbs);
01096     }
01097 
01098     return (result==0);
01099 
01100 OutlineError:
01101     if (LocalDC && pDC!=NULL)
01102         delete pDC;
01103     return FALSE;
01104 }

static OUTLINETEXTMETRIC* ATMFontMan::GetOutlineTextMetric LOGFONT pLogFont  )  [inline, static]
 

Definition at line 240 of file atmfonts.h.

00240 { return NULL; }

static INT32 ATMFontMan::GetUtilVersion  )  [inline, static, private]
 

Definition at line 248 of file atmfonts.h.

00248 { return ATMUtilVersion; }

static INT32 ATMFontMan::GetVersion  )  [inline, static, private]
 

Definition at line 249 of file atmfonts.h.

00249 { return ATMVersion; }

BOOL ATMFontMan::InitDLL  )  [static]
 

Determine whether we can make further calls to the Adobe Type Manager.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
TRUE if the ATM mangler is actually running and can be used on this OpSys

Definition at line 231 of file atmfonts.cpp.

00232 {
00233     if (!ATMRunning)
00234         ATMRunning = (ThunkProperlyLoaded()>0);
00235     
00236     ATMVersion = ThunkGetVersion();
00237     ATMUtilVersion = ThunkGetUtilVersion();
00238 
00239     return ATMRunning;
00240 }

BOOL ATMFontMan::InitLib  )  [static]
 

Determine whether we can make further calls to the Adobe Type Manager Notes: Implemented for the ATM for Windows NT4.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/97
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
TRUE if the proper ATM library is actually running and can be used on this OpSys

Definition at line 1351 of file atmfonts.cpp.

01352 {
01353     if (!ATMRunning)
01354         ATMRunning = (LibProperlyLoaded() > 0);
01355 
01356     if (ATMRunning)
01357     {
01358         ATMVersion = LibGetVersion();
01359         ATMUtilVersion = 0; // ThunkGetUtilVersion();
01360 
01361         UseThunking = FALSE;
01362     }
01363 
01364     return ATMRunning;
01365 }

INT32 ATMFontMan::InstallFont TCHAR pMenuName,
WORD  Style,
TCHAR lpMetricsFile,
TCHAR lpFontFile
[static]
 

See ATMFontMan::AddFont for details.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/9/95

Definition at line 1119 of file atmfonts.cpp.

01120 {
01121     INT32 err = BeginFontChange();
01122 
01123     if (err==ATM_NOERR)
01124         err = AddFont(pMenuName, Style, lpMetricsFile, lpFontFile);
01125 
01126     EndFontChange();
01127 
01128     return err;
01129 }

typedef ATMFontMan::INT32 FAR PASCAL *  PFN_ATMRemoveFont  )  [private]
 

typedef ATMFontMan::INT32 FAR PASCAL *  PFN_ATMAddFont  )  [private]
 

typedef ATMFontMan::INT32 FAR PASCAL *  PFN_ATMFontStatus  )  [private]
 

typedef ATMFontMan::INT32 FAR PASCAL *  PFN_ATMGetOutline  )  [private]
 

BOOL ATMFontMan::IsOkToCall  )  [static, private]
 

Determine whether we can make further calls to the Adobe Type Manager.

static BOOL ATMFontMan::IsOkToCall()

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Returns:
TRUE if the ATM mangler is actually running and can be used on this OpSys

Definition at line 415 of file atmfonts.cpp.

00416 {
00417     return ATMRunning;
00418 }

INT32 ATMFontMan::LibGetVersion  )  [static, private]
 

The version number of the currently running ATM.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/97
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
High byte major version, low byte minor version

Definition at line 1440 of file atmfonts.cpp.

01441 {
01442     if (pfnATMGetVersion == NULL)
01443     {
01444         return FALSE;
01445     }
01446 
01447     INT32 result = (INT32)(*pfnATMGetVersion)();
01448     
01449     return result;
01450 }

INT32 ATMFontMan::LibProperlyLoaded  )  [static, private]
 

Determine whether we can make further calls to the Adobe Type Manager This call has been in the ATM from version 1.00 so there's no need to check it.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/10/97
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
>0 if the ATM manager is actually running and can be used on this OpSys

Definition at line 1382 of file atmfonts.cpp.

01383 {
01384     // Try and set up the dynamic links to the AtmLib dll.
01385     LPSTR LibName = "AtmLib.DLL";
01386     DLLHandle = LoadLibrary(LibName);
01387     if (DLLHandle == NULL)
01388     {
01389         return FALSE;
01390     }
01391 
01392     // extract the function pointers that we require
01393     pfnATMProperlyLoaded    = (PFN_ATMProperlyLoaded)   GetProcAddress( DLLHandle, "ATMProperlyLoaded");
01394     pfnATMGetVersion        = (PFN_ATMGetVersion)       GetProcAddress( DLLHandle, "ATMGetVersion");
01395     pfnATMGetOutline        = (PFN_ATMGetOutline)       GetProcAddress( DLLHandle, "ATMGetOutlineA");
01396     pfnATMForceExactWidth   = (PFN_ATMForceExactWidth)  GetProcAddress( DLLHandle, "ATMForceExactWidth");
01397     pfnATMBeginFontChange   = (PFN_ATMBeginFontChange)  GetProcAddress( DLLHandle, "ATMBeginFontChange");
01398     pfnATMEndFontChange     = (PFN_ATMEndFontChange)    GetProcAddress( DLLHandle, "ATMEndFontChange");
01399     pfnATMForceFontChange   = (PFN_ATMForceFontChange)  GetProcAddress( DLLHandle, "ATMForceFontChange");
01400     pfnATMFontStatus        = (PFN_ATMFontStatus)       GetProcAddress( DLLHandle, "ATMFontStatusA");
01401     pfnATMAddFont           = (PFN_ATMAddFont)          GetProcAddress( DLLHandle, "ATMAddFontA");
01402     pfnATMRemoveFont        = (PFN_ATMRemoveFont)       GetProcAddress( DLLHandle, "ATMRemoveFontA");
01403 
01404     // If we had a problem then unload the DLL and say so
01405     if (pfnATMProperlyLoaded    == NULL ||
01406         pfnATMGetVersion        == NULL ||
01407         pfnATMGetOutline        == NULL ||
01408 //      pfnATMForceExactWidth   == NULL ||
01409         pfnATMBeginFontChange   == NULL ||
01410         pfnATMEndFontChange     == NULL ||
01411         pfnATMForceFontChange   == NULL ||
01412         pfnATMFontStatus        == NULL ||
01413         pfnATMAddFont           == NULL ||
01414         pfnATMRemoveFont        == NULL
01415         )
01416     {
01417         FreeLibrary(DLLHandle);                 // remove DLL as no longer required
01418         DLLHandle = NULL;
01419         return FALSE;
01420     }
01421 
01422     // Otherwise, check that the DLL thinks that everything is ok
01423     INT32 result = (INT32)(*pfnATMProperlyLoaded)();
01424     return result;
01425 }

BOOL FAR PASCAL EXPORT ATMFontMan::MyClosePath LPSTR  lpData  )  [static, private]
 

Definition at line 1159 of file atmfonts.cpp.

01160 {
01161     return OILFontMan::ClosePath();
01162 }

BOOL FAR PASCAL EXPORT ATMFontMan::MyCurveTo LPATMFixedPoint  lpFixPnt1,
LPATMFixedPoint  lpFixPnt2,
LPATMFixedPoint  lpFixPnt3,
LPSTR  lpData
[static, private]
 

Definition at line 1180 of file atmfonts.cpp.

01184 {
01185     POINT p0,p1,p2;
01186     p0.x = SCALEORD(lpFixPnt1->x);
01187     p0.y = SCALEORD(lpFixPnt1->y);
01188     p1.x = SCALEORD(lpFixPnt2->x);
01189     p1.y = SCALEORD(lpFixPnt2->y);
01190     p2.x = SCALEORD(lpFixPnt3->x);
01191     p2.y = SCALEORD(lpFixPnt3->y);
01192     return OILFontMan::AddBezierTo(p0,p1,p2);
01193 }

BOOL FAR PASCAL EXPORT ATMFontMan::MyLineTo LPATMFixedPoint  lpFixPnt,
LPSTR  lpData
[static, private]
 

Definition at line 1172 of file atmfonts.cpp.

01173 {
01174     POINT p;
01175     p.x = SCALEORD(lpFixPnt->x);
01176     p.y = SCALEORD(lpFixPnt->y);
01177     return OILFontMan::AddLineTo(p);
01178 }

BOOL FAR PASCAL EXPORT ATMFontMan::MyMoveTo LPATMFixedPoint  lpFixPnt,
LPSTR  lpData
[static, private]
 

Definition at line 1164 of file atmfonts.cpp.

01165 {
01166     POINT p;
01167     p.x = SCALEORD(lpFixPnt->x);
01168     p.y = SCALEORD(lpFixPnt->y);
01169     return OILFontMan::AddMoveTo(p);
01170 }

INT32 ATMFontMan::RemoveFont TCHAR pMenuName,
WORD  Style
[static, private]
 

This call makes a font inaccessible to ATM. Any subsequent requests to ATM for this font will fail.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
The lpMenuName contains the Windows name of the font. [INPUTS] The style parameter contains none, one or both of the flags ATM_ITALIC and ATM_BOLD.
- [OUTPUTS]
Returns:
Successful return values are: ATM_NOERR
Failure return values are: ATM_BADSTYLE The style parameter has bad bits! ATM_NOFONT The specified font is not available. ATM_BADMENUNAME Missing or invalid menu name given.

Definition at line 888 of file atmfonts.cpp.

00889 {
00890     // Are we on Windows 95 and hence require the thunking DLL?
00891     // This should be the default case
00892     if (UseThunking)
00893     {
00894         const HINSTANCE hLib = ExtraDLLs[ ATM_Util_DLL ];
00895         // if our DLL is not up then return FALSE.
00896         if (!hLib)
00897             return ATM_NOTRUNNING;
00898 
00899         // If we haven't got the correct version then we cannot call it.
00900         if (!CorrectVersion(MinVer_RemoveFont))
00901             return ATM_NOTSUPPORTED;
00902 
00903         // do some dynamic linking to the DLL
00904         if (pfnXSATMRemoveFont == NULL)
00905             return ATM_NOTRUNNING;
00906 
00907         return (INT32)((INT8)(*pfnXSATMRemoveFont)(pMenuName, Style));
00908     }
00909 
00910     // We must be on NT where we have a real DLL
00911     if (pfnATMRemoveFont == NULL)
00912         return ATM_NOTRUNNING;
00913 
00914     return (INT32)((INT8)(*pfnATMRemoveFont)(pMenuName, Style));
00915 }

INT32 ATMFontMan::ThunkGetUtilVersion  )  [static, private]
 

Returns the version number of our ATM thunking layer support DLL.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
High byte major version, low byte minor version

Errors: None.

Definition at line 545 of file atmfonts.cpp.

00546 {
00547     // if our DLL is not up then return FALSE.
00548     const HINSTANCE hLib = GetATMDLL();
00549     if (!hLib)
00550         return 0;
00551 
00552     // do some dynamic linking to the DLL
00553     LPFNATMGETUTILVERSION lpfn = (LPFNATMGETUTILVERSION)GetProcAddress(hLib, MAKEINTRESOURCE(XSATM_GetUtilVersion) );
00554     if (lpfn==NULL)
00555         return 0;
00556 
00557     return (INT32)(*lpfn)();
00558 }

INT32 ATMFontMan::ThunkGetVersion  )  [static, private]
 

The version number of the currently running ATM.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/94
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
High byte major version, low byte minor version

Definition at line 573 of file atmfonts.cpp.

00574 {
00575     // if our DLL is not up then return FALSE.
00576     const HINSTANCE hLib = GetATMDLL();
00577     if (!hLib)
00578         return 0;
00579 
00580     // do some dynamic linking to the DLL
00581     LPFNATMGETVERSION lpfn = (LPFNATMGETVERSION)GetProcAddress(hLib, MAKEINTRESOURCE(XSATM_ATMGetVersion) );
00582     if (lpfn==NULL)
00583         return 0;
00584 
00585     INT32 result = (INT32)(*lpfn)();
00586     
00587     // swap the byte order as its rampant!
00588     INT32 minor = HIBYTE(LOWORD(result));
00589     INT32 major = LOBYTE(LOWORD(result));
00590 
00591     return (minor | (major<<8));
00592 }

INT32 ATMFontMan::ThunkProperlyLoaded  )  [static, private]
 

Determine whether we can make further calls to the Adobe Type Manager This call has been in the ATM from version 1.00 so there's no need to check it.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/9/95
Parameters:
- [INPUTS]
[OUTPUTS] 
Returns:
>0 if the ATM manager is actually running and can be used on this OpSys

Definition at line 490 of file atmfonts.cpp.

00491 {
00492     typedef WORD (FAR PASCAL *PFN)();
00493     
00494     const HINSTANCE hLib = ExtraDLLs[ ATM_Util_DLL ];
00495     // if our DLL is not up then return FALSE.
00496     if (!hLib)
00497         return 0;
00498 
00499     // extract the function pointers that we require
00500     pfnXSATMProperlyLoaded  = (LPFNATMPROPERLYLOADED)   GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMProperlyLoaded));
00501 //  pfnXSATMGetVersion      = (LPFNATMGETVERSION)       GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMGetVersion));
00502     pfnXSATMGetOutline      = (LPFNATMGETOUTLINE)       GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMGetOutline));
00503     pfnXSATMForceExactWidth = (LPFNATMFORCEEXACTWIDTH)  GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMForceExactWidth));
00504     pfnXSATMBeginFontChange = (LPFNATMBEGINFONTCHANGE)  GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMBeginFontChange));
00505     pfnXSATMEndFontChange   = (LPFNATMENDFONTCHANGE)    GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMEndFontChange));
00506 //  pfnXSATMForceFontChange = (PFN_ATMForceFontChange)  GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMForceFontChange"));
00507     pfnXSATMFontStatus      = (LPFNATMFONTSTATUS)       GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMFontStatus));
00508     pfnXSATMAddFont         = (LPFNATMADDFONT)          GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMAddFont));
00509     pfnXSATMRemoveFont      = (LPFNATMREMOVEFONT)       GetProcAddress( hLib, MAKEINTRESOURCE(XSATM_ATMRemoveFont));
00510 
00511     // If we had a problem then unload the DLL and say so
00512     if (pfnXSATMProperlyLoaded  == NULL ||
00513 //      pfnXSATMGetVersion      == NULL ||
00514         pfnXSATMGetOutline      == NULL ||
00515         pfnXSATMForceExactWidth == NULL ||
00516         pfnXSATMBeginFontChange == NULL ||
00517         pfnXSATMEndFontChange   == NULL ||
00518 //      pfnXSATMForceFontChange == NULL ||
00519         pfnXSATMFontStatus      == NULL ||
00520         pfnXSATMAddFont         == NULL ||
00521         pfnXSATMRemoveFont      == NULL
00522         )
00523     {
00524         return FALSE;
00525     }
00526 
00527     INT32 result = (INT32)(*pfnXSATMProperlyLoaded)();
00528     return result;
00529 }

void ATMFontMan::ValidateCache  )  [static, private]
 

This function attempts to recache a font of the ATM variety.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/9/95

Definition at line 344 of file atmfonts.cpp.

00345 {
00346     CDC Screen;
00347     if (Screen.CreateIC(TEXT("DISPLAY"), 0, 0, 0))
00348     {
00349         EnumFontFamilies(Screen.m_hDC,
00350                          NULL,
00351                          (FONTENUMPROC) ATMFontMan_CallBackValidateFont,
00352                          NULL);
00353         Screen.DeleteDC();
00354     }
00355 }

typedef ATMFontMan::WORD FAR PASCAL *  PFN_ATMForceFontChange  )  [private]
 

typedef ATMFontMan::WORD FAR PASCAL *  PFN_ATMEndFontChange  )  [private]
 

typedef ATMFontMan::WORD FAR PASCAL *  PFN_ATMBeginFontChange  )  [private]
 

typedef ATMFontMan::WORD FAR PASCAL *  PFN_ATMGetVersion  )  [private]
 

typedef ATMFontMan::WORD FAR PASCAL *  PFN_ATMProperlyLoaded  )  [private]
 


Friends And Related Function Documentation

friend class OILFontMan [friend]
 

Definition at line 223 of file atmfonts.h.


Member Data Documentation

BOOL ATMFontMan::ATMRunning = FALSE [static, private]
 

Definition at line 348 of file atmfonts.h.

INT32 ATMFontMan::ATMUtilVersion = 0 [static, private]
 

Definition at line 350 of file atmfonts.h.

INT32 ATMFontMan::ATMVersion = 0 [static, private]
 

Definition at line 349 of file atmfonts.h.

HINSTANCE ATMFontMan::DLLHandle = NULL [static, private]
 

Definition at line 274 of file atmfonts.h.

ATMFontMan::PFN_ATMAddFont ATMFontMan::pfnATMAddFont = NULL [static, private]
 

Definition at line 315 of file atmfonts.h.

ATMFontMan::PFN_ATMBeginFontChange ATMFontMan::pfnATMBeginFontChange = NULL [static, private]
 

Definition at line 311 of file atmfonts.h.

ATMFontMan::PFN_ATMEndFontChange ATMFontMan::pfnATMEndFontChange = NULL [static, private]
 

Definition at line 312 of file atmfonts.h.

ATMFontMan::PFN_ATMFontStatus ATMFontMan::pfnATMFontStatus = NULL [static, private]
 

Definition at line 314 of file atmfonts.h.

ATMFontMan::PFN_ATMForceExactWidth ATMFontMan::pfnATMForceExactWidth = NULL [static, private]
 

Definition at line 310 of file atmfonts.h.

ATMFontMan::PFN_ATMForceFontChange ATMFontMan::pfnATMForceFontChange = NULL [static, private]
 

Definition at line 313 of file atmfonts.h.

ATMFontMan::PFN_ATMGetOutline ATMFontMan::pfnATMGetOutline = NULL [static, private]
 

Definition at line 309 of file atmfonts.h.

ATMFontMan::PFN_ATMGetVersion ATMFontMan::pfnATMGetVersion = NULL [static, private]
 

Definition at line 308 of file atmfonts.h.

ATMFontMan::PFN_ATMProperlyLoaded ATMFontMan::pfnATMProperlyLoaded = NULL [static, private]
 

Definition at line 307 of file atmfonts.h.

ATMFontMan::PFN_ATMRemoveFont ATMFontMan::pfnATMRemoveFont = NULL [static, private]
 

Definition at line 316 of file atmfonts.h.

LPFNATMADDFONT ATMFontMan::pfnXSATMAddFont = NULL [static, private]
 

Definition at line 328 of file atmfonts.h.

LPFNATMBEGINFONTCHANGE ATMFontMan::pfnXSATMBeginFontChange = NULL [static, private]
 

Definition at line 324 of file atmfonts.h.

LPFNATMENDFONTCHANGE ATMFontMan::pfnXSATMEndFontChange = NULL [static, private]
 

Definition at line 325 of file atmfonts.h.

LPFNATMFONTSTATUS ATMFontMan::pfnXSATMFontStatus = NULL [static, private]
 

Definition at line 327 of file atmfonts.h.

LPFNATMFORCEEXACTWIDTH ATMFontMan::pfnXSATMForceExactWidth = NULL [static, private]
 

Definition at line 323 of file atmfonts.h.

LPFNATMGETOUTLINE ATMFontMan::pfnXSATMGetOutline = NULL [static, private]
 

Definition at line 322 of file atmfonts.h.

LPFNATMPROPERLYLOADED ATMFontMan::pfnXSATMProperlyLoaded = NULL [static, private]
 

Definition at line 320 of file atmfonts.h.

LPFNATMREMOVEFONT ATMFontMan::pfnXSATMRemoveFont = NULL [static, private]
 

Definition at line 329 of file atmfonts.h.

BOOL ATMFontMan::UseThunking = TRUE [static, private]
 

Definition at line 352 of file atmfonts.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:50:04 2007 for Camelot by  doxygen 1.4.4