From e15fa7a8cffbe6a67b1048d7b87b7df77d8b1686 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Jul 2014 11:44:35 -0400 Subject: [PATCH] Do not require the '=' in hb_feature_from_string() Towards accepting CSS font-feature-settings strings. --- src/hb-shape.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-shape.cc b/src/hb-shape.cc index a63a5c1e0..b4d300418 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -139,7 +139,11 @@ parse_feature_indices (const char **pp, const char *end, hb_feature_t *feature) static hb_bool_t parse_feature_value_postfix (const char **pp, const char *end, hb_feature_t *feature) { - return !parse_char (pp, end, '=') || parse_uint (pp, end, &feature->value); + bool had_equal = parse_char (pp, end, '='); + bool had_value = parse_uint (pp, end, &feature->value); + /* If there was an equal-sign, then there *must* be a value. + * A value without an eqaul-sign is ok, but not required. */ + return !had_equal || had_value; }