]> gitweb.michael.orlitzky.com - libsvgtiny.git/log
libsvgtiny.git
3 months agosrc/svgtiny_internal.h: add svgtiny_select_style() to the header
Michael Orlitzky [Wed, 18 Oct 2023 00:08:55 +0000 (20:08 -0400)]
src/svgtiny_internal.h: add svgtiny_select_style() to the header

We'll need a prototype in order to use that function in svgtiny.c.

3 months agosrc/svgtiny_css.c: add svgtiny_select_style() wrapper
Michael Orlitzky [Tue, 17 Oct 2023 21:43:35 +0000 (17:43 -0400)]
src/svgtiny_css.c: add svgtiny_select_style() wrapper

Some boilerplate will be needed when we call css_select_style() during
parsing. In preparation for (avoiding) that, we factor it out into a
convenience function called svgtiny_select_style().

3 months agosrc/svgtiny_css.c: use our userdata handler in set_libcss_node_data()
Michael Orlitzky [Tue, 17 Oct 2023 21:04:07 +0000 (17:04 -0400)]
src/svgtiny_css.c: use our userdata handler in set_libcss_node_data()

This was a missing part of the implementation that had to wait until
our css_select_handler vtable was defined.

3 months agosrc/svgtiny_css.c: add user handler function
Michael Orlitzky [Tue, 17 Oct 2023 15:35:13 +0000 (11:35 -0400)]
src/svgtiny_css.c: add user handler function

This function needs to be passed to dom_node_set_user_data() in
set_libcss_node_data(), but we couldn't implement it before our
css_select_handler was defined, because it passes the address of
that select handler to css_libcss_node_data_handler().

3 months agosrc/svgtiny_css.c: define a css_select_handler
Michael Orlitzky [Tue, 17 Oct 2023 20:55:03 +0000 (16:55 -0400)]
src/svgtiny_css.c: define a css_select_handler

We define a css_select_handler structure full of all of the select
handlers we've just implemented. This is the big piece of the puzzle
that we need before we can call css_select_style().

3 months agosrc/svgtiny_css.c: implement named_ancestor_node() select handler
Michael Orlitzky [Tue, 17 Oct 2023 20:41:37 +0000 (16:41 -0400)]
src/svgtiny_css.c: implement named_ancestor_node() select handler

3 months agosrc/svgtiny_css.c: implement node_presentational_hint() select handler
Michael Orlitzky [Tue, 17 Oct 2023 15:07:33 +0000 (11:07 -0400)]
src/svgtiny_css.c: implement node_presentational_hint() select handler

3 months agosrc/svgtiny_css.c: implement get_libcss_node_data() select handler
Michael Orlitzky [Tue, 17 Oct 2023 14:36:08 +0000 (10:36 -0400)]
src/svgtiny_css.c: implement get_libcss_node_data() select handler

3 months agosrc/svgtiny_css.c: implement set_libcss_node_data() select handler
Michael Orlitzky [Tue, 17 Oct 2023 14:29:52 +0000 (10:29 -0400)]
src/svgtiny_css.c: implement set_libcss_node_data() select handler

3 months agosrc/svgtiny_strings.h: intern a "userdata" key string
Michael Orlitzky [Tue, 17 Oct 2023 14:22:35 +0000 (10:22 -0400)]
src/svgtiny_strings.h: intern a "userdata" key string

To implement libcss's select handler API, we need to implement two
functions that get/set "userdata" on a node. The corresponding libdom
API allows you to set arbitrary data in the form of key->value pairs;
so to identify THIS particular data, we need to use the same string
each time. For that reason we intern "_libcss_user_data" and call it
the "userdata_key".

3 months agosrc/svgtiny_css.c: implement node_is_visited() select handler
Michael Orlitzky [Tue, 17 Oct 2023 02:08:28 +0000 (22:08 -0400)]
src/svgtiny_css.c: implement node_is_visited() select handler

3 months agosrc/svgtiny_css.c: implement ua_default_for_property() select handler
Michael Orlitzky [Tue, 17 Oct 2023 02:04:15 +0000 (22:04 -0400)]
src/svgtiny_css.c: implement ua_default_for_property() select handler

