diff options
| author | Andrew Innes | 1999-05-15 17:39:26 +0000 |
|---|---|---|
| committer | Andrew Innes | 1999-05-15 17:39:26 +0000 |
| commit | b1ae662fa6945545d6933276bfb68d17445d2414 (patch) | |
| tree | 601ea4e660117812ee8c3a123d8f3ea41e2aea3c | |
| parent | 5eabfe721e6da51b557bf22c54d75f311b31bb4b (diff) | |
| download | emacs-b1ae662fa6945545d6933276bfb68d17445d2414.tar.gz emacs-b1ae662fa6945545d6933276bfb68d17445d2414.zip | |
(dumpglyphs): Use correct colours for drawing rectangles in place of
missing fonts, and make them the right size.
| -rw-r--r-- | src/w32term.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/w32term.c b/src/w32term.c index ed4255f2294..c309665831e 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -1016,7 +1016,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 1016 | if (font) | 1016 | if (font) |
| 1017 | { | 1017 | { |
| 1018 | if (font->hfont) | 1018 | if (font->hfont) |
| 1019 | SelectObject (hdc, font->hfont); | 1019 | SelectObject (hdc, font->hfont); |
| 1020 | 1020 | ||
| 1021 | if (!cmpcharp) | 1021 | if (!cmpcharp) |
| 1022 | { | 1022 | { |
| @@ -1233,11 +1233,22 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 1233 | { | 1233 | { |
| 1234 | /* Show rectangles to indicate that we found no font. */ | 1234 | /* Show rectangles to indicate that we found no font. */ |
| 1235 | int limit = cmpcharp ? 1 : len; | 1235 | int limit = cmpcharp ? 1 : len; |
| 1236 | HBRUSH hb, oldhb; | ||
| 1237 | HPEN hp, oldhp; | ||
| 1238 | hb = CreateSolidBrush (bg); | ||
| 1239 | hp = CreatePen (PS_SOLID, 0, fg); | ||
| 1240 | oldhb = SelectObject(hdc, hb); | ||
| 1241 | oldhp = SelectObject(hdc, hp); | ||
| 1236 | 1242 | ||
| 1237 | for (i = 0; i < limit; i++) | 1243 | for (i = 0; i < limit; i++) |
| 1238 | Rectangle (hdc, left + glyph_width * i, top, | 1244 | Rectangle (hdc, left + glyph_width * i, top, |
| 1239 | left + glyph_width * (i + 1) - 1, | 1245 | left + glyph_width * (i + 1), |
| 1240 | top + line_height - 1); | 1246 | top + line_height); |
| 1247 | |||
| 1248 | SelectObject(hdc, oldhb); | ||
| 1249 | SelectObject(hdc, oldhp); | ||
| 1250 | DeleteObject (hb); | ||
| 1251 | DeleteObject (hp); | ||
| 1241 | } | 1252 | } |
| 1242 | else if (require_clipping && !NILP (Vhighlight_wrong_size_font)) | 1253 | else if (require_clipping && !NILP (Vhighlight_wrong_size_font)) |
| 1243 | { | 1254 | { |
| @@ -1252,6 +1263,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 1252 | top + line_height - 3, 1, 2); | 1263 | top + line_height - 3, 1, 2); |
| 1253 | } | 1264 | } |
| 1254 | } | 1265 | } |
| 1266 | |||
| 1255 | { | 1267 | { |
| 1256 | /* Setting underline position based on the metric of the | 1268 | /* Setting underline position based on the metric of the |
| 1257 | current font results in shaky underline if it strides | 1269 | current font results in shaky underline if it strides |
| @@ -1272,7 +1284,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 1272 | } | 1284 | } |
| 1273 | 1285 | ||
| 1274 | if (!cmpcharp) | 1286 | if (!cmpcharp) |
| 1275 | left += run_width; | 1287 | left += run_width; |
| 1276 | } | 1288 | } |
| 1277 | } | 1289 | } |
| 1278 | release_frame_dc (f, hdc); | 1290 | release_frame_dc (f, hdc); |