Commit b70be253 authored by Jason Rumney's avatar Jason Rumney

(w32_native_per_char_metric): Swap width and rbearing

calculations for non-Truetype fonts.
(x_draw_glyph_string): Sync with xterm.c.
(x_draw_glyph_string_foreground) [USE_FONT_BACKEND]: Remove
redundant code.
(w32_initialize) [USE_FONT_BACKEND]: Call w32font_initialize.
parent 47e420b5
......@@ -62,6 +62,7 @@ Boston, MA 02110-1301, USA. */
#ifdef USE_FONT_BACKEND
#include "font.h"
void w32font_initialize P_ ((void));
#endif /* USE_FONT_BACKEND */
#define abs(x) ((x) < 0 ? -(x) : (x))
......@@ -979,8 +980,8 @@ w32_native_per_char_metric (font, char2b, font_type, pcm)
if (retval)
{
pcm->width = sz.cx - font->tm.tmOverhang;
pcm->rbearing = sz.cx;
pcm->width = sz.cx;
pcm->rbearing = sz.cx + font->tm.tmOverhang;
pcm->lbearing = 0;
pcm->ascent = FONT_BASE (font);
pcm->descent = FONT_DESCENT (font);
......@@ -1836,14 +1837,10 @@ x_draw_glyph_string_foreground (s)
#ifdef USE_FONT_BACKEND
else if (enable_font_backend)
{
unsigned *code = alloca (sizeof (unsigned) * s->nchars);
int boff = s->font_info->baseline_offset;
struct font *font = (struct font *) s->font_info;
int y;
for (i = 0; i < s->nchars; i++)
code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2;
if (s->font_info->vertical_centering)
boff = VCENTER_BASELINE_OFFSET (s->font, s->f) - boff;
......@@ -2875,7 +2872,7 @@ x_draw_glyph_string (s)
&& (s->font->bdf || !s->font->tm.tmUnderlined))
{
unsigned long h;
unsigned long dy = 0;
int y;
/* Get the underline thickness. Default is 1 pixel. */
#ifdef USE_FONT_BACKEND
if (enable_font_backend)
......@@ -2897,28 +2894,29 @@ x_draw_glyph_string (s)
else
#endif
{
if (x_underline_at_descent_line)
dy = s->height - h;
else
y = s->y + s->height - h;
/* TODO: Use font information for positioning and
thickness of underline. See OUTLINETEXTMETRIC,
and xterm.c. Note: If you make this work,
don't forget to change the doc string of
x-use-underline_color-position-properties
below. */
#if 0
if (!x_underline_at_descent_line)
{
/* TODO: Use font information for positioning and
thickness of underline. See OUTLINETEXTMETRIC,
and xterm.c. Note: If you makedev this work,
don't forget to change the doc string of
x-use-underline_color-position-properties
below. */
dy = s->height - h;
...
}
#endif
}
if (s->face->underline_defaulted_p)
{
w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x,
s->y + dy, s->background_width, 1);
y, s->background_width, 1);
}
else
{
w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x,
s->y + dy, s->background_width, 1);
y, s->background_width, 1);
}
}
/* Draw overline. */
......@@ -7002,6 +7000,11 @@ w32_initialize ()
&& SystemParametersInfo (SPI_GETFONTSMOOTHINGTYPE, 0, &smoothing_type, 0)
&& smoothing_type == FE_FONTSMOOTHINGCLEARTYPE;
}
#ifdef USE_FONT_BACKEND
w32font_initialize ();
#endif
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment