aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2000-10-29 20:59:47 +0000
committerJason Rumney2000-10-29 20:59:47 +0000
commit00c9699523b536c635deaa1a509ec3abc874e606 (patch)
tree364db5067d0487956ab3653db62ac3ca499207e7 /src
parent905dfb8ebd07c8c5ea03212ce3abf59e80db5554 (diff)
downloademacs-00c9699523b536c635deaa1a509ec3abc874e606.tar.gz
emacs-00c9699523b536c635deaa1a509ec3abc874e606.zip
(w32_bdf_per_char_metric): Negate descent.
(w32_cache_char_metrics): Handle possibility that 'x' does not exist in a BDF font. (W32_TEXTOUT): w32_BDF_TextOut wants number of bytes not chars.
Diffstat (limited to 'src')
-rw-r--r--src/w32term.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 4bea6a87c61..5a2b1bdeb10 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1150,7 +1150,7 @@ w32_bdf_per_char_metric (font, char2b, dim, pcm)
1150 pcm->rbearing = bdf_metric->dwidth 1150 pcm->rbearing = bdf_metric->dwidth
1151 - (bdf_metric->bbox + bdf_metric->bbw); 1151 - (bdf_metric->bbox + bdf_metric->bbw);
1152 pcm->ascent = bdf_metric->bboy + bdf_metric->bbh; 1152 pcm->ascent = bdf_metric->bboy + bdf_metric->bbh;
1153 pcm->descent = bdf_metric->bboy; 1153 pcm->descent = -bdf_metric->bboy;
1154 1154
1155 return 1; 1155 return 1;
1156 } 1156 }
@@ -1280,7 +1280,16 @@ w32_cache_char_metrics (font)
1280 if (font->bdf) 1280 if (font->bdf)
1281 { 1281 {
1282 /* TODO: determine whether font is fixed-pitch. */ 1282 /* TODO: determine whether font is fixed-pitch. */
1283 w32_bdf_per_char_metric (font, &char2b, 1, &font->max_bounds); 1283 if (!w32_bdf_per_char_metric (font, &char2b, 1, &font->max_bounds))
1284 {
1285 /* Use the font width and height as max bounds, as not all BDF
1286 fonts contain the letter 'x'. */
1287 font->max_bounds.width = FONT_MAX_WIDTH (font);
1288 font->max_bounds.lbearing = -font->bdf->llx;
1289 font->max_bounds.rbearing = FONT_MAX_WIDTH (font) - font->bdf->urx;
1290 font->max_bounds.ascent = FONT_BASE (font);
1291 font->max_bounds.descent = FONT_DESCENT (font);
1292 }
1284 } 1293 }
1285 else 1294 else
1286 { 1295 {
@@ -2370,7 +2379,8 @@ void W32_TEXTOUT (s, x, y,chars,nchars)
2370 int charset_dim = w32_font_is_double_byte (s->gc->font) ? 2 : 1; 2379 int charset_dim = w32_font_is_double_byte (s->gc->font) ? 2 : 1;
2371 if (s->gc->font->bdf) 2380 if (s->gc->font->bdf)
2372 w32_BDF_TextOut (s->gc->font->bdf, s->hdc, 2381 w32_BDF_TextOut (s->gc->font->bdf, s->hdc,
2373 x, y, (char *) chars, charset_dim, nchars, 0); 2382 x, y, (char *) chars, charset_dim,
2383 nchars * charset_dim, 0);
2374 else if (s->first_glyph->w32_font_type == UNICODE_FONT) 2384 else if (s->first_glyph->w32_font_type == UNICODE_FONT)
2375 ExtTextOutW (s->hdc, x, y, 0, NULL, chars, nchars, NULL); 2385 ExtTextOutW (s->hdc, x, y, 0, NULL, chars, nchars, NULL);
2376 else 2386 else