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.

115 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. font.h
  5. Abstract:
  6. This module contains the data structures, data types,
  7. and procedures related to fonts.
  8. Author:
  9. Therese Stowell (thereses) 15-Jan-1991
  10. Revision History:
  11. --*/
  12. #ifndef FONT_H
  13. #define FONT_H
  14. #define INITIAL_FONTS 20
  15. #define FONT_INCREMENT 3
  16. #define CONSOLE_MAX_FONT_NAME_LENGTH 256
  17. #define EF_NEW 0x0001 // a newly available face
  18. #define EF_OLD 0x0002 // a previously available face
  19. #define EF_ENUMERATED 0x0004 // all sizes have been enumerated
  20. #define EF_OEMFONT 0x0008 // an OEM face
  21. #define EF_TTFONT 0x0010 // a TT face
  22. #define EF_DEFFACE 0x0020 // the default face
  23. #if defined(FE_SB)
  24. #define EF_DBCSFONT 0x0040 // the DBCS font
  25. #endif
  26. /*
  27. * FONT_INFO
  28. *
  29. * The distinction between the desired and actual font dimensions obtained
  30. * is important in the case of TrueType fonts, in which there is no guarantee
  31. * that what you ask for is what you will get.
  32. *
  33. * Note that the correspondence between "Desired" and "Actual" is broken
  34. * whenever the user changes his display driver, because GDI uses driver
  35. * parameters to control the font rasterization.
  36. *
  37. * The SizeDesired is {0, 0} if the font is a raster font.
  38. */
  39. typedef struct _FONT_INFO {
  40. HFONT hFont;
  41. COORD Size; // font size obtained
  42. COORD SizeWant; // 0;0 if Raster font
  43. LONG Weight;
  44. LPTSTR FaceName;
  45. BYTE Family;
  46. #if defined(FE_SB)
  47. BYTE tmCharSet;
  48. #endif
  49. } FONT_INFO, *PFONT_INFO;
  50. typedef struct tagFACENODE {
  51. struct tagFACENODE *pNext;
  52. DWORD dwFlag;
  53. TCHAR atch[];
  54. } FACENODE, *PFACENODE;
  55. #define TM_IS_TT_FONT(x) (((x) & TMPF_TRUETYPE) == TMPF_TRUETYPE)
  56. #define IS_BOLD(w) ((w) >= FW_SEMIBOLD)
  57. #define SIZE_EQUAL(s1, s2) (((s1).X == (s2).X) && ((s1).Y == (s2).Y))
  58. #define POINTS_PER_INCH 72
  59. #define MIN_PIXEL_HEIGHT 5
  60. #define MAX_PIXEL_HEIGHT 72
  61. //
  62. // Function prototypes
  63. //
  64. VOID
  65. InitializeFonts(VOID);
  66. VOID
  67. DestroyFonts(VOID);
  68. NTSTATUS
  69. EnumerateFonts(DWORD Flags);
  70. #if !defined(FE_SB)
  71. int
  72. FindCreateFont(
  73. DWORD Family,
  74. LPTSTR ptszFace,
  75. COORD Size,
  76. LONG Weight);
  77. #else
  78. int
  79. FindCreateFont(
  80. DWORD Family,
  81. LPTSTR ptszFace,
  82. COORD Size,
  83. LONG Weight,
  84. UINT CodePage);
  85. #endif
  86. BOOL
  87. DoFontEnum(
  88. HDC hDC,
  89. LPTSTR ptszFace,
  90. PSHORT pTTPoints,
  91. UINT nTTPoints);
  92. #endif /* !FONT_H */