[HarfBuzz] hb-view
Martin Hosken
martin_hosken at sil.org
Wed Mar 2 01:43:40 PST 2011
Dear Behdad,
> A compromise would be a parsing string that handles the defined enum values,
> and uses a tag for unknown values. Something like:
>
> hb_script_t
> hb_script_from_string (const char *s)
> {
> if (strcmp (s, "Arab"))
> return HB_SCRIPT_ARABIC;
> if (strcmp (s, "Latn"))
> return HB_SCRIPT_LATIN;
> ...
>
> return hb_tag_from_string (s);
> }
+1
I like this approach. We need to get away from enums and into more open approaches, while maintaining backward compatibility. Perhaps your hb_tag_from_string could work on an uppercased version of the string, to allow the script tag to remain case independent. Hmm perhaps the whole function needs to be case independent.
Yours,
Martin
More information about the HarfBuzz
mailing list