3 months agosrc/svgtiny_css.c: implement node_is_lang() select handler
Michael Orlitzky [Tue, 17 Oct 2023 01:22:28 +0000 (21:22 -0400)]
src/svgtiny_css.c: implement node_is_lang() select handler

3 months agosrc/svgtiny_css.c: case-insensitivity for node_has_attribute_substring()
Michael Orlitzky [Tue, 17 Oct 2023 01:19:04 +0000 (21:19 -0400)]
src/svgtiny_css.c: case-insensitivity for node_has_attribute_substring()

All of the CSS attribute selectors take a flag to make the comparison
case-insensitive. Libcss doesn't support that yet, but in the case of
node_has_attribute_substring(), factoring out the implementation and
letting it take an "insensitive" flag will be of use to us when we
implement the node_is_lang() select handler.

3 months agosrc/svgtiny_css.c: implement node_is_target() select handler
Michael Orlitzky [Mon, 16 Oct 2023 23:42:09 +0000 (19:42 -0400)]
src/svgtiny_css.c: implement node_is_target() select handler

3 months agosrc/svgtiny_css.c: implement node_is_checked() select handler
Michael Orlitzky [Mon, 16 Oct 2023 23:37:00 +0000 (19:37 -0400)]
src/svgtiny_css.c: implement node_is_checked() select handler

3 months agosrc/svgtiny_css.c: implement node_is_disabled() select handler
Michael Orlitzky [Sat, 14 Oct 2023 23:53:52 +0000 (19:53 -0400)]
src/svgtiny_css.c: implement node_is_disabled() select handler

3 months agosrc/svgtiny_css.c: implement node_is_enabled() select handler
Michael Orlitzky [Sat, 14 Oct 2023 23:49:16 +0000 (19:49 -0400)]
src/svgtiny_css.c: implement node_is_enabled() select handler

3 months agosrc/svgtiny_css.c: implement node_is_focus() select handler
Michael Orlitzky [Sat, 14 Oct 2023 23:36:39 +0000 (19:36 -0400)]
src/svgtiny_css.c: implement node_is_focus() select handler

3 months agosrc/svgtiny_css.c: implement node_is_active() select handler
Michael Orlitzky [Sat, 14 Oct 2023 23:30:15 +0000 (19:30 -0400)]
src/svgtiny_css.c: implement node_is_active() select handler

3 months agosrc/svgtiny_css.c: implement node_is_hover() select handler
Michael Orlitzky [Sat, 14 Oct 2023 23:27:56 +0000 (19:27 -0400)]
src/svgtiny_css.c: implement node_is_hover() select handler

3 months agosrc/svgtiny_css.c: implement node_is_link() select handler
Michael Orlitzky [Sat, 14 Oct 2023 17:13:45 +0000 (13:13 -0400)]
src/svgtiny_css.c: implement node_is_link() select handler

3 months agosrc/svgtiny_css.c: implement node_is_empty() select handler
Michael Orlitzky [Sat, 14 Oct 2023 15:39:20 +0000 (11:39 -0400)]
src/svgtiny_css.c: implement node_is_empty() select handler

3 months agosrc/svgtiny_css.c: implement node_count_siblings() select handler
Michael Orlitzky [Sat, 14 Oct 2023 14:31:14 +0000 (10:31 -0400)]
src/svgtiny_css.c: implement node_count_siblings() select handler

3 months agosrc/svgtiny_css.c: implement node_is_root() select handler
Michael Orlitzky [Sat, 14 Oct 2023 00:42:35 +0000 (20:42 -0400)]
src/svgtiny_css.c: implement node_is_root() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute_substring() select handler
Michael Orlitzky [Sat, 14 Oct 2023 00:22:49 +0000 (20:22 -0400)]
src/svgtiny_css.c: implement node_has_attribute_substring() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute_suffix() select handler
Michael Orlitzky [Fri, 13 Oct 2023 23:53:16 +0000 (19:53 -0400)]
src/svgtiny_css.c: implement node_has_attribute_suffix() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute_prefix() select handler
Michael Orlitzky [Fri, 13 Oct 2023 23:33:06 +0000 (19:33 -0400)]
src/svgtiny_css.c: implement node_has_attribute_prefix() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute_includes() select handler
Michael Orlitzky [Fri, 13 Oct 2023 01:40:34 +0000 (21:40 -0400)]
src/svgtiny_css.c: implement node_has_attribute_includes() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute_dashmatch() select handler
Michael Orlitzky [Fri, 13 Oct 2023 01:00:53 +0000 (21:00 -0400)]
src/svgtiny_css.c: implement node_has_attribute_dashmatch() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute_equal() select handler
Michael Orlitzky [Thu, 12 Oct 2023 23:42:45 +0000 (19:42 -0400)]
src/svgtiny_css.c: implement node_has_attribute_equal() select handler

