summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--do_tests.c62
-rw-r--r--do_text.c18
3 files changed, 50 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index 93036b7..2309bae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ yes)
esac
# Check for Xft library
-PKG_CHECK_MODULES(XFT, xft, [xft_found=yes], [xft_found=no])
+PKG_CHECK_MODULES(XFT, xft fontconfig, [xft_found=yes], [xft_found=no])
case "$xft_found" in
yes)
AC_DEFINE(XFT,1,[Xft library available])
diff --git a/do_tests.c b/do_tests.c
index 14fa328..402f4f2 100644
--- a/do_tests.c
+++ b/do_tests.c
@@ -924,7 +924,7 @@ Test test[] = {
InitText, DoText, ClearTextWin, EndText,
V1_2FEATURE, ROP, 0,
{80, False, "6x13", NULL}},
- {"-tileftext","Char in 80-char line (6x13)", NULL,
+ {"-tileftext","Char in 80-char line tiled (6x13)", NULL,
InitText, DoText, ClearTextWin, EndText,
V1_2FEATURE, ROP, 0,
{80, False, "6x13", NULL, FillTiled}},
@@ -1008,78 +1008,78 @@ Test test[] = {
"-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1",
NULL}},
#ifdef XFT
- {"-aa10text", "Char in 80-char aa line (Charter 10)", NULL,
+ {"-aa10text", "Char in 80-char aa line (DejaVu Sans 10)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 10, "charter:antialias=true:rgba=0:pixelsize=10", NULL}},
- {"-aa24text", "Char in 30-char aa line (Charter 24)", NULL,
+ {80, 10, "DejaVu Sans:antialias=true:rgba=0:pixelsize=10", NULL}},
+ {"-aa24text", "Char in 30-char aa line (DejaVu Sans 24)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {30, 24, "charter:antialias=true:rgba=0:pixelsize=24", NULL}},
+ {30, 24, "DejaVu Sans:antialias=true:rgba=0:pixelsize=24", NULL}},
{"-aaftext", "Char in 80-char aa line (Courier 12)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 12, "courier:antialias=true:rgba=0:pixelsize=12", NULL}},
- {"-a10text", "Char in 80-char a line (Charter 10)", NULL,
+ {80, 12, "Courier:antialias=true:rgba=0:pixelsize=12", NULL}},
+ {"-a10text", "Char in 80-char a line (DejaVu Sans 10)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 10, "charter:antialias=false:rgba=0:pixelsize=10", NULL}},
- {"-a24text", "Char in 30-char a line (Charter 24)", NULL,
+ {80, 10, "DejaVu Sans:antialias=false:rgba=0:pixelsize=10", NULL}},
+ {"-a24text", "Char in 30-char a line (DejaVu Sans 24)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {30, 24, "charter:antialias=false:rgba=0:pixelsize=24", NULL}},
+ {30, 24, "DejaVu Sans:antialias=false:rgba=0:pixelsize=24", NULL}},
{"-aftext", "Char in 80-char a line (Courier 12)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 12, "courier:antialias=false:rgba=0:pixelsize=12", NULL}},
- {"-rgb10text", "Char in 80-char rgb line (Charter 10)", NULL,
+ {80, 12, "Courier:antialias=false:rgba=0:pixelsize=12", NULL}},
+ {"-rgb10text", "Char in 80-char rgb line (DejaVu Sans 10)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 10, "charter:antialias=true:rgba=rgb:pixelsize=10", NULL}},
- {"-rgb24text", "Char in 30-char rgb line (Charter 24)", NULL,
+ {80, 10, "DejaVu Sans:antialias=true:rgba=rgb:pixelsize=10", NULL}},
+ {"-rgb24text", "Char in 30-char rgb line (DejaVu Sans 24)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {30, 24, "charter:antialias=true:rgba=rgb:pixelsize=24", NULL}},
+ {30, 24, "DejaVu Sans:antialias=true:rgba=rgb:pixelsize=24", NULL}},
{"-rgbftext", "Char in 80-char rgb line (Courier 12)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 12, "courier:antialias=true:rgba=rgb:pixelsize=12", NULL}},
- {"-caa10text", "Char in 80-char aa core line (Charter 10)", NULL,
+ {80, 12, "Courier:antialias=true:rgba=rgb:pixelsize=12", NULL}},
+ {"-caa10text", "Char in 80-char aa core line (DejaVu Sans 10)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 10, "charter:antialias=true:render=false:rgba=0:pixelsize=10", NULL}},
- {"-caa24text", "Char in 30-char aa core line (Charter 24)", NULL,
+ {80, 10, "DejaVu Sans:antialias=true:render=false:rgba=0:pixelsize=10", NULL}},
+ {"-caa24text", "Char in 30-char aa core line (DejaVu Sans 24)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {30, 24, "charter:antialias=true:render=false:rgba=0:pixelsize=24", NULL}},
+ {30, 24, "DejaVu Sans:antialias=true:render=false:rgba=0:pixelsize=24", NULL}},
{"-caaftext", "Char in 80-char aa core line (Courier 12)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 12, "courier:antialias=true:render=false:rgba=0:pixelsize=12", NULL}},
- {"-ca10text", "Char in 80-char a core line (Charter 10)", NULL,
+ {80, 12, "Courier:antialias=true:render=false:rgba=0:pixelsize=12", NULL}},
+ {"-ca10text", "Char in 80-char a core line (DejaVu Sans 10)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 10, "charter:antialias=false:render=false:rgba=0:pixelsize=10", NULL}},
- {"-ca24text", "Char in 30-char a core line (Charter 24)", NULL,
+ {80, 10, "DejaVu Sans:antialias=false:render=false:rgba=0:pixelsize=10", NULL}},
+ {"-ca24text", "Char in 30-char a core line (DejaVu Sans 24)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {30, 24, "charter:antialias=false:render=false:rgba=0:pixelsize=24", NULL}},
+ {30, 24, "DejaVu Sans:antialias=false:render=false:rgba=0:pixelsize=24", NULL}},
{"-caftext", "Char in 80-char a core line (Courier 12)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 12, "courier:antialias=false:render=false:rgba=0:pixelsize=12", NULL}},
- {"-crgb10text", "Char in 80-char rgb core line (Charter 10)", NULL,
+ {80, 12, "Courier:antialias=false:render=false:rgba=0:pixelsize=12", NULL}},
+ {"-crgb10text", "Char in 80-char rgb core line (DejaVu Sans 10)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 10, "charter:antialias=true:render=false:rgba=rgb:pixelsize=10", NULL}},
- {"-crgb24text", "Char in 30-char rgb core line (Charter 24)", NULL,
+ {80, 10, "DejaVu Sans:antialias=true:render=false:rgba=rgb:pixelsize=10", NULL}},
+ {"-crgb24text", "Char in 30-char rgb core line (DejaVu Sans 24)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {30, 24, "charter:antialias=true:render=false:rgba=rgb:pixelsize=24", NULL}},
+ {30, 24, "DejaVu Sans:antialias=true:render=false:rgba=rgb:pixelsize=24", NULL}},
{"-crgbftext", "Char in 80-char rgb core line (Courier 12)", NULL,
InitAAText, DoAAText, ClearTextWin, EndAAText,
V1_5FEATURE, NONROP, 0,
- {80, 12, "courier:antialias=true:render=false:rgba=rgb:pixelsize=12", NULL}},
+ {80, 12, "Courier:antialias=true:render=false:rgba=rgb:pixelsize=12", NULL}},
#endif
{"-scroll10", "Scroll 10x10 pixels", NULL,
InitScroll, DoScroll, MidScroll, EndScroll,
diff --git a/do_text.c b/do_text.c
index 8d28def..355ba8d 100644
--- a/do_text.c
+++ b/do_text.c
@@ -409,6 +409,8 @@ InitAAText(XParms xp, Parms p, int64_t reps)
{
char ch;
XRenderColor color;
+ FcValue value;
+ int v_len;
aafont = XftFontOpenName (xp->d, DefaultScreen (xp->d), p->font);
@@ -418,6 +420,22 @@ InitAAText(XParms xp, Parms p, int64_t reps)
p->font);
return 0;
}
+ if (FcPatternGet(aafont->pattern, FC_FAMILY, 0, &value) != FcResultMatch ||
+ value.type != FcTypeString)
+ {
+ printf("Could not load font '%s', benchmark omitted\n",
+ p->font);
+ XftFontClose (xp->d, aafont);
+ return 0;
+ }
+ v_len = strlen((char *) value.u.s);
+ if (strncmp((char *) value.u.s, p->font, v_len) != 0 || p->font[v_len] != ':') {
+ printf("Could not load font '%s' (found %s), benchmark omitted\n",
+ p->font,
+ (char *) value.u.s);
+ XftFontClose (xp->d, aafont);
+ return 0;
+ }
aadraw = XftDrawCreate (xp->d, xp->w,
xp->vinfo.visual,