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.

78 lines
2.3 KiB

  1. //////////////////////////////////////////////////////////////////
  2. // File : cfont.h
  3. // Purpose : class CFont define.
  4. // Util method for font handling.
  5. //
  6. //
  7. // Date : Thu Jul 01 12:21:00 1999
  8. // Author : toshiak
  9. //
  10. // Copyright(c) 1995-1999, Microsoft Corp. All rights reserved
  11. //////////////////////////////////////////////////////////////////
  12. #ifndef __C_FONT_H__
  13. #define __C_FONT_H__
  14. #ifdef UNDER_CE // Windows CE does not support ENUMLOGFONTEX
  15. #ifndef ENUMLOGFONTEX
  16. #define ENUMLOGFONTEX ENUMLOGFONT
  17. #endif // !ENUMLOGFONTEX
  18. #endif // UNDER_CE
  19. class CFont
  20. {
  21. public:
  22. //Common method.
  23. static HFONT CreateDefGUIFont(VOID);
  24. //Ansi&Unicode
  25. static BOOL GetDefGUILogFont(LOGFONT *lpLf);
  26. static HFONT CreateGUIFontByNameCharSet(LPTSTR lpstrFontFace,
  27. INT charSet,
  28. INT pointSize);
  29. static BOOL IsFontExist(LPTSTR lpstrFontFace,
  30. INT charSet);
  31. static BOOL GetFontNameByCharSet(INT charSet,
  32. LPTSTR lpstrFontFace,
  33. INT cchMax);
  34. static BOOL GetFontInfoByName(LPTSTR lpstrFontFace,
  35. INT *pCharSet,
  36. INT *pCodePage);
  37. static BOOL SearchLogFontByNameCharSet(LOGFONT *lpLf,
  38. LPTSTR lpstrFontFace,
  39. INT charSet,
  40. BOOL fIncVert=FALSE);
  41. static INT CALLBACK EnumFontFamiliesExProc(ENUMLOGFONTEX *lpElf,
  42. NEWTEXTMETRIC *lpNtm,
  43. INT iFontType,
  44. LPARAM lParam);
  45. #ifdef AWBOTH
  46. static BOOL GetDefGUILogFontW(LOGFONTW *pLf);
  47. static HFONT CreateGUIFontByNameCharSetW(LPWSTR lptstrFontFace,
  48. INT charSet,
  49. INT pointSize);
  50. static BOOL IsFontExist(LPWSTR lpstrFontFace,
  51. INT charSet);
  52. static BOOL GetFontNameByCharSetW(INT charSet,
  53. LPWSTR lpstrFontFace,
  54. INT cchMax);
  55. static BOOL GetFontInfoByNameW(LPWSTR lpstrFontFace,
  56. INT *pCharSet,
  57. INT *pCodePage);
  58. static BOOL SearchLogFontByNameCharSetW(LOGFONTW *lpLf,
  59. LPWSTR lpstrFontFace,
  60. INT charSet,
  61. BOOL fIncVert=FALSE);
  62. static INT CALLBACK EnumFontFamiliesExProcW(ENUMLOGFONTEXW *lpElf,
  63. NEWTEXTMETRIC *lpNtm,
  64. INT iFontType,
  65. LPARAM lParam);
  66. #endif //AWBOTH
  67. };
  68. #endif //__C_FONT_H__