3 months agosrc/svgtiny_css.c: implement node_has_attribute() select handler
Michael Orlitzky [Thu, 12 Oct 2023 22:38:45 +0000 (18:38 -0400)]
src/svgtiny_css.c: implement node_has_attribute() select handler

3 months agosrc/svgtiny_css.c: implement node_has_id() select handler
Michael Orlitzky [Thu, 12 Oct 2023 22:28:40 +0000 (18:28 -0400)]
src/svgtiny_css.c: implement node_has_id() select handler

3 months agosrc/svgtiny_css.c: implement node_has_class() select handler
Michael Orlitzky [Thu, 12 Oct 2023 22:18:30 +0000 (18:18 -0400)]
src/svgtiny_css.c: implement node_has_class() select handler

3 months agosrc/svgtiny_css.c: implement node_has_name() select handler
Michael Orlitzky [Thu, 12 Oct 2023 22:10:05 +0000 (18:10 -0400)]
src/svgtiny_css.c: implement node_has_name() select handler

3 months agosrc/svgtiny_strings.h: intern the universal selector string "*"
Michael Orlitzky [Thu, 12 Oct 2023 22:07:44 +0000 (18:07 -0400)]
src/svgtiny_strings.h: intern the universal selector string "*"

This is a prerequisite for implementing the node_has_name() select
handler.

3 months agosrc/svgtiny_css.c: implement sibling_node() select handler
Michael Orlitzky [Thu, 12 Oct 2023 18:43:39 +0000 (14:43 -0400)]
src/svgtiny_css.c: implement sibling_node() select handler

3 months agosrc/svgtiny_css.c: implement parent_node() select handler
Michael Orlitzky [Thu, 12 Oct 2023 18:20:05 +0000 (14:20 -0400)]
src/svgtiny_css.c: implement parent_node() select handler

3 months agosrc/svgtiny_css.c: implement named_generic_sibling_node() select handler
Michael Orlitzky [Thu, 12 Oct 2023 18:07:44 +0000 (14:07 -0400)]
src/svgtiny_css.c: implement named_generic_sibling_node() select handler

3 months agosrc/svgtiny_css.c: implement named_sibling_node() select handler
Michael Orlitzky [Thu, 12 Oct 2023 12:17:45 +0000 (08:17 -0400)]
src/svgtiny_css.c: implement named_sibling_node() select handler

3 months agosrc/svgtiny_css.c: implement named_parent_node() select handler
Michael Orlitzky [Thu, 12 Oct 2023 11:42:02 +0000 (07:42 -0400)]
src/svgtiny_css.c: implement named_parent_node() select handler

3 months agosrc/svgtiny_css.c: implement node_id() select handler
Michael Orlitzky [Thu, 12 Oct 2023 02:25:00 +0000 (22:25 -0400)]
src/svgtiny_css.c: implement node_id() select handler

3 months agosrc/svgtiny_strings.h: intern "id" for libcss
Michael Orlitzky [Thu, 12 Oct 2023 02:17:34 +0000 (22:17 -0400)]
src/svgtiny_strings.h: intern "id" for libcss

As a prerequisite for implementing a libcss node_id() select handler,
we intern the string "id" that it will need access to.

3 months agosrc/svgtiny_css.c: implement node_classes() select handler
Michael Orlitzky [Wed, 11 Oct 2023 23:57:56 +0000 (19:57 -0400)]
src/svgtiny_css.c: implement node_classes() select handler

3 months agosrc/svgtiny_css.c: implement node_name() select handler
Michael Orlitzky [Wed, 11 Oct 2023 23:40:08 +0000 (19:40 -0400)]
src/svgtiny_css.c: implement node_name() select handler

