Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1164 lines
33 KiB

  1. /*
  2. File: Fonts.h
  3. Contains: Public interface to the Font Manager.
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __FONTS__
  11. #define __FONTS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __FILES__
  16. #include <Files.h>
  17. #endif
  18. #ifndef __MACERRORS__
  19. #include <MacErrors.h>
  20. #endif
  21. #ifndef __TEXTCOMMON__
  22. #include <TextCommon.h>
  23. #endif
  24. #ifndef __ATSTYPES__
  25. #include <ATSTypes.h>
  26. #endif
  27. #ifndef __QUICKDRAW__
  28. #include <Quickdraw.h>
  29. #endif
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #if PRAGMA_IMPORT
  37. #pragma import on
  38. #endif
  39. #if PRAGMA_STRUCT_ALIGN
  40. #pragma options align=mac68k
  41. #elif PRAGMA_STRUCT_PACKPUSH
  42. #pragma pack(push, 2)
  43. #elif PRAGMA_STRUCT_PACK
  44. #pragma pack(2)
  45. #endif
  46. enum {
  47. systemFont = 0,
  48. applFont = 1
  49. };
  50. enum {
  51. kFMDefaultOptions = kNilOptions
  52. };
  53. /* Activation contexts */
  54. enum {
  55. kFMDefaultActivationContext = kFMDefaultOptions,
  56. kFMGlobalActivationContext = 0x00000001,
  57. kFMLocalActivationContext = kFMDefaultActivationContext
  58. };
  59. /* Iteration scopes */
  60. enum {
  61. kFMDefaultIterationScope = kFMDefaultOptions,
  62. kFMGlobalIterationScope = 0x00000001,
  63. kFMLocalIterationScope = kFMDefaultIterationScope
  64. };
  65. /* kPlatformDefaultGuiFontID is used in QuickTime 3.0. */
  66. #if TARGET_OS_MAC
  67. enum {
  68. kPlatformDefaultGuiFontID = applFont
  69. };
  70. #else
  71. enum {
  72. kPlatformDefaultGuiFontID = -1
  73. };
  74. #endif /* TARGET_OS_MAC */
  75. enum {
  76. commandMark = 17,
  77. checkMark = 18,
  78. diamondMark = 19,
  79. appleMark = 20
  80. };
  81. enum {
  82. propFont = 36864L,
  83. prpFntH = 36865L,
  84. prpFntW = 36866L,
  85. prpFntHW = 36867L,
  86. fixedFont = 45056L,
  87. fxdFntH = 45057L,
  88. fxdFntW = 45058L,
  89. fxdFntHW = 45059L,
  90. fontWid = 44208L
  91. };
  92. struct FMInput {
  93. short family;
  94. short size;
  95. Style face;
  96. Boolean needBits;
  97. short device;
  98. Point numer;
  99. Point denom;
  100. };
  101. typedef struct FMInput FMInput;
  102. struct FMOutput {
  103. short errNum;
  104. Handle fontHandle;
  105. UInt8 boldPixels;
  106. UInt8 italicPixels;
  107. UInt8 ulOffset;
  108. UInt8 ulShadow;
  109. UInt8 ulThick;
  110. UInt8 shadowPixels;
  111. SInt8 extra;
  112. UInt8 ascent;
  113. UInt8 descent;
  114. UInt8 widMax;
  115. SInt8 leading;
  116. SInt8 curStyle;
  117. Point numer;
  118. Point denom;
  119. };
  120. typedef struct FMOutput FMOutput;
  121. typedef FMOutput * FMOutputPtr;
  122. typedef FMOutputPtr FMOutPtr;
  123. struct FMetricRec {
  124. Fixed ascent; /*base line to top*/
  125. Fixed descent; /*base line to bottom*/
  126. Fixed leading; /*leading between lines*/
  127. Fixed widMax; /*maximum character width*/
  128. Handle wTabHandle; /*handle to font width table*/
  129. };
  130. typedef struct FMetricRec FMetricRec;
  131. typedef FMetricRec * FMetricRecPtr;
  132. typedef FMetricRecPtr * FMetricRecHandle;
  133. #if CALL_NOT_IN_CARBON
  134. /*
  135. * InitFonts()
  136. *
  137. * Availability:
  138. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  139. * CarbonLib: not available
  140. * Mac OS X: not available
  141. */
  142. EXTERN_API( void )
  143. InitFonts(void) ONEWORDINLINE(0xA8FE);
  144. #endif /* CALL_NOT_IN_CARBON */
  145. /*
  146. * GetFontName()
  147. *
  148. * Availability:
  149. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  150. * CarbonLib: in CarbonLib 1.0 and later
  151. * Mac OS X: in version 10.0 and later
  152. */
  153. EXTERN_API( void )
  154. GetFontName(
  155. short familyID,
  156. Str255 name) ONEWORDINLINE(0xA8FF);
  157. /*
  158. * GetFNum()
  159. *
  160. * Availability:
  161. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  162. * CarbonLib: in CarbonLib 1.0 and later
  163. * Mac OS X: in version 10.0 and later
  164. */
  165. EXTERN_API( void )
  166. GetFNum(
  167. ConstStr255Param name,
  168. short * familyID) ONEWORDINLINE(0xA900);
  169. /*
  170. * RealFont()
  171. *
  172. * Availability:
  173. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  174. * CarbonLib: in CarbonLib 1.0 and later
  175. * Mac OS X: in version 10.0 and later
  176. */
  177. EXTERN_API( Boolean )
  178. RealFont(
  179. short fontNum,
  180. short size) ONEWORDINLINE(0xA902);
  181. #if CALL_NOT_IN_CARBON
  182. /*
  183. * SetFontLock()
  184. *
  185. * Availability:
  186. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  187. * CarbonLib: not available
  188. * Mac OS X: not available
  189. */
  190. EXTERN_API( void )
  191. SetFontLock(Boolean lockFlag) ONEWORDINLINE(0xA903);
  192. #endif /* CALL_NOT_IN_CARBON */
  193. /*
  194. * FMSwapFont()
  195. *
  196. * Availability:
  197. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  198. * CarbonLib: in CarbonLib 1.0 and later
  199. * Mac OS X: in version 10.0 and later
  200. */
  201. EXTERN_API( FMOutPtr )
  202. FMSwapFont(const FMInput * inRec) ONEWORDINLINE(0xA901);
  203. /*
  204. * SetFScaleDisable()
  205. *
  206. * Availability:
  207. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  208. * CarbonLib: in CarbonLib 1.0 and later
  209. * Mac OS X: in version 10.0 and later
  210. */
  211. EXTERN_API( void )
  212. SetFScaleDisable(Boolean fscaleDisable) ONEWORDINLINE(0xA834);
  213. /*
  214. * FontMetrics()
  215. *
  216. * Availability:
  217. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  218. * CarbonLib: in CarbonLib 1.0 and later
  219. * Mac OS X: in version 10.0 and later
  220. */
  221. EXTERN_API( void )
  222. FontMetrics(FMetricRecPtr theMetrics) ONEWORDINLINE(0xA835);
  223. /*
  224. * SetFractEnable()
  225. *
  226. * Availability:
  227. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  228. * CarbonLib: in CarbonLib 1.0 and later
  229. * Mac OS X: in version 10.0 and later
  230. */
  231. EXTERN_API( void )
  232. SetFractEnable(Boolean fractEnable) ONEWORDINLINE(0xA814);
  233. /*
  234. * GetDefFontSize()
  235. *
  236. * Availability:
  237. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  238. * CarbonLib: in CarbonLib 1.0 and later
  239. * Mac OS X: in version 10.0 and later
  240. */
  241. EXTERN_API( short )
  242. GetDefFontSize(void) FIVEWORDINLINE(0x3EB8, 0x0BA8, 0x6604, 0x3EBC, 0x000C);
  243. /*
  244. * IsOutline()
  245. *
  246. * Availability:
  247. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  248. * CarbonLib: in CarbonLib 1.0 and later
  249. * Mac OS X: in version 10.0 and later
  250. */
  251. EXTERN_API( Boolean )
  252. IsOutline(
  253. Point numer,
  254. Point denom) TWOWORDINLINE(0x7000, 0xA854);
  255. /*
  256. * SetOutlinePreferred()
  257. *
  258. * Availability:
  259. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  260. * CarbonLib: in CarbonLib 1.0 and later
  261. * Mac OS X: in version 10.0 and later
  262. */
  263. EXTERN_API( void )
  264. SetOutlinePreferred(Boolean outlinePreferred) TWOWORDINLINE(0x7001, 0xA854);
  265. /*
  266. * GetOutlinePreferred()
  267. *
  268. * Availability:
  269. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  270. * CarbonLib: in CarbonLib 1.0 and later
  271. * Mac OS X: in version 10.0 and later
  272. */
  273. EXTERN_API( Boolean )
  274. GetOutlinePreferred(void) TWOWORDINLINE(0x7009, 0xA854);
  275. /*
  276. * OutlineMetrics()
  277. *
  278. * Availability:
  279. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  280. * CarbonLib: in CarbonLib 1.0 and later
  281. * Mac OS X: in version 10.0 and later
  282. */
  283. EXTERN_API( OSErr )
  284. OutlineMetrics(
  285. short byteCount,
  286. const void * textPtr,
  287. Point numer,
  288. Point denom,
  289. short * yMax,
  290. short * yMin,
  291. FixedPtr awArray,
  292. FixedPtr lsbArray,
  293. RectPtr boundsArray) TWOWORDINLINE(0x7008, 0xA854);
  294. /*
  295. * SetPreserveGlyph()
  296. *
  297. * Availability:
  298. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  299. * CarbonLib: in CarbonLib 1.0 and later
  300. * Mac OS X: in version 10.0 and later
  301. */
  302. EXTERN_API( void )
  303. SetPreserveGlyph(Boolean preserveGlyph) TWOWORDINLINE(0x700A, 0xA854);
  304. /*
  305. * GetPreserveGlyph()
  306. *
  307. * Availability:
  308. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  309. * CarbonLib: in CarbonLib 1.0 and later
  310. * Mac OS X: in version 10.0 and later
  311. */
  312. EXTERN_API( Boolean )
  313. GetPreserveGlyph(void) TWOWORDINLINE(0x700B, 0xA854);
  314. #if CALL_NOT_IN_CARBON
  315. /*
  316. * FlushFonts()
  317. *
  318. * Availability:
  319. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  320. * CarbonLib: not available
  321. * Mac OS X: not available
  322. */
  323. EXTERN_API( OSErr )
  324. FlushFonts(void) TWOWORDINLINE(0x700C, 0xA854);
  325. #endif /* CALL_NOT_IN_CARBON */
  326. #if CALL_NOT_IN_CARBON
  327. /*
  328. * getfnum()
  329. *
  330. * Availability:
  331. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  332. * CarbonLib: not available
  333. * Mac OS X: not available
  334. */
  335. EXTERN_API_C( void )
  336. getfnum(
  337. const char * theName,
  338. short * familyID);
  339. /*
  340. * getfontname()
  341. *
  342. * Availability:
  343. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  344. * CarbonLib: not available
  345. * Mac OS X: not available
  346. */
  347. EXTERN_API_C( void )
  348. getfontname(
  349. short familyID,
  350. char * theName);
  351. #endif /* CALL_NOT_IN_CARBON */
  352. /*
  353. * GetSysFont()
  354. *
  355. * Availability:
  356. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  357. * CarbonLib: in CarbonLib 1.0 and later
  358. * Mac OS X: in version 10.0 and later
  359. */
  360. EXTERN_API( short )
  361. GetSysFont(void) TWOWORDINLINE(0x3EB8, 0x0BA6);
  362. /*
  363. * GetAppFont()
  364. *
  365. * Availability:
  366. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  367. * CarbonLib: in CarbonLib 1.0 and later
  368. * Mac OS X: in version 10.0 and later
  369. */
  370. EXTERN_API( short )
  371. GetAppFont(void) TWOWORDINLINE(0x3EB8, 0x0984);
  372. /*--------------------------------------------------------------------------------------*/
  373. /* Extended font data functions (available only with Mac OS 8.5 or later) */
  374. /*--------------------------------------------------------------------------------------*/
  375. /*
  376. * SetAntiAliasedTextEnabled()
  377. *
  378. * Availability:
  379. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  380. * CarbonLib: in CarbonLib 1.0 and later
  381. * Mac OS X: in version 10.0 and later
  382. */
  383. EXTERN_API( OSStatus )
  384. SetAntiAliasedTextEnabled(
  385. Boolean iEnable,
  386. SInt16 iMinFontSize) TWOWORDINLINE(0x7011, 0xA854);
  387. /*
  388. * IsAntiAliasedTextEnabled()
  389. *
  390. * Availability:
  391. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  392. * CarbonLib: in CarbonLib 1.0 and later
  393. * Mac OS X: in version 10.0 and later
  394. */
  395. EXTERN_API( Boolean )
  396. IsAntiAliasedTextEnabled(SInt16 * oMinFontSize) TWOWORDINLINE(0x7012, 0xA854);
  397. /*
  398. * QDTextBounds()
  399. *
  400. * Availability:
  401. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  402. * CarbonLib: in CarbonLib 1.0 and later
  403. * Mac OS X: in version 10.0 and later
  404. */
  405. EXTERN_API( void )
  406. QDTextBounds(
  407. short byteCount,
  408. const void * textAddr,
  409. Rect * bounds) TWOWORDINLINE(0x7013, 0xA854);
  410. /*
  411. * FetchFontInfo()
  412. *
  413. * Availability:
  414. * Non-Carbon CFM: in InterfaceLib 8.6 and later
  415. * CarbonLib: in CarbonLib 1.0 and later
  416. * Mac OS X: in version 10.0 and later
  417. */
  418. EXTERN_API( OSErr )
  419. FetchFontInfo(
  420. SInt16 fontID,
  421. SInt16 fontSize,
  422. SInt16 fontStyle,
  423. FontInfo * info) TWOWORDINLINE(0x7014, 0xA854);
  424. /*--------------------------------------------------------------------------------------*/
  425. /* Font access and data management functions (available only with Mac OS 9.0 or later) */
  426. /*--------------------------------------------------------------------------------------*/
  427. /* Enumeration */
  428. /*
  429. * FMCreateFontFamilyIterator()
  430. *
  431. * Availability:
  432. * Non-Carbon CFM: in FontManager 9.0 and later
  433. * CarbonLib: in CarbonLib 1.0 and later
  434. * Mac OS X: in version 10.0 and later
  435. */
  436. EXTERN_API_C( OSStatus )
  437. FMCreateFontFamilyIterator(
  438. const FMFilter * iFilter, /* can be NULL */
  439. void * iRefCon,
  440. OptionBits iOptions,
  441. FMFontFamilyIterator * ioIterator);
  442. /*
  443. * FMDisposeFontFamilyIterator()
  444. *
  445. * Availability:
  446. * Non-Carbon CFM: in FontManager 9.0 and later
  447. * CarbonLib: in CarbonLib 1.0 and later
  448. * Mac OS X: in version 10.0 and later
  449. */
  450. EXTERN_API_C( OSStatus )
  451. FMDisposeFontFamilyIterator(FMFontFamilyIterator * ioIterator);
  452. /*
  453. * FMResetFontFamilyIterator()
  454. *
  455. * Availability:
  456. * Non-Carbon CFM: in FontManager 9.0 and later
  457. * CarbonLib: in CarbonLib 1.0 and later
  458. * Mac OS X: in version 10.0 and later
  459. */
  460. EXTERN_API_C( OSStatus )
  461. FMResetFontFamilyIterator(
  462. const FMFilter * iFilter, /* can be NULL */
  463. void * iRefCon,
  464. OptionBits iOptions,
  465. FMFontFamilyIterator * ioIterator);
  466. /*
  467. * FMGetNextFontFamily()
  468. *
  469. * Availability:
  470. * Non-Carbon CFM: in FontManager 9.0 and later
  471. * CarbonLib: in CarbonLib 1.0 and later
  472. * Mac OS X: in version 10.0 and later
  473. */
  474. EXTERN_API_C( OSStatus )
  475. FMGetNextFontFamily(
  476. FMFontFamilyIterator * ioIterator,
  477. FMFontFamily * oFontFamily);
  478. /*
  479. * FMCreateFontIterator()
  480. *
  481. * Availability:
  482. * Non-Carbon CFM: in FontManager 9.0 and later
  483. * CarbonLib: in CarbonLib 1.0 and later
  484. * Mac OS X: in version 10.0 and later
  485. */
  486. EXTERN_API_C( OSStatus )
  487. FMCreateFontIterator(
  488. const FMFilter * iFilter, /* can be NULL */
  489. void * iRefCon,
  490. OptionBits iOptions,
  491. FMFontIterator * ioIterator);
  492. /*
  493. * FMDisposeFontIterator()
  494. *
  495. * Availability:
  496. * Non-Carbon CFM: in FontManager 9.0 and later
  497. * CarbonLib: in CarbonLib 1.0 and later
  498. * Mac OS X: in version 10.0 and later
  499. */
  500. EXTERN_API_C( OSStatus )
  501. FMDisposeFontIterator(FMFontIterator * ioIterator);
  502. /*
  503. * FMResetFontIterator()
  504. *
  505. * Availability:
  506. * Non-Carbon CFM: in FontManager 9.0 and later
  507. * CarbonLib: in CarbonLib 1.0 and later
  508. * Mac OS X: in version 10.0 and later
  509. */
  510. EXTERN_API_C( OSStatus )
  511. FMResetFontIterator(
  512. const FMFilter * iFilter, /* can be NULL */
  513. void * iRefCon,
  514. OptionBits iOptions,
  515. FMFontIterator * ioIterator);
  516. /*
  517. * FMGetNextFont()
  518. *
  519. * Availability:
  520. * Non-Carbon CFM: in FontManager 9.0 and later
  521. * CarbonLib: in CarbonLib 1.0 and later
  522. * Mac OS X: in version 10.0 and later
  523. */
  524. EXTERN_API_C( OSStatus )
  525. FMGetNextFont(
  526. FMFontIterator * ioIterator,
  527. FMFont * oFont);
  528. /* Font families */
  529. /*
  530. * FMCreateFontFamilyInstanceIterator()
  531. *
  532. * Availability:
  533. * Non-Carbon CFM: in FontManager 9.0 and later
  534. * CarbonLib: in CarbonLib 1.0 and later
  535. * Mac OS X: in version 10.0 and later
  536. */
  537. EXTERN_API_C( OSStatus )
  538. FMCreateFontFamilyInstanceIterator(
  539. FMFontFamily iFontFamily,
  540. FMFontFamilyInstanceIterator * ioIterator);
  541. /*
  542. * FMDisposeFontFamilyInstanceIterator()
  543. *
  544. * Availability:
  545. * Non-Carbon CFM: in FontManager 9.0 and later
  546. * CarbonLib: in CarbonLib 1.0 and later
  547. * Mac OS X: in version 10.0 and later
  548. */
  549. EXTERN_API_C( OSStatus )
  550. FMDisposeFontFamilyInstanceIterator(FMFontFamilyInstanceIterator * ioIterator);
  551. /*
  552. * FMResetFontFamilyInstanceIterator()
  553. *
  554. * Availability:
  555. * Non-Carbon CFM: in FontManager 9.0 and later
  556. * CarbonLib: in CarbonLib 1.0 and later
  557. * Mac OS X: in version 10.0 and later
  558. */
  559. EXTERN_API_C( OSStatus )
  560. FMResetFontFamilyInstanceIterator(
  561. FMFontFamily iFontFamily,
  562. FMFontFamilyInstanceIterator * ioIterator);
  563. /*
  564. * FMGetNextFontFamilyInstance()
  565. *
  566. * Availability:
  567. * Non-Carbon CFM: in FontManager 9.0 and later
  568. * CarbonLib: in CarbonLib 1.0 and later
  569. * Mac OS X: in version 10.0 and later
  570. */
  571. EXTERN_API_C( OSStatus )
  572. FMGetNextFontFamilyInstance(
  573. FMFontFamilyInstanceIterator * ioIterator,
  574. FMFont * oFont,
  575. FMFontStyle * oStyle, /* can be NULL */
  576. FMFontSize * oSize); /* can be NULL */
  577. /*
  578. * FMGetFontFamilyFromName()
  579. *
  580. * Availability:
  581. * Non-Carbon CFM: in FontManager 9.0 and later
  582. * CarbonLib: in CarbonLib 1.0 and later
  583. * Mac OS X: in version 10.0 and later
  584. */
  585. EXTERN_API_C( FMFontFamily )
  586. FMGetFontFamilyFromName(ConstStr255Param iName);
  587. /*
  588. * FMGetFontFamilyName()
  589. *
  590. * Availability:
  591. * Non-Carbon CFM: in FontManager 9.0 and later
  592. * CarbonLib: in CarbonLib 1.0 and later
  593. * Mac OS X: in version 10.0 and later
  594. */
  595. EXTERN_API_C( OSStatus )
  596. FMGetFontFamilyName(
  597. FMFontFamily iFontFamily,
  598. Str255 oName);
  599. /*
  600. * FMGetFontFamilyTextEncoding()
  601. *
  602. * Availability:
  603. * Non-Carbon CFM: in FontManager 9.0 and later
  604. * CarbonLib: in CarbonLib 1.0 and later
  605. * Mac OS X: in version 10.0 and later
  606. */
  607. EXTERN_API_C( OSStatus )
  608. FMGetFontFamilyTextEncoding(
  609. FMFontFamily iFontFamily,
  610. TextEncoding * oTextEncoding);
  611. /*
  612. * FMGetFontFamilyGeneration()
  613. *
  614. * Availability:
  615. * Non-Carbon CFM: in FontManager 9.0 and later
  616. * CarbonLib: in CarbonLib 1.0 and later
  617. * Mac OS X: in version 10.0 and later
  618. */
  619. EXTERN_API_C( OSStatus )
  620. FMGetFontFamilyGeneration(
  621. FMFontFamily iFontFamily,
  622. FMGeneration * oGeneration);
  623. /* Fonts */
  624. /*
  625. * FMGetFontFormat()
  626. *
  627. * Availability:
  628. * Non-Carbon CFM: in FontManager 9.0 and later
  629. * CarbonLib: in CarbonLib 1.0 and later
  630. * Mac OS X: in version 10.0 and later
  631. */
  632. EXTERN_API_C( OSStatus )
  633. FMGetFontFormat(
  634. FMFont iFont,
  635. FourCharCode * oFormat);
  636. /*
  637. * FMGetFontTableDirectory()
  638. *
  639. * Availability:
  640. * Non-Carbon CFM: in FontManager 9.0 and later
  641. * CarbonLib: in CarbonLib 1.0 and later
  642. * Mac OS X: in version 10.0 and later
  643. */
  644. EXTERN_API_C( OSStatus )
  645. FMGetFontTableDirectory(
  646. FMFont iFont,
  647. ByteCount iLength,
  648. void * iBuffer,
  649. ByteCount * oActualLength); /* can be NULL */
  650. /*
  651. * FMGetFontTable()
  652. *
  653. * Availability:
  654. * Non-Carbon CFM: in FontManager 9.0 and later
  655. * CarbonLib: in CarbonLib 1.0 and later
  656. * Mac OS X: in version 10.0 and later
  657. */
  658. EXTERN_API_C( OSStatus )
  659. FMGetFontTable(
  660. FMFont iFont,
  661. FourCharCode iTag,
  662. ByteOffset iOffset,
  663. ByteCount iLength,
  664. void * iBuffer,
  665. ByteCount * oActualLength); /* can be NULL */
  666. /*
  667. * FMGetFontGeneration()
  668. *
  669. * Availability:
  670. * Non-Carbon CFM: in FontManager 9.0 and later
  671. * CarbonLib: in CarbonLib 1.0 and later
  672. * Mac OS X: in version 10.0 and later
  673. */
  674. EXTERN_API_C( OSStatus )
  675. FMGetFontGeneration(
  676. FMFont iFont,
  677. FMGeneration * oGeneration);
  678. /*
  679. * FMGetFontContainer()
  680. *
  681. * Availability:
  682. * Non-Carbon CFM: in FontManager 9.0 and later
  683. * CarbonLib: in CarbonLib 1.0 and later
  684. * Mac OS X: in version 10.0 and later
  685. */
  686. EXTERN_API_C( OSStatus )
  687. FMGetFontContainer(
  688. FMFont iFont,
  689. FSSpec * oFontContainer);
  690. /* Conversion */
  691. /*
  692. * FMGetFontFromFontFamilyInstance()
  693. *
  694. * Availability:
  695. * Non-Carbon CFM: in FontManager 9.0 and later
  696. * CarbonLib: in CarbonLib 1.0 and later
  697. * Mac OS X: in version 10.0 and later
  698. */
  699. EXTERN_API_C( OSStatus )
  700. FMGetFontFromFontFamilyInstance(
  701. FMFontFamily iFontFamily,
  702. FMFontStyle iStyle,
  703. FMFont * oFont,
  704. FMFontStyle * oIntrinsicStyle); /* can be NULL */
  705. /*
  706. * FMGetFontFamilyInstanceFromFont()
  707. *
  708. * Availability:
  709. * Non-Carbon CFM: in FontManager 9.0 and later
  710. * CarbonLib: in CarbonLib 1.0 and later
  711. * Mac OS X: in version 10.0 and later
  712. */
  713. EXTERN_API_C( OSStatus )
  714. FMGetFontFamilyInstanceFromFont(
  715. FMFont iFont,
  716. FMFontFamily * oFontFamily,
  717. FMFontStyle * oStyle);
  718. /*
  719. * FMGetATSFontRefFromFont()
  720. *
  721. * Availability:
  722. * Non-Carbon CFM: not available
  723. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  724. * Mac OS X: in version 10.1 and later
  725. */
  726. EXTERN_API_C( ATSFontRef )
  727. FMGetATSFontRefFromFont(FMFont iFont);
  728. /*
  729. * FMGetATSFontFamilyRefFromFontFamily()
  730. *
  731. * Availability:
  732. * Non-Carbon CFM: not available
  733. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  734. * Mac OS X: in version 10.1 and later
  735. */
  736. EXTERN_API_C( ATSFontFamilyRef )
  737. FMGetATSFontFamilyRefFromFontFamily(FMFontFamily iFamily);
  738. /*
  739. * FMGetFontFromATSFontRef()
  740. *
  741. * Availability:
  742. * Non-Carbon CFM: not available
  743. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  744. * Mac OS X: in version 10.1 and later
  745. */
  746. EXTERN_API_C( FMFont )
  747. FMGetFontFromATSFontRef(ATSFontRef iFont);
  748. /*
  749. * FMGetFontFamilyFromATSFontFamilyRef()
  750. *
  751. * Availability:
  752. * Non-Carbon CFM: not available
  753. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  754. * Mac OS X: in version 10.1 and later
  755. */
  756. EXTERN_API_C( FMFontFamily )
  757. FMGetFontFamilyFromATSFontFamilyRef(ATSFontFamilyRef iFamily);
  758. /* Activation */
  759. /*
  760. * FMActivateFonts()
  761. *
  762. * Availability:
  763. * Non-Carbon CFM: in FontManager 9.0 and later
  764. * CarbonLib: in CarbonLib 1.0 and later
  765. * Mac OS X: in version 10.0 and later
  766. */
  767. EXTERN_API_C( OSStatus )
  768. FMActivateFonts(
  769. const FSSpec * iFontContainer,
  770. const FMFilter * iFilter, /* can be NULL */
  771. void * iRefCon,
  772. OptionBits iOptions);
  773. /*
  774. * FMDeactivateFonts()
  775. *
  776. * Availability:
  777. * Non-Carbon CFM: in FontManager 9.0 and later
  778. * CarbonLib: in CarbonLib 1.0 and later
  779. * Mac OS X: in version 10.0 and later
  780. */
  781. EXTERN_API_C( OSStatus )
  782. FMDeactivateFonts(
  783. const FSSpec * iFontContainer,
  784. const FMFilter * iFilter, /* can be NULL */
  785. void * iRefCon,
  786. OptionBits iOptions);
  787. /*
  788. * FMGetGeneration()
  789. *
  790. * Availability:
  791. * Non-Carbon CFM: in FontManager 9.0 and later
  792. * CarbonLib: in CarbonLib 1.0 and later
  793. * Mac OS X: in version 10.0 and later
  794. */
  795. EXTERN_API_C( FMGeneration )
  796. FMGetGeneration(void);
  797. /* Container Access */
  798. /*
  799. * FMGetFontContainerFromFontFamilyInstance()
  800. *
  801. * Availability:
  802. * Non-Carbon CFM: not available
  803. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  804. * Mac OS X: in version 10.1 and later
  805. */
  806. EXTERN_API_C( OSStatus )
  807. FMGetFontContainerFromFontFamilyInstance(
  808. FMFontFamily iFontFamily,
  809. FMFontStyle iStyle,
  810. FMFontSize iFontSize,
  811. FSSpec * oFontContainer);
  812. /*
  813. * FMGetFontFamilyResource()
  814. *
  815. * Availability:
  816. * Non-Carbon CFM: not available
  817. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
  818. * Mac OS X: in version 10.1 and later
  819. */
  820. EXTERN_API_C( OSStatus )
  821. FMGetFontFamilyResource(
  822. FMFontFamily iFontFamily,
  823. FMFontStyle iFontStyle,
  824. FMFontSize iFontSize,
  825. ByteCount iBufferSize,
  826. void * ioBuffer,
  827. ByteCount * oSize); /* can be NULL */
  828. typedef FMFontFamily FontFamilyID;
  829. typedef FMFontSize FontPointSize;
  830. /*--------------------------------------------------------------------------------------*/
  831. /* Deprecated constant and type definitions */
  832. /*--------------------------------------------------------------------------------------*/
  833. /* The font identifier constants are deprecated; use GetFNum or FMGetFontFamilyFromName
  834. to find a font family from a standard QuickDraw name.
  835. */
  836. enum {
  837. kFMUseGlobalScopeOption = 0x00000001
  838. };
  839. enum {
  840. kFontIDNewYork = 2,
  841. kFontIDGeneva = 3,
  842. kFontIDMonaco = 4,
  843. kFontIDVenice = 5,
  844. kFontIDLondon = 6,
  845. kFontIDAthens = 7,
  846. kFontIDSanFrancisco = 8,
  847. kFontIDToronto = 9,
  848. kFontIDCairo = 11,
  849. kFontIDLosAngeles = 12,
  850. kFontIDTimes = 20,
  851. kFontIDHelvetica = 21,
  852. kFontIDCourier = 22,
  853. kFontIDSymbol = 23,
  854. kFontIDMobile = 24
  855. };
  856. /* The following data structures referenced by the low memory global variables of the
  857. Font Manager are deprecated on Mac OS X and CarbonLib 1.1. The low memory global
  858. variables are not shared between processes and may result in inconsistencies
  859. compared to previous releases of the system software. Changes made to the
  860. information contained in the low memory global variables, including any
  861. indirectly referenced width tables, font family records, and font records, are
  862. not reflected in the global state of the Font Manager and may only be accessed
  863. through the font access and data management functions of the Font Manager or ATS.
  864. */
  865. struct WidEntry {
  866. short widStyle; /*style entry applies to*/
  867. };
  868. typedef struct WidEntry WidEntry;
  869. struct WidTable {
  870. short numWidths; /*number of entries - 1*/
  871. };
  872. typedef struct WidTable WidTable;
  873. struct AsscEntry {
  874. short fontSize;
  875. short fontStyle;
  876. short fontID; /*font resource ID*/
  877. };
  878. typedef struct AsscEntry AsscEntry;
  879. struct FontAssoc {
  880. short numAssoc; /*number of entries - 1*/
  881. };
  882. typedef struct FontAssoc FontAssoc;
  883. struct StyleTable {
  884. short fontClass;
  885. long offset;
  886. long reserved;
  887. char indexes[48];
  888. };
  889. typedef struct StyleTable StyleTable;
  890. struct NameTable {
  891. short stringCount;
  892. Str255 baseFontName;
  893. };
  894. typedef struct NameTable NameTable;
  895. struct KernPair {
  896. char kernFirst; /*1st character of kerned pair*/
  897. char kernSecond; /*2nd character of kerned pair*/
  898. short kernWidth; /*kerning in 1pt fixed format*/
  899. };
  900. typedef struct KernPair KernPair;
  901. struct KernEntry {
  902. short kernStyle; /*style the entry applies to*/
  903. short kernLength; /*length of this entry*/
  904. };
  905. typedef struct KernEntry KernEntry;
  906. struct KernTable {
  907. short numKerns; /*number of kerning entries*/
  908. };
  909. typedef struct KernTable KernTable;
  910. struct WidthTable {
  911. Fixed tabData[256]; /*character widths*/
  912. Handle tabFont; /*font record used to build table*/
  913. long sExtra; /*space extra used for table*/
  914. long style; /*extra due to style*/
  915. short fID; /*font family ID*/
  916. short fSize; /*font size request*/
  917. short face; /*style (face) request*/
  918. short device; /*device requested*/
  919. Point inNumer; /*scale factors requested*/
  920. Point inDenom; /*scale factors requested*/
  921. short aFID; /*actual font family ID for table*/
  922. Handle fHand; /*family record used to build up table*/
  923. Boolean usedFam; /*used fixed point family widths*/
  924. UInt8 aFace; /*actual face produced*/
  925. short vOutput; /*vertical scale output value*/
  926. short hOutput; /*horizontal scale output value*/
  927. short vFactor; /*vertical scale output value*/
  928. short hFactor; /*horizontal scale output value*/
  929. short aSize; /*actual size of actual font used*/
  930. short tabSize; /*total size of table*/
  931. };
  932. typedef struct WidthTable WidthTable;
  933. typedef WidthTable * WidthTablePtr;
  934. typedef WidthTablePtr * WidthTableHdl;
  935. struct FamRec {
  936. short ffFlags; /*flags for family*/
  937. short ffFamID; /*family ID number*/
  938. short ffFirstChar; /*ASCII code of 1st character*/
  939. short ffLastChar; /*ASCII code of last character*/
  940. short ffAscent; /*maximum ascent for 1pt font*/
  941. short ffDescent; /*maximum descent for 1pt font*/
  942. short ffLeading; /*maximum leading for 1pt font*/
  943. short ffWidMax; /*maximum widMax for 1pt font*/
  944. long ffWTabOff; /*offset to width table*/
  945. long ffKernOff; /*offset to kerning table*/
  946. long ffStylOff; /*offset to style mapping table*/
  947. short ffProperty[9]; /*style property info*/
  948. short ffIntl[2]; /*for international use*/
  949. short ffVersion; /*version number*/
  950. };
  951. typedef struct FamRec FamRec;
  952. struct FontRec {
  953. short fontType; /*font type*/
  954. short firstChar; /*ASCII code of first character*/
  955. short lastChar; /*ASCII code of last character*/
  956. short widMax; /*maximum character width*/
  957. short kernMax; /*negative of maximum character kern*/
  958. short nDescent; /*negative of descent*/
  959. short fRectWidth; /*width of font rectangle*/
  960. short fRectHeight; /*height of font rectangle*/
  961. unsigned short owTLoc; /*offset to offset/width table*/
  962. short ascent; /*ascent*/
  963. short descent; /*descent*/
  964. short leading; /*leading*/
  965. short rowWords; /*row width of bit image / 2 */
  966. };
  967. typedef struct FontRec FontRec;
  968. typedef FontRec * FontRecPtr;
  969. typedef FontRecPtr * FontRecHdl;
  970. /*--------------------------------------------------------------------------------------*/
  971. #if OLDROUTINENAMES
  972. enum {
  973. newYork = kFontIDNewYork,
  974. geneva = kFontIDGeneva,
  975. monaco = kFontIDMonaco,
  976. venice = kFontIDVenice,
  977. london = kFontIDLondon,
  978. athens = kFontIDAthens,
  979. sanFran = kFontIDSanFrancisco,
  980. toronto = kFontIDToronto,
  981. cairo = kFontIDCairo,
  982. losAngeles = kFontIDLosAngeles,
  983. times = kFontIDTimes,
  984. helvetica = kFontIDHelvetica,
  985. courier = kFontIDCourier,
  986. symbol = kFontIDSymbol,
  987. mobile = kFontIDMobile
  988. };
  989. #endif /* OLDROUTINENAMES */
  990. /*--------------------------------------------------------------------------------------*/
  991. #if PRAGMA_STRUCT_ALIGN
  992. #pragma options align=reset
  993. #elif PRAGMA_STRUCT_PACKPUSH
  994. #pragma pack(pop)
  995. #elif PRAGMA_STRUCT_PACK
  996. #pragma pack()
  997. #endif
  998. #ifdef PRAGMA_IMPORT_OFF
  999. #pragma import off
  1000. #elif PRAGMA_IMPORT
  1001. #pragma import reset
  1002. #endif
  1003. #ifdef __cplusplus
  1004. }
  1005. #endif
  1006. #endif /* __FONTS__ */