[cairo-bugs] [Bug 90166] Add a way to specify units

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Oct 11 23:19:21 UTC 2017


--- Comment #9 from Bill Spitzak <spitzak at gmail.com> ---
Comment # 8 on bug 90166 from Adrian Johnson

The proposed api in this bug
https://bugs.freedesktop.org/show_bug.cgi?id=90166 uses an enumeration
for each of the svg unit types, but nothing is ever done with that
enumeration other than to print a 2-letter string into the svg output.

I propose a better api would be to just accept the string and print it
without any checking. This would remove the need to modify cairo on
any svg updates that add new units, and also probably makes it much
easier to copy the units from one svg to another.

Proposed api:

void cairo_svg_surface_set_document_unit (cairo_surface_t*, const char*)

The string pointer must point at a valid svg unit type, such as "pt"
or "em". NULL is the same as "" (which means "user" units). The
function should do some basic sanity checks (maximum length, and only
printing ASCII) and is a no-op if it fails.

On Wed, Oct 11, 2017 at 1:45 PM,  <bugzilla-daemon at freedesktop.org> wrote:
> Comment # 8 on bug 90166 from Adrian Johnson
> Please post API proposals to the mailing list for discussion.
> ________________________________
> You are receiving this mail because:
> You are watching the QA Contact of the bug.

You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20171011/f100b330/attachment.html>

More information about the cairo-bugs mailing list