[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r103231: Port to Solaris 10, which do
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r103231: Port to Solaris 10, which doesn't support FC_HINT_STYLE. |
Date: |
Fri, 11 Feb 2011 21:13:34 -0800 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 103231
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Fri 2011-02-11 21:13:34 -0800
message:
Port to Solaris 10, which doesn't support FC_HINT_STYLE.
modified:
src/ChangeLog
src/xftfont.c
src/xsettings.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-02-11 15:40:19 +0000
+++ b/src/ChangeLog 2011-02-12 05:13:34 +0000
@@ -1,3 +1,11 @@
+2011-02-12 Paul Eggert <address@hidden>
+
+ Port to Solaris 10, which doesn't support FC_HINT_STYLE.
+ * xftfont.c (FC_HINT_STYLE): #define to "hintstyle" if not
+ defined.
+ * xsettings.c (parse_settings, apply_xft_settings): Don't assume
+ FC_HINT_STYLE is supported.
+
2011-02-11 Jan Djärv <address@hidden>
* xterm.c (x_set_frame_alpha): Access data before it is free:d.
=== modified file 'src/xftfont.c'
--- a/src/xftfont.c 2011-02-05 22:30:14 +0000
+++ b/src/xftfont.c 2011-02-12 05:13:34 +0000
@@ -187,17 +187,20 @@
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);
@@ -781,4 +784,3 @@
register_font_driver (&xftfont_driver, NULL);
}
-
=== modified file 'src/xsettings.c'
--- a/src/xsettings.c 2011-01-25 04:08:28 +0000
+++ b/src/xsettings.c 2011-02-12 05:13:34 +0000
@@ -75,7 +75,7 @@
SEEN_FONT = 0x40,
SEEN_TB_STYLE = 0x80,
};
-struct xsettings
+struct xsettings
{
#ifdef HAVE_XFT
FcBool aa, hinting;
@@ -104,7 +104,7 @@
gpointer user_data)
{
GConfValue *v = gconf_entry_get_value (entry);
-
+
if (!v) return;
if (v->type == GCONF_VALUE_STRING)
{
@@ -196,7 +196,7 @@
4 CARD32 last-change-serial
and then the value, For string:
-
+
bytes type what
------------------------------------
4 CARD32 n = value-length
@@ -280,7 +280,7 @@
(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;
@@ -310,14 +310,14 @@
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)
@@ -341,6 +341,7 @@
settings->seen |= SEEN_HINTING;
settings->hinting = ival != 0;
}
+# ifdef FC_HINT_STYLE
else if (strcmp (name, "Xft/HintStyle") == 0)
{
settings->seen |= SEEN_HINTSTYLE;
@@ -355,6 +356,7 @@
else
settings->seen &= ~SEEN_HINTSTYLE;
}
+# endif
else if (strcmp (name, "Xft/RGBA") == 0)
{
settings->seen |= SEEN_RGBA;
@@ -442,7 +444,9 @@
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);
@@ -488,6 +492,7 @@
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)
{
@@ -496,6 +501,7 @@
++changed;
oldsettings.hintstyle = settings->hintstyle;
}
+# endif
if (strlen (buf) > 0) strcat (buf, ", ");
sprintf (buf+strlen (buf), "Hintstyle: %d", oldsettings.hintstyle);
@@ -508,7 +514,7 @@
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)
@@ -565,7 +571,7 @@
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;
@@ -774,4 +780,3 @@
Fprovide (intern_c_string ("dynamic-setting"), Qnil);
}
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r103231: Port to Solaris 10, which doesn't support FC_HINT_STYLE.,
Paul Eggert <=