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.

147 lines
4.6 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: fontfile.h
  3. *
  4. * (Brief description)
  5. *
  6. * Created: 25-Oct-1990 09:20:11
  7. * Author: Bodin Dresevic [BodinD]
  8. *
  9. * Copyright (c) 1990 Microsoft Corporation
  10. \**************************************************************************/
  11. // allowed values for FONTFILE.iType field:
  12. // ORIGINAL FILE IS AN *.FNT FILE which contains a single
  13. // size of the single font
  14. #define TYPE_FNT 1L
  15. // ORIGINAL FILE IS A win 3.0 16 bit *.DLL (*.fon FILE),
  16. // This file is compiled out of many *.fnt files
  17. // that correspond to different sizes of the same face, (e.g. tmsr or helv)
  18. // This is provided to ensure binary compatibility with win 3.0 *.fon files
  19. #define TYPE_DLL16 2L
  20. // ORIGINAL FILE IS A win 3.0 32 bit *.DLL
  21. // This file is compiled out of many *.fnt files using NT tools
  22. // (coff linker and nt resource compiler)
  23. #define TYPE_DLL32 3L
  24. // an fnt file that is embeded in an exe and loaded using FdLoadResData
  25. #define TYPE_EXE 4L
  26. typedef struct _FACEDATA
  27. {
  28. RES_ELEM re; // -> top of the resource within the file
  29. ULONG iDefFace;
  30. CP_GLYPHSET *pcp;
  31. IFIMETRICS *pifi;
  32. }FACEDATA, *PFACEDATA;
  33. // file is gone
  34. #define FF_EXCEPTION_IN_PAGE_ERROR 1
  35. typedef struct _VT_FONTFILE // ff
  36. {
  37. ULONG iType; // original file is *.fnt, 16 bit dll or 32 bit dll
  38. ULONG_PTR iFile; // file handle for EngMapFontFile,EngUnmapFontFile
  39. PVOID pvView; // pointer to the base of the mapped view
  40. ULONG cjView; // size of the mapped view
  41. FLONG fl; // general flags
  42. ULONG cRef; // # no of times this font file is selected
  43. // into a font context
  44. ULONG cFace; // # of resources in the file
  45. FACEDATA afd[1]; // cFace of them followed by cFace IFIMETRICS
  46. } FONTFILE, *PFONTFILE;
  47. #define PFF(hff) ((FONTFILE*)(hff))
  48. typedef struct _VT_FONTCONTEXT // fc
  49. {
  50. PFONTFILE pff; // the font file selected into this context
  51. PIFIMETRICS pifi;
  52. EFLOAT efM11; // Transform matrix.
  53. EFLOAT efM12;
  54. EFLOAT efM21;
  55. EFLOAT efM22;
  56. FIX fxInkTop; // Transformed Ascender.
  57. FIX fxInkBottom; // -Transformed Descender.
  58. EFLOAT efBase;
  59. POINTE pteUnitBase;
  60. VECTORFL vtflBase;
  61. POINTQF ptqUnitBase; // pteUnitBase in POINTQF format,
  62. // has to be added to all ptqD's if emboldening
  63. POINTFIX pfxBaseOffset; // offset strokes this much for emboldened font
  64. FIX fxEmbolden; // length of the above vector
  65. FIX fxItalic; // add to fxD to get fxAB
  66. EFLOAT efSide;
  67. POINTE pteUnitSide;
  68. RES_ELEM *pre; // -> beginning of the mapped font file
  69. FLONG flags; // simulation and transform flag
  70. ULONG dpFirstChar; // -> control points of the first char
  71. }FONTCONTEXT, *PFONTCONTEXT;
  72. #define PFC(hfc) ((FONTCONTEXT*)(hfc))
  73. // Allowed values for flags
  74. #define FC_SIM_EMBOLDEN 1
  75. #define FC_SIM_ITALICIZE 2
  76. #define FC_SCALE_ONLY 4
  77. #define FC_X_INVERT 8
  78. #define FC_ORIENT_1 16
  79. #define FC_ORIENT_2 32
  80. #define FC_ORIENT_3 64
  81. #define FC_ORIENT_4 128
  82. #define FC_ORIENT_5 256
  83. #define FC_ORIENT_6 512
  84. #define FC_ORIENT_7 1024
  85. #define FC_ORIENT_8 2048
  86. #define ORIENT_MASK (FC_ORIENT_1|FC_ORIENT_2|FC_ORIENT_3|FC_ORIENT_4| \
  87. FC_ORIENT_5|FC_ORIENT_6|FC_ORIENT_7|FC_ORIENT_8)
  88. // Font file/context allocation/free macros.
  89. #define pffAlloc(cj) ((PFONTFILE)EngAllocMem(0, cj, 'dftV'))
  90. #define pfcAlloc() ((PFONTCONTEXT)EngAllocMem(0, sizeof(FONTCONTEXT), 'dftV'))
  91. #define vFree(pv) EngFreeMem((PVOID) pv)
  92. BOOL bXformUnitVector
  93. (
  94. POINTL *pptl, // IN, incoming unit vector
  95. XFORML *pxf, // IN, xform to use
  96. PVECTORFL pvtflXformed, // OUT, xform of the incoming unit vector
  97. POINTE *ppteUnit, // OUT, *pptqXormed/|*pptqXormed|, POINTE
  98. POINTQF *pptqUnit, // out optional
  99. EFLOAT *pefNorm // OUT, |*pptqXormed|
  100. );
  101. // default face in the font.
  102. #define FF_FACE_NORMAL 0L
  103. #define FF_FACE_BOLD 1L
  104. #define FF_FACE_ITALIC 2L
  105. #define FF_FACE_BOLDITALIC 3L
  106. extern FD_GLYPHSET *gpgsetVTFD;
  107. #define PEN_UP (CHAR)0x80