double dpi;
FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b);
- if (! b)
+ if (! b)
{
FcPatternDel (match, FC_ANTIALIAS);
FcPatternAddBool (match, FC_ANTIALIAS, FcFalse);
}
FcPatternGetBool (pat, FC_HINTING, 0, &b);
- if (! b)
+ if (! b)
{
FcPatternDel (match, FC_HINTING);
FcPatternAddBool (match, FC_HINTING, FcFalse);
}
+#ifndef FC_HINT_STYLE
+# define FC_HINT_STYLE "hintstyle"
+#endif
if (FcResultMatch == FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i))
{
FcPatternDel (match, FC_HINT_STYLE);
register_font_driver (&xftfont_driver, NULL);
}
-
SEEN_FONT = 0x40,
SEEN_TB_STYLE = 0x80,
};
-struct xsettings
+struct xsettings
{
#ifdef HAVE_XFT
FcBool aa, hinting;
gpointer user_data)
{
GConfValue *v = gconf_entry_get_value (entry);
-
+
if (!v) return;
if (v->type == GCONF_VALUE_STRING)
{
4 CARD32 last-change-serial
and then the value, For string:
-
+
bytes type what
------------------------------------
4 CARD32 n = value-length
(strcmp (XSETTINGS_FONT_NAME, name) == 0)
|| (strcmp (XSETTINGS_TOOL_BAR_STYLE, name) == 0);
- switch (type)
+ switch (type)
{
case 0: /* Integer */
if (bytes_parsed+4 > bytes) return BadLength;
case 2: /* RGB value */
/* No need to parse this */
if (bytes_parsed+8 > bytes) return BadLength;
- bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */
+ bytes_parsed += 8; /* 4 values (r, b, g, alpha), 2 bytes each. */
break;
default: /* Parse Error */
return BadValue;
}
- if (want_this)
+ if (want_this)
{
++settings_seen;
if (strcmp (name, XSETTINGS_FONT_NAME) == 0)
settings->seen |= SEEN_HINTING;
settings->hinting = ival != 0;
}
+# ifdef FC_HINT_STYLE
else if (strcmp (name, "Xft/HintStyle") == 0)
{
settings->seen |= SEEN_HINTSTYLE;
else
settings->seen &= ~SEEN_HINTSTYLE;
}
+# endif
else if (strcmp (name, "Xft/RGBA") == 0)
{
settings->seen |= SEEN_RGBA;
pat);
FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa);
FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting);
+# ifdef FC_HINT_STYLE
FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle);
+# endif
FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter);
FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "LCDFilter: %d", oldsettings.lcdfilter);
+# ifdef FC_HINT_STYLE
if ((settings->seen & SEEN_HINTSTYLE) != 0
&& oldsettings.hintstyle != settings->hintstyle)
{
++changed;
oldsettings.hintstyle = settings->hintstyle;
}
+# endif
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle);
FcPatternAddDouble (pat, FC_DPI, settings->dpi);
++changed;
oldsettings.dpi = settings->dpi;
-
+
/* Change the DPI on this display and all frames on the display. */
dpyinfo->resy = dpyinfo->resx = settings->dpi;
FOR_EACH_FRAME (tail, frame)
if (settings.seen & SEEN_FONT)
{
- if (!current_font || strcmp (current_font, settings.font) != 0)
+ if (!current_font || strcmp (current_font, settings.font) != 0)
{
free (current_font);
current_font = settings.font;
Fprovide (intern_c_string ("dynamic-setting"), Qnil);
}
-