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 24 #ifndef __PANGOWIN32_H__ 25 #define __PANGOWIN32_H__ 26 27 #include <glib.h> 28 #include <pango/pango-font.h> 29 #include <pango/pango-layout.h> 30 31 G_BEGIN_DECLS 32 33 #define STRICT 34 #ifndef _WIN32_WINNT 35 #define _WIN32_WINNT 0x0600 /* To get ClearType-related macros */ 36 #endif 37 #include <windows.h> 38 #undef STRICT 39 40 /** 41 * PANGO_RENDER_TYPE_WIN32: 42 * 43 * A string constant identifying the Win32 renderer. The associated quark (see 44 * g_quark_from_string()) is used to identify the renderer in pango_find_map(). 45 */ 46 #define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32" 47 48 /* Calls for applications 49 */ 50 #ifndef PANGO_DISABLE_DEPRECATED 51 PANGO_DEPRECATED_FOR(pango_font_map_create_context) 52 PangoContext * pango_win32_get_context (void); 53 #endif 54 55 PANGO_AVAILABLE_IN_ALL 56 void pango_win32_render (HDC hdc, 57 PangoFont *font, 58 PangoGlyphString *glyphs, 59 gint x, 60 gint y); 61 PANGO_AVAILABLE_IN_ALL 62 void pango_win32_render_layout_line (HDC hdc, 63 PangoLayoutLine *line, 64 int x, 65 int y); 66 PANGO_AVAILABLE_IN_ALL 67 void pango_win32_render_layout (HDC hdc, 68 PangoLayout *layout, 69 int x, 70 int y); 71 72 PANGO_AVAILABLE_IN_ALL 73 void pango_win32_render_transformed (HDC hdc, 74 const PangoMatrix *matrix, 75 PangoFont *font, 76 PangoGlyphString *glyphs, 77 int x, 78 int y); 79 80 #ifndef PANGO_DISABLE_DEPRECATED 81 82 /* For shape engines 83 */ 84 85 PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH) 86 PangoGlyph pango_win32_get_unknown_glyph (PangoFont *font, 87 gunichar wc); 88 PANGO_DEPRECATED 89 gint pango_win32_font_get_glyph_index(PangoFont *font, 90 gunichar wc); 91 92 PANGO_DEPRECATED 93 HDC pango_win32_get_dc (void); 94 95 PANGO_DEPRECATED 96 gboolean pango_win32_get_debug_flag (void); 97 98 PANGO_DEPRECATED 99 gboolean pango_win32_font_select_font (PangoFont *font, 100 HDC hdc); 101 PANGO_DEPRECATED 102 void pango_win32_font_done_font (PangoFont *font); 103 PANGO_DEPRECATED 104 double pango_win32_font_get_metrics_factor (PangoFont *font); 105 106 #endif 107 108 /* API for libraries that want to use PangoWin32 mixed with classic 109 * Win32 fonts. 110 */ 111 typedef struct _PangoWin32FontCache PangoWin32FontCache; 112 113 PANGO_AVAILABLE_IN_ALL 114 PangoWin32FontCache *pango_win32_font_cache_new (void); 115 PANGO_AVAILABLE_IN_ALL 116 void pango_win32_font_cache_free (PangoWin32FontCache *cache); 117 118 PANGO_AVAILABLE_IN_ALL 119 HFONT pango_win32_font_cache_load (PangoWin32FontCache *cache, 120 const LOGFONTA *logfont); 121 PANGO_AVAILABLE_IN_1_16 122 HFONT pango_win32_font_cache_loadw (PangoWin32FontCache *cache, 123 const LOGFONTW *logfont); 124 PANGO_AVAILABLE_IN_ALL 125 void pango_win32_font_cache_unload (PangoWin32FontCache *cache, 126 HFONT hfont); 127 128 PANGO_AVAILABLE_IN_ALL 129 PangoFontMap *pango_win32_font_map_for_display (void); 130 PANGO_AVAILABLE_IN_ALL 131 void pango_win32_shutdown_display (void); 132 PANGO_AVAILABLE_IN_ALL 133 PangoWin32FontCache *pango_win32_font_map_get_font_cache (PangoFontMap *font_map); 134 135 PANGO_AVAILABLE_IN_ALL 136 LOGFONTA *pango_win32_font_logfont (PangoFont *font); 137 PANGO_AVAILABLE_IN_1_16 138 LOGFONTW *pango_win32_font_logfontw (PangoFont *font); 139 140 PANGO_AVAILABLE_IN_1_12 141 PangoFontDescription *pango_win32_font_description_from_logfont (const LOGFONTA *lfp); 142 143 PANGO_AVAILABLE_IN_1_16 144 PangoFontDescription *pango_win32_font_description_from_logfontw (const LOGFONTW *lfp); 145 146 G_END_DECLS 147 148 #endif /* __PANGOWIN32_H__ */ 149