3 months agosrc/svgtiny{.c,_internal.h}: intern SVG's XML namespace URI
Michael Orlitzky [Sat, 7 Jun 2025 14:58:40 +0000 (10:58 -0400)]
src/svgtiny{.c,_internal.h}: intern SVG's XML namespace URI

Intern the string "http://www.w3.org/2000/svg" in the parser state for
later use in libcss's node_name() select handler.

3 months agosrc/svgtiny_parse.c: add svgtiny_parse_style_inline() function
Michael Orlitzky [Sat, 7 Jun 2025 14:49:17 +0000 (10:49 -0400)]
src/svgtiny_parse.c: add svgtiny_parse_style_inline() function

This function parses the contents of an inline style="..." attribute
into a libcss stylesheet, or NULL if anything went wrong.

We use the new function in svgtiny_parse_paint_attributes() to parse
an inline sheet... and then (for now) do nothing with it. We are able
to parse the inline style="..." attributes right now but more
scaffolding is needed before we can utilize css_select_style().

3 months agosrc/svgtiny.c: use svgtiny_create_stylesheet() to parse <style>
Michael Orlitzky [Sat, 7 Jun 2025 14:28:47 +0000 (10:28 -0400)]
src/svgtiny.c: use svgtiny_create_stylesheet() to parse <style>

The new function handles all of the boilerplate parameter creation
that was originally done in svgtiny_parse_style_element().

3 months agosrc/svgtiny_internal.h: add svgtiny_create_stylesheet() prototype
Michael Orlitzky [Wed, 11 Oct 2023 12:40:51 +0000 (08:40 -0400)]
src/svgtiny_internal.h: add svgtiny_create_stylesheet() prototype

Needed to let src/svgtiny.c know about the new function.

3 months agosrc/svgtiny_css.c: new function svgtiny_create_stylesheet()
Michael Orlitzky [Wed, 11 Oct 2023 12:27:22 +0000 (08:27 -0400)]
src/svgtiny_css.c: new function svgtiny_create_stylesheet()

We add a function to handle the creation of a new stylesheet with the
default set of parameters. This is in preparation for parsing the
inline styles, which a priori would involve copy/pasting a lot of

  params.foo = bar;

lines from svgtiny_parse_style_element(). The goal is to factor the
common bits out of both the <style> and style= implementations.

3 months agosrc/svgtiny.c: add svgtiny_parse_style_element() function and use it
Michael Orlitzky [Sat, 7 Jun 2025 14:25:55 +0000 (10:25 -0400)]
src/svgtiny.c: add svgtiny_parse_style_element() function and use it

The new function parses the contents of a <style> element. We add a
call to it in svgtiny_preparse_styles() where previously a placeholder
was left.

3 months agosrc/Makefile: add the new svgtiny_css.c to the list of sources
Michael Orlitzky [Sat, 7 Jun 2025 14:15:47 +0000 (10:15 -0400)]
src/Makefile: add the new svgtiny_css.c to the list of sources

3 months agosrc/svgtiny_css.c: new file with new svgtiny_resolve_url() function
Michael Orlitzky [Wed, 4 Oct 2023 12:27:28 +0000 (08:27 -0400)]
src/svgtiny_css.c: new file with new svgtiny_resolve_url() function

Define a stub relative-URL resolver that assumes all URLs are absolute
and returns them unmodified. Some method of doing this is required by
libcss. At the moment, libcss does not support any SVG properties that
take url() values, so not much is lost.

3 months agoMakefile: drop -pedantic from CFLAGS
Michael Orlitzky [Sat, 7 Jun 2025 17:07:16 +0000 (13:07 -0400)]
Makefile: drop -pedantic from CFLAGS

With -pedantic enabled, -Werror causes build failures when we try to
call lwc_string_ref(). For example,

  src/svgtiny_css.c:120:9: error: use of GNU statement expression
  extension from macro expansion [-Werror,
  -Wgnu-statement-expression-from-macro-expansion]
  120 |         *abs = lwc_string_ref(rel);

will happen in the very next commit.

3 months agosrc/svgtiny.c: add impotent svgtiny_preparse_styles() function
Michael Orlitzky [Sat, 7 Jun 2025 14:14:00 +0000 (10:14 -0400)]
src/svgtiny.c: add impotent svgtiny_preparse_styles() function

