/* Font backend for the Microsoft W32 API.
- Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <math.h>
#include <ctype.h>
#include <commdlg.h>
+#include <setjmp.h>
#include "lisp.h"
#include "w32term.h"
/* The following code is copied from the function intern (in lread.c). */
obarray = Vobarray;
- if (!VECTORP (obarray) || XVECTOR (obarray)->size == 0)
+ if (!VECTORP (obarray) || XVECTOR_SIZE (obarray) == 0)
obarray = check_obarray (obarray);
tem = oblookup (obarray, SDATA (str), len, len);
if (SYMBOLP (tem))
}
/* w32 implementation of encode_char for font backend.
- Return a glyph code of FONT for characer C (Unicode code point).
+ Return a glyph code of FONT for character C (Unicode code point).
If FONT doesn't have such a glyph, return FONT_INVALID_CODE.
For speed, the gdi backend uses unicode (Emacs calls encode_char
/* Save clip region for later restoration. */
orig_clip = CreateRectRgn (0, 0, 0, 0);
- if (!GetClipRgn(s->hdc, orig_clip))
+ if (!GetClipRgn (s->hdc, orig_clip))
{
DeleteObject (orig_clip);
orig_clip = NULL;
return font_type == TRUETYPE_FONTTYPE ? Qiso10646_1 : Qunknown;
charset = w32_to_x_charset (w32_charset, NULL);
- return font_intern_prop (charset, strlen(charset), 1);
+ return font_intern_prop (charset, strlen (charset), 1);
}
static int
if (fnweight >= FW_NORMAL) return 100;
if (fnweight >= FW_LIGHT) return 50;
if (fnweight >= FW_EXTRALIGHT) return 40;
- if (fnweight > FW_THIN) return 20;
+ if (fnweight > FW_THIN) return 20;
return 0;
}
if (n >= 100) return FW_NORMAL;
if (n >= 50) return FW_LIGHT;
if (n >= 40) return FW_EXTRALIGHT;
- if (n >= 20) return FW_THIN;
+ if (n >= 20) return FW_THIN;
return 0;
}
int n;
{
if (n >= FW_EXTRABOLD) return intern ("black");
- if (n >= FW_BOLD) return intern ("bold");
- if (n >= FW_SEMIBOLD) return intern ("demibold");
- if (n >= FW_NORMAL) return intern ("medium");
+ if (n >= FW_BOLD) return intern ("bold");
+ if (n >= FW_SEMIBOLD) return intern ("demibold");
+ if (n >= FW_NORMAL) return intern ("medium");
return intern ("light");
}
logfont->lfPitchAndFamily = family | DEFAULT_PITCH;
}
-
/* Set pitch based on the spacing property. */
tmp = AREF (font_spec, FONT_SPACING_INDEX);
if (INTEGERP (tmp))
is written. If the buffer is not large enough to contain the name,
the function returns -1, otherwise it returns the number of bytes
written to FCNAME. */
-static int logfont_to_fcname(font, pointsize, fcname, size)
+static int
+logfont_to_fcname (font, pointsize, fcname, size)
LOGFONT* font;
int pointsize;
char *fcname;
return DECODE_SYSTEM (build_string (buf));
}
+static const char *w32font_booleans [] = {
+ NULL,
+};
+
+static const char *w32font_non_booleans [] = {
+ ":script",
+ ":antialias",
+ ":style",
+ NULL,
+};
+
+static void
+w32font_filter_properties (font, alist)
+ Lisp_Object font;
+ Lisp_Object alist;
+{
+ font_filter_properties (font, alist, w32font_booleans, w32font_non_booleans);
+}
+
struct font_driver w32font_driver =
{
0, /* Qgdi */
NULL, /* otf_drive */
NULL, /* start_for_frame */
NULL, /* end_for_frame */
- NULL /* shape */
+ NULL, /* shape */
+ NULL, /* check */
+ NULL, /* get_variation_glyphs */
+ w32font_filter_properties,
};