Leaked source code of windows server 2003
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.

135 lines
3.7 KiB

  1. /*
  2. * Adobe Library
  3. *
  4. * Copyright (c) 1996 Adobe Systems Inc.
  5. * All Rights Reserved
  6. *
  7. * TTformat.h -defines data structure to access TTF and TTC
  8. *
  9. *
  10. * $Header:
  11. */
  12. #ifndef _H_TTFORMAT
  13. #define _H_TTFORMAT
  14. /*
  15. * Macros for accessing little-endian data
  16. */
  17. #ifdef MAC_ENV
  18. #define MOTOROLALONG(a) a
  19. #define MOTOROLAINT(a) a
  20. #define MOTOROLASLONG(a) a
  21. #define MOTOROLASINT(a) a
  22. #else /* Windows */
  23. /*
  24. * NOTE: These must be used with valid variables or memory addresses.
  25. * No constants are allowed!
  26. */
  27. #define MOTOROLALONG(a) (unsigned long)(((unsigned long)*((unsigned char *)&a) << 24) \
  28. + ((unsigned long)*(((unsigned char *)&a) + 1) << 16) \
  29. + ((unsigned long)*(((unsigned char *)&a) + 2) << 8) \
  30. + ((unsigned long)*(((unsigned char *)&a) + 3)))
  31. #define MOTOROLAINT(a) (unsigned short)(((unsigned short)*((unsigned char *)&a) << 8) \
  32. + (unsigned short)*(((unsigned char *)&a) + 1))
  33. #define MOTOROLASLONG(a) ((signed long)MOTOROLALONG(a))
  34. #define MOTOROLASINT(a) ((signed short)MOTOROLAINT(a))
  35. #endif / * Windows */
  36. /*
  37. * General definitions for TrueType
  38. */
  39. /*
  40. * TrueType font table names
  41. */
  42. #define CFF_TABLE (*(unsigned long*)"CFF ")
  43. #define GSUB_TABLE (*(unsigned long*)"GSUB")
  44. #define OS2_TABLE (*(unsigned long*)"OS/2")
  45. #define CMAP_TABLE (*(unsigned long*)"cmap")
  46. #define GLYF_TABLE (*(unsigned long*)"glyf")
  47. #define HEAD_TABLE (*(unsigned long*)"head")
  48. #define HHEA_TABLE (*(unsigned long*)"hhea")
  49. #define LOCA_TABLE (*(unsigned long*)"loca")
  50. #define MAXP_TABLE (*(unsigned long*)"maxp")
  51. #define MORT_TABLE (*(unsigned long*)"mort")
  52. #define NAME_TABLE (*(unsigned long*)"name")
  53. #define POST_TABLE (*(unsigned long*)"post")
  54. #define TTCF_TABLE (*(unsigned long*)"ttcf")
  55. #define VHEA_TABLE (*(unsigned long*)"vhea")
  56. #define VMTX_TABLE (*(unsigned long*)"vmtx")
  57. #define CVT_TABLE (*(unsigned long*)"cvt ")
  58. #define FPGM_TABLE (*(unsigned long*)"fpgm")
  59. #define HMTX_TABLE (*(unsigned long*)"hmtx")
  60. #define PREP_TABLE (*(unsigned long*)"prep")
  61. //Begin Constants to read NAME Table
  62. #define TYPE42NAME_PS 6
  63. #define TYPE42NAME_MENU 1
  64. #define TYPE42PLATFORM_WINDOWS 3
  65. #define PLATFORM_APPLE 1
  66. #define TYPE42ENCODING_UGL 4
  67. #define TYPE42ENCODING_NONUGL 0
  68. #define TYPE42ENCODING_CONTINUOUS 0
  69. #define WINDOWS_UNICODE_ENCODING 1
  70. #define APPLE_ROMAN_ENCODING 0
  71. #define WINDOWS_LANG_ENGLISH 0x0409
  72. #define APPLE_LANG_ENGLISH 0
  73. //End Constants to read NAME Table
  74. typedef struct tagTTCFHEADER {
  75. unsigned long ulTTCTag; // "ttcf" tag
  76. unsigned long version; // This is actually FIXED32 - see TTC doc
  77. unsigned long cDirectory; // num of directories in this TTC File
  78. } TTCFHEADER;
  79. typedef struct tagNAMEHEADER
  80. {
  81. unsigned short formatSelector;
  82. unsigned short recordNumber;
  83. unsigned short stringOffsets;
  84. } NAMEHEADER;
  85. typedef struct tagNAMERECORD {
  86. unsigned short platformID;
  87. unsigned short encodingID;
  88. unsigned short languageID;
  89. unsigned short nameID;
  90. unsigned short length;
  91. unsigned short offset;
  92. } NAMERECORD;
  93. typedef struct {
  94. unsigned long version;
  95. unsigned short numTables;
  96. unsigned short searchRange;
  97. unsigned short entrySelector;
  98. unsigned short rangeshift;
  99. } TableDirectoryStruct;
  100. typedef struct tagTableEntryStruct {
  101. unsigned long tag;
  102. unsigned long checkSum;
  103. unsigned long offset;
  104. unsigned long length;
  105. } TableEntryStruct;
  106. #define MACSTYLE_BOLD_PRESENT 0x01
  107. #define MACSTYLE_ITALIC_PRESENT 0x02
  108. #endif //_H_TTFORMAT