We declare and add the svgtiny_preparse_styles() function that will be
used to make a first pass through the SVG document and parse all of
the <style> elements. At the moment it is only half implemented:
once we find a <style> element, we do nothing with it. A separate
function will be used to parse a <style> once we have it.

3 months agosrc/svgtiny.c: initialise/finalise the libcss context
Michael Orlitzky [Sat, 7 Jun 2025 13:51:16 +0000 (09:51 -0400)]
src/svgtiny.c: initialise/finalise the libcss context

Before we begin parsing, we have to initialize our new css_select_ctx
by calling css_select_ctx_create(). Later, when parsing is complete,
we css_select_ctx_destroy() it.

3 months agoinclude/svgtiny.h: add new error constant svgtiny_LIBCSS_ERROR
Michael Orlitzky [Wed, 4 Oct 2023 03:50:00 +0000 (23:50 -0400)]
include/svgtiny.h: add new error constant svgtiny_LIBCSS_ERROR

Analogous to svgtiny_LIBDOM_ERROR, we add svgtiny_LIBCSS_ERROR to
indicate an error related to CSS.

3 months agosrc/svgtiny_strings.h: add "media" to the list of strings
Michael Orlitzky [Wed, 4 Oct 2023 03:03:30 +0000 (23:03 -0400)]
src/svgtiny_strings.h: add "media" to the list of strings

The "media" attribute is arguably the only meaningful attribute a
<style> element has within an SVG document. Here we intern the string
"media" in preparation for parsing <style>. Libcss can at least store
the media information even if we decide not to use it.

3 months agosrc/svgtiny_internal.h: add CSS context to parser state
Michael Orlitzky [Wed, 4 Oct 2023 02:51:38 +0000 (22:51 -0400)]
src/svgtiny_internal.h: add CSS context to parser state

Add a css_select_ctx pointer to the svgtiny_parse_state that is
threaded through each phase of SVG parsing. This will allow us to
populate the context with any <style> sheets we find; later, we can
consult those stylesheets while constructing our svgtiny_diagram (the
abstract representation into which we parse an SVG).

3 months agoREADME: mention that libcss is required
Michael Orlitzky [Wed, 4 Oct 2023 03:12:37 +0000 (23:12 -0400)]
README: mention that libcss is required

3 months agoMakefile: build against libcss
Michael Orlitzky [Wed, 4 Oct 2023 02:03:29 +0000 (22:03 -0400)]
Makefile: build against libcss

The first step towards adding libcss support is to build against
libcss. For now that means getting its "cflags" and "libs" from
pkg-config and putting them into CFLAGS and LDFLAGS.

3 months agosrc/svgtiny.c: remove old misleading libcss comments
Michael Orlitzky [Sat, 7 Jun 2025 13:43:35 +0000 (09:43 -0400)]
src/svgtiny.c: remove old misleading libcss comments

There were a few comments in this file suggesting some future libcss
integration. However, now that we are beginning that integration (much
later), it is probably best to start with a clean slate. So, we remove
those comments.

3 months agosrc/svgtiny_internal.h: removed commented libcss stub
Michael Orlitzky [Wed, 4 Oct 2023 00:10:13 +0000 (20:10 -0400)]
src/svgtiny_internal.h: removed commented libcss stub

This files once thought about declaring,

  /*struct css_style style;*/

as a member of the svgtiny_parse_state struct. We delete that comment
now so that we can begin libcss integration with a clean slate.

3 months agosrc/svgtiny_gradient.c: be more careful with float -> int assignment
Michael Orlitzky [Sun, 8 Jun 2025 00:58:50 +0000 (20:58 -0400)]
src/svgtiny_gradient.c: be more careful with float -> int assignment

Assigning the value of a float to an unsigned int is undefined
behavior unless the value is guaranteed to fit. We run afoul of this
in compute_grad_points(), where the number of steps is computed using
a floating point calculation.

On a RISC-V / musl system, the end result is that we wind up with
steps = the maximum value of an unsigned int, when really this should
be an error case resulting in steps = 1. The test suite catches this.

13 months agoUpdate AFL test corpus master
Vincent Sanders [Mon, 24 Jun 2024 08:19:13 +0000 (09:19 +0100)]
Update AFL test corpus

in addition provides near complete coverage when used as unit test vectors

13 months agoUpdate test dir to add fuzzer configuration
Vincent Sanders [Fri, 21 Jun 2024 15:26:07 +0000 (16:26 +0100)]
Update test dir to add fuzzer configuration

13 months agoImplement use element
Vincent Sanders [Thu, 18 Jul 2024 21:38:26 +0000 (22:38 +0100)]
Implement use element

13 months agoimprove svg parse initialisation/finalisation
Vincent Sanders [Thu, 18 Jul 2024 11:19:06 +0000 (12:19 +0100)]
improve svg parse initialisation/finalisation

13 months agorefactor path parse
Vincent Sanders [Wed, 17 Jul 2024 21:47:45 +0000 (22:47 +0100)]
refactor path parse

13 months agofixup named colour lookup
Vincent Sanders [Wed, 17 Jul 2024 10:42:40 +0000 (11:42 +0100)]
fixup named colour lookup

13 months agofixup paint parse
Vincent Sanders [Tue, 16 Jul 2024 10:22:52 +0000 (11:22 +0100)]
fixup paint parse

14 months agoImprove gradient parsing and generation
Vincent Sanders [Thu, 4 Jul 2024 13:09:35 +0000 (14:09 +0100)]
Improve gradient parsing and generation

14 months agoImprove attribute parsing with operation tables
Vincent Sanders [Wed, 10 Jul 2024 09:15:53 +0000 (10:15 +0100)]
Improve attribute parsing with operation tables

14 months agoReimplement style processing
Vincent Sanders [Wed, 3 Jul 2024 16:16:07 +0000 (17:16 +0100)]
Reimplement style processing

14 months agoReimplement parsing of viewbox
Vincent Sanders [Tue, 2 Jul 2024 23:11:04 +0000 (00:11 +0100)]
Reimplement parsing of viewbox

fixup tests that used non existant viewport attribute

14 months agoImprove number parse API
Vincent Sanders [Tue, 2 Jul 2024 13:23:55 +0000 (14:23 +0100)]
Improve number parse API

14 months agoReimplement color parsing
Vincent Sanders [Mon, 1 Jul 2024 14:03:41 +0000 (15:03 +0100)]
Reimplement color parsing

14 months agoReimplement transform processing
Vincent Sanders [Wed, 19 Jun 2024 23:07:45 +0000 (00:07 +0100)]
Reimplement transform processing

remove use of sscanf and string duplication in transform processing

14 months agoCleanup length parsing
Vincent Sanders [Sat, 15 Jun 2024 14:41:07 +0000 (15:41 +0100)]
Cleanup length parsing

remove the incorrect use of atof and use an API that does not require the string to be copied to terminate with a null

14 months agoRework poly point parsing
Vincent Sanders [Thu, 13 Jun 2024 10:48:20 +0000 (11:48 +0100)]
Rework poly point parsing

Change parsing of poly points to use a specific number parser insteads of sscanf

14 months agoExtend polyline tests
Vincent Sanders [Thu, 13 Jun 2024 10:22:55 +0000 (11:22 +0100)]
Extend polyline tests

15 months agoSquash -Wcalloc-transposed-args (gcc-14)
Michael Drake [Fri, 24 May 2024 20:30:56 +0000 (21:30 +0100)]
Squash -Wcalloc-transposed-args (gcc-14)

20 months agoUpdate component version for release
Vincent Sanders [Wed, 27 Dec 2023 21:45:54 +0000 (21:45 +0000)]
Update component version for release

2 years agoexamples/svgtiny_display_x11.c: include the system copy of svgtiny.h
Michael Orlitzky [Sun, 6 Aug 2023 00:36:05 +0000 (20:36 -0400)]
examples/svgtiny_display_x11.c: include the system copy of svgtiny.h

The header of this file includes instructions for how to build it:

  Compile using:
    gcc -g -W -Wall -o svgtiny_display_x11 svgtiny_display_x11.c \
            `pkg-config --cflags --libs libsvgtiny cairo` -lX11

That pkg-config command will generate the flags to link against the
installed copy of libsvgtiny. The line,

  #include "svgtiny.h"

on the other hand, attempts to use a local header. This commit changes
that line to,

  #include <svgtiny.h>

which will use the corresponding system header from whatever include
directory pkg-config hands us for libsvgtiny.

2 years agoexamples/svgtiny_display_x11.c: add missing stdlib.h include
Michael Orlitzky [Sun, 6 Aug 2023 00:36:04 +0000 (20:36 -0400)]
examples/svgtiny_display_x11.c: add missing stdlib.h include

This file uses malloc(), free(), and exit() -- all of which are
defined in stdlib.h. GCC seems unhappy about the situation, so we now
include it. This allows the file to be compiled once again.

2 years agoexamples/svgtiny_display_x11.c: update LIBXML -> LIBDOM
Michael Orlitzky [Sun, 6 Aug 2023 00:36:03 +0000 (20:36 -0400)]
examples/svgtiny_display_x11.c: update LIBXML -> LIBDOM

The svgtiny_LIBXML_ERROR constant was changed to throughout the
codebase to svgtiny_LIBDOM_ERROR a long time ago, in 9275ab308, but
this example was missed, probably because it isn't built by default.

2 years agoREADME: update LIBXML -> LIBDOM
Michael Orlitzky [Sun, 6 Aug 2023 00:36:02 +0000 (20:36 -0400)]
README: update LIBXML -> LIBDOM

This constant svgtiny_LIBXML_ERROR was changed throughout the codebase
to svgtiny_LIBDOM_ERROR a long time ago, in 9275ab308, but the README
was missed because nobody reads the documentation :)

4 years agoimplement svg path arc correctly
Vincent Sanders [Sat, 3 Oct 2020 14:12:30 +0000 (15:12 +0100)]
implement svg path arc correctly

7 years agoUpdate component version for release
Vincent Sanders [Tue, 28 Aug 2018 10:18:37 +0000 (11:18 +0100)]
Update component version for release

7 years agoFix various bugs which caused ASAN and UBSAN to be upset
Daniel Silverstone [Sun, 29 Jul 2018 09:20:38 +0000 (10:20 +0100)]
Fix various bugs which caused ASAN and UBSAN to be upset

7 years agoEnsure we report failures better
Daniel Silverstone [Sun, 29 Jul 2018 09:20:24 +0000 (10:20 +0100)]
Ensure we report failures better

7 years agoIgnore the autogenerated colours file
Daniel Silverstone [Sun, 29 Jul 2018 09:20:16 +0000 (10:20 +0100)]
Ignore the autogenerated colours file

7 years agoUpdate component version for 0.1.6 release
Vincent Sanders [Fri, 13 Oct 2017 09:00:16 +0000 (10:00 +0100)]
Update component version for 0.1.6 release

8 years agoFix parsing of multiple vertical lineto commands
Michael Drake [Mon, 24 Jul 2017 13:18:53 +0000 (14:18 +0100)]
Fix parsing of multiple vertical lineto commands

Thanks to Nils for spotting this.

8 years agoBuildsystem: OpenBSD `sed` doesn't handle -i option.
Michael Drake [Thu, 20 Apr 2017 10:50:01 +0000 (11:50 +0100)]
Buildsystem: OpenBSD `sed` doesn't handle -i option.

8 years agoBuildsystem: Squash "no previous declaration for 'svgtiny_color_lookup'"
Michael Drake [Thu, 20 Apr 2017 10:39:32 +0000 (11:39 +0100)]
Buildsystem: Squash "no previous declaration for 'svgtiny_color_lookup'"

8 years agoBuild: Include gperf-generated code directly.
Michael Drake [Thu, 20 Apr 2017 09:51:07 +0000 (10:51 +0100)]
Build: Include gperf-generated code directly.

Previously we built the generated code separatly and then linked to
it.  However, this caused problems with certain compilers and gperf
versions.  This change includes the generated code directly in
svgtiny.c instead, which is the only place its used.

8 years agoPrepare for release of 0.1.5
Daniel Silverstone [Sat, 19 Nov 2016 09:41:47 +0000 (09:41 +0000)]
Prepare for release of 0.1.5

8 years agoTest data: Move file to correct place.
Michael Drake [Wed, 26 Oct 2016 15:12:32 +0000 (16:12 +0100)]
Test data: Move file to correct place.

8 years agoMerge branch 'tlsa/fix-gradients'
Michael Drake [Wed, 26 Oct 2016 15:10:49 +0000 (16:10 +0100)]
Merge branch 'tlsa/fix-gradients'