summaryrefslogtreecommitdiff
path: root/test/font-variations.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2017-09-20 15:11:27 -0700
committerBehdad Esfahbod <behdad@behdad.org>2017-12-19 15:17:01 -0500
commit34047d11db847777d32b5eb49dfcb64bc08e33d0 (patch)
tree4fd79d3635ac6a150890fab8028e5dd2e36c4196 /test/font-variations.c
parent6accf16093b3d3451eca10ee194c00a1107b8861 (diff)
[variations] Fix test
This does not exercise merging of variations from font-options and from pattern. Before this commit the code was more towards doing that.
Diffstat (limited to 'test/font-variations.c')
-rw-r--r--test/font-variations.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/test/font-variations.c b/test/font-variations.c
index 47dcd3706..36724f05b 100644
--- a/test/font-variations.c
+++ b/test/font-variations.c
@@ -59,14 +59,9 @@ test_variation (cairo_test_context_t *ctx,
#if CAIRO_HAS_FC_FONT
FcPattern *pattern;
-#ifndef FC_FONT_VARIATIONS
-#define FC_FONT_VARIATIONS "fontvariations"
-#endif
-
/* we need a font that has variations */
pattern = FcPatternBuild (NULL,
FC_FAMILY, FcTypeString, (FcChar8*)"Adobe Variable Font Prototype",
- FC_FONT_VARIATIONS, FcTypeString, input,
NULL);
font_face = cairo_ft_font_face_create_for_pattern (pattern);
status = cairo_font_face_status (font_face);
@@ -84,13 +79,13 @@ test_variation (cairo_test_context_t *ctx,
return CAIRO_TEST_FAILURE;
}
- cairo_font_options_set_variations (options, "wdth=200,wght=300");
+ cairo_font_options_set_variations (options, input);
if (cairo_font_options_status (options) != CAIRO_STATUS_SUCCESS) {
cairo_test_log (ctx, "Failed to set variations");
return CAIRO_TEST_FAILURE;
}
- if (strcmp (cairo_font_options_get_variations (options), "wdth=200,wght=300") != 0) {
+ if (strcmp (cairo_font_options_get_variations (options), input) != 0) {
cairo_test_log (ctx, "Failed to verify variations");
return CAIRO_TEST_FAILURE;
}
@@ -172,10 +167,10 @@ preamble (cairo_test_context_t *ctx)
int expected_default;
float expected_value;
} tests[] = {
- { "wdth=200,wght=300", "wght", 0, 200.0 }, // valid
- { "wdth=200.5,wght=300", "wght", 0, 200.5 }, // valid, using decimal dot
- { "wdth 200 , wght=300", "wght", 0, 200.0 }, // valid, without =
- { "wdth = 200", "wght", 0, 200.0 }, // valid, whitespace and =
+ { "wdth=200,wght=300", "wdth", 0, 200.0 }, // valid
+ { "wdth=200.5,wght=300", "wdth", 0, 200.5 }, // valid, using decimal dot
+ { "wdth 200 , wght=300", "wdth", 0, 200.0 }, // valid, without =
+ { "wdth = 200", "wdth", 0, 200.0 }, // valid, whitespace and =
{ "CNTR=20", "wght", 1, 0.0 }, // valid, not setting wght
{ "weight=100", "wght", 1, 0.0 }, // not a valid tag
{ NULL, 0 }