diff options
author | David Corbett <corbett.dav@husky.neu.edu> | 2019-02-18 22:30:40 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2019-02-25 17:48:16 -0500 |
commit | 45adc185260f0fa1fa86472aafb7f91f942c567e (patch) | |
tree | 6f3facdcc2745af55a278bea996d7c3bc56251f6 /src | |
parent | d66f7e14a0097d8ca54ad9824f7aa7daee6c7f72 (diff) |
Fix or document unsupported font-feature-settings
Diffstat (limited to 'src')
-rw-r--r-- | src/hb-common.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/hb-common.cc b/src/hb-common.cc index fb8c7b72..ab93bf42 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -731,7 +731,7 @@ parse_uint (const char **pp, const char *end, unsigned int *pv) /* Intentionally use strtol instead of strtoul, such that * -1 turns into "big number"... */ errno = 0; - v = strtol (p, &pend, 0); + v = strtol (p, &pend, 10); if (errno || p == pend) return false; @@ -755,7 +755,7 @@ parse_uint32 (const char **pp, const char *end, uint32_t *pv) /* Intentionally use strtol instead of strtoul, such that * -1 turns into "big number"... */ errno = 0; - v = strtol (p, &pend, 0); + v = strtol (p, &pend, 10); if (errno || p == pend) return false; @@ -857,9 +857,14 @@ parse_bool (const char **pp, const char *end, uint32_t *pv) (*pp)++; /* CSS allows on/off as aliases 1/0. */ - if (*pp - p == 2 && 0 == strncmp (p, "on", 2)) + if (*pp - p == 2 + && TOLOWER (p[0]) == 'o' + && TOLOWER (p[1]) == 'n') *pv = 1; - else if (*pp - p == 3 && 0 == strncmp (p, "off", 3)) + else if (*pp - p == 3 + && TOLOWER (p[0]) == 'o' + && TOLOWER (p[1]) == 'f' + && TOLOWER (p[2]) == 'f') *pv = 0; else return false; @@ -975,8 +980,9 @@ parse_one_feature (const char **pp, const char *end, hb_feature_t *feature) * Parses a string into a #hb_feature_t. * * The format for specifying feature strings follows. All valid CSS - * font-feature-settings values other than 'normal' and 'inherited' are also - * accepted, though, not documented below. + * font-feature-settings values other than 'normal' and the global values are + * also accepted, though not documented below. CSS string escapes are not + * supported. * * The range indices refer to the positions between Unicode characters. The * position before the first character is always 0. |