pangowin32.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* Pango
  2. * pangowin32.h:
  3. *
  4. * Copyright (C) 1999 Red Hat Software
  5. * Copyright (C) 2000 Tor Lillqvist
  6. * Copyright (C) 2001 Alexander Larsson
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Library General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Library General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Library General Public
  19. * License along with this library; if not, write to the
  20. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21. * Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef __PANGOWIN32_H__
  24. #define __PANGOWIN32_H__
  25. #include <glib.h>
  26. #include <pango/pango-font.h>
  27. #include <pango/pango-layout.h>
  28. G_BEGIN_DECLS
  29. #define STRICT
  30. #ifndef _WIN32_WINNT
  31. #define _WIN32_WINNT 0x0600 /* To get ClearType-related macros */
  32. #endif
  33. #include <windows.h>
  34. #undef STRICT
  35. /**
  36. * PANGO_RENDER_TYPE_WIN32:
  37. *
  38. * A string constant identifying the Win32 renderer. The associated quark (see
  39. * g_quark_from_string()) is used to identify the renderer in pango_find_map().
  40. */
  41. #define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32"
  42. /* Calls for applications
  43. */
  44. #ifndef PANGO_DISABLE_DEPRECATED
  45. PANGO_DEPRECATED_FOR(pango_font_map_create_context)
  46. PangoContext * pango_win32_get_context (void);
  47. #endif
  48. PANGO_AVAILABLE_IN_ALL
  49. void pango_win32_render (HDC hdc,
  50. PangoFont *font,
  51. PangoGlyphString *glyphs,
  52. gint x,
  53. gint y);
  54. PANGO_AVAILABLE_IN_ALL
  55. void pango_win32_render_layout_line (HDC hdc,
  56. PangoLayoutLine *line,
  57. int x,
  58. int y);
  59. PANGO_AVAILABLE_IN_ALL
  60. void pango_win32_render_layout (HDC hdc,
  61. PangoLayout *layout,
  62. int x,
  63. int y);
  64. PANGO_AVAILABLE_IN_ALL
  65. void pango_win32_render_transformed (HDC hdc,
  66. const PangoMatrix *matrix,
  67. PangoFont *font,
  68. PangoGlyphString *glyphs,
  69. int x,
  70. int y);
  71. #ifndef PANGO_DISABLE_DEPRECATED
  72. /* For shape engines
  73. */
  74. PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH)
  75. PangoGlyph pango_win32_get_unknown_glyph (PangoFont *font,
  76. gunichar wc);
  77. PANGO_DEPRECATED
  78. gint pango_win32_font_get_glyph_index(PangoFont *font,
  79. gunichar wc);
  80. PANGO_DEPRECATED
  81. HDC pango_win32_get_dc (void);
  82. PANGO_DEPRECATED
  83. gboolean pango_win32_get_debug_flag (void);
  84. PANGO_DEPRECATED
  85. gboolean pango_win32_font_select_font (PangoFont *font,
  86. HDC hdc);
  87. PANGO_DEPRECATED
  88. void pango_win32_font_done_font (PangoFont *font);
  89. PANGO_DEPRECATED
  90. double pango_win32_font_get_metrics_factor (PangoFont *font);
  91. #endif
  92. /* API for libraries that want to use PangoWin32 mixed with classic
  93. * Win32 fonts.
  94. */
  95. typedef struct _PangoWin32FontCache PangoWin32FontCache;
  96. PANGO_AVAILABLE_IN_ALL
  97. PangoWin32FontCache *pango_win32_font_cache_new (void);
  98. PANGO_AVAILABLE_IN_ALL
  99. void pango_win32_font_cache_free (PangoWin32FontCache *cache);
  100. PANGO_AVAILABLE_IN_ALL
  101. HFONT pango_win32_font_cache_load (PangoWin32FontCache *cache,
  102. const LOGFONTA *logfont);
  103. PANGO_AVAILABLE_IN_1_16
  104. HFONT pango_win32_font_cache_loadw (PangoWin32FontCache *cache,
  105. const LOGFONTW *logfont);
  106. PANGO_AVAILABLE_IN_ALL
  107. void pango_win32_font_cache_unload (PangoWin32FontCache *cache,
  108. HFONT hfont);
  109. PANGO_AVAILABLE_IN_ALL
  110. PangoFontMap *pango_win32_font_map_for_display (void);
  111. PANGO_AVAILABLE_IN_ALL
  112. void pango_win32_shutdown_display (void);
  113. PANGO_AVAILABLE_IN_ALL
  114. PangoWin32FontCache *pango_win32_font_map_get_font_cache (PangoFontMap *font_map);
  115. PANGO_AVAILABLE_IN_ALL
  116. LOGFONTA *pango_win32_font_logfont (PangoFont *font);
  117. PANGO_AVAILABLE_IN_1_16
  118. LOGFONTW *pango_win32_font_logfontw (PangoFont *font);
  119. PANGO_AVAILABLE_IN_1_12
  120. PangoFontDescription *pango_win32_font_description_from_logfont (const LOGFONTA *lfp);
  121. PANGO_AVAILABLE_IN_1_16
  122. PangoFontDescription *pango_win32_font_description_from_logfontw (const LOGFONTW *lfp);
  123. PANGO_AVAILABLE_IN_1_52
  124. gboolean pango_win32_font_map_add_font_file (PangoFontMap *font_map,
  125. const char *font_file_path,
  126. GError **error);
  127. G_END_DECLS
  128. #endif /* __PANGOWIN32_H__ */