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

Antonio Ospite ao2 at ao2.it
Sat Oct 21 17:10:49 UTC 2017


On Tue, 17 Oct 2017 06:24:17 +1030
Adrian Johnson <ajohnson at redneon.com> wrote:

> On 17/10/17 06:15, Bill Spitzak wrote:
> > I would put USER first as it appears to be the default value, making
> > it zero is a good idea to avoid confusion.
> 
> The default is points.
> 

So, should I put PT first and have the following order?

+typedef enum _cairo_svg_unit {
+    CAIRO_SVG_UNIT_PT = 0,
+    CAIRO_SVG_UNIT_EM,
+    CAIRO_SVG_UNIT_EX,
+    CAIRO_SVG_UNIT_PX,
+    CAIRO_SVG_UNIT_IN,
+    CAIRO_SVG_UNIT_CM,
+    CAIRO_SVG_UNIT_MM,
+    CAIRO_SVG_UNIT_PC,
+    CAIRO_SVG_UNIT_PERCENT,
+    CAIRO_SVG_UNIT_USER
+} cairo_svg_unit_t;

Or can I stick to the "official" order suggested by the specification
[1], and just mention in the API doc that "pt" happens to be the default
unit for *cairo*, if cairo_svg_surface_set_document_unit () is not
called?

Thanks,
   Antonio

[1]  https://www.w3.org/TR/SVG/types.html#DataTypeLength

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


More information about the cairo mailing list