Re: [Bug 90166] Add a way to specify units (in SVG output)

Adrian Johnson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On 07/11/17 08:44, Bryce Harrington wrote:
> On Fri, Nov 03, 2017 at 03:13:05PM +0100, Antonio Ospite wrote:
>> On Thu, 12 Oct 2017 12:25:41 +0200
>> Antonio Ospite <[email protected]> wrote:
>>
>> [...] 
>>> The API addition I originally proposed[1,2] looks like this:
>>>
>>> void cairo_svg_surface_set_document_unit (cairo_surface_t*, cairo_svg_unit_t)
>>>
>>> Where cairo_svg_unit_t is an enum type representing all the possible
>>> units.
>>>
>>
>> Hi,
>>
>> here is v2 of the path:
>> https://bugs.freedesktop.org/show_bug.cgi?id=90166#c11
>>
>> After this is merged we can discuss if some extensions can be useful;
>> like getting an array of all the possible units, or having a function
>> to convert the enum values to strings, I mean following the model of 
>> cairo_svg_get_versions() and cairo_svg_version_to_string().
>>
>> I was also thinking of tweaking the documentation of the functions which
>> create SVG surfaces to state that "width" and "height" are assumed to
>> be in points by *default*, but that their unit can be changed later.
> 
> The patch looks good to me.  I agree with making user the default even
> though cairo has defaulted to "pt" historically.

That would be an API change. We can't do that.

>  Regarding using the
> abbr versions of the units rather than full strings I could go either
> way on myself, and have no arguments against using the short versions;
> anyone dealing with SVG document syntax should be adequately familiar
> with the abbreviated versions already.
> 
> Reviewed-by: Bryce Harrington <[email protected]>
> 
> If no one raises any further qualms within the next few days, I'll go
> ahead and land this patch.
> 
> Bryce
> 

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