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.

89 lines
2.1 KiB

  1. #include <windows.h>
  2. #include <objbase.h>
  3. #include <math.h> // sin & cos
  4. //
  5. // Where is IStream included from?
  6. //
  7. #define IStream int
  8. #include "gdiplus.h"
  9. using namespace Gdiplus;
  10. #define DG_NOGDI 4
  11. #define MAX_GLYPH_COUNT 100
  12. //copy from winddi.h
  13. typedef ULONG HGLYPH;
  14. typedef LONG FIX;
  15. // point in the 32.32 bit precission
  16. typedef struct _POINTQF // ptq
  17. {
  18. LARGE_INTEGER x;
  19. LARGE_INTEGER y;
  20. } POINTQF, *PPOINTQF;
  21. typedef struct _GLYPHBITS
  22. {
  23. POINTL ptlOrigin;
  24. SIZEL sizlBitmap;
  25. BYTE aj[1];
  26. } GLYPHBITS;
  27. typedef union _GLYPHDEF
  28. {
  29. GLYPHBITS *pgb;
  30. // PATHOBJ *ppo;
  31. PVOID *ppo;
  32. } GLYPHDEF;
  33. typedef struct _GLYPHDATA {
  34. GLYPHDEF gdf;
  35. HGLYPH hg;
  36. FIX fxD;
  37. FIX fxA;
  38. FIX fxAB;
  39. FIX fxInkTop;
  40. FIX fxInkBottom;
  41. RECTL rclInk;
  42. POINTQF ptqD;
  43. } GLYPHDATA;
  44. typedef GpStatus (*FN_GDIPDRAWGLYPHS)(GpGraphics*, UINT16*, INT, GpFont*, GpBrush*, INT*, INT*, INT);
  45. typedef GpStatus (*FN_GDIPPATHADDGLYPHS)(GpPath*, UINT16*, INT, GpFont*, REAL*, REAL*, INT);
  46. typedef GpStatus (*FN_GDIPSETTEXTRENDERINGHINT)(GpGraphics *graphics, TextRenderingHint mode);
  47. enum AddFontFlag
  48. {
  49. AddFontFlagPublic = 0,
  50. AddFontFlagNotEnumerate = 1
  51. };
  52. // globals
  53. extern HINSTANCE ghInst;
  54. extern HWND ghWndMain;
  55. extern HWND ghWndList;
  56. extern HBRUSH ghbrWhite;
  57. extern HINSTANCE ghGdiplus;
  58. extern Font *gFont;
  59. extern FN_GDIPDRAWGLYPHS gfnGdipDrawGlyphs;
  60. extern FN_GDIPPATHADDGLYPHS gfnGdipPathAddGlyphs;
  61. extern FN_GDIPSETTEXTRENDERINGHINT gfnGdipSetTextRenderingHint;
  62. void Dbgprintf(PCH msg, ...);
  63. void CreateNewFont(char*, FLOAT, FontStyle, Unit);
  64. void TestDrawGlyphs(HWND hwnd, UINT16 *glyphIndices, INT count, INT *px, INT *py, INT flags);
  65. void TestPathGlyphs(HWND hwnd, UINT16 *glyphIndices, INT count, REAL *px, REAL *py, INT flags);
  66. void TestAddFontFile(CHAR* fileName, INT flag, BOOL loasAsImage);
  67. void TestRemoveFontFile(char* fileName);
  68. void TestTextAntiAliasOn();
  69. void TestTextAntiAliasOff();