aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Rumney2007-05-31 13:09:08 +0000
committerJason Rumney2007-05-31 13:09:08 +0000
commit7785759564c5b4e4b04ab0944edd89e21c85b9ba (patch)
tree1af85162b5e472e0cea9a719564c948d3f3e2745 /src
parent2689c3981937004d93fddecf738685e4af61cc1a (diff)
downloademacs-7785759564c5b4e4b04ab0944edd89e21c85b9ba.tar.gz
emacs-7785759564c5b4e4b04ab0944edd89e21c85b9ba.zip
* w32fns.c (w32_load_system_font): Fix detecting FIXED_PITCH fonts.
(x_to_w32_font): Fill in lfPitchAndFamily correctly. * w32fns.c [USE_FONT_BACKEND]: Port font backend changes from xfns.c. (x_to_w32_charset, w32_to_x_charset): Expose externally.
Diffstat (limited to 'src')
-rw-r--r--src/w32fns.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 62a97c96fdd..977d6a13333 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4707,7 +4707,7 @@ w32_load_system_font (f,fontname,size)
4707 fontp->name = (char *) xmalloc (strlen (fontname) + 1); 4707 fontp->name = (char *) xmalloc (strlen (fontname) + 1);
4708 bcopy (fontname, fontp->name, strlen (fontname) + 1); 4708 bcopy (fontname, fontp->name, strlen (fontname) + 1);
4709 4709
4710 if (lf.lfPitchAndFamily == FIXED_PITCH) 4710 if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH)
4711 { 4711 {
4712 /* Fixed width font. */ 4712 /* Fixed width font. */
4713 fontp->average_width = fontp->space_width = FONT_WIDTH (font); 4713 fontp->average_width = fontp->space_width = FONT_WIDTH (font);
@@ -4725,7 +4725,6 @@ w32_load_system_font (f,fontname,size)
4725 fontp->average_width = font->tm.tmAveCharWidth; 4725 fontp->average_width = font->tm.tmAveCharWidth;
4726 } 4726 }
4727 4727
4728
4729 fontp->charset = -1; 4728 fontp->charset = -1;
4730 charset = xlfd_charset_of_font (fontname); 4729 charset = xlfd_charset_of_font (fontname);
4731 4730
@@ -5612,8 +5611,12 @@ x_to_w32_font (lpxstr, lplogfont)
5612 lplogfont->lfHeight = atoi (height) * dpi / 720; 5611 lplogfont->lfHeight = atoi (height) * dpi / 720;
5613 5612
5614 if (fields > 0) 5613 if (fields > 0)
5615 lplogfont->lfPitchAndFamily = 5614 {
5616 (fields > 0 && pitch == 'p') ? VARIABLE_PITCH : FIXED_PITCH; 5615 if (pitch == 'p')
5616 lplogfont->lfPitchAndFamily = VARIABLE_PITCH | FF_DONTCARE;
5617 else if (pitch == 'c')
5618 lplogfont->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
5619 }
5617 5620
5618 fields--; 5621 fields--;
5619 5622