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.

154 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. font.cpp
  5. Abstract:
  6. PCL XL minidriver plug-in font managing header file
  7. Environment:
  8. Windows Whistler
  9. Revision History:
  10. 08/23/99
  11. Created it.
  12. --*/
  13. tyedef enum {
  14. eXLNull,
  15. eXLTrueType,
  16. eXLDevice,
  17. eXLSubstitution
  18. } XLFontType;
  19. typedef enum {
  20. eXLTTNull,
  21. eXLTTBitmap,
  22. eXLTTTrueType
  23. } XLTrueTypeFontType;
  24. class XLFont
  25. {
  26. public:
  27. XLFont:
  28. XLFont();
  29. XLFont::
  30. ~XLFont();
  31. HRESULT SetFont(FONTOBJ *pfo, STROBJ *pstro);
  32. HRESULT SetSubstitutionTable(TTSUBST_TABLE* pTable);
  33. HRESULT SetTTDownloadType(XLTrueTypeFontType TTType);
  34. HRESULT SetUFM(UNIFM_HDR *pUFM);
  35. HRESULT SetGTT(UNI_GLYPHSETDATA *pGTT);
  36. //
  37. // Functions to emit commands
  38. //
  39. HRESULT DownloadFont();
  40. HRESULT SelectFont();
  41. HRESULT SendString();
  42. private:
  43. //
  44. // DDI parameters
  45. //
  46. STROBJ *m_pstro;
  47. FONTOBJ *m_pfo;
  48. IFIMETRICS *m_pifi;
  49. //
  50. // font info
  51. //
  52. XLFontType m_FontType;
  53. XLTrueTypeFontType m_TrueTypeType;
  54. DWORD m_dwFlags;
  55. CHAR m_ubFontName[17];
  56. FLOATOBJ m_floHeight;
  57. FLOATOBJ m_floWidth;
  58. UNIFM_HDR *m_pUFM;
  59. UNI_GLYPHSETDATA *m_pGTT;
  60. TTSUBST_TABLE m_pTTSubTbl;
  61. };
  62. XLFont::
  63. XLFont()
  64. {
  65. m_FontType = eXLNull;
  66. m_TrueTypeType = eXLTTNull;
  67. m_dwFlags = 0;
  68. }
  69. XLFont::
  70. ~XLFont()
  71. {
  72. }
  73. HRESULT
  74. XLFont::
  75. SetFont(
  76. FONTOBJ *pfo,
  77. STROBJ *pstro)
  78. {
  79. m_pstro = pstro;
  80. m_pfo = pfo;
  81. m_pifi = FONTOBJ_pifi(pfo);
  82. if (pfo->flFontType & DEVICEFONT_FONTTYPE)
  83. {
  84. m_FontType = eXLDevice;
  85. }
  86. else
  87. {
  88. // !!Need to consider font substitution.
  89. m_FontType = eXLTrueType;
  90. }
  91. return S_OK;
  92. }
  93. HRESULT
  94. XLFont::
  95. SetTTDownloadType(
  96. XLTrueTypeFontType TTType)
  97. {
  98. m_TrueTypeType = TTType;
  99. return S_OK;
  100. }
  101. HRESULT
  102. XLFont::
  103. SetSubstitutionTable(
  104. TTSUBST_TABLE* pTable)
  105. {
  106. m_pTTSUbTbl = pTable;
  107. return S_OK;
  108. }
  109. HRESULT
  110. XLFont::
  111. SetUFM(
  112. UNIFM_HDR *pUFM)
  113. {
  114. m_pUFM = pUFM;
  115. return S_OK;
  116. }
  117. HRESULT
  118. XLFont::
  119. SetGTT(
  120. UNI_GLYPHSETDATA *pGTT)
  121. {
  122. m_pGTT = pGTT;
  123. return S_OK;
  124. }