extern struct font_driver w32font_driver;
Lisp_Object Qgdi;
-extern Lisp_Object QCfamily; /* reuse from xfaces.c */
-static Lisp_Object Qmonospace, Qsans_serif, Qserif, Qmono, Qsans, Qsans__serif;
-static Lisp_Object Qscript, Qdecorative, Qraster, Qoutline, Qunknown;
+static Lisp_Object Qmonospace, Qsansserif, Qmono, Qsans, Qsans_serif;
+static Lisp_Object Qserif, Qscript, Qdecorative;
+static Lisp_Object Qraster, Qoutline, Qunknown;
/* antialiasing */
extern Lisp_Object QCantialias; /* defined in font.c */
particularly troublesome with tooltip frames, and causes crashes. */
f = ((struct w32font_info *)font)->owning_frame;
#else
- f = selected_frame;
+ f = XFRAME (selected_frame);
#endif
dc = get_frame_dc (f);
if (generic_type == FF_DECORATIVE)
tem = Qdecorative;
else if (generic_type == FF_MODERN)
- tem = Qmonospace;
+ tem = Qmono;
else if (generic_type == FF_ROMAN)
tem = Qserif;
else if (generic_type == FF_SCRIPT)
tem = Qscript;
else if (generic_type == FF_SWISS)
- tem = Qsans_serif;
+ tem = Qsans;
else
- tem = Qnil;
-
- if (! NILP (tem))
- font_put_extra (entity, QCfamily, tem);
+ tem = null_string;
+
+ ASET (entity, FONT_ADSTYLE_INDEX, tem);
if (physical_font->ntmTm.tmPitchAndFamily & 0x01)
font_put_extra (entity, QCspacing, make_number (FONT_SPACING_PROPORTIONAL));
/* Generic families. */
if (EQ (name, Qmonospace) || EQ (name, Qmono))
return FF_MODERN;
- else if (EQ (name, Qsans_serif) || EQ (name, Qsans__serif)
- || EQ (name, Qsans))
+ else if (EQ (name, Qsans) || EQ (name, Qsans_serif) || EQ (name, Qsansserif))
return FF_SWISS;
else if (EQ (name, Qserif))
return FF_ROMAN;
|| font->lfWeight > (pattern->lfWeight + 150)))
return 0;
+ if (pattern->lfPitchAndFamily & 0xF0 != FF_DONTCARE
+ && pattern->lfPitchAndFamily & 0xF0 != font->lfPitchAndFamily & 0xF0)
+ return 0;
+
/* Charset and face should be OK. Italic has to be checked
against the original spec, in case we don't have any preference. */
return 1;
{
Lisp_Object key = XCAR (extra_entry);
val = XCDR (extra_entry);
- if (EQ (key, QCfamily))
- {
- /* Generic family. Most useful when there is no font name
- specified. eg, if a script does not exist in the default
- font, we could look for a font with the same generic family
- that does support the script. Full PANOSE support would
- be better, but we need to open the font to get that. */
- BYTE w32_family = w32_generic_family (val);
-
- /* Reject if FF_DONTCARE is returned, as it means the
- font spec is bad. */
- if (w32_family == FF_DONTCARE
- || w32_family != (font->ntmTm.tmPitchAndFamily & 0xF0))
- return 0;
- }
- else if (EQ (key, QCspacing))
+ if (EQ (key, QCspacing))
{
int proportional;
if (INTEGERP (val))
strncpy (logfont->lfFaceName, SDATA (tmp), LF_FACESIZE);
}
+ tmp = AREF (font_spec, FONT_ADSTYLE_INDEX);
+ if (!NILP (tmp))
+ {
+ /* Override generic family. */
+ BYTE family = w32_generic_family (tmp);
+ if (family != FF_DONTCARE)
+ logfont->lfPitchAndFamily = family | DEFAULT_PITCH;
+ }
+
/* Process EXTRA info. */
for ( ; CONSP (extra); extra = XCDR (extra))
{
{
Lisp_Object key, val;
key = XCAR (tmp), val = XCDR (tmp);
- if (EQ (key, QCfamily))
- {
- /* Override generic family. */
- BYTE family = w32_generic_family (val);
- if (family != FF_DONTCARE)
- logfont->lfPitchAndFamily
- = logfont->lfPitchAndFamily & 0x0F | family;
- }
- else if (EQ (key, QCspacing))
+ if (EQ (key, QCspacing))
{
/* Set pitch based on the spacing property. */
if (INTEGERP (val))
/* Generic font families. */
DEFSYM (Qmonospace, "monospace");
DEFSYM (Qserif, "serif");
- DEFSYM (Qsans_serif, "sans-serif");
+ DEFSYM (Qsansserif, "sansserif");
DEFSYM (Qscript, "script");
DEFSYM (Qdecorative, "decorative");
/* Aliases. */
- DEFSYM (Qsans__serif, "sans_serif");
+ DEFSYM (Qsans_serif, "sans_serif");
DEFSYM (Qsans, "sans");
DEFSYM (Qmono, "mono");