home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Libraries / VideoToolbox 94.11.17 / VideoToolboxSources / ATMInterface.3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-15  |  15.8 KB  |  613 lines  |  [TEXT/KAHL]

  1. /*
  2.  * ATMInterface.c
  3.  *
  4.  * Version 3.0
  5.  *
  6.  * Adobe Type Manager is a trademark of Adobe Systems Incorporated.
  7.  * Copyright 1983-1991 Adobe Systems Incorporated.
  8.  * All Rights Reserved.
  9.  */
  10.  
  11. /* 
  12. NOTE:
  13. ATMInterface.c can be downloaded from:
  14. ftp://ftp.mv.us.adobe.com/pub/adobe/Programs/MacATM30headers.sea.hqx
  15. For current documentation of the ATM Macintosh C interface download:
  16. ftp://ftp.mv.us.adobe.com/pub/adobe/DeveloperSupport/TechNotes/5072.ATM_Adv_Mac.pdf
  17.  
  18. HISTORY:
  19. 8/94    dgp downloaded it.
  20. 9/7/94    dgp cosmetic editing.
  21. 11/15/94 dgp Asserted, below, that Metrowerks CodeWarrior C can call Pascal routines directly,
  22. since I don't know where to look for the CallPascal() routine that Adobe uses otherwise. This
  23. seems to compile ok, but I haven't tested it.
  24. 11/15/94 dgp did cosmetic editing to eliminate compiler warnings about possibly undesired
  25. assignment within an if condition. Converted a couple old-style function headers to ANSI style.
  26. */
  27. #if __powerc
  28.     #error "This file is not PowerPC compatible. It'll crash. Use ATMInterface.c instead."
  29. /*
  30. This file is fine for 68k compilation, but is likely to crash if compiled for ppc.
  31. The calls to ATM need to be converted to use UniversalProcPtr's, since the ATM code
  32. might be 68k or ppc code, depending on which version of ATM is installed on your PowerPC.
  33. The conversion is straightforward, but tedious. Either use ATMInterface.c, or, if you
  34. need the functionality of this file and Adobe has yet to post a new, universal, version,
  35. then you could convert this file yourself, using ATMInterface.c as a guide. If you do
  36. succeed then please send the happy result to denis_pelli@isr.syr.edu to share with
  37. other users of the VideoToolbox.
  38. */
  39. #endif
  40. #if THINK_C >= 5 || applec
  41.     #include <Types.h>
  42.     #include <Dialogs.h>
  43.     #include <Files.h>
  44.     #include <Devices.h>
  45.     #ifdef THINK_C
  46.         #include <pascal.h>
  47.     #endif
  48. #endif
  49.  
  50. #if THINK_C >= 5 || applec || __MWERKS__    /* dgp added CodeWarrior since I can't find CallPascal */
  51.     #define CALL_PASCAL        0                /* can make Pascal calls directly */
  52. #else
  53.     #define CALL_PASCAL        1                /* needs CallPascal() help */
  54. #endif
  55.  
  56. #include "ATMInterface.3.h"
  57.  
  58. #ifndef FALSE
  59.     #define FALSE 0
  60. #endif
  61.  
  62. short            ATMOpen = 0;
  63. short            ATMOpenVersion;
  64. LATEST_PROCS    ATMProcs;
  65.  
  66. short initVersionATM(short version)
  67. {
  68.     CntrlParam c;
  69.     OSErr    err;
  70.     
  71.     ATMOpen = 0;
  72.     
  73.     if (OpenDriver((StringPtr) "\p.ATM", &c.ioCRefNum))
  74.         return 0;
  75.  
  76.     /* Use ATMPascalProcsStatusCode for all routines to use all pascal interfaces. */
  77.     c.csCode = ATMProcsStatusCode;
  78.     ATMProcs.version = version;
  79.     *(ATMProcs5 **) c.csParam = &ATMProcs;
  80.  
  81.     err = PBStatus((ParmBlkPtr) &c, 0);
  82.     if (err)
  83.         return 0;
  84.  
  85.     ATMOpenVersion = version;
  86.     return ATMOpen = 1;
  87. }
  88.  
  89. short initPascalVersionATM(short version)
  90. {
  91.     CntrlParam c;
  92.     OSErr    err;
  93.     
  94.     ATMOpen = 0;
  95.     
  96.     if (OpenDriver((StringPtr) "\p.ATM", &c.ioCRefNum))
  97.         return 0;
  98.  
  99.     /* Use ATMPascalProcsStatusCode for all routines to use all pascal interfaces. */
  100.     c.csCode = ATMPascalProcsStatusCode;
  101.     ATMProcs.version = version;
  102.     *(ATMProcs5 **) c.csParam = &ATMProcs;
  103.  
  104.     err = PBStatus((ParmBlkPtr) &c, 0);
  105.     if (err)
  106.         return 0;
  107.  
  108.     ATMOpenVersion = version;
  109.     return ATMOpen = 1;
  110. }
  111.  
  112. short fontAvailableATM(short family, short style)
  113. {
  114.     return ATMOpen ? (*ATMProcs.fontAvailable)(family, style) : 0;
  115. }
  116.  
  117. short showTextATM(Byte *text, short length, ATMFixedMatrix *matrix)
  118. {
  119.     /* Note: this really is "showText", version 3 style. */
  120.     return (ATMOpen && ATMOpenVersion == ATMProcs3Version) ?
  121.         (*(short (*)(StringPtr , short, ATMFixedMatrix *)) ATMProcs.showTextErr)
  122.             (text, length, matrix) : length;
  123. }
  124.  
  125. short showTextATMErr(Byte *text, short length, ATMFixedMatrix *matrix, short *errorCode)
  126. {
  127.     return (ATMOpen && ATMOpenVersion >= ATMProcs4Version) ? (*ATMProcs.showTextErr)
  128.         ((void *) text, length, matrix, errorCode) : length;
  129. }
  130.  
  131. short xyshowTextATM(Byte *text, short length, ATMFixedMatrix *matrix, ATMFixed *displacements)
  132. {
  133.     /* Note: this really is "xyshowText", version 3 style. */
  134.     return (ATMOpen && ATMOpenVersion == ATMProcs3Version) ?
  135.         (*(short (*)(StringPtr , short, ATMFixedMatrix *, ATMFixed *)) ATMProcs.xyshowTextErr)
  136.             (text, length, matrix, displacements) : length;
  137. }
  138.  
  139. short xyshowTextATMErr(Byte *text, short length, ATMFixedMatrix *matrix,
  140.                     ATMFixed *displacements, short *errorCode)
  141. {
  142.     return (ATMOpen && ATMOpenVersion >= ATMProcs4Version) ? (*ATMProcs.xyshowTextErr)
  143.         ((void *) text, length, matrix, displacements, errorCode) : length;
  144. }
  145.  
  146. short getOutlineATM(
  147.     short c,
  148.     ATMFixedMatrix *matrix, 
  149.     Ptr clientHook,
  150.     short (*MoveTo)(),
  151.     short (*LineTo)(),
  152.     short (*CurveTo)(), 
  153.     short (*ClosePath)())
  154. {
  155.     if (!ATMOpen)
  156.         return ATM_NOT_ON;
  157.     return ATMOpenVersion >= ATMProcs4Version ? 
  158.         (*ATMProcs.getOutline)(c, matrix, clientHook, MoveTo, LineTo, CurveTo, ClosePath) : ATM_WRONG_VERSION;
  159. }                
  160.  
  161. short startFillATM(void)
  162. {
  163.     if (!ATMOpen)
  164.         return ATM_NOT_ON;
  165.     return ATMOpenVersion >= ATMProcs4Version ? 
  166.         (*ATMProcs.startFill)() : ATM_WRONG_VERSION;
  167. }                
  168.  
  169. short fillMoveToATM(ATMPFixedPoint pc)
  170. {
  171.     if (!ATMOpen)
  172.         return ATM_NOT_ON;
  173.     return ATMOpenVersion >= ATMProcs4Version ? 
  174.         (*ATMProcs.fillMoveTo)(pc) : ATM_WRONG_VERSION;
  175. }                
  176.  
  177. short fillLineToATM(ATMPFixedPoint pc)
  178. {
  179.     if (!ATMOpen)
  180.         return ATM_NOT_ON;
  181.     return ATMOpenVersion >= ATMProcs4Version ? 
  182.         (*ATMProcs.fillLineTo)(pc) : ATM_WRONG_VERSION;
  183. }                
  184.  
  185. short fillCurveToATM(ATMPFixedPoint pc1, ATMPFixedPoint pc2, ATMPFixedPoint pc3)
  186. {
  187.     if (!ATMOpen)
  188.         return ATM_NOT_ON;
  189.     return ATMOpenVersion >= ATMProcs4Version ? 
  190.         (*ATMProcs.fillCurveTo)(pc1, pc2, pc3) : ATM_WRONG_VERSION;
  191. }                
  192.  
  193. short fillClosePathATM(void)
  194. {
  195.     if (!ATMOpen)
  196.         return ATM_NOT_ON;
  197.     return ATMOpenVersion >= ATMProcs4Version ? 
  198.         (*ATMProcs.fillClosePath)() : ATM_WRONG_VERSION;
  199. }                
  200.  
  201. short endFillATM(void)
  202. {
  203.     if (!ATMOpen)
  204.         return ATM_NOT_ON;
  205.     return ATMOpenVersion >= ATMProcs4Version ? 
  206.         (*ATMProcs.endFill)() : ATM_WRONG_VERSION;
  207. }                
  208.  
  209. void disableATM(void)
  210. {
  211.     if (!ATMOpen)
  212.         return;
  213.     if (ATMOpenVersion >= ATMProcs5Version) 
  214. #if CALL_PASCAL
  215.         CallPascal(ATMProcs.disable);
  216. #else
  217.         (*ATMProcs.disable)();
  218. #endif
  219. }                
  220.  
  221. void reenableATM(void)
  222. {
  223.     if (!ATMOpen)
  224.         return;
  225.     if (ATMOpenVersion >= ATMProcs5Version) 
  226. #if CALL_PASCAL
  227.         CallPascal(ATMProcs.reenable);
  228. #else
  229.         (*ATMProcs.reenable)();
  230. #endif
  231. }                
  232.  
  233. short getBlendedFontTypeATM(StringPtr fontName, short fondID)
  234. {
  235.     if (!ATMOpen)
  236.         return ATMNotBlendFont;
  237.     return ATMOpenVersion >= ATMProcs5Version ? 
  238. #if CALL_PASCAL
  239.         CallPascalW(fontName, fondID, ATMProcs.getBlendedFontType)
  240. #else
  241.         (*ATMProcs.getBlendedFontType)(fontName, fondID) 
  242. #endif
  243.             : ATMNotBlendFont;
  244. }
  245.  
  246. ATMErr encodeBlendedFontNameATM(StringPtr familyName, short numAxes,
  247.                 Fixed *coords, StringPtr blendName)
  248. {
  249.     if (!ATMOpen)
  250.         return ATM_NOT_ON;
  251.     return ATMOpenVersion >= ATMProcs5Version ? 
  252. #if CALL_PASCAL
  253.         CallPascalW(familyName, numAxes, coords, blendName, ATMProcs.encodeBlendedFontName)
  254. #else
  255.         (*ATMProcs.encodeBlendedFontName)(familyName, numAxes, coords, blendName) 
  256. #endif
  257.             : ATM_WRONG_VERSION;
  258. }
  259.  
  260. ATMErr decodeBlendedFontNameATM(StringPtr blendName, StringPtr familyName,
  261.             short *numAxes, Fixed *coords, StringPtr displayInstanceStr)
  262. {
  263.     if (!ATMOpen)
  264.         return ATM_NOT_ON;
  265.     return ATMOpenVersion >= ATMProcs5Version ? 
  266. #if CALL_PASCAL
  267.         CallPascalW(blendName, familyName, numAxes, coords, displayInstanceStr,
  268.                         ATMProcs.decodeBlendedFontName) 
  269. #else
  270.         (*ATMProcs.decodeBlendedFontName)(blendName, familyName, numAxes, coords, displayInstanceStr) 
  271. #endif
  272.             : ATM_WRONG_VERSION;
  273. }
  274.  
  275. ATMErr    addMacStyleToCoordsATM(Fixed *coords, short macStyle, Fixed *newCoords, short *stylesLeft)
  276. {
  277.     if (!ATMOpen)
  278.         return ATM_NOT_ON;
  279.     return ATMOpenVersion >= ATMProcs5Version ? 
  280. #if CALL_PASCAL
  281.         CallPascalW(coords, macStyle, newCoords, stylesLeft,
  282.                         ATMProcs.addMacStyleToCoords) 
  283. #else
  284.         (*ATMProcs.addMacStyleToCoords)(coords, macStyle, newCoords, stylesLeft) 
  285. #endif
  286.             : ATM_WRONG_VERSION;
  287. }
  288.  
  289. ATMErr convertCoordsToBlendATM(Fixed *coords, Fixed *weightVector)
  290. {
  291.     if (!ATMOpen)
  292.         return ATM_NOT_ON;
  293.     return ATMOpenVersion >= ATMProcs5Version ? 
  294. #if CALL_PASCAL
  295.         CallPascalW(coords, weightVector, ATMProcs.convertCoordsToBlend) 
  296. #else
  297.         (*ATMProcs.convertCoordsToBlend)(coords, weightVector) 
  298. #endif
  299.             : ATM_WRONG_VERSION;
  300. }
  301.  
  302. ATMErr normToUserCoordsATM(Fixed *normalCoords, Fixed *coords)
  303. {
  304.     if (!ATMOpen)
  305.         return ATM_NOT_ON;
  306.     return ATMOpenVersion >= ATMProcs5Version ? 
  307. #if CALL_PASCAL
  308.         CallPascalW(normalCoords, coords, ATMProcs.normToUserCoords) 
  309. #else
  310.         (*ATMProcs.normToUserCoords)(normalCoords, coords) 
  311. #endif
  312.             : ATM_WRONG_VERSION;
  313. }
  314.  
  315. ATMErr userToNormCoordsATM(Fixed *coords, Fixed *normalCoords)
  316. {
  317.     if (!ATMOpen)
  318.         return ATM_NOT_ON;
  319.     return ATMOpenVersion >= ATMProcs5Version ? 
  320. #if CALL_PASCAL
  321.         CallPascalW(coords, normalCoords, ATMProcs.userToNormCoords) 
  322. #else
  323.         (*ATMProcs.userToNormCoords)(coords, normalCoords) 
  324. #endif
  325.             : ATM_WRONG_VERSION;
  326. }
  327.  
  328. ATMErr createTempBlendedFontATM(short numAxes, Fixed *coords, short *useFondID)
  329. {
  330.     if (!ATMOpen)
  331.         return ATM_NOT_ON;
  332.     return ATMOpenVersion >= ATMProcs5Version ? 
  333. #if CALL_PASCAL
  334.         CallPascalW(numAxes, coords, useFondID, ATMProcs.createTempBlendedFont) 
  335. #else
  336.         (*ATMProcs.createTempBlendedFont)(numAxes, coords, useFondID) 
  337. #endif
  338.             : ATM_WRONG_VERSION;
  339. }
  340.  
  341. ATMErr disposeTempBlendedFontATM(short fondID)
  342. {
  343.     if (!ATMOpen)
  344.         return ATM_NOT_ON;
  345.     return ATMOpenVersion >= ATMProcs5Version ? 
  346. #if CALL_PASCAL
  347.         CallPascalW(fondID, ATMProcs.disposeTempBlendedFont) 
  348. #else
  349.         (*ATMProcs.disposeTempBlendedFont)(fondID) 
  350. #endif
  351.             : ATM_WRONG_VERSION;
  352. }
  353.  
  354. ATMErr createPermBlendedFontATM(StringPtr fontName, short fontSize, short fontFileID, short *retFondID)
  355. {
  356.     if (!ATMOpen)
  357.         return ATM_NOT_ON;
  358.     return ATMOpenVersion >= ATMProcs5Version ? 
  359. #if CALL_PASCAL
  360.         CallPascalW(fontName, fontSize, fontFileID, retFondID, ATMProcs.createPermBlendedFont) 
  361. #else
  362.         (*ATMProcs.createPermBlendedFont)(fontName, fontSize, fontFileID, retFondID) 
  363. #endif
  364.             : ATM_WRONG_VERSION;
  365. }
  366.  
  367. ATMErr disposePermBlendedFontATM(short fondID)
  368. {
  369.     if (!ATMOpen)
  370.         return ATM_NOT_ON;
  371.     return ATMOpenVersion >= ATMProcs5Version ? 
  372. #if CALL_PASCAL
  373.         CallPascalW(fondID, ATMProcs.disposePermBlendedFont) 
  374. #else
  375.         (*ATMProcs.disposePermBlendedFont)(fondID) 
  376. #endif
  377.             : ATM_WRONG_VERSION;
  378. }
  379.  
  380. ATMErr getTempBlendedFontFileIDATM(short *fileID)
  381. {
  382.     if (!ATMOpen)
  383.         return ATM_NOT_ON;
  384.     return ATMOpenVersion >= ATMProcs5Version ? 
  385. #if CALL_PASCAL
  386.         CallPascalW(fileID, ATMProcs.getTempBlendedFontFileID) 
  387. #else
  388.         (*ATMProcs.getTempBlendedFontFileID)(fileID) 
  389. #endif
  390.             : ATM_WRONG_VERSION;
  391. }
  392.  
  393. ATMErr getNumAxesATM(short *numAxes)
  394. {
  395.     if (!ATMOpen)
  396.         return ATM_NOT_ON;
  397.     *numAxes = 0;
  398.     return ATMOpenVersion >= ATMProcs5Version ? 
  399. #if CALL_PASCAL
  400.         CallPascalW(numAxes, ATMProcs.getNumAxes)
  401. #else
  402.         (*ATMProcs.getNumAxes)(numAxes) 
  403. #endif
  404.             : ATM_WRONG_VERSION;
  405. }
  406.  
  407. ATMErr getNumMastersATM(short *numMasters)
  408. {
  409.     if (!ATMOpen)
  410.         return ATM_NOT_ON;
  411.     *numMasters = 0;
  412.     return ATMOpenVersion >= ATMProcs5Version ? 
  413. #if CALL_PASCAL
  414.         CallPascalW(numMasters, ATMProcs.getNumMasters)
  415. #else
  416.         (*ATMProcs.getNumMasters)(numMasters)
  417. #endif
  418.             : ATM_WRONG_VERSION;
  419. }
  420.  
  421. ATMErr getMasterFONDATM(short i, short *masterFOND)
  422. {
  423.     if (!ATMOpen)
  424.         return ATM_NOT_ON;
  425.     return ATMOpenVersion >= ATMProcs5Version ? 
  426. #if CALL_PASCAL
  427.         CallPascalW(i, masterFOND, ATMProcs.getMasterFOND) 
  428. #else
  429.         (*ATMProcs.getMasterFOND)(i, masterFOND) 
  430. #endif
  431.             : 0;
  432. }
  433.  
  434. ATMErr copyFitATM(short method, Fixed TargetWidth, Fixed *beginCoords,
  435.                     Fixed *baseWidths, Fixed *resultWidth, Fixed *resultCoords)
  436. {
  437.     if (!ATMOpen)
  438.         return ATM_NOT_ON;
  439.     return ATMOpenVersion >= ATMProcs5Version ? 
  440. #if CALL_PASCAL
  441.         CallPascalW(method, TargetWidth, beginCoords, baseWidths, resultWidth, resultCoords,
  442.                         ATMProcs.copyFit) 
  443. #else
  444.         (*ATMProcs.copyFit)(method, TargetWidth, beginCoords, baseWidths, resultWidth, resultCoords) 
  445. #endif
  446.             : ATM_WRONG_VERSION;
  447. }
  448.  
  449. ATMErr showTextDesignATM(StringPtr fontFamily, Byte *text, short len, ATMFixedMatrix *matrix,
  450.                 Fixed *coords, Fixed *displacements, short *lenDisplayed)
  451. {
  452.     if (!ATMOpen)
  453.         return ATM_NOT_ON;
  454.     return ATMOpenVersion >= ATMProcs5Version ? 
  455. #if CALL_PASCAL
  456.         CallPascalW(fontFamily, text, len, matrix, coords, displacements, lenDisplayed,
  457.                         ATMProcs.showTextDesign) 
  458. #else
  459.         (*ATMProcs.showTextDesign)(fontFamily, text, len, matrix, coords, displacements, lenDisplayed) 
  460. #endif
  461.             : ATM_WRONG_VERSION;
  462. }
  463.  
  464. ATMErr getAxisBlendInfoATM(short axis, short *userMin, short *userMax, StringPtr axisType,
  465.                     StringPtr axisLabel, StringPtr axisShortLabel)
  466. {
  467.     if (!ATMOpen)
  468.         return ATM_NOT_ON;
  469.     return ATMOpenVersion >= ATMProcs5Version ? 
  470. #if CALL_PASCAL
  471.         CallPascalW(axis, userMin, userMax, axisType, axisLabel, axisShortLabel,
  472.                         ATMProcs.getAxisBlendInfo) 
  473. #else
  474.         (*ATMProcs.getAxisBlendInfo)(axis, userMin, userMax, axisType, axisLabel, axisShortLabel) 
  475. #endif
  476.             : ATM_WRONG_VERSION;
  477. }
  478.  
  479. ATMErr getFontSpecsATM(FontSpecs *specs)
  480. {
  481.     if (!ATMOpen)
  482.         return ATM_NOT_ON;
  483.     return ATMOpenVersion >= ATMProcs5Version ? 
  484. #if CALL_PASCAL
  485.         CallPascalW(specs, ATMProcs.getFontSpecs) 
  486. #else
  487.         (*ATMProcs.getFontSpecs)(specs) 
  488. #endif
  489.             : ATM_WRONG_VERSION;
  490. }
  491.  
  492. ATMErr fontFitATM(Fixed *origCoords, short numTargets, short *varyAxes,
  493.                 Fixed *targetMetrics, Fixed **masterMetrics,
  494.                 Fixed *retCoords, Fixed *retWeightVector)
  495. {
  496.     if (!ATMOpen)
  497.         return ATM_NOT_ON;
  498.     return ATMOpenVersion >= ATMProcs5Version ? 
  499. #if CALL_PASCAL
  500.         CallPascalW(origCoords, numTargets, varyAxes, targetMetrics,
  501.             masterMetrics, retCoords, retWeightVector,
  502.                         ATMProcs.fontFit) 
  503. #else
  504.         (*ATMProcs.fontFit)(origCoords, numTargets, varyAxes, targetMetrics,
  505.             masterMetrics, retCoords, retWeightVector) 
  506. #endif
  507.             : ATM_WRONG_VERSION;
  508. }
  509.  
  510. ATMErr        getNumBlessedFontsATM(short *numBlessedFonts)
  511. {
  512.     if (!ATMOpen)
  513.         return ATM_NOT_ON;
  514.     return ATMOpenVersion >= ATMProcs5Version ? 
  515. #if CALL_PASCAL
  516.         CallPascalW(numBlessedFonts, ATMProcs.getNumBlessedFonts) 
  517. #else
  518.         (*ATMProcs.getNumBlessedFonts)(numBlessedFonts) 
  519. #endif
  520.             : ATM_WRONG_VERSION;
  521. }
  522.  
  523. ATMErr        getBlessedFontNameATM(short i, StringPtr blessedFontName, Fixed *coords)
  524. {
  525.     if (!ATMOpen)
  526.         return ATM_NOT_ON;
  527.     return ATMOpenVersion >= ATMProcs5Version ? 
  528. #if CALL_PASCAL
  529.         CallPascalW(i, blessedFontName, coords, ATMProcs.getBlessedFontName) 
  530. #else
  531.         (*ATMProcs.getBlessedFontName)(i, blessedFontName, coords) 
  532. #endif
  533.             : ATM_WRONG_VERSION;
  534. }
  535.  
  536. ATMErr        getRegularBlessedFontATM(short *regularID)
  537. {
  538.     if (!ATMOpen)
  539.         return ATM_NOT_ON;
  540.     return ATMOpenVersion >= ATMProcs5Version ? 
  541. #if CALL_PASCAL
  542.         CallPascalW(regularID, ATMProcs.getRegularBlessedFont) 
  543. #else
  544.         (*ATMProcs.getRegularBlessedFont)(regularID) 
  545. #endif
  546.             : ATM_WRONG_VERSION;
  547. }
  548.  
  549. ATMErr        flushCacheATM(void)
  550. {
  551.     if (!ATMOpen)
  552.         return ATM_NOT_ON;
  553.     return ATMOpenVersion >= ATMProcs5Version ? 
  554. #if CALL_PASCAL
  555.         CallPascalW(ATMProcs.flushCache) 
  556. #else
  557.         (*ATMProcs.flushCache)() 
  558. #endif
  559.             : ATM_WRONG_VERSION;
  560. }
  561.  
  562. ATMErr        getFontFamilyFONDATM(StringPtr familyName, short *retFondID)
  563. {
  564.     if (!ATMOpen)
  565.         return ATM_NOT_ON;
  566.     return ATMOpenVersion >= ATMProcs5Version ? 
  567. #if CALL_PASCAL
  568.         CallPascalW(familyName, retFondID, ATMProcs.getFontFamilyFOND) 
  569. #else
  570.         (*ATMProcs.getFontFamilyFOND)(familyName, retFondID) 
  571. #endif
  572.             : ATM_WRONG_VERSION;
  573. }
  574.  
  575. ATMErr        MMFontPickerATM(struct MMFP_Parms *parms, struct MMFP_Reply *reply)
  576. {
  577.     if (!ATMOpen)
  578.         return ATM_NOT_ON;
  579.     return ATMOpenVersion >= ATMProcs5Version ? 
  580. #if CALL_PASCAL
  581.         CallPascalW(parms, reply, ATMProcs.MMFontPicker) 
  582. #else
  583.         (*ATMProcs.MMFontPicker)(parms, reply) 
  584. #endif
  585.             : ATM_WRONG_VERSION;
  586. }
  587.  
  588. Boolean isSubstFontATM(StringPtr fontName, short fondID, short style, FontSpecs ***fontSpecs, Handle *chamName)
  589. {
  590.     if (!ATMOpen)
  591.         return FALSE;
  592.     return ATMOpenVersion >= ATMProcs8Version ? 
  593. #if CALL_PASCAL
  594.         CallPascalB(fontName, fondID, style, fontSpecs, chamName, ATMProcs.isSubstFont)
  595. #else
  596.         (*ATMProcs.isSubstFont)(fontName, fondID, style, fontSpecs, chamName) 
  597. #endif
  598.          : FALSE;
  599. }
  600.  
  601. ATMErr getPSNumATM(StringPtr psName, short *retFondID, Boolean doCreate)
  602. {
  603.     if (!ATMOpen)
  604.         return ATM_NOT_ON;
  605.     return ATMOpenVersion >= ATMProcs8Version ?
  606. #if CALL_PASCAL
  607.         CallPascalW(psName, retFondID, doCreate, ATMProcs.getPSNum) 
  608. #else
  609.         (*ATMProcs.getPSNum)(psName, retFondID, doCreate) 
  610. #endif
  611.             : ATM_WRONG_VERSION;
  612. }
  613.