Source code of Windows XP (NT5)
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.

93 lines
2.5 KiB

  1. #define tag_cmap 0x70616d63 // 'cmap'
  2. #define tag_gasp 0x70736167 // 'gasp'
  3. #define tag_head 0x64616568 // 'head'
  4. #define tag_hdmx 0x786d6468 // 'hdmx'
  5. #define tag_hhea 0x61656868 // 'hhea'
  6. #define tag_hmtx 0x78746d68 // 'hmtx'
  7. #define tag_kern 0x6e72656b // 'kern'
  8. #define tag_LTSH 0x4853544c // 'LTSH'
  9. #define tag_maxp 0x7078616d // 'maxp'
  10. #define tag_name 0x656d616e // 'name'
  11. #define tag_OS2 0x322f534f // 'OS/2'
  12. #define tag_post 0x74736f70 // 'post'
  13. #define tag_VDMX 0x584d4456 // 'VDMX'
  14. typedef signed char int8;
  15. typedef unsigned char uint8;
  16. typedef short int16;
  17. typedef unsigned short uint16;
  18. typedef long int32;
  19. typedef unsigned long uint32;
  20. typedef short FUnit;
  21. typedef unsigned short uFUnit;
  22. typedef long Fixed;
  23. typedef long Fract;
  24. #define FS_2BYTE(p) ( ((unsigned short)((p)[0]) << 8) | (p)[1])
  25. #define FS_4BYTE(p) ( FS_2BYTE((p)+2) | ( (FS_2BYTE(p)+0L) << 16) )
  26. #define SWAPW(a) ((int16) FS_2BYTE( (unsigned char *)(&a) ))
  27. #define SWAPL(a) ((int32) FS_4BYTE( (unsigned char *)(&a) ))
  28. typedef struct {
  29. uint32 bc;
  30. uint32 ad;
  31. } BigDate;
  32. typedef uint32 sfnt_TableTag;
  33. typedef struct {
  34. sfnt_TableTag tag;
  35. uint32 checkSum;
  36. uint32 offset;
  37. uint32 length;
  38. } sfnt_DirectoryEntry, *sfnt_DirectoryEntryPtr;
  39. typedef struct {
  40. int32 version; // 0x10000 (1.0)
  41. uint16 numOffsets; // number of tables
  42. uint16 searchRange; // (max2 <= numOffsets)*16
  43. uint16 entrySelector; // log2 (max2 <= numOffsets)
  44. uint16 rangeShift; // numOffsets*16-searchRange
  45. sfnt_DirectoryEntry table[1]; // table[numOffsets]
  46. } sfnt_OffsetTable, *sfnt_OffsetTablePtr;
  47. #define SFNT_MAGIC 0x5F0F3CF5
  48. typedef struct {
  49. Fixed version; // for this table, set to 1.0
  50. Fixed fontRevision; // For Font Manufacturer
  51. uint32 checkSumAdjustment;
  52. uint32 magicNumber; // signature, should always be 0x5F0F3CF5 == MAGIC
  53. uint16 flags;
  54. uint16 unitsPerEm; // Specifies how many in Font Units we have per EM
  55. BigDate created;
  56. BigDate modified;
  57. FUnit xMin;
  58. FUnit yMin;
  59. FUnit xMax;
  60. FUnit yMax;
  61. uint16 macStyle; // macintosh style word
  62. uint16 lowestRecPPEM; // lowest recommended pixels per Em
  63. int16 fontDirectionHint;
  64. int16 indexToLocFormat;
  65. int16 glyphDataFormat;
  66. } sfnt_FontHeader, *sfnt_FontHeaderPtr;