Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * GDI font objects |
| 3 | * |
| 4 | * Copyright 1993 Alexandre Julliard |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 5 | * 1997 Alex Korobka |
Alexandre Julliard | 7e56f68 | 1996-01-31 19:02:28 +0000 | [diff] [blame] | 6 | */ |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 7 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 8 | #include <stdlib.h> |
Alexandre Julliard | 8d24ae6 | 1994-04-05 21:42:43 +0000 | [diff] [blame] | 9 | #include <string.h> |
Marcus Meissner | 317af32 | 1999-02-17 13:51:06 +0000 | [diff] [blame] | 10 | #include "wine/winestring.h" |
Alexandre Julliard | 7cbe657 | 1995-01-09 18:21:16 +0000 | [diff] [blame] | 11 | #include "font.h" |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 12 | #include "heap.h" |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 13 | #include "metafile.h" |
Alexandre Julliard | 7e56f68 | 1996-01-31 19:02:28 +0000 | [diff] [blame] | 14 | #include "options.h" |
Alexandre Julliard | 06c275a | 1999-05-02 14:32:27 +0000 | [diff] [blame] | 15 | #include "debugtools.h" |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 16 | #include "winerror.h" |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 17 | #include "dc.h" |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 18 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 19 | DEFAULT_DEBUG_CHANNEL(font) |
Patrik Stridvall | b4b9fae | 1999-04-19 14:56:29 +0000 | [diff] [blame] | 20 | DECLARE_DEBUG_CHANNEL(gdi) |
| 21 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 22 | #define ENUM_UNICODE 0x00000001 |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 23 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 24 | typedef struct |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 25 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 26 | LPLOGFONT16 lpLogFontParam; |
| 27 | FONTENUMPROCEX16 lpEnumFunc; |
| 28 | LPARAM lpData; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 29 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 30 | LPNEWTEXTMETRICEX16 lpTextMetric; |
| 31 | LPENUMLOGFONTEX16 lpLogFont; |
| 32 | SEGPTR segTextMetric; |
| 33 | SEGPTR segLogFont; |
| 34 | } fontEnum16; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 35 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 36 | typedef struct |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 37 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 38 | LPLOGFONTW lpLogFontParam; |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 39 | FONTENUMPROCEXW lpEnumFunc; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 40 | LPARAM lpData; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 41 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 42 | LPNEWTEXTMETRICEXW lpTextMetric; |
| 43 | LPENUMLOGFONTEXW lpLogFont; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 44 | DWORD dwFlags; |
| 45 | } fontEnum32; |
| 46 | |
Douglas Ridgway | ab9e8bc | 1999-01-01 18:41:22 +0000 | [diff] [blame] | 47 | /* |
| 48 | * For TranslateCharsetInfo |
| 49 | */ |
| 50 | #define FS(x) {{0,0,0,0},{0x1<<(x),0}} |
| 51 | #define MAXTCIINDEX 32 |
| 52 | static CHARSETINFO FONT_tci[MAXTCIINDEX] = { |
| 53 | /* ANSI */ |
| 54 | { ANSI_CHARSET, 1252, FS(0)}, |
| 55 | { EASTEUROPE_CHARSET, 1250, FS(1)}, |
| 56 | { RUSSIAN_CHARSET, 1251, FS(2)}, |
| 57 | { GREEK_CHARSET, 1253, FS(3)}, |
| 58 | { TURKISH_CHARSET, 1254, FS(4)}, |
| 59 | { HEBREW_CHARSET, 1255, FS(5)}, |
| 60 | { ARABIC_CHARSET, 1256, FS(6)}, |
| 61 | { BALTIC_CHARSET, 1257, FS(7)}, |
| 62 | /* reserved by ANSI */ |
| 63 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 64 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 65 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 66 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 67 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 68 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 69 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 70 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 71 | /* ANSI and OEM */ |
| 72 | { THAI_CHARSET, 874, FS(16)}, |
| 73 | { SHIFTJIS_CHARSET, 932, FS(17)}, |
| 74 | { GB2312_CHARSET, 936, FS(18)}, |
| 75 | { HANGEUL_CHARSET, 949, FS(19)}, |
| 76 | { CHINESEBIG5_CHARSET, 950, FS(20)}, |
| 77 | { JOHAB_CHARSET, 1361, FS(21)}, |
| 78 | /* reserved for alternate ANSI and OEM */ |
| 79 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 80 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 81 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 82 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 83 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 84 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 85 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 86 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 87 | /* reserved for system */ |
| 88 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 89 | { DEFAULT_CHARSET, 0, FS(0)}, |
| 90 | }; |
| 91 | |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 92 | /*********************************************************************** |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 93 | * LOGFONT conversion functions. |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 94 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 95 | void FONT_LogFont32ATo16( const LOGFONTA* font32, LPLOGFONT16 font16 ) |
Alexandre Julliard | e2991ea | 1995-07-29 13:09:43 +0000 | [diff] [blame] | 96 | { |
Ulrich Weigand | d1682aa | 1999-11-21 02:21:17 +0000 | [diff] [blame] | 97 | font16->lfHeight = font32->lfHeight; |
| 98 | font16->lfWidth = font32->lfWidth; |
| 99 | font16->lfEscapement = font32->lfEscapement; |
| 100 | font16->lfOrientation = font32->lfOrientation; |
| 101 | font16->lfWeight = font32->lfWeight; |
| 102 | font16->lfItalic = font32->lfItalic; |
| 103 | font16->lfUnderline = font32->lfUnderline; |
| 104 | font16->lfStrikeOut = font32->lfStrikeOut; |
| 105 | font16->lfCharSet = font32->lfCharSet; |
| 106 | font16->lfOutPrecision = font32->lfOutPrecision; |
| 107 | font16->lfClipPrecision = font32->lfClipPrecision; |
| 108 | font16->lfQuality = font32->lfQuality; |
| 109 | font16->lfPitchAndFamily = font32->lfPitchAndFamily; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 110 | lstrcpynA( font16->lfFaceName, font32->lfFaceName, LF_FACESIZE ); |
Alexandre Julliard | ded3038 | 1995-07-06 17:18:27 +0000 | [diff] [blame] | 111 | } |
Alexandre Julliard | e2991ea | 1995-07-29 13:09:43 +0000 | [diff] [blame] | 112 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 113 | void FONT_LogFont32WTo16( const LOGFONTW* font32, LPLOGFONT16 font16 ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 114 | { |
Ulrich Weigand | d1682aa | 1999-11-21 02:21:17 +0000 | [diff] [blame] | 115 | font16->lfHeight = font32->lfHeight; |
| 116 | font16->lfWidth = font32->lfWidth; |
| 117 | font16->lfEscapement = font32->lfEscapement; |
| 118 | font16->lfOrientation = font32->lfOrientation; |
| 119 | font16->lfWeight = font32->lfWeight; |
| 120 | font16->lfItalic = font32->lfItalic; |
| 121 | font16->lfUnderline = font32->lfUnderline; |
| 122 | font16->lfStrikeOut = font32->lfStrikeOut; |
| 123 | font16->lfCharSet = font32->lfCharSet; |
| 124 | font16->lfOutPrecision = font32->lfOutPrecision; |
| 125 | font16->lfClipPrecision = font32->lfClipPrecision; |
| 126 | font16->lfQuality = font32->lfQuality; |
| 127 | font16->lfPitchAndFamily = font32->lfPitchAndFamily; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 128 | lstrcpynWtoA( font16->lfFaceName, font32->lfFaceName, LF_FACESIZE ); |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 129 | } |
| 130 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 131 | void FONT_LogFont16To32A( const LPLOGFONT16 font16, LPLOGFONTA font32 ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 132 | { |
Ulrich Weigand | d1682aa | 1999-11-21 02:21:17 +0000 | [diff] [blame] | 133 | font32->lfHeight = font16->lfHeight; |
| 134 | font32->lfWidth = font16->lfWidth; |
| 135 | font32->lfEscapement = font16->lfEscapement; |
| 136 | font32->lfOrientation = font16->lfOrientation; |
| 137 | font32->lfWeight = font16->lfWeight; |
| 138 | font32->lfItalic = font16->lfItalic; |
| 139 | font32->lfUnderline = font16->lfUnderline; |
| 140 | font32->lfStrikeOut = font16->lfStrikeOut; |
| 141 | font32->lfCharSet = font16->lfCharSet; |
| 142 | font32->lfOutPrecision = font16->lfOutPrecision; |
| 143 | font32->lfClipPrecision = font16->lfClipPrecision; |
| 144 | font32->lfQuality = font16->lfQuality; |
| 145 | font32->lfPitchAndFamily = font16->lfPitchAndFamily; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 146 | lstrcpynA( font32->lfFaceName, font16->lfFaceName, LF_FACESIZE ); |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 147 | } |
| 148 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 149 | void FONT_LogFont16To32W( const LPLOGFONT16 font16, LPLOGFONTW font32 ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 150 | { |
Ulrich Weigand | d1682aa | 1999-11-21 02:21:17 +0000 | [diff] [blame] | 151 | font32->lfHeight = font16->lfHeight; |
| 152 | font32->lfWidth = font16->lfWidth; |
| 153 | font32->lfEscapement = font16->lfEscapement; |
| 154 | font32->lfOrientation = font16->lfOrientation; |
| 155 | font32->lfWeight = font16->lfWeight; |
| 156 | font32->lfItalic = font16->lfItalic; |
| 157 | font32->lfUnderline = font16->lfUnderline; |
| 158 | font32->lfStrikeOut = font16->lfStrikeOut; |
| 159 | font32->lfCharSet = font16->lfCharSet; |
| 160 | font32->lfOutPrecision = font16->lfOutPrecision; |
| 161 | font32->lfClipPrecision = font16->lfClipPrecision; |
| 162 | font32->lfQuality = font16->lfQuality; |
| 163 | font32->lfPitchAndFamily = font16->lfPitchAndFamily; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 164 | lstrcpynAtoW( font32->lfFaceName, font16->lfFaceName, LF_FACESIZE ); |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 165 | } |
| 166 | |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 167 | void FONT_EnumLogFontEx16To32A( const LPENUMLOGFONTEX16 font16, LPENUMLOGFONTEXA font32 ) |
| 168 | { |
| 169 | FONT_LogFont16To32A( (LPLOGFONT16)font16, (LPLOGFONTA)font32); |
| 170 | lstrcpynA( font32->elfFullName, font16->elfFullName, LF_FULLFACESIZE ); |
| 171 | lstrcpynA( font32->elfStyle, font16->elfStyle, LF_FACESIZE ); |
| 172 | lstrcpynA( font32->elfScript, font16->elfScript, LF_FACESIZE ); |
| 173 | } |
| 174 | |
| 175 | void FONT_EnumLogFontEx16To32W( const LPENUMLOGFONTEX16 font16, LPENUMLOGFONTEXW font32 ) |
| 176 | { |
| 177 | FONT_LogFont16To32W( (LPLOGFONT16)font16, (LPLOGFONTW)font32); |
| 178 | lstrcpynAtoW( font32->elfFullName, font16->elfFullName, LF_FULLFACESIZE ); |
| 179 | lstrcpynAtoW( font32->elfStyle, font16->elfStyle, LF_FACESIZE ); |
| 180 | lstrcpynAtoW( font32->elfScript, font16->elfScript, LF_FACESIZE ); |
| 181 | } |
| 182 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 183 | /*********************************************************************** |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 184 | * TEXTMETRIC conversion functions. |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 185 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 186 | void FONT_TextMetric32Ato16(const LPTEXTMETRICA ptm32, LPTEXTMETRIC16 ptm16 ) |
Alexandre Julliard | e2991ea | 1995-07-29 13:09:43 +0000 | [diff] [blame] | 187 | { |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 188 | ptm16->tmHeight = ptm32->tmHeight; |
| 189 | ptm16->tmAscent = ptm32->tmAscent; |
| 190 | ptm16->tmDescent = ptm32->tmDescent; |
| 191 | ptm16->tmInternalLeading = ptm32->tmInternalLeading; |
| 192 | ptm16->tmExternalLeading = ptm32->tmExternalLeading; |
| 193 | ptm16->tmAveCharWidth = ptm32->tmAveCharWidth; |
| 194 | ptm16->tmMaxCharWidth = ptm32->tmMaxCharWidth; |
| 195 | ptm16->tmWeight = ptm32->tmWeight; |
| 196 | ptm16->tmOverhang = ptm32->tmOverhang; |
| 197 | ptm16->tmDigitizedAspectX = ptm32->tmDigitizedAspectX; |
| 198 | ptm16->tmDigitizedAspectY = ptm32->tmDigitizedAspectY; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 199 | ptm16->tmFirstChar = ptm32->tmFirstChar; |
| 200 | ptm16->tmLastChar = ptm32->tmLastChar; |
| 201 | ptm16->tmDefaultChar = ptm32->tmDefaultChar; |
| 202 | ptm16->tmBreakChar = ptm32->tmBreakChar; |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 203 | ptm16->tmItalic = ptm32->tmItalic; |
| 204 | ptm16->tmUnderlined = ptm32->tmUnderlined; |
| 205 | ptm16->tmStruckOut = ptm32->tmStruckOut; |
| 206 | ptm16->tmPitchAndFamily = ptm32->tmPitchAndFamily; |
| 207 | ptm16->tmCharSet = ptm32->tmCharSet; |
Alexandre Julliard | ded3038 | 1995-07-06 17:18:27 +0000 | [diff] [blame] | 208 | } |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 209 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 210 | void FONT_TextMetric32Wto16(const LPTEXTMETRICW ptm32, LPTEXTMETRIC16 ptm16 ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 211 | { |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 212 | ptm16->tmHeight = ptm32->tmHeight; |
| 213 | ptm16->tmAscent = ptm32->tmAscent; |
| 214 | ptm16->tmDescent = ptm32->tmDescent; |
| 215 | ptm16->tmInternalLeading = ptm32->tmInternalLeading; |
| 216 | ptm16->tmExternalLeading = ptm32->tmExternalLeading; |
| 217 | ptm16->tmAveCharWidth = ptm32->tmAveCharWidth; |
| 218 | ptm16->tmMaxCharWidth = ptm32->tmMaxCharWidth; |
| 219 | ptm16->tmWeight = ptm32->tmWeight; |
| 220 | ptm16->tmOverhang = ptm32->tmOverhang; |
| 221 | ptm16->tmDigitizedAspectX = ptm32->tmDigitizedAspectX; |
| 222 | ptm16->tmDigitizedAspectY = ptm32->tmDigitizedAspectY; |
| 223 | ptm16->tmFirstChar = ptm32->tmFirstChar; |
| 224 | ptm16->tmLastChar = ptm32->tmLastChar; |
| 225 | ptm16->tmDefaultChar = ptm32->tmDefaultChar; |
| 226 | ptm16->tmBreakChar = ptm32->tmBreakChar; |
| 227 | ptm16->tmItalic = ptm32->tmItalic; |
| 228 | ptm16->tmUnderlined = ptm32->tmUnderlined; |
| 229 | ptm16->tmStruckOut = ptm32->tmStruckOut; |
| 230 | ptm16->tmPitchAndFamily = ptm32->tmPitchAndFamily; |
| 231 | ptm16->tmCharSet = ptm32->tmCharSet; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 232 | } |
| 233 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 234 | void FONT_TextMetric16to32A(const LPTEXTMETRIC16 ptm16, LPTEXTMETRICA ptm32 ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 235 | { |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 236 | ptm32->tmHeight = ptm16->tmHeight; |
| 237 | ptm32->tmAscent = ptm16->tmAscent; |
| 238 | ptm32->tmDescent = ptm16->tmDescent; |
| 239 | ptm32->tmInternalLeading = ptm16->tmInternalLeading; |
| 240 | ptm32->tmExternalLeading = ptm16->tmExternalLeading; |
| 241 | ptm32->tmAveCharWidth = ptm16->tmAveCharWidth; |
| 242 | ptm32->tmMaxCharWidth = ptm16->tmMaxCharWidth; |
| 243 | ptm32->tmWeight = ptm16->tmWeight; |
| 244 | ptm32->tmOverhang = ptm16->tmOverhang; |
| 245 | ptm32->tmDigitizedAspectX = ptm16->tmDigitizedAspectX; |
| 246 | ptm32->tmDigitizedAspectY = ptm16->tmDigitizedAspectY; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 247 | ptm32->tmFirstChar = ptm16->tmFirstChar; |
| 248 | ptm32->tmLastChar = ptm16->tmLastChar; |
| 249 | ptm32->tmDefaultChar = ptm16->tmDefaultChar; |
| 250 | ptm32->tmBreakChar = ptm16->tmBreakChar; |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 251 | ptm32->tmItalic = ptm16->tmItalic; |
| 252 | ptm32->tmUnderlined = ptm16->tmUnderlined; |
| 253 | ptm32->tmStruckOut = ptm16->tmStruckOut; |
| 254 | ptm32->tmPitchAndFamily = ptm16->tmPitchAndFamily; |
| 255 | ptm32->tmCharSet = ptm16->tmCharSet; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 256 | } |
| 257 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 258 | void FONT_TextMetric16to32W(const LPTEXTMETRIC16 ptm16, LPTEXTMETRICW ptm32 ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 259 | { |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 260 | ptm32->tmHeight = ptm16->tmHeight; |
| 261 | ptm32->tmAscent = ptm16->tmAscent; |
| 262 | ptm32->tmDescent = ptm16->tmDescent; |
| 263 | ptm32->tmInternalLeading = ptm16->tmInternalLeading; |
| 264 | ptm32->tmExternalLeading = ptm16->tmExternalLeading; |
| 265 | ptm32->tmAveCharWidth = ptm16->tmAveCharWidth; |
| 266 | ptm32->tmMaxCharWidth = ptm16->tmMaxCharWidth; |
| 267 | ptm32->tmWeight = ptm16->tmWeight; |
| 268 | ptm32->tmOverhang = ptm16->tmOverhang; |
| 269 | ptm32->tmDigitizedAspectX = ptm16->tmDigitizedAspectX; |
| 270 | ptm32->tmDigitizedAspectY = ptm16->tmDigitizedAspectY; |
| 271 | ptm32->tmFirstChar = ptm16->tmFirstChar; |
| 272 | ptm32->tmLastChar = ptm16->tmLastChar; |
| 273 | ptm32->tmDefaultChar = ptm16->tmDefaultChar; |
| 274 | ptm32->tmBreakChar = ptm16->tmBreakChar; |
| 275 | ptm32->tmItalic = ptm16->tmItalic; |
| 276 | ptm32->tmUnderlined = ptm16->tmUnderlined; |
| 277 | ptm32->tmStruckOut = ptm16->tmStruckOut; |
| 278 | ptm32->tmPitchAndFamily = ptm16->tmPitchAndFamily; |
| 279 | ptm32->tmCharSet = ptm16->tmCharSet; |
| 280 | } |
| 281 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 282 | void FONT_TextMetric32Ato32W(const LPTEXTMETRICA ptm32A, LPTEXTMETRICW ptm32W ) |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 283 | { |
| 284 | ptm32W->tmHeight = ptm32A->tmHeight; |
| 285 | ptm32W->tmAscent = ptm32A->tmAscent; |
| 286 | ptm32W->tmDescent = ptm32A->tmDescent; |
| 287 | ptm32W->tmInternalLeading = ptm32A->tmInternalLeading; |
| 288 | ptm32W->tmExternalLeading = ptm32A->tmExternalLeading; |
| 289 | ptm32W->tmAveCharWidth = ptm32A->tmAveCharWidth; |
| 290 | ptm32W->tmMaxCharWidth = ptm32A->tmMaxCharWidth; |
| 291 | ptm32W->tmWeight = ptm32A->tmWeight; |
| 292 | ptm32W->tmOverhang = ptm32A->tmOverhang; |
| 293 | ptm32W->tmDigitizedAspectX = ptm32A->tmDigitizedAspectX; |
| 294 | ptm32W->tmDigitizedAspectY = ptm32A->tmDigitizedAspectY; |
| 295 | ptm32W->tmFirstChar = ptm32A->tmFirstChar; |
| 296 | ptm32W->tmLastChar = ptm32A->tmLastChar; |
| 297 | ptm32W->tmDefaultChar = ptm32A->tmDefaultChar; |
| 298 | ptm32W->tmBreakChar = ptm32A->tmBreakChar; |
| 299 | ptm32W->tmItalic = ptm32A->tmItalic; |
| 300 | ptm32W->tmUnderlined = ptm32A->tmUnderlined; |
| 301 | ptm32W->tmStruckOut = ptm32A->tmStruckOut; |
| 302 | ptm32W->tmPitchAndFamily = ptm32A->tmPitchAndFamily; |
| 303 | ptm32W->tmCharSet = ptm32A->tmCharSet; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 304 | } |
Alexandre Julliard | e2991ea | 1995-07-29 13:09:43 +0000 | [diff] [blame] | 305 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 306 | /*********************************************************************** |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 307 | * CreateFontIndirect16 (GDI.57) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 308 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 309 | HFONT16 WINAPI CreateFontIndirect16( const LOGFONT16 *font ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 310 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 311 | HFONT16 hFont = 0; |
Alexandre Julliard | 0c126c7 | 1996-02-18 18:44:41 +0000 | [diff] [blame] | 312 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 313 | if (font) |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 314 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 315 | hFont = GDI_AllocObject( sizeof(FONTOBJ), FONT_MAGIC ); |
| 316 | if( hFont ) |
| 317 | { |
| 318 | FONTOBJ* fontPtr; |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 319 | fontPtr = (FONTOBJ *) GDI_HEAP_LOCK( hFont ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 320 | memcpy( &fontPtr->logfont, font, sizeof(LOGFONT16) ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 321 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 322 | TRACE("(%i %i %i %i) '%s' %s %s => %04x\n", |
| 323 | font->lfHeight, font->lfWidth, |
| 324 | font->lfEscapement, font->lfOrientation, |
| 325 | font->lfFaceName ? font->lfFaceName : "NULL", |
| 326 | font->lfWeight > 400 ? "Bold" : "", |
| 327 | font->lfItalic ? "Italic" : "", hFont); |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 328 | |
| 329 | if (font->lfEscapement != font->lfOrientation) { |
| 330 | /* this should really depend on whether GM_ADVANCED is set */ |
| 331 | fontPtr->logfont.lfOrientation = fontPtr->logfont.lfEscapement; |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 332 | WARN("orientation angle %f set to " |
| 333 | "escapement angle %f for new font %04x\n", |
| 334 | font->lfOrientation/10., font->lfEscapement/10., hFont); |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 335 | } |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 336 | GDI_HEAP_UNLOCK( hFont ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 337 | } |
| 338 | } |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 339 | else WARN("(NULL) => NULL\n"); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 340 | |
| 341 | return hFont; |
| 342 | } |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 343 | |
| 344 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 345 | * CreateFontIndirectA (GDI32.44) |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 346 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 347 | HFONT WINAPI CreateFontIndirectA( const LOGFONTA *font ) |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 348 | { |
| 349 | LOGFONT16 font16; |
| 350 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 351 | FONT_LogFont32ATo16( font, &font16 ); |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 352 | return CreateFontIndirect16( &font16 ); |
| 353 | } |
| 354 | |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 355 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 356 | * CreateFontIndirectW (GDI32.45) |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 357 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 358 | HFONT WINAPI CreateFontIndirectW( const LOGFONTW *font ) |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 359 | { |
| 360 | LOGFONT16 font16; |
| 361 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 362 | FONT_LogFont32WTo16( font, &font16 ); |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 363 | return CreateFontIndirect16( &font16 ); |
| 364 | } |
| 365 | |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 366 | /*********************************************************************** |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 367 | * CreateFont16 (GDI.56) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 368 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 369 | HFONT16 WINAPI CreateFont16(INT16 height, INT16 width, INT16 esc, INT16 orient, |
| 370 | INT16 weight, BYTE italic, BYTE underline, |
| 371 | BYTE strikeout, BYTE charset, BYTE outpres, |
| 372 | BYTE clippres, BYTE quality, BYTE pitch, |
| 373 | LPCSTR name ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 374 | { |
Patrik Stridvall | a9a671d | 1999-04-25 19:01:52 +0000 | [diff] [blame] | 375 | LOGFONT16 logfont; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 376 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 377 | TRACE("('%s',%d,%d)\n", (name ? name : "(null)") , height, width); |
Patrik Stridvall | a9a671d | 1999-04-25 19:01:52 +0000 | [diff] [blame] | 378 | |
| 379 | logfont.lfHeight = height; |
| 380 | logfont.lfWidth = width; |
| 381 | logfont.lfEscapement = esc; |
| 382 | logfont.lfOrientation = orient; |
| 383 | logfont.lfWeight = weight; |
| 384 | logfont.lfItalic = italic; |
| 385 | logfont.lfUnderline = underline; |
| 386 | logfont.lfStrikeOut = strikeout; |
| 387 | logfont.lfCharSet = charset; |
| 388 | logfont.lfOutPrecision = outpres; |
| 389 | logfont.lfClipPrecision = clippres; |
| 390 | logfont.lfQuality = quality; |
| 391 | logfont.lfPitchAndFamily = pitch; |
| 392 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 393 | if (name) |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 394 | lstrcpynA(logfont.lfFaceName,name,sizeof(logfont.lfFaceName)); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 395 | else |
| 396 | logfont.lfFaceName[0] = '\0'; |
Patrik Stridvall | a9a671d | 1999-04-25 19:01:52 +0000 | [diff] [blame] | 397 | |
Alexandre Julliard | ca22b33 | 1996-07-12 19:02:39 +0000 | [diff] [blame] | 398 | return CreateFontIndirect16( &logfont ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 399 | } |
| 400 | |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 401 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 402 | * CreateFontA (GDI32.43) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 403 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 404 | HFONT WINAPI CreateFontA( INT height, INT width, INT esc, |
| 405 | INT orient, INT weight, DWORD italic, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 406 | DWORD underline, DWORD strikeout, DWORD charset, |
| 407 | DWORD outpres, DWORD clippres, DWORD quality, |
| 408 | DWORD pitch, LPCSTR name ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 409 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 410 | return (HFONT)CreateFont16( height, width, esc, orient, weight, italic, |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 411 | underline, strikeout, charset, outpres, |
| 412 | clippres, quality, pitch, name ); |
| 413 | } |
| 414 | |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 415 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 416 | * CreateFontW (GDI32.46) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 417 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 418 | HFONT WINAPI CreateFontW( INT height, INT width, INT esc, |
| 419 | INT orient, INT weight, DWORD italic, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 420 | DWORD underline, DWORD strikeout, DWORD charset, |
| 421 | DWORD outpres, DWORD clippres, DWORD quality, |
| 422 | DWORD pitch, LPCWSTR name ) |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 423 | { |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 424 | LPSTR namea = HEAP_strdupWtoA( GetProcessHeap(), 0, name ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 425 | HFONT ret = (HFONT)CreateFont16( height, width, esc, orient, weight, |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 426 | italic, underline, strikeout, charset, |
| 427 | outpres, clippres, quality, pitch, |
| 428 | namea ); |
Alexandre Julliard | 491502b | 1997-11-01 19:08:16 +0000 | [diff] [blame] | 429 | if (namea) HeapFree( GetProcessHeap(), 0, namea ); |
Alexandre Julliard | 18f92e7 | 1996-07-17 20:02:21 +0000 | [diff] [blame] | 430 | return ret; |
| 431 | } |
| 432 | |
| 433 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 434 | /*********************************************************************** |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 435 | * FONT_GetObject16 |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 436 | */ |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 437 | INT16 FONT_GetObject16( FONTOBJ * font, INT16 count, LPSTR buffer ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 438 | { |
Alexandre Julliard | d90840e | 1996-06-11 16:02:08 +0000 | [diff] [blame] | 439 | if (count > sizeof(LOGFONT16)) count = sizeof(LOGFONT16); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 440 | memcpy( buffer, &font->logfont, count ); |
| 441 | return count; |
| 442 | } |
| 443 | |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 444 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 445 | * FONT_GetObjectA |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 446 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 447 | INT FONT_GetObjectA( FONTOBJ *font, INT count, LPSTR buffer ) |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 448 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 449 | LOGFONTA fnt32; |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 450 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 451 | FONT_LogFont16To32A( &font->logfont, &fnt32 ); |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 452 | |
| 453 | if (count > sizeof(fnt32)) count = sizeof(fnt32); |
| 454 | memcpy( buffer, &fnt32, count ); |
| 455 | return count; |
| 456 | } |
Juergen Schmied | cba8488 | 1998-10-23 13:27:36 +0000 | [diff] [blame] | 457 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 458 | * FONT_GetObjectW |
Juergen Schmied | cba8488 | 1998-10-23 13:27:36 +0000 | [diff] [blame] | 459 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 460 | INT FONT_GetObjectW( FONTOBJ *font, INT count, LPSTR buffer ) |
Juergen Schmied | cba8488 | 1998-10-23 13:27:36 +0000 | [diff] [blame] | 461 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 462 | LOGFONTW fnt32; |
Juergen Schmied | cba8488 | 1998-10-23 13:27:36 +0000 | [diff] [blame] | 463 | |
| 464 | FONT_LogFont16To32W( &font->logfont, &fnt32 ); |
| 465 | |
| 466 | if (count > sizeof(fnt32)) count = sizeof(fnt32); |
| 467 | memcpy( buffer, &fnt32, count ); |
| 468 | return count; |
| 469 | } |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 470 | |
| 471 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 472 | /*********************************************************************** |
| 473 | * FONT_EnumInstance16 |
| 474 | * |
| 475 | * Called by the device driver layer to pass font info |
| 476 | * down to the application. |
| 477 | */ |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 478 | static INT FONT_EnumInstance16( LPENUMLOGFONTEX16 plf, |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 479 | LPNEWTEXTMETRIC16 ptm, UINT16 fType, LPARAM lp ) |
| 480 | { |
| 481 | #define pfe ((fontEnum16*)lp) |
| 482 | if( pfe->lpLogFontParam->lfCharSet == DEFAULT_CHARSET || |
| 483 | pfe->lpLogFontParam->lfCharSet == plf->elfLogFont.lfCharSet ) |
| 484 | { |
| 485 | memcpy( pfe->lpLogFont, plf, sizeof(ENUMLOGFONT16) ); |
| 486 | memcpy( pfe->lpTextMetric, ptm, sizeof(NEWTEXTMETRIC16) ); |
| 487 | |
| 488 | return pfe->lpEnumFunc( pfe->segLogFont, pfe->segTextMetric, fType, (LPARAM)(pfe->lpData) ); |
| 489 | } |
| 490 | #undef pfe |
| 491 | return 1; |
| 492 | } |
| 493 | |
| 494 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 495 | * FONT_EnumInstance |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 496 | */ |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 497 | static INT FONT_EnumInstance( LPENUMLOGFONTEX16 plf, |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 498 | LPNEWTEXTMETRIC16 ptm, UINT16 fType, LPARAM lp ) |
| 499 | { |
| 500 | /* lfCharSet is at the same offset in both LOGFONT32A and LOGFONT32W */ |
| 501 | |
| 502 | #define pfe ((fontEnum32*)lp) |
| 503 | if( pfe->lpLogFontParam->lfCharSet == DEFAULT_CHARSET || |
| 504 | pfe->lpLogFontParam->lfCharSet == plf->elfLogFont.lfCharSet ) |
| 505 | { |
| 506 | /* convert font metrics */ |
| 507 | |
| 508 | if( pfe->dwFlags & ENUM_UNICODE ) |
| 509 | { |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 510 | FONT_EnumLogFontEx16To32W( plf, pfe->lpLogFont ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 511 | FONT_TextMetric16to32W( (LPTEXTMETRIC16)ptm, (LPTEXTMETRICW)(pfe->lpTextMetric) ); |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 512 | |
| 513 | return pfe->lpEnumFunc( pfe->lpLogFont, pfe->lpTextMetric, fType, pfe->lpData ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 514 | } |
| 515 | else |
| 516 | { |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 517 | ENUMLOGFONTEXA logfont; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 518 | |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 519 | FONT_EnumLogFontEx16To32A( plf, &logfont); |
| 520 | FONT_TextMetric16to32A( (LPTEXTMETRIC16)ptm, (LPTEXTMETRICA)pfe->lpTextMetric ); |
| 521 | |
| 522 | return pfe->lpEnumFunc( (LPENUMLOGFONTEXW)&logfont, |
| 523 | pfe->lpTextMetric, fType, pfe->lpData ); |
| 524 | } |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 525 | } |
| 526 | #undef pfe |
| 527 | return 1; |
| 528 | } |
| 529 | |
| 530 | /*********************************************************************** |
| 531 | * EnumFontFamiliesEx16 (GDI.613) |
| 532 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 533 | INT16 WINAPI EnumFontFamiliesEx16( HDC16 hDC, LPLOGFONT16 plf, |
| 534 | FONTENUMPROCEX16 efproc, LPARAM lParam, |
| 535 | DWORD dwFlags) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 536 | { |
| 537 | INT16 retVal = 0; |
| 538 | DC* dc = (DC*) GDI_GetObjPtr( hDC, DC_MAGIC ); |
| 539 | |
| 540 | if( dc && dc->funcs->pEnumDeviceFonts ) |
| 541 | { |
| 542 | LPNEWTEXTMETRICEX16 lptm16 = SEGPTR_ALLOC( sizeof(NEWTEXTMETRICEX16) ); |
| 543 | if( lptm16 ) |
| 544 | { |
| 545 | LPENUMLOGFONTEX16 lplf16 = SEGPTR_ALLOC( sizeof(ENUMLOGFONTEX16) ); |
| 546 | if( lplf16 ) |
| 547 | { |
Patrik Stridvall | a9a671d | 1999-04-25 19:01:52 +0000 | [diff] [blame] | 548 | fontEnum16 fe16; |
| 549 | |
| 550 | fe16.lpLogFontParam = plf; |
| 551 | fe16.lpEnumFunc = efproc; |
| 552 | fe16.lpData = lParam; |
| 553 | |
| 554 | fe16.lpTextMetric = lptm16; |
| 555 | fe16.lpLogFont = lplf16; |
| 556 | fe16.segTextMetric = SEGPTR_GET(lptm16); |
| 557 | fe16.segLogFont = SEGPTR_GET(lplf16); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 558 | |
| 559 | retVal = dc->funcs->pEnumDeviceFonts( dc, plf, FONT_EnumInstance16, (LPARAM)&fe16 ); |
| 560 | |
| 561 | SEGPTR_FREE(lplf16); |
| 562 | } |
| 563 | SEGPTR_FREE(lptm16); |
| 564 | } |
| 565 | } |
| 566 | return retVal; |
| 567 | } |
| 568 | |
| 569 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 570 | * FONT_EnumFontFamiliesEx |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 571 | */ |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 572 | static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, FONTENUMPROCEXW efproc, |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 573 | LPARAM lParam, DWORD dwUnicode) |
| 574 | { |
| 575 | DC* dc = (DC*) GDI_GetObjPtr( hDC, DC_MAGIC ); |
| 576 | |
| 577 | if( dc && dc->funcs->pEnumDeviceFonts ) |
| 578 | { |
| 579 | LOGFONT16 lf16; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 580 | NEWTEXTMETRICEXW tm32w; |
| 581 | ENUMLOGFONTEXW lf32w; |
Patrik Stridvall | a9a671d | 1999-04-25 19:01:52 +0000 | [diff] [blame] | 582 | fontEnum32 fe32; |
| 583 | |
| 584 | fe32.lpLogFontParam = plf; |
| 585 | fe32.lpEnumFunc = efproc; |
| 586 | fe32.lpData = lParam; |
| 587 | |
| 588 | fe32.lpTextMetric = &tm32w; |
| 589 | fe32.lpLogFont = &lf32w; |
| 590 | fe32.dwFlags = dwUnicode; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 591 | |
| 592 | /* the only difference between LOGFONT32A and LOGFONT32W is in the lfFaceName */ |
| 593 | |
| 594 | if( plf->lfFaceName[0] ) |
| 595 | { |
| 596 | if( dwUnicode ) |
| 597 | lstrcpynWtoA( lf16.lfFaceName, plf->lfFaceName, LF_FACESIZE ); |
| 598 | else |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 599 | lstrcpynA( lf16.lfFaceName, (LPCSTR)plf->lfFaceName, LF_FACESIZE ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 600 | } |
| 601 | else lf16.lfFaceName[0] = '\0'; |
| 602 | lf16.lfCharSet = plf->lfCharSet; |
| 603 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 604 | return dc->funcs->pEnumDeviceFonts( dc, &lf16, FONT_EnumInstance, (LPARAM)&fe32 ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 605 | } |
| 606 | return 0; |
| 607 | } |
| 608 | |
| 609 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 610 | * EnumFontFamiliesExW (GDI32.82) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 611 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 612 | INT WINAPI EnumFontFamiliesExW( HDC hDC, LPLOGFONTW plf, |
| 613 | FONTENUMPROCEXW efproc, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 614 | LPARAM lParam, DWORD dwFlags ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 615 | { |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 616 | return FONT_EnumFontFamiliesEx( hDC, plf, efproc, lParam, ENUM_UNICODE ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 617 | } |
| 618 | |
| 619 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 620 | * EnumFontFamiliesExA (GDI32.81) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 621 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 622 | INT WINAPI EnumFontFamiliesExA( HDC hDC, LPLOGFONTA plf, |
| 623 | FONTENUMPROCEXA efproc, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 624 | LPARAM lParam, DWORD dwFlags) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 625 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 626 | return FONT_EnumFontFamiliesEx( hDC, (LPLOGFONTW)plf, |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 627 | (FONTENUMPROCEXW)efproc, lParam, 0); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 628 | } |
| 629 | |
| 630 | /*********************************************************************** |
| 631 | * EnumFontFamilies16 (GDI.330) |
| 632 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 633 | INT16 WINAPI EnumFontFamilies16( HDC16 hDC, LPCSTR lpFamily, |
| 634 | FONTENUMPROC16 efproc, LPARAM lpData ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 635 | { |
| 636 | LOGFONT16 lf; |
| 637 | |
| 638 | lf.lfCharSet = DEFAULT_CHARSET; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 639 | if( lpFamily ) lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 640 | else lf.lfFaceName[0] = '\0'; |
| 641 | |
| 642 | return EnumFontFamiliesEx16( hDC, &lf, (FONTENUMPROCEX16)efproc, lpData, 0 ); |
| 643 | } |
| 644 | |
| 645 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 646 | * EnumFontFamiliesA (GDI32.80) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 647 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 648 | INT WINAPI EnumFontFamiliesA( HDC hDC, LPCSTR lpFamily, |
| 649 | FONTENUMPROCA efproc, LPARAM lpData ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 650 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 651 | LOGFONTA lf; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 652 | |
| 653 | lf.lfCharSet = DEFAULT_CHARSET; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 654 | if( lpFamily ) lstrcpynA( lf.lfFaceName, lpFamily, LF_FACESIZE ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 655 | else lf.lfFaceName[0] = lf.lfFaceName[1] = '\0'; |
| 656 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 657 | return FONT_EnumFontFamiliesEx( hDC, (LPLOGFONTW)&lf, |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 658 | (FONTENUMPROCEXW)efproc, lpData, 0 ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 659 | } |
| 660 | |
| 661 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 662 | * EnumFontFamiliesW (GDI32.83) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 663 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 664 | INT WINAPI EnumFontFamiliesW( HDC hDC, LPCWSTR lpFamily, |
| 665 | FONTENUMPROCW efproc, LPARAM lpData ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 666 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 667 | LOGFONTW lf; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 668 | |
| 669 | lf.lfCharSet = DEFAULT_CHARSET; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 670 | if( lpFamily ) lstrcpynW( lf.lfFaceName, lpFamily, LF_FACESIZE ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 671 | else lf.lfFaceName[0] = 0; |
| 672 | |
Ulrich Czekalla | e6ab9d3 | 1999-10-24 17:26:45 +0000 | [diff] [blame] | 673 | return FONT_EnumFontFamiliesEx( hDC, &lf, (FONTENUMPROCEXW)efproc, |
| 674 | lpData, ENUM_UNICODE ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 675 | } |
| 676 | |
| 677 | /*********************************************************************** |
| 678 | * EnumFonts16 (GDI.70) |
| 679 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 680 | INT16 WINAPI EnumFonts16( HDC16 hDC, LPCSTR lpName, FONTENUMPROC16 efproc, |
| 681 | LPARAM lpData ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 682 | { |
| 683 | return EnumFontFamilies16( hDC, lpName, (FONTENUMPROCEX16)efproc, lpData ); |
| 684 | } |
| 685 | |
| 686 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 687 | * EnumFontsA (GDI32.84) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 688 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 689 | INT WINAPI EnumFontsA( HDC hDC, LPCSTR lpName, FONTENUMPROCA efproc, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 690 | LPARAM lpData ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 691 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 692 | return EnumFontFamiliesA( hDC, lpName, efproc, lpData ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 693 | } |
| 694 | |
| 695 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 696 | * EnumFontsW (GDI32.85) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 697 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 698 | INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 699 | LPARAM lpData ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 700 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 701 | return EnumFontFamiliesW( hDC, lpName, efproc, lpData ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 702 | } |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 703 | |
| 704 | |
| 705 | /*********************************************************************** |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 706 | * GetTextCharacterExtra16 (GDI.89) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 707 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 708 | INT16 WINAPI GetTextCharacterExtra16( HDC16 hdc ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 709 | { |
| 710 | DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); |
| 711 | if (!dc) return 0; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 712 | return abs( (dc->w.charExtra * dc->wndExtX + dc->vportExtX / 2) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 713 | / dc->vportExtX ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 714 | } |
| 715 | |
| 716 | |
| 717 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 718 | * GetTextCharacterExtra (GDI32.225) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 719 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 720 | INT WINAPI GetTextCharacterExtra( HDC hdc ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 721 | { |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 722 | DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); |
| 723 | if (!dc) return 0; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 724 | return abs( (dc->w.charExtra * dc->wndExtX + dc->vportExtX / 2) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 725 | / dc->vportExtX ); |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 726 | } |
| 727 | |
| 728 | |
| 729 | /*********************************************************************** |
| 730 | * SetTextCharacterExtra16 (GDI.8) |
| 731 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 732 | INT16 WINAPI SetTextCharacterExtra16( HDC16 hdc, INT16 extra ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 733 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 734 | return (INT16)SetTextCharacterExtra( hdc, extra ); |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 735 | } |
| 736 | |
| 737 | |
| 738 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 739 | * SetTextCharacterExtra (GDI32.337) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 740 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 741 | INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 742 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 743 | INT prev; |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 744 | DC * dc = DC_GetDCPtr( hdc ); |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 745 | if (!dc) return 0; |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 746 | if (dc->funcs->pSetTextCharacterExtra) |
| 747 | return dc->funcs->pSetTextCharacterExtra( dc, extra ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 748 | extra = (extra * dc->vportExtX + dc->wndExtX / 2) / dc->wndExtX; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 749 | prev = dc->w.charExtra; |
| 750 | dc->w.charExtra = abs(extra); |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 751 | return (prev * dc->wndExtX + dc->vportExtX / 2) / dc->vportExtX; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 752 | } |
| 753 | |
| 754 | |
| 755 | /*********************************************************************** |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 756 | * SetTextJustification16 (GDI.10) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 757 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 758 | INT16 WINAPI SetTextJustification16( HDC16 hdc, INT16 extra, INT16 breaks ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 759 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 760 | return SetTextJustification( hdc, extra, breaks ); |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 761 | } |
| 762 | |
| 763 | |
| 764 | /*********************************************************************** |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 765 | * SetTextJustification (GDI32.339) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 766 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 767 | BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 768 | { |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 769 | DC * dc = DC_GetDCPtr( hdc ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 770 | if (!dc) return 0; |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 771 | if (dc->funcs->pSetTextJustification) |
| 772 | return dc->funcs->pSetTextJustification( dc, extra, breaks ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 773 | |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 774 | extra = abs((extra * dc->vportExtX + dc->wndExtX / 2) / dc->wndExtX); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 775 | if (!extra) breaks = 0; |
| 776 | dc->w.breakTotalExtra = extra; |
| 777 | dc->w.breakCount = breaks; |
| 778 | if (breaks) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 779 | { |
| 780 | dc->w.breakExtra = extra / breaks; |
| 781 | dc->w.breakRem = extra - (dc->w.breakCount * dc->w.breakExtra); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 782 | } |
| 783 | else |
| 784 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 785 | dc->w.breakExtra = 0; |
| 786 | dc->w.breakRem = 0; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 787 | } |
| 788 | return 1; |
| 789 | } |
| 790 | |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 791 | |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 792 | /*********************************************************************** |
| 793 | * GetTextFace16 (GDI.92) |
| 794 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 795 | INT16 WINAPI GetTextFace16( HDC16 hdc, INT16 count, LPSTR name ) |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 796 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 797 | return GetTextFaceA(hdc,count,name); |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 798 | } |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 799 | |
| 800 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 801 | * GetTextFaceA (GDI32.234) |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 802 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 803 | INT WINAPI GetTextFaceA( HDC hdc, INT count, LPSTR name ) |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 804 | { |
| 805 | FONTOBJ *font; |
| 806 | |
| 807 | DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); |
| 808 | if (!dc) return 0; |
| 809 | if (!(font = (FONTOBJ *) GDI_GetObjPtr( dc->w.hFont, FONT_MAGIC ))) |
| 810 | return 0; |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 811 | if (name) |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 812 | lstrcpynA( name, font->logfont.lfFaceName, count ); |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 813 | GDI_HEAP_UNLOCK( dc->w.hFont ); |
Alexandre Julliard | 829fe32 | 1998-07-26 14:27:39 +0000 | [diff] [blame] | 814 | if (name) |
| 815 | return strlen(name); |
| 816 | else |
| 817 | return strlen(font->logfont.lfFaceName) + 1; |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 818 | } |
| 819 | |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 820 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 821 | * GetTextFaceW (GDI32.235) |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 822 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 823 | INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name ) |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 824 | { |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 825 | LPSTR nameA = HeapAlloc( GetProcessHeap(), 0, count ); |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 826 | INT res = GetTextFaceA(hdc,count,nameA); |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 827 | lstrcpyAtoW( name, nameA ); |
| 828 | HeapFree( GetProcessHeap(), 0, nameA ); |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 829 | return res; |
| 830 | } |
| 831 | |
Alexandre Julliard | aca0578 | 1994-10-17 18:12:41 +0000 | [diff] [blame] | 832 | |
| 833 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 834 | * GetTextExtent16 (GDI.91) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 835 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 836 | DWORD WINAPI GetTextExtent16( HDC16 hdc, LPCSTR str, INT16 count ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 837 | { |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 838 | SIZE16 size; |
| 839 | if (!GetTextExtentPoint16( hdc, str, count, &size )) return 0; |
Alexandre Julliard | 234bc24 | 1994-12-10 13:02:28 +0000 | [diff] [blame] | 840 | return MAKELONG( size.cx, size.cy ); |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 841 | } |
| 842 | |
| 843 | |
| 844 | /*********************************************************************** |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 845 | * GetTextExtentPoint16 (GDI.471) |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 846 | * |
| 847 | * FIXME: Should this have a bug for compatibility? |
| 848 | * Original Windows versions of GetTextExtentPoint{A,W} have documented |
Alexandre Julliard | 638f169 | 1999-01-17 16:32:32 +0000 | [diff] [blame] | 849 | * bugs (-> MSDN KB q147647.txt). |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 850 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 851 | BOOL16 WINAPI GetTextExtentPoint16( HDC16 hdc, LPCSTR str, INT16 count, |
| 852 | LPSIZE16 size ) |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 853 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 854 | SIZE size32; |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 855 | BOOL ret; |
| 856 | TRACE("%04x, %p (%s), %d, %p\n", hdc, str, debugstr_an(str, count), count, |
| 857 | size); |
| 858 | ret = GetTextExtentPoint32A( hdc, str, count, &size32 ); |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 859 | CONV_SIZE32TO16( &size32, size ); |
| 860 | return (BOOL16)ret; |
| 861 | } |
| 862 | |
| 863 | |
| 864 | /*********************************************************************** |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 865 | * GetTextExtentPoint32A (GDI32.230) |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 866 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 867 | BOOL WINAPI GetTextExtentPoint32A( HDC hdc, LPCSTR str, INT count, |
| 868 | LPSIZE size ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 869 | { |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 870 | LPWSTR p; |
| 871 | BOOL ret; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 872 | |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 873 | /* str may not be 0 terminated so we can't use HEAP_strdupWtoA. |
| 874 | * We allocate one more than we need so that lstrcpynWtoA can write a |
| 875 | * trailing 0 if it wants. |
| 876 | */ |
Alexandre Julliard | 0e270f4 | 1996-08-24 18:26:35 +0000 | [diff] [blame] | 877 | |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 878 | p = HeapAlloc( GetProcessHeap(), 0, (count+1) * sizeof(WCHAR) ); |
| 879 | lstrcpynAtoW(p, str, count+1); |
| 880 | ret = GetTextExtentPoint32W( hdc, p, count, size ); |
| 881 | HeapFree( GetProcessHeap(), 0, p ); |
| 882 | return ret; |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 883 | } |
| 884 | |
| 885 | |
| 886 | /*********************************************************************** |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 887 | * GetTextExtentPoint32W [GDI32.231] Computes width/height for a string |
| 888 | * |
| 889 | * Computes width and height of the specified string. |
| 890 | * |
| 891 | * RETURNS |
| 892 | * Success: TRUE |
| 893 | * Failure: FALSE |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 894 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 895 | BOOL WINAPI GetTextExtentPoint32W( |
| 896 | HDC hdc, /* [in] Handle of device context */ |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 897 | LPCWSTR str, /* [in] Address of text string */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 898 | INT count, /* [in] Number of characters in string */ |
| 899 | LPSIZE size) /* [out] Address of structure for string size */ |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 900 | { |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 901 | DC * dc = DC_GetDCPtr( hdc ); |
| 902 | if (!dc || !dc->funcs->pGetTextExtentPoint || |
| 903 | !dc->funcs->pGetTextExtentPoint( dc, str, count, size )) |
| 904 | return FALSE; |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 905 | |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 906 | TRACE("(%08x %s %d %p): returning %d,%d\n", |
| 907 | hdc, debugstr_wn (str, count), count, size, size->cx, size->cy ); |
| 908 | return TRUE; |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 909 | } |
| 910 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 911 | |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 912 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 913 | * GetTextExtentPointA (GDI32.232) |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 914 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 915 | BOOL WINAPI GetTextExtentPointA( HDC hdc, LPCSTR str, INT count, |
| 916 | LPSIZE size ) |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 917 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 918 | TRACE("not bug compatible.\n"); |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 919 | return GetTextExtentPoint32A( hdc, str, count, size ); |
| 920 | } |
| 921 | |
| 922 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 923 | * GetTextExtentPointW (GDI32.233) |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 924 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 925 | BOOL WINAPI GetTextExtentPointW( HDC hdc, LPCWSTR str, INT count, |
| 926 | LPSIZE size ) |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 927 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 928 | TRACE("not bug compatible.\n"); |
Alexandre Julliard | 7e6ae4b | 1996-12-08 19:25:27 +0000 | [diff] [blame] | 929 | return GetTextExtentPoint32W( hdc, str, count, size ); |
| 930 | } |
| 931 | |
Alexandre Julliard | e2bfa4c | 1996-05-16 18:21:06 +0000 | [diff] [blame] | 932 | |
| 933 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 934 | * GetTextExtentExPointA (GDI32.228) |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 935 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 936 | BOOL WINAPI GetTextExtentExPointA( HDC hdc, LPCSTR str, INT count, |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 937 | INT maxExt, LPINT lpnFit, |
| 938 | LPINT alpDx, LPSIZE size ) |
| 939 | { |
| 940 | LPWSTR p; |
| 941 | BOOL ret; |
| 942 | |
| 943 | /* Docs say str should be 0 terminated here, but we'll use count just in case |
| 944 | */ |
| 945 | |
| 946 | p = HeapAlloc( GetProcessHeap(), 0, (count+1) * sizeof(WCHAR) ); |
| 947 | lstrcpynAtoW(p, str, count+1); |
| 948 | ret = GetTextExtentExPointW( hdc, p, count, maxExt, lpnFit, alpDx, size); |
| 949 | HeapFree( GetProcessHeap(), 0, p ); |
| 950 | return ret; |
| 951 | } |
| 952 | |
| 953 | |
| 954 | /*********************************************************************** |
| 955 | * GetTextExtentExPointW (GDI32.229) |
| 956 | */ |
| 957 | |
| 958 | BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count, |
| 959 | INT maxExt, LPINT lpnFit, |
| 960 | LPINT alpDx, LPSIZE size ) |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 961 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 962 | int index, nFit, extent; |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 963 | SIZE tSize; |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 964 | DC * dc = DC_GetDCPtr( hdc ); |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 965 | |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 966 | if (!dc || !dc->funcs->pGetTextExtentPoint) return FALSE; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 967 | |
| 968 | size->cx = size->cy = nFit = extent = 0; |
| 969 | for(index = 0; index < count; index++) |
| 970 | { |
| 971 | if(!dc->funcs->pGetTextExtentPoint( dc, str, 1, &tSize )) return FALSE; |
| 972 | if( extent+tSize.cx < maxExt ) |
| 973 | { |
| 974 | extent+=tSize.cx; |
| 975 | nFit++; |
| 976 | str++; |
| 977 | if( alpDx ) alpDx[index] = extent; |
| 978 | if( tSize.cy > size->cy ) size->cy = tSize.cy; |
| 979 | } |
| 980 | else break; |
| 981 | } |
| 982 | size->cx = extent; |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 983 | *lpnFit = nFit; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 984 | |
Huw D M Davies | c553924 | 1999-12-26 00:47:03 +0000 | [diff] [blame^] | 985 | TRACE("(%08x %s %d) returning %d %d %d\n", |
| 986 | hdc,debugstr_wn(str,count),maxExt,nFit, size->cx,size->cy); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 987 | return TRUE; |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 988 | } |
| 989 | |
Alexandre Julliard | b1bac32 | 1996-12-15 19:45:59 +0000 | [diff] [blame] | 990 | /*********************************************************************** |
Alexandre Julliard | 3051b64 | 1996-07-05 17:14:13 +0000 | [diff] [blame] | 991 | * GetTextMetrics16 (GDI.93) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 992 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 993 | BOOL16 WINAPI GetTextMetrics16( HDC16 hdc, TEXTMETRIC16 *metrics ) |
Alexandre Julliard | 401710d | 1993-09-04 10:09:32 +0000 | [diff] [blame] | 994 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 995 | TEXTMETRICA tm32; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 996 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 997 | if (!GetTextMetricsA( (HDC)hdc, &tm32 )) return FALSE; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 998 | FONT_TextMetric32Ato16( &tm32, metrics ); |
Alexandre Julliard | 3051b64 | 1996-07-05 17:14:13 +0000 | [diff] [blame] | 999 | return TRUE; |
| 1000 | } |
| 1001 | |
| 1002 | |
| 1003 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1004 | * GetTextMetricsA (GDI32.236) |
Alexandre Julliard | 01d6346 | 1997-01-20 19:43:45 +0000 | [diff] [blame] | 1005 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1006 | BOOL WINAPI GetTextMetricsA( HDC hdc, TEXTMETRICA *metrics ) |
Alexandre Julliard | 01d6346 | 1997-01-20 19:43:45 +0000 | [diff] [blame] | 1007 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1008 | DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); |
Alexandre Julliard | 01d6346 | 1997-01-20 19:43:45 +0000 | [diff] [blame] | 1009 | if (!dc) |
| 1010 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1011 | if (!(dc = (DC *)GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) |
Alexandre Julliard | 01d6346 | 1997-01-20 19:43:45 +0000 | [diff] [blame] | 1012 | return FALSE; |
| 1013 | } |
| 1014 | |
| 1015 | if (!dc->funcs->pGetTextMetrics || |
Alexandre Julliard | 77b9918 | 1997-09-14 17:17:23 +0000 | [diff] [blame] | 1016 | !dc->funcs->pGetTextMetrics( dc, metrics )) |
Alexandre Julliard | 01d6346 | 1997-01-20 19:43:45 +0000 | [diff] [blame] | 1017 | return FALSE; |
Alexandre Julliard | 77b9918 | 1997-09-14 17:17:23 +0000 | [diff] [blame] | 1018 | |
| 1019 | /* device layer returns values in device units |
| 1020 | * therefore we have to convert them to logical */ |
| 1021 | |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1022 | #define WDPTOLP(x) ((x<0)? \ |
| 1023 | (-abs((x)*dc->wndExtX/dc->vportExtX)): \ |
| 1024 | (abs((x)*dc->wndExtX/dc->vportExtX))) |
| 1025 | #define HDPTOLP(y) ((y<0)? \ |
| 1026 | (-abs((y)*dc->wndExtY/dc->vportExtY)): \ |
| 1027 | (abs((y)*dc->wndExtY/dc->vportExtY))) |
| 1028 | |
| 1029 | metrics->tmHeight = HDPTOLP(metrics->tmHeight); |
| 1030 | metrics->tmAscent = HDPTOLP(metrics->tmAscent); |
| 1031 | metrics->tmDescent = HDPTOLP(metrics->tmDescent); |
| 1032 | metrics->tmInternalLeading = HDPTOLP(metrics->tmInternalLeading); |
| 1033 | metrics->tmExternalLeading = HDPTOLP(metrics->tmExternalLeading); |
| 1034 | metrics->tmAveCharWidth = WDPTOLP(metrics->tmAveCharWidth); |
| 1035 | metrics->tmMaxCharWidth = WDPTOLP(metrics->tmMaxCharWidth); |
| 1036 | metrics->tmOverhang = WDPTOLP(metrics->tmOverhang); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1037 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1038 | TRACE("text metrics:\n" |
| 1039 | " Weight = %03li\t FirstChar = %03i\t AveCharWidth = %li\n" |
| 1040 | " Italic = % 3i\t LastChar = %03i\t\t MaxCharWidth = %li\n" |
| 1041 | " UnderLined = %01i\t DefaultChar = %03i\t Overhang = %li\n" |
| 1042 | " StruckOut = %01i\t BreakChar = %03i\t CharSet = %i\n" |
| 1043 | " PitchAndFamily = %02x\n" |
| 1044 | " --------------------\n" |
| 1045 | " InternalLeading = %li\n" |
| 1046 | " Ascent = %li\n" |
| 1047 | " Descent = %li\n" |
| 1048 | " Height = %li\n", |
| 1049 | metrics->tmWeight, metrics->tmFirstChar, metrics->tmAveCharWidth, |
| 1050 | metrics->tmItalic, metrics->tmLastChar, metrics->tmMaxCharWidth, |
| 1051 | metrics->tmUnderlined, metrics->tmDefaultChar, metrics->tmOverhang, |
| 1052 | metrics->tmStruckOut, metrics->tmBreakChar, metrics->tmCharSet, |
| 1053 | metrics->tmPitchAndFamily, |
| 1054 | metrics->tmInternalLeading, |
| 1055 | metrics->tmAscent, |
| 1056 | metrics->tmDescent, |
| 1057 | metrics->tmHeight ); |
Alexandre Julliard | 01d6346 | 1997-01-20 19:43:45 +0000 | [diff] [blame] | 1058 | return TRUE; |
| 1059 | } |
| 1060 | |
| 1061 | |
| 1062 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1063 | * GetTextMetricsW (GDI32.237) |
Alexandre Julliard | 3051b64 | 1996-07-05 17:14:13 +0000 | [diff] [blame] | 1064 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1065 | BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ) |
Alexandre Julliard | 3051b64 | 1996-07-05 17:14:13 +0000 | [diff] [blame] | 1066 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1067 | TEXTMETRICA tm; |
| 1068 | if (!GetTextMetricsA( (HDC16)hdc, &tm )) return FALSE; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1069 | FONT_TextMetric32Ato32W( &tm, metrics ); |
Alexandre Julliard | 3051b64 | 1996-07-05 17:14:13 +0000 | [diff] [blame] | 1070 | return TRUE; |
| 1071 | } |
| 1072 | |
| 1073 | |
| 1074 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1075 | * GetOutlineTextMetrics16 [GDI.308] Gets metrics for TrueType fonts. |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 1076 | * |
| 1077 | * NOTES |
| 1078 | * lpOTM should be LPOUTLINETEXTMETRIC |
| 1079 | * |
| 1080 | * RETURNS |
| 1081 | * Success: Non-zero or size of required buffer |
| 1082 | * Failure: 0 |
| 1083 | */ |
Alexandre Julliard | 85ed45e | 1998-08-22 19:03:56 +0000 | [diff] [blame] | 1084 | UINT16 WINAPI GetOutlineTextMetrics16( |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 1085 | HDC16 hdc, /* [in] Handle of device context */ |
Alexandre Julliard | 85ed45e | 1998-08-22 19:03:56 +0000 | [diff] [blame] | 1086 | UINT16 cbData, /* [in] Size of metric data array */ |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1087 | LPOUTLINETEXTMETRIC16 lpOTM) /* [out] Address of metric data array */ |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 1088 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1089 | FIXME("(%04x,%04x,%p): stub\n", hdc,cbData,lpOTM); |
Alexandre Julliard | c7c217b | 1998-04-13 12:21:30 +0000 | [diff] [blame] | 1090 | return 0; |
| 1091 | } |
| 1092 | |
| 1093 | |
| 1094 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1095 | * GetOutlineTextMetricsA [GDI.207] Gets metrics for TrueType fonts. |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1096 | * |
| 1097 | * |
| 1098 | * RETURNS |
| 1099 | * Success: Non-zero or size of required buffer |
| 1100 | * Failure: 0 |
| 1101 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1102 | UINT WINAPI GetOutlineTextMetricsA( |
| 1103 | HDC hdc, /* [in] Handle of device context */ |
| 1104 | UINT cbData, /* [in] Size of metric data array */ |
| 1105 | LPOUTLINETEXTMETRICA lpOTM) /* [out] Address of metric data array */ |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1106 | { |
| 1107 | |
| 1108 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1109 | UINT rtn = FALSE; |
| 1110 | LPTEXTMETRICA lptxtMetr; |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1111 | |
| 1112 | |
| 1113 | |
| 1114 | if (lpOTM == 0) |
| 1115 | { |
| 1116 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1117 | lpOTM = (LPOUTLINETEXTMETRICA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(OUTLINETEXTMETRICA)); |
| 1118 | rtn = sizeof(OUTLINETEXTMETRICA); |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1119 | cbData = rtn; |
| 1120 | } else |
| 1121 | { |
| 1122 | cbData = sizeof(*lpOTM); |
| 1123 | rtn = cbData; |
| 1124 | }; |
| 1125 | |
| 1126 | lpOTM->otmSize = cbData; |
| 1127 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1128 | lptxtMetr =HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TEXTMETRICA)); |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1129 | |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1130 | if (!GetTextMetricsA(hdc,lptxtMetr)) |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1131 | { |
| 1132 | return 0; |
| 1133 | } else |
| 1134 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1135 | memcpy(&(lpOTM->otmTextMetrics),lptxtMetr,sizeof(TEXTMETRICA)); |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1136 | }; |
| 1137 | |
| 1138 | HeapFree(GetProcessHeap(),HEAP_ZERO_MEMORY,lptxtMetr); |
| 1139 | |
| 1140 | lpOTM->otmFilter = 0; |
| 1141 | |
| 1142 | lpOTM->otmPanoseNumber.bFamilyType = 0; |
| 1143 | lpOTM->otmPanoseNumber.bSerifStyle = 0; |
| 1144 | lpOTM->otmPanoseNumber.bWeight = 0; |
| 1145 | lpOTM->otmPanoseNumber.bProportion = 0; |
| 1146 | lpOTM->otmPanoseNumber.bContrast = 0; |
| 1147 | lpOTM->otmPanoseNumber.bStrokeVariation = 0; |
| 1148 | lpOTM->otmPanoseNumber.bArmStyle = 0; |
| 1149 | lpOTM->otmPanoseNumber.bLetterform = 0; |
| 1150 | lpOTM->otmPanoseNumber.bMidline = 0; |
| 1151 | lpOTM->otmPanoseNumber.bXHeight = 0; |
| 1152 | |
| 1153 | lpOTM->otmfsSelection = 0; |
| 1154 | lpOTM->otmfsType = 0; |
| 1155 | |
| 1156 | /* |
| 1157 | Further fill of the structure not implemented, |
| 1158 | Needs real values for the structure members |
| 1159 | */ |
| 1160 | |
| 1161 | return rtn; |
| 1162 | } |
| 1163 | |
Alexandre Julliard | 0c0e3be | 1998-12-10 15:49:22 +0000 | [diff] [blame] | 1164 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1165 | * GetOutlineTextMetricsW [GDI32.208] |
Alexandre Julliard | 0c0e3be | 1998-12-10 15:49:22 +0000 | [diff] [blame] | 1166 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1167 | UINT WINAPI GetOutlineTextMetricsW( |
| 1168 | HDC hdc, /* [in] Handle of device context */ |
| 1169 | UINT cbData, /* [in] Size of metric data array */ |
| 1170 | LPOUTLINETEXTMETRICW lpOTM) /* [out] Address of metric data array */ |
Alexandre Julliard | 0c0e3be | 1998-12-10 15:49:22 +0000 | [diff] [blame] | 1171 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1172 | FIXME("(%d,%d,%p): stub\n", hdc, cbData, lpOTM); |
Alexandre Julliard | 0c0e3be | 1998-12-10 15:49:22 +0000 | [diff] [blame] | 1173 | return 0; |
| 1174 | } |
Moshe Vainer | 4a150e7 | 1998-10-14 18:15:43 +0000 | [diff] [blame] | 1175 | |
| 1176 | /*********************************************************************** |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1177 | * GetCharWidth16 (GDI.350) |
| 1178 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1179 | BOOL16 WINAPI GetCharWidth16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, |
| 1180 | LPINT16 buffer ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1181 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1182 | BOOL retVal = FALSE; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1183 | |
| 1184 | if( firstChar != lastChar ) |
| 1185 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1186 | LPINT buf32 = (LPINT)HeapAlloc(GetProcessHeap(), 0, |
| 1187 | sizeof(INT)*(1 + (lastChar - firstChar))); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1188 | if( buf32 ) |
| 1189 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1190 | LPINT obuf32 = buf32; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1191 | int i; |
| 1192 | |
| 1193 | retVal = GetCharWidth32A(hdc, firstChar, lastChar, buf32); |
| 1194 | if (retVal) |
| 1195 | { |
| 1196 | for (i = firstChar; i <= lastChar; i++) |
| 1197 | *buffer++ = *buf32++; |
| 1198 | } |
Alexandre Julliard | 3db94ef | 1997-09-28 17:43:24 +0000 | [diff] [blame] | 1199 | HeapFree(GetProcessHeap(), 0, obuf32); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1200 | } |
| 1201 | } |
Alexandre Julliard | 33072e1 | 1997-06-29 18:08:02 +0000 | [diff] [blame] | 1202 | else /* happens quite often to warrant a special treatment */ |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1203 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1204 | INT chWidth; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1205 | retVal = GetCharWidth32A(hdc, firstChar, lastChar, &chWidth ); |
Alexandre Julliard | 33072e1 | 1997-06-29 18:08:02 +0000 | [diff] [blame] | 1206 | *buffer = chWidth; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1207 | } |
| 1208 | return retVal; |
| 1209 | } |
| 1210 | |
| 1211 | |
| 1212 | /*********************************************************************** |
| 1213 | * GetCharWidth32A (GDI32.155) |
| 1214 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1215 | BOOL WINAPI GetCharWidth32A( HDC hdc, UINT firstChar, UINT lastChar, |
| 1216 | LPINT buffer ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1217 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1218 | UINT i, extra; |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1219 | DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ); |
| 1220 | if (!dc) |
| 1221 | { |
| 1222 | if (!(dc = (DC *)GDI_GetObjPtr( hdc, METAFILE_DC_MAGIC ))) |
| 1223 | return FALSE; |
| 1224 | } |
| 1225 | |
| 1226 | if (!dc->funcs->pGetCharWidth || |
| 1227 | !dc->funcs->pGetCharWidth( dc, firstChar, lastChar, buffer)) |
| 1228 | return FALSE; |
| 1229 | |
Alexandre Julliard | 33072e1 | 1997-06-29 18:08:02 +0000 | [diff] [blame] | 1230 | /* convert device units to logical */ |
| 1231 | |
| 1232 | extra = dc->vportExtX >> 1; |
| 1233 | for( i = firstChar; i <= lastChar; i++, buffer++ ) |
| 1234 | *buffer = (*buffer * dc->wndExtX + extra) / dc->vportExtX; |
| 1235 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1236 | return TRUE; |
| 1237 | } |
| 1238 | |
| 1239 | |
| 1240 | /*********************************************************************** |
| 1241 | * GetCharWidth32W (GDI32.158) |
| 1242 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1243 | BOOL WINAPI GetCharWidth32W( HDC hdc, UINT firstChar, UINT lastChar, |
| 1244 | LPINT buffer ) |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1245 | { |
| 1246 | return GetCharWidth32A( hdc, firstChar, lastChar, buffer ); |
| 1247 | } |
| 1248 | |
| 1249 | |
| 1250 | |
| 1251 | /* FIXME: all following APIs ******************************************* |
| 1252 | * |
| 1253 | * |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 1254 | * SetMapperFlags16 (GDI.349) |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 1255 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1256 | DWORD WINAPI SetMapperFlags16( HDC16 hDC, DWORD dwFlag ) |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 1257 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1258 | return SetMapperFlags( hDC, dwFlag ); |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 1259 | } |
| 1260 | |
| 1261 | |
| 1262 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1263 | * SetMapperFlags (GDI32.322) |
Alexandre Julliard | f0cbfa0 | 1997-02-15 14:29:56 +0000 | [diff] [blame] | 1264 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1265 | DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag ) |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 1266 | { |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 1267 | DC *dc = DC_GetDCPtr( hDC ); |
| 1268 | DWORD ret = 0; |
| 1269 | if(!dc) return 0; |
| 1270 | if(dc->funcs->pSetMapperFlags) |
| 1271 | ret = dc->funcs->pSetMapperFlags( dc, dwFlag ); |
| 1272 | else |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1273 | FIXME("(0x%04x, 0x%08lx): stub - harmless\n", hDC, dwFlag); |
Huw D M Davies | 7603dea | 1999-04-25 09:24:23 +0000 | [diff] [blame] | 1274 | GDI_HEAP_UNLOCK( hDC ); |
| 1275 | return ret; |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 1276 | } |
| 1277 | |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1278 | /*********************************************************************** |
| 1279 | * GetAspectRatioFilterEx16 (GDI.486) |
| 1280 | */ |
Alexandre Julliard | 85ed45e | 1998-08-22 19:03:56 +0000 | [diff] [blame] | 1281 | BOOL16 WINAPI GetAspectRatioFilterEx16( HDC16 hdc, LPSIZE16 pAspectRatio ) |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1282 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1283 | FIXME("(%04x, %p): -- Empty Stub !\n", hdc, pAspectRatio); |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1284 | return FALSE; |
| 1285 | } |
| 1286 | |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1287 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1288 | * GetAspectRatioFilterEx (GDI32.142) |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1289 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1290 | BOOL WINAPI GetAspectRatioFilterEx( HDC hdc, LPSIZE pAspectRatio ) |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1291 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1292 | FIXME("(%04x, %p): -- Empty Stub !\n", hdc, pAspectRatio); |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1293 | return FALSE; |
| 1294 | } |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1295 | |
Alexandre Julliard | 7d654eb | 1996-02-25 11:36:22 +0000 | [diff] [blame] | 1296 | /*********************************************************************** |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1297 | * GetCharABCWidths16 (GDI.307) |
Alexandre Julliard | 7d654eb | 1996-02-25 11:36:22 +0000 | [diff] [blame] | 1298 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1299 | BOOL16 WINAPI GetCharABCWidths16( HDC16 hdc, UINT16 firstChar, UINT16 lastChar, |
| 1300 | LPABC16 abc ) |
Alexandre Julliard | 7d654eb | 1996-02-25 11:36:22 +0000 | [diff] [blame] | 1301 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1302 | ABC abc32; |
| 1303 | if (!GetCharABCWidthsA( hdc, firstChar, lastChar, &abc32 )) return FALSE; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1304 | abc->abcA = abc32.abcA; |
| 1305 | abc->abcB = abc32.abcB; |
| 1306 | abc->abcC = abc32.abcC; |
| 1307 | return TRUE; |
| 1308 | } |
Alexandre Julliard | 1e9ac79 | 1996-06-06 18:38:27 +0000 | [diff] [blame] | 1309 | |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1310 | |
| 1311 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1312 | * GetCharABCWidthsA (GDI32.149) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1313 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1314 | BOOL WINAPI GetCharABCWidthsA(HDC hdc, UINT firstChar, UINT lastChar, |
| 1315 | LPABC abc ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1316 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1317 | return GetCharABCWidthsW( hdc, firstChar, lastChar, abc ); |
Alexandre Julliard | 7d654eb | 1996-02-25 11:36:22 +0000 | [diff] [blame] | 1318 | } |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 1319 | |
Alexandre Julliard | 5f721f8 | 1994-01-04 20:14:34 +0000 | [diff] [blame] | 1320 | |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 1321 | /****************************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1322 | * GetCharABCWidthsW [GDI32.152] Retrieves widths of characters in range |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 1323 | * |
| 1324 | * PARAMS |
| 1325 | * hdc [I] Handle of device context |
| 1326 | * firstChar [I] First character in range to query |
| 1327 | * lastChar [I] Last character in range to query |
| 1328 | * abc [O] Address of character-width structure |
| 1329 | * |
| 1330 | * NOTES |
| 1331 | * Only works with TrueType fonts |
| 1332 | * |
| 1333 | * RETURNS |
| 1334 | * Success: TRUE |
| 1335 | * Failure: FALSE |
Alexandre Julliard | 0e60778 | 1993-11-03 19:23:37 +0000 | [diff] [blame] | 1336 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1337 | BOOL WINAPI GetCharABCWidthsW( HDC hdc, UINT firstChar, UINT lastChar, |
| 1338 | LPABC abc ) |
Alexandre Julliard | 0e60778 | 1993-11-03 19:23:37 +0000 | [diff] [blame] | 1339 | { |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 1340 | /* No TrueType fonts in Wine so far */ |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1341 | FIXME("(%04x,%04x,%04x,%p): stub\n", hdc, firstChar, lastChar, abc); |
Alexandre Julliard | 46ea8b3 | 1998-05-03 19:01:20 +0000 | [diff] [blame] | 1342 | return FALSE; |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1343 | } |
| 1344 | |
| 1345 | |
| 1346 | /*********************************************************************** |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1347 | * GetGlyphOutline16 (GDI.309) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1348 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1349 | DWORD WINAPI GetGlyphOutline16( HDC16 hdc, UINT16 uChar, UINT16 fuFormat, |
| 1350 | LPGLYPHMETRICS16 lpgm, DWORD cbBuffer, |
| 1351 | LPVOID lpBuffer, const MAT2 *lpmat2 ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1352 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1353 | FIXME("(%04x, '%c', %04x, %p, %ld, %p, %p): stub\n", |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1354 | hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1355 | return (DWORD)-1; /* failure */ |
Alexandre Julliard | 0e60778 | 1993-11-03 19:23:37 +0000 | [diff] [blame] | 1356 | } |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 1357 | |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 1358 | |
| 1359 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1360 | * GetGlyphOutlineA (GDI32.186) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1361 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1362 | DWORD WINAPI GetGlyphOutlineA( HDC hdc, UINT uChar, UINT fuFormat, |
| 1363 | LPGLYPHMETRICS lpgm, DWORD cbBuffer, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1364 | LPVOID lpBuffer, const MAT2 *lpmat2 ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1365 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1366 | FIXME("(%04x, '%c', %04x, %p, %ld, %p, %p): stub\n", |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1367 | hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1368 | return (DWORD)-1; /* failure */ |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1369 | } |
| 1370 | |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1371 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1372 | * GetGlyphOutlineW (GDI32.187) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1373 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1374 | DWORD WINAPI GetGlyphOutlineW( HDC hdc, UINT uChar, UINT fuFormat, |
| 1375 | LPGLYPHMETRICS lpgm, DWORD cbBuffer, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1376 | LPVOID lpBuffer, const MAT2 *lpmat2 ) |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1377 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1378 | FIXME("(%04x, '%c', %04x, %p, %ld, %p, %p): stub\n", |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1379 | hdc, uChar, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2 ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1380 | return (DWORD)-1; /* failure */ |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1381 | } |
| 1382 | |
Alexandre Julliard | 7ebe1a4 | 1996-12-22 18:27:48 +0000 | [diff] [blame] | 1383 | /*********************************************************************** |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1384 | * CreateScalableFontResource16 (GDI.310) |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 1385 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1386 | BOOL16 WINAPI CreateScalableFontResource16( UINT16 fHidden, |
| 1387 | LPCSTR lpszResourceFile, |
| 1388 | LPCSTR fontFile, LPCSTR path ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1389 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1390 | return CreateScalableFontResourceA( fHidden, lpszResourceFile, |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1391 | fontFile, path ); |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1392 | } |
| 1393 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1394 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1395 | * CreateScalableFontResourceA (GDI32.62) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1396 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1397 | BOOL WINAPI CreateScalableFontResourceA( DWORD fHidden, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1398 | LPCSTR lpszResourceFile, |
| 1399 | LPCSTR lpszFontFile, |
| 1400 | LPCSTR lpszCurrentPath ) |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 1401 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1402 | /* fHidden=1 - only visible for the calling app, read-only, not |
| 1403 | * enumbered with EnumFonts/EnumFontFamilies |
| 1404 | * lpszCurrentPath can be NULL |
| 1405 | */ |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1406 | FIXME("(%ld,%s,%s,%s): stub\n", |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1407 | fHidden, lpszResourceFile, lpszFontFile, lpszCurrentPath ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1408 | return FALSE; /* create failed */ |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 1409 | } |
| 1410 | |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 1411 | /*********************************************************************** |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1412 | * CreateScalableFontResourceW (GDI32.63) |
Alexandre Julliard | 3ed37e0 | 1994-11-07 18:20:42 +0000 | [diff] [blame] | 1413 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1414 | BOOL WINAPI CreateScalableFontResourceW( DWORD fHidden, |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1415 | LPCWSTR lpszResourceFile, |
| 1416 | LPCWSTR lpszFontFile, |
| 1417 | LPCWSTR lpszCurrentPath ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1418 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1419 | FIXME("(%ld,%p,%p,%p): stub\n", |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1420 | fHidden, lpszResourceFile, lpszFontFile, lpszCurrentPath ); |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1421 | return FALSE; /* create failed */ |
Alexandre Julliard | 75d86e1 | 1996-11-17 18:59:11 +0000 | [diff] [blame] | 1422 | } |
| 1423 | |
| 1424 | |
| 1425 | /************************************************************************* |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1426 | * GetRasterizerCaps16 (GDI.313) |
Alexandre Julliard | fa68b75 | 1995-04-03 16:55:37 +0000 | [diff] [blame] | 1427 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1428 | BOOL16 WINAPI GetRasterizerCaps16( LPRASTERIZER_STATUS lprs, UINT16 cbNumBytes) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1429 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1430 | return GetRasterizerCaps( lprs, cbNumBytes ); |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1431 | } |
Alexandre Julliard | 5819953 | 1994-04-21 01:20:00 +0000 | [diff] [blame] | 1432 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1433 | |
| 1434 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1435 | * GetRasterizerCaps (GDI32.216) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1436 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1437 | BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes) |
Alexandre Julliard | fa68b75 | 1995-04-03 16:55:37 +0000 | [diff] [blame] | 1438 | { |
Alexandre Julliard | 03468f7 | 1998-02-15 19:40:49 +0000 | [diff] [blame] | 1439 | lprs->nSize = sizeof(RASTERIZER_STATUS); |
| 1440 | lprs->wFlags = TT_AVAILABLE|TT_ENABLED; |
| 1441 | lprs->nLanguageID = 0; |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1442 | return TRUE; |
Alexandre Julliard | fa68b75 | 1995-04-03 16:55:37 +0000 | [diff] [blame] | 1443 | } |
Alexandre Julliard | bd34d4f | 1995-06-20 19:08:12 +0000 | [diff] [blame] | 1444 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1445 | |
Alexandre Julliard | bd34d4f | 1995-06-20 19:08:12 +0000 | [diff] [blame] | 1446 | /************************************************************************* |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1447 | * GetKerningPairs16 (GDI.332) |
Alexandre Julliard | bd34d4f | 1995-06-20 19:08:12 +0000 | [diff] [blame] | 1448 | */ |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1449 | INT16 WINAPI GetKerningPairs16( HDC16 hDC, INT16 cPairs, |
| 1450 | LPKERNINGPAIR16 lpKerningPairs ) |
Alexandre Julliard | bd34d4f | 1995-06-20 19:08:12 +0000 | [diff] [blame] | 1451 | { |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1452 | /* At this time kerning is ignored (set to 0) */ |
Alexandre Julliard | 339eefc | 1996-06-23 14:56:20 +0000 | [diff] [blame] | 1453 | int i; |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1454 | FIXME("(%x,%d,%p): almost empty stub!\n", hDC, cPairs, lpKerningPairs); |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1455 | for (i = 0; i < cPairs; i++) |
| 1456 | lpKerningPairs[i].iKernAmount = 0; |
Alexandre Julliard | 339eefc | 1996-06-23 14:56:20 +0000 | [diff] [blame] | 1457 | return 0; |
Alexandre Julliard | bd34d4f | 1995-06-20 19:08:12 +0000 | [diff] [blame] | 1458 | } |
Alexandre Julliard | 349a953 | 1997-02-02 19:01:52 +0000 | [diff] [blame] | 1459 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1460 | |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1461 | |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1462 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1463 | * GetKerningPairsA (GDI32.192) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1464 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1465 | DWORD WINAPI GetKerningPairsA( HDC hDC, DWORD cPairs, |
| 1466 | LPKERNINGPAIR lpKerningPairs ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1467 | { |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1468 | int i; |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1469 | FIXME("(%x,%ld,%p): almost empty stub!\n", hDC, cPairs, lpKerningPairs); |
Alexandre Julliard | 54c2711 | 1998-03-29 19:44:57 +0000 | [diff] [blame] | 1470 | for (i = 0; i < cPairs; i++) |
| 1471 | lpKerningPairs[i].iKernAmount = 0; |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1472 | return 0; |
| 1473 | } |
| 1474 | |
| 1475 | |
| 1476 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1477 | * GetKerningPairsW (GDI32.193) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1478 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1479 | DWORD WINAPI GetKerningPairsW( HDC hDC, DWORD cPairs, |
| 1480 | LPKERNINGPAIR lpKerningPairs ) |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1481 | { |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1482 | return GetKerningPairsA( hDC, cPairs, lpKerningPairs ); |
Alexandre Julliard | 2197901 | 1997-03-05 08:22:35 +0000 | [diff] [blame] | 1483 | } |
Alexandre Julliard | 23946ad | 1997-06-16 17:43:53 +0000 | [diff] [blame] | 1484 | |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1485 | /************************************************************************* |
Douglas Ridgway | 4f7d9ed | 1998-12-18 17:38:39 +0000 | [diff] [blame] | 1486 | * TranslateCharsetInfo [GDI32.382] |
| 1487 | * |
| 1488 | * Fills a CHARSETINFO structure for a character set, code page, or |
| 1489 | * font. This allows making the correspondance between different labelings |
| 1490 | * (character set, Windows, ANSI, and OEM codepages, and Unicode ranges) |
| 1491 | * of the same encoding. |
| 1492 | * |
| 1493 | * Only one codepage will be set in lpCs->fs. If TCI_SRCFONTSIG is used, |
| 1494 | * only one codepage should be set in *lpSrc. |
| 1495 | * |
| 1496 | * RETURNS |
| 1497 | * TRUE on success, FALSE on failure. |
| 1498 | * |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1499 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1500 | BOOL WINAPI TranslateCharsetInfo( |
Douglas Ridgway | 4f7d9ed | 1998-12-18 17:38:39 +0000 | [diff] [blame] | 1501 | LPDWORD lpSrc, /* |
| 1502 | if flags == TCI_SRCFONTSIG: pointer to fsCsb of a FONTSIGNATURE |
| 1503 | if flags == TCI_SRCCHARSET: a character set value |
| 1504 | if flags == TCI_SRCCODEPAGE: a code page value |
| 1505 | */ |
| 1506 | LPCHARSETINFO lpCs, /* structure to receive charset information */ |
| 1507 | DWORD flags /* determines interpretation of lpSrc */ |
| 1508 | ) { |
Douglas Ridgway | ab9e8bc | 1999-01-01 18:41:22 +0000 | [diff] [blame] | 1509 | int index = 0; |
| 1510 | switch (flags) { |
| 1511 | case TCI_SRCFONTSIG: |
| 1512 | while (!(*lpSrc>>index & 0x0001) && index<MAXTCIINDEX) index++; |
| 1513 | break; |
| 1514 | case TCI_SRCCODEPAGE: |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1515 | while ((UINT) (lpSrc) != FONT_tci[index].ciACP && index < MAXTCIINDEX) index++; |
Douglas Ridgway | ab9e8bc | 1999-01-01 18:41:22 +0000 | [diff] [blame] | 1516 | break; |
| 1517 | case TCI_SRCCHARSET: |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1518 | while ((UINT) (lpSrc) != FONT_tci[index].ciCharset && index < MAXTCIINDEX) index++; |
Douglas Ridgway | ab9e8bc | 1999-01-01 18:41:22 +0000 | [diff] [blame] | 1519 | break; |
| 1520 | default: |
| 1521 | return FALSE; |
| 1522 | } |
| 1523 | if (index >= MAXTCIINDEX || FONT_tci[index].ciCharset == DEFAULT_CHARSET) return FALSE; |
| 1524 | memcpy(lpCs, &FONT_tci[index], sizeof(CHARSETINFO)); |
Alexandre Julliard | 670cdc4 | 1997-08-24 16:00:30 +0000 | [diff] [blame] | 1525 | return TRUE; |
| 1526 | } |
| 1527 | |
Alexandre Julliard | e658d82 | 1997-11-30 17:45:40 +0000 | [diff] [blame] | 1528 | /************************************************************************* |
| 1529 | * GetFontLanguageInfo (GDI32.182) |
| 1530 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1531 | DWORD WINAPI GetFontLanguageInfo(HDC hdc) { |
Alexandre Julliard | e658d82 | 1997-11-30 17:45:40 +0000 | [diff] [blame] | 1532 | /* return value 0 is correct for most cases anyway */ |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1533 | FIXME("(%x):stub!\n", hdc); |
Alexandre Julliard | e658d82 | 1997-11-30 17:45:40 +0000 | [diff] [blame] | 1534 | return 0; |
| 1535 | } |
| 1536 | |
| 1537 | /************************************************************************* |
| 1538 | * GetFontLanguageInfo (GDI.616) |
| 1539 | */ |
| 1540 | DWORD WINAPI GetFontLanguageInfo16(HDC16 hdc) { |
| 1541 | /* return value 0 is correct for most cases anyway */ |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1542 | FIXME("(%x):stub!\n",hdc); |
Alexandre Julliard | e658d82 | 1997-11-30 17:45:40 +0000 | [diff] [blame] | 1543 | return 0; |
| 1544 | } |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1545 | |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 1546 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1547 | * GetFontData [GDI32.181] Retrieve data for TrueType font |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 1548 | * |
| 1549 | * RETURNS |
| 1550 | * |
| 1551 | * success: Number of bytes returned |
| 1552 | * failure: GDI_ERROR |
| 1553 | * |
| 1554 | * NOTES |
| 1555 | * |
| 1556 | * Calls SetLastError() |
| 1557 | * |
| 1558 | * BUGS |
| 1559 | * |
| 1560 | * Unimplemented |
| 1561 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1562 | DWORD WINAPI GetFontData(HDC hdc, DWORD table, DWORD offset, |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 1563 | LPVOID buffer, DWORD length) |
| 1564 | { |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1565 | FIXME("(%x,%ld,%ld,%p,%ld): stub\n", hdc, table, offset, buffer, length); |
Alexandre Julliard | 767e6f6 | 1998-08-09 12:47:43 +0000 | [diff] [blame] | 1566 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); |
| 1567 | return GDI_ERROR; |
| 1568 | } |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1569 | |
| 1570 | /************************************************************************* |
Huw D M Davies | cdf191a | 1999-11-21 02:01:41 +0000 | [diff] [blame] | 1571 | * GetFontData16 [GDI.311] |
| 1572 | * |
| 1573 | */ |
| 1574 | DWORD WINAPI GetFontData16(HDC16 hdc, DWORD dwTable, DWORD dwOffset, |
| 1575 | LPVOID lpvBuffer, DWORD cbData) |
| 1576 | { |
| 1577 | return GetFontData(hdc, dwTable, dwOffset, lpvBuffer, cbData); |
| 1578 | } |
| 1579 | |
| 1580 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1581 | * GetCharacterPlacementA [GDI32.160] |
Juergen Schmied | 2259e44 | 1999-08-15 14:22:48 +0000 | [diff] [blame] | 1582 | * |
| 1583 | * NOTES: |
| 1584 | * the web browser control of ie4 calls this with dwFlags=0 |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1585 | */ |
| 1586 | DWORD WINAPI |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1587 | GetCharacterPlacementA(HDC hdc, LPCSTR lpString, INT uCount, |
| 1588 | INT nMaxExtent, GCP_RESULTSA *lpResults, |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1589 | DWORD dwFlags) |
| 1590 | { |
Juergen Schmied | 2259e44 | 1999-08-15 14:22:48 +0000 | [diff] [blame] | 1591 | DWORD ret=0; |
| 1592 | SIZE size; |
| 1593 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1594 | TRACE("%s 0x%08x 0x%08x 0x%08lx:stub!\n", |
| 1595 | debugstr_a(lpString), uCount, nMaxExtent, dwFlags); |
Juergen Schmied | 2259e44 | 1999-08-15 14:22:48 +0000 | [diff] [blame] | 1596 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1597 | TRACE("lpOrder=%p lpDx=%p lpCaretPos=%p lpClass=%p " |
| 1598 | "lpOutString=%p lpGlyphs=%p\n", |
| 1599 | lpResults->lpOrder, lpResults->lpDx, lpResults->lpCaretPos, |
| 1600 | lpResults->lpClass, lpResults->lpOutString, lpResults->lpGlyphs); |
Juergen Schmied | 2259e44 | 1999-08-15 14:22:48 +0000 | [diff] [blame] | 1601 | |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1602 | if(dwFlags) FIXME("flags 0x%08lx ignored\n", dwFlags); |
| 1603 | if(lpResults->lpOrder) FIXME("reordering not implemented\n"); |
| 1604 | if(lpResults->lpCaretPos) FIXME("caret positions not implemented\n"); |
| 1605 | if(lpResults->lpClass) FIXME("classes not implemented\n"); |
| 1606 | if(lpResults->lpGlyphs) FIXME("glyphs not implemented\n"); |
Juergen Schmied | 2259e44 | 1999-08-15 14:22:48 +0000 | [diff] [blame] | 1607 | |
| 1608 | /* copy will do if the GCP_REORDER flag is not set */ |
| 1609 | if(lpResults->lpOutString) |
| 1610 | { |
| 1611 | lstrcpynA(lpResults->lpOutString, lpString, uCount); |
| 1612 | } |
| 1613 | |
| 1614 | if (lpResults->lpDx) |
| 1615 | { |
| 1616 | int i, c; |
| 1617 | for (i=0; i<uCount;i++) |
| 1618 | { |
| 1619 | if (GetCharWidth32A(hdc, lpString[i], lpString[i], &c)) |
| 1620 | lpResults->lpDx[i]= c; |
| 1621 | } |
| 1622 | } |
| 1623 | |
| 1624 | if (GetTextExtentPoint32A(hdc, lpString, uCount, &size)) |
| 1625 | ret = MAKELONG(size.cx, size.cy); |
| 1626 | |
| 1627 | return ret; |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1628 | } |
| 1629 | |
| 1630 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1631 | * GetCharacterPlacementW [GDI32.161] |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1632 | */ |
| 1633 | DWORD WINAPI |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1634 | GetCharacterPlacementW(HDC hdc, LPCWSTR lpString, INT uCount, |
| 1635 | INT nMaxExtent, GCP_RESULTSW *lpResults, |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1636 | DWORD dwFlags) |
| 1637 | { |
| 1638 | /* return value 0 is correct for most cases anyway */ |
Dimitrie O. Paun | dd03cc1 | 1999-12-08 03:56:23 +0000 | [diff] [blame] | 1639 | FIXME(":stub!\n"); |
Alexandre Julliard | 642d313 | 1998-07-12 19:29:36 +0000 | [diff] [blame] | 1640 | return 0; |
| 1641 | } |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1642 | |
| 1643 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1644 | * GetCharABCWidthsFloatA [GDI32.150] |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1645 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1646 | BOOL WINAPI GetCharABCWidthsFloatA(HDC hdc, UINT iFirstChar, UINT iLastChar, |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1647 | LPABCFLOAT lpABCF) |
| 1648 | { |
Alexandre Julliard | 06c275a | 1999-05-02 14:32:27 +0000 | [diff] [blame] | 1649 | FIXME_(gdi)("GetCharABCWidthsFloatA, stub\n"); |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1650 | return 0; |
| 1651 | } |
| 1652 | |
| 1653 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1654 | * GetCharABCWidthsFloatW [GDI32.151] |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1655 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1656 | BOOL WINAPI GetCharABCWidthsFloatW(HDC hdc, UINT iFirstChar, |
| 1657 | UINT iLastChar, LPABCFLOAT lpABCF) |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1658 | { |
Alexandre Julliard | 06c275a | 1999-05-02 14:32:27 +0000 | [diff] [blame] | 1659 | FIXME_(gdi)("GetCharABCWidthsFloatW, stub\n"); |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1660 | return 0; |
| 1661 | } |
| 1662 | |
| 1663 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1664 | * GetCharWidthFloatA [GDI32.156] |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1665 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1666 | BOOL WINAPI GetCharWidthFloatA(HDC hdc, UINT iFirstChar, |
| 1667 | UINT iLastChar, PFLOAT pxBuffer) |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1668 | { |
Alexandre Julliard | 06c275a | 1999-05-02 14:32:27 +0000 | [diff] [blame] | 1669 | FIXME_(gdi)("GetCharWidthFloatA, stub\n"); |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1670 | return 0; |
| 1671 | } |
| 1672 | |
| 1673 | /************************************************************************* |
Huw D M Davies | aec373c | 1999-07-23 19:25:11 +0000 | [diff] [blame] | 1674 | * GetCharWidthFloatW [GDI32.157] |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1675 | */ |
Alexandre Julliard | a396029 | 1999-02-26 11:11:13 +0000 | [diff] [blame] | 1676 | BOOL WINAPI GetCharWidthFloatW(HDC hdc, UINT iFirstChar, |
| 1677 | UINT iLastChar, PFLOAT pxBuffer) |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1678 | { |
Alexandre Julliard | 06c275a | 1999-05-02 14:32:27 +0000 | [diff] [blame] | 1679 | FIXME_(gdi)("GetCharWidthFloatW, stub\n"); |
Paul Quinn | 1beaae5 | 1998-12-15 15:38:36 +0000 | [diff] [blame] | 1680 | return 0; |
| 1681 | } |
| 1682 | |