[cairo] OpenType font variations and cairo

Matthias Clasen matthias.clasen at gmail.com
Thu Sep 14 20:22:28 UTC 2017


On Thu, Sep 14, 2017 at 12:37 PM, Behdad Esfahbod <behdad.esfahbod at gmail.com
> wrote:

> Thanks Matthias.  I took a look at the patch.  Looks good!  Minor comments:
>
> - Moving the format towards CSS by default (no comma, no equal sign; just
> spaces!) while accepting both is what I do in HarfBuzz. Maybe advertise the
> same here,  UPDATE: I was wrong.  CSS uses comma as well.  It's the equal
> sign that they don't use, they use space.  We should accept both.
>

I've made the parser a bit more flexible. It now accepts variations like

wdth=200,wght=300
wdth 200, wght=300
wdth 200 , wght 300


- Maybe make the variations member be "const char *" instead of "char *".
>

But I'm strdup'ing and freeing it. The const will get in the way there.


> - In +cairo_font_options_set_variations(), typically in these kinds of
> functions I like copying then freeing the old value, such that the input
> can be the return value of get_variations() on the same object.
>

Done


> - (((uint8_t)p[0])<<24)|(((uint8_t)p[1])<<16)|(((uint8_t)
> p[2])<<8)|((uint8_t)p[3]);
> FreeType has a macro for that: FT_MAKE_TAG()
>

Thanks for the reminder. Done.

(Generally I find it easier pushing a tree on github and reviewing there;
> also because I can just fix stuff and push my own tree.)
>
>
You can find the new version here:

https://github.com/matthiasclasen/cairo/commits/wip/matthiasc/font-variations
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20170914/46d4015d/attachment.html>


More information about the cairo mailing list