<div dir="ltr">'MM/CM' vs 'INCHES' and all others seems inconsistent to me.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 12, 2017 at 9:38 PM, Adrian Johnson <span dir="ltr"><<a href="mailto:ajohnson@redneon.com" target="_blank">ajohnson@redneon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 12/10/17 21:59, Adrian Johnson wrote:<br>
> On 12/10/17 20:55, Antonio Ospite wrote:<br>
>> The API addition I originally proposed[1,2] looks like this:<br>
>><br>
>> void cairo_svg_surface_set_<wbr>document_unit (cairo_surface_t*, cairo_svg_unit_t)<br>
>><br>
>> Where cairo_svg_unit_t is an enum type representing all the possible<br>
>> units.<br>
><br>
> The enum in the patch is:<br>
><br>
> typedef enum _cairo_svg_unit {<br>
> CAIRO_SVG_UNIT_EM,<br>
> CAIRO_SVG_UNIT_EX,<br>
> CAIRO_SVG_UNIT_PX,<br>
> CAIRO_SVG_UNIT_IN,<br>
> CAIRO_SVG_UNIT_CM,<br>
> CAIRO_SVG_UNIT_MM,<br>
> CAIRO_SVG_UNIT_PT,<br>
> CAIRO_SVG_UNIT_PC,<br>
> CAIRO_SVG_UNIT_PERCENT,<br>
> CAIRO_SVG_UNIT_USER<br>
> } cairo_svg_unit_t;<br>
<br>
</span>We don't have to use the SVG abbreviations in the enum. The non standard<br>
abbreviations can be expanded to make it clearer. I've reordered it<br>
slightly to put the default first followed by the more common units.<br>
<br>
typedef enum _cairo_svg_unit {<br>
CAIRO_SVG_UNIT_POINTS,<br>
CAIRO_SVG_UNIT_PIXELS,<br>
CAIRO_SVG_UNIT_MM,<br>
CAIRO_SVG_UNIT_CM,<br>
CAIRO_SVG_UNIT_INCHES,<br>
CAIRO_SVG_UNIT_PICAS,<br>
CAIRO_SVG_UNIT_FONT_EM,<br>
CAIRO_SVG_UNIT_FONT_X,<br>
<div class="HOEnZb"><div class="h5"> CAIRO_SVG_UNIT_PERCENT,<br>
CAIRO_SVG_UNIT_USER<br>
} cairo_svg_unit_t;<br>
<br>
<br>
><br>
> This looks good to me. It just needs a getter. Are all the units in SVG<br>
> 1.1? If not the minimum version will need to be documented. The default<br>
> unit will also need to be documented.<br>
><br>
<br>
--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="https://lists.cairographics.org/mailman/listinfo/cairo" rel="noreferrer" target="_blank">https://lists.cairographics.<wbr>org/mailman/listinfo/cairo</a></div></div></blockquote></div><br></div>