Commit 223e5fc6 authored by Jan Djärv's avatar Jan Djärv
Browse files

xftfont.c: Parse symbolic names for constants also.

(QClcdfilter): New variable.
(xftfont_open): Parse constant names for RGBA, HINT_STYLE and LCDFILTER.
(syms_of_xftfont): Initialize QClcdfilter.
parent bd770592
2009-12-13 Jan Djärv <jan.h.d@swipnet.se>
* xftfont.c (QClcdfilter): New variable.
(xftfont_open): Parse constant names for RGBA, HINT_STYLE and LCDFILTER.
(syms_of_xftfont): Initialize QClcdfilter.
2009-12-12 Jan Djärv <jan.h.d@swipnet.se>
* xsettings.c (struct xsettings): Add member seen.
......
......@@ -39,7 +39,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Xft font driver. */
static Lisp_Object Qxft;
static Lisp_Object QChinting , QCautohint, QChintstyle, QCrgba, QCembolden;
static Lisp_Object QChinting, QCautohint, QChintstyle, QCrgba, QCembolden,
QClcdfilter;
/* The actual structure for Xft font that can be casted to struct
font. */
......@@ -252,7 +253,7 @@ xftfont_open (f, entity, pixel_size)
XftFont *xftfont = NULL;
int spacing;
char name[256];
int len, i;
int len, i, ival;
XGlyphInfo extents;
FT_Face ft_face;
FcMatrix *matrix;
......@@ -311,11 +312,25 @@ xftfont_open (f, entity, pixel_size)
{
if (INTEGERP (val))
FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
else if (SYMBOLP (val)
&& FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
}
else if (EQ (key, QCrgba))
{
if (INTEGERP (val))
FcPatternAddInteger (pat, FC_RGBA, XINT (val));
else if (SYMBOLP (val)
&& FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
FcPatternAddInteger (pat, FC_RGBA, ival);
}
else if (EQ (key, QClcdfilter))
{
if (INTEGERP (val))
FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
else if (SYMBOLP (val)
&& FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
}
#ifdef FC_EMBOLDEN
else if (EQ (key, QCembolden))
......@@ -343,7 +358,7 @@ xftfont_open (f, entity, pixel_size)
XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);
match = XftFontMatch (display, FRAME_X_SCREEN_NUMBER (f), pat, &result);
xftfont_fix_match (pat, match);
FcPatternDestroy (pat);
xftfont = XftFontOpenPattern (display, match);
if (!xftfont)
......@@ -706,6 +721,7 @@ syms_of_xftfont ()
DEFSYM (QChintstyle, ":hintstyle");
DEFSYM (QCrgba, ":rgba");
DEFSYM (QCembolden, ":embolden");
DEFSYM (QClcdfilter, ":lcdfilter");
xftfont_driver = ftfont_driver;
xftfont_driver.type = Qxft;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment