Re: OpenType font variations and cairo

Adrian Johnson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On 15/09/17 05:52, Matthias Clasen wrote:
> On Thu, Sep 14, 2017 at 12:37 PM, Behdad Esfahbod
> <[email protected] <mailto:[email protected]>> 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

Does it work with decimal commas?

> 
> 
>     - 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
> 
> 
> 

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.