]>
gitweb.michael.orlitzky.com - libsvgtiny.git/log
Michael Orlitzky [Wed, 4 Oct 2023 00:13:53 +0000 (20:13 -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.
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.
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.
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.
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.
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 :)
Vincent Sanders [Sat, 3 Oct 2020 14:12:30 +0000 (15:12 +0100)]
implement svg path arc correctly
Vincent Sanders [Tue, 28 Aug 2018 10:18:37 +0000 (11:18 +0100)]
Update component version for release
Daniel Silverstone [Sun, 29 Jul 2018 09:20:38 +0000 (10:20 +0100)]
Fix various bugs which caused ASAN and UBSAN to be upset
Daniel Silverstone [Sun, 29 Jul 2018 09:20:24 +0000 (10:20 +0100)]
Ensure we report failures better
Daniel Silverstone [Sun, 29 Jul 2018 09:20:16 +0000 (10:20 +0100)]
Ignore the autogenerated colours file
Vincent Sanders [Fri, 13 Oct 2017 09:00:16 +0000 (10:00 +0100)]
Update component version for 0.1.6 release
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.
Michael Drake [Thu, 20 Apr 2017 10:50:01 +0000 (11:50 +0100)]
Buildsystem: OpenBSD `sed` doesn't handle -i option.
Michael Drake [Thu, 20 Apr 2017 10:39:32 +0000 (11:39 +0100)]
Buildsystem: Squash "no previous declaration for 'svgtiny_color_lookup'"
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.
Daniel Silverstone [Sat, 19 Nov 2016 09:41:47 +0000 (09:41 +0000)]
Prepare for release of 0.1.5
Michael Drake [Wed, 26 Oct 2016 15:12:32 +0000 (16:12 +0100)]
Test data: Move file to correct place.
Michael Drake [Wed, 26 Oct 2016 15:10:49 +0000 (16:10 +0100)]
Merge branch 'tlsa/fix-gradients'
Michael Drake [Wed, 26 Oct 2016 15:06:45 +0000 (16:06 +0100)]
Test data: Add SVG with missing stroke gradient definition.
Michael Drake [Wed, 26 Oct 2016 14:56:32 +0000 (15:56 +0100)]
Parse: Ensure consumed characters count is initiliased.
Michael Drake [Wed, 26 Oct 2016 14:21:51 +0000 (15:21 +0100)]
Parse: Make the parse state have two sets of gradient details.
One for fills and another for strokes. This stops an SVG such as
<svg viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="foo">
<stop stop-color="#69f" offset="0"/>
<stop stop-color="#468" offset="1"/>
</linearGradient>
</defs>
<path fill="url(#foo)" stroke='url(#bar)' d='M10 10 H 90 V 90 H 10 Z' />
</svg>
from getting its fill gradient details trampled when we reset the
gradient for the the missing bar gadient definition. Note, we only
handle linearGradient on the fill anyway.
Michael Drake [Wed, 26 Oct 2016 13:32:30 +0000 (14:32 +0100)]
Parse: Avoid strndup with unchecked return value.
Michael Drake [Wed, 26 Oct 2016 13:15:28 +0000 (14:15 +0100)]
Parse: Remove explicit init of gradient state; gets memset anyway.
Vincent Sanders [Sun, 11 Sep 2016 15:57:35 +0000 (16:57 +0100)]
add polyline test case with floating point colour percentages
Vincent Sanders [Sun, 11 Sep 2016 15:13:29 +0000 (16:13 +0100)]
SVG dictionary for use with AFL tool
Vincent Sanders [Sun, 11 Sep 2016 15:08:17 +0000 (16:08 +0100)]
Add test set derived from AFL
Generated with AFL using custom dictionary then minimised with cmin
and tmin tools to be the smallest test set possible
The run used two thousand processor hours on a 24way xeon 2.3GHz system
Vincent Sanders [Wed, 31 Aug 2016 14:19:46 +0000 (15:19 +0100)]
prevent division by zero for gradient with no points and add test
Vincent Sanders [Wed, 31 Aug 2016 14:18:58 +0000 (15:18 +0100)]
improve test suite runner
Vincent Sanders [Sat, 27 Aug 2016 19:45:07 +0000 (20:45 +0100)]
add crash test generated with AFL
Vincent Sanders [Wed, 24 Aug 2016 21:02:47 +0000 (22:02 +0100)]
cope with lack of root svg element
Vincent Sanders [Tue, 23 Aug 2016 20:13:22 +0000 (21:13 +0100)]
add file output to test decoder
Vincent Sanders [Sun, 3 Jan 2016 11:57:27 +0000 (11:57 +0000)]
Update component version for release
Michael Drake [Sun, 1 Nov 2015 10:04:47 +0000 (10:04 +0000)]
Fix build with certain C libraries.
Vincent Sanders [Wed, 2 Sep 2015 08:21:05 +0000 (09:21 +0100)]
enable decode tests for svg files
These svg files have caused the library to crash and to render poorly.
Vincent Sanders [Sun, 23 Aug 2015 21:44:54 +0000 (22:44 +0100)]
Fix reallocation of path buffer length to cope with differng path lengths
Vincent Sanders [Sun, 22 Mar 2015 00:22:24 +0000 (00:22 +0000)]
Update CFLAGS to avoid deprication warning for glibc 2.21 and later.
Adrien Destugues [Mon, 9 Jun 2014 18:32:12 +0000 (20:32 +0200)]
Fix paths for Haiku.
Vincent Sanders [Sun, 8 Mar 2015 23:24:51 +0000 (23:24 +0000)]
Update the component version for release
Vincent Sanders [Thu, 15 Jan 2015 12:38:04 +0000 (12:38 +0000)]
Ensure path generation does not overrun allocated storage.
This fixes bug #2251 which was caused by the svg:
<svg width="11" height="11" id="support-entry-icon"
y="3389"><g><g><path fill-rule="evenodd" clip-rule="evenodd"
fill="#D6D6D6" d="M0,0v11h11V0H0z M10,10H1V1h9V10z M9,3H2v1h7V3z
M9,5H2v1h7V5z M9,7H2v1h7V7z"/></g></g></svg>
The svg was causing more path elements to be generated in the internal
representation than space was allocated for and overrunning heap
blocks.
The path element parsing was using a fixed size allocation for the
path elements and never bounds checked. Further it did not cope with
zero length paths (which the spec says are permitted). It was also
grossly overallocating for the common case.
This changes the path element array to be bounds checked and then
extended if required, the initial allocation is generally sufficient
and in testing very few resizes occurred.
The reallocation strategy grows the element storage by 2.5 each time
this means even in the degenerate case very few reallocations are
required. In testing no more than a single reallocation has been
observed.
The final path element array will always be reallocted to the minimum
required size. This reduces overall memory usage which is useful with
complex scenes.
Vincent Sanders [Sun, 7 Dec 2014 12:33:26 +0000 (12:33 +0000)]
Update README to cover dependancies and core buildsystem
Fix various issues with the test target and update the documentation
to be more correct.
John-Mark Bell [Sun, 16 Nov 2014 10:33:50 +0000 (10:33 +0000)]
Fix up for new buildsystem
Vincent Sanders [Thu, 23 Oct 2014 21:18:16 +0000 (22:18 +0100)]
fix parsing of whitespace in transform operators
The SVG spec for the transform attribute allows whitespace in places
that were causing the %n specifier in the ssanf to return 0 as the
match failed before it completed the parse.
http://www.w3.org/TR/SVG/coords.html#TransformAttribute
Paul Mecklenburg [Fri, 10 Oct 2014 22:13:02 +0000 (23:13 +0100)]
Fix relative move commands following a path close.
Both 'M' and 'm' are moves and therefore start a new (sub)path. In
either case the location should be cached so that a later 'close path'
(z or Z) knows the location it is returning to. The location is not
written to 'p', since it is assumed that the client code remembers. If
the next move is relative (lowercase), then it's important that last_x,
last_y were correctly updated while processing Z/z.
Michael Drake [Fri, 10 Oct 2014 22:09:30 +0000 (23:09 +0100)]
Add test case image for broken behaviour of relative move.
Vincent Sanders [Tue, 26 Aug 2014 14:44:29 +0000 (07:44 -0700)]
Update component version for release
Daniel Silverstone [Sat, 26 Apr 2014 15:24:54 +0000 (16:24 +0100)]
Hopefully silence warnings about inlines and non inlines calling one
another.
Vincent Sanders [Fri, 18 Apr 2014 11:19:22 +0000 (12:19 +0100)]
Update component version for release
John-Mark Bell [Mon, 13 Jan 2014 01:07:38 +0000 (01:07 +0000)]
Add support for multilib
Michael Drake [Fri, 23 Aug 2013 09:48:36 +0000 (10:48 +0100)]
Fix to use list_size accessor.
Michael Drake [Fri, 23 Aug 2013 09:47:56 +0000 (10:47 +0100)]
Minor tidyup.
Michael Drake [Fri, 23 Aug 2013 08:26:38 +0000 (09:26 +0100)]
Move gradient logging to svgtiny_gradient.c, and suppress when not debugging gradients.
Michael Drake [Fri, 23 Aug 2013 08:21:51 +0000 (09:21 +0100)]
Fix leak of gradient dom strings.
Michael Drake [Thu, 22 Aug 2013 22:14:56 +0000 (23:14 +0100)]
Suppress most gradient debug.
Vincent Sanders [Fri, 19 Apr 2013 19:26:48 +0000 (20:26 +0100)]
update component version for release
Vincent Sanders [Thu, 18 Apr 2013 16:44:01 +0000 (17:44 +0100)]
add a .gitattributes so .gitignore is not exported
Chris Young [Sat, 5 Jan 2013 21:11:31 +0000 (21:11 +0000)]
Explicitly check if r0 or r1 are NaN, as if they are, on x86 the function evaluates as 0 (which is already handled), but on PPC the function evaluates to a negative value, causing the following for loop to become infinite.
John-Mark Bell [Mon, 31 Dec 2012 00:10:38 +0000 (00:10 +0000)]
Handle empty text nodes correctly.
John-Mark Bell [Sun, 30 Dec 2012 23:38:32 +0000 (23:38 +0000)]
Drop const, as this can't work with libdom.
Chris Young [Tue, 27 Nov 2012 18:29:05 +0000 (18:29 +0000)]
correct target name
Daniel Silverstone [Sat, 3 Nov 2012 22:42:11 +0000 (22:42 +0000)]
Replace dom_string_length with dom_string_byte_length -- faster and more correct
Daniel Silverstone [Sat, 3 Nov 2012 18:22:52 +0000 (18:22 +0000)]
Void myself unpleasantly in order to satisfy RISC OS toolchain
Daniel Silverstone [Sat, 3 Nov 2012 18:03:23 +0000 (18:03 +0000)]
Clean up properly
Daniel Silverstone [Sat, 3 Nov 2012 17:53:10 +0000 (17:53 +0000)]
Fix up pkgconfig
Daniel Silverstone [Sat, 3 Nov 2012 17:51:55 +0000 (17:51 +0000)]
Merge branch 'dsilvers/tolibdom'
Daniel Silverstone [Sat, 3 Nov 2012 17:49:30 +0000 (17:49 +0000)]
Convert the last bits for libdom
Daniel Silverstone [Sat, 3 Nov 2012 17:45:07 +0000 (17:45 +0000)]
The library now builds
Daniel Silverstone [Sat, 3 Nov 2012 16:46:39 +0000 (16:46 +0000)]
More work towards libdom conversion
Daniel Silverstone [Sat, 3 Nov 2012 15:00:36 +0000 (15:00 +0000)]
Parse text
Daniel Silverstone [Sat, 3 Nov 2012 14:35:11 +0000 (14:35 +0000)]
Make more svg elements parse again
Daniel Silverstone [Sat, 3 Nov 2012 14:13:47 +0000 (14:13 +0000)]
More work to bring svgtiny into the libdom era
Daniel Silverstone [Sat, 3 Nov 2012 14:13:41 +0000 (14:13 +0000)]
Ignore ~ files
Daniel Silverstone [Sat, 3 Nov 2012 12:05:13 +0000 (12:05 +0000)]
Begin conversion to libdom
Daniel Silverstone [Sat, 3 Nov 2012 10:32:06 +0000 (10:32 +0000)]
Add an example SVG and a gitignore
Daniel Silverstone [Fri, 29 Jun 2012 19:56:04 +0000 (19:56 -0000)]
Update to new NSBUILD infrastructure
svn path=/trunk/libsvgtiny/; revision=14010
Vincent Sanders [Mon, 27 Feb 2012 13:40:19 +0000 (13:40 -0000)]
Bump version number
svn path=/trunk/libsvgtiny/; revision=13487
Chris Young [Wed, 28 Sep 2011 17:04:54 +0000 (17:04 -0000)]
Don't treat warnings as errors on AmigaOS
svn path=/trunk/libsvgtiny/; revision=12908
François Revel [Mon, 21 Mar 2011 22:07:10 +0000 (22:07 -0000)]
sed in BeOS still doesn't handle -i, so use a temporary file since RiscOS doesn't know pipes.
svn path=/trunk/libsvgtiny/; revision=12121
John Mark Bell [Sun, 2 Jan 2011 22:09:46 +0000 (22:09 -0000)]
s/strndup/svgtiny_strndup
svn path=/trunk/libsvgtiny/; revision=11186
John Mark Bell [Wed, 29 Dec 2010 18:06:04 +0000 (18:06 -0000)]
Use built-in strndup if the platform we're targetting doesn't have one
svn path=/trunk/libsvgtiny/; revision=11140
James Bursa [Fri, 24 Sep 2010 23:41:14 +0000 (23:41 -0000)]
Split the string for stroke-width like it's done for the other attributes so svgtiny_parse_length doesn't get confused about the remainder of the string. Contributed by Peter Korsgaard.
svn path=/trunk/libsvgtiny/; revision=10837
James Bursa [Sun, 10 Jan 2010 21:08:17 +0000 (21:08 -0000)]
Add an example of using libsvgtiny. Displays an SVG using X11 and cairo.
svn path=/trunk/libsvgtiny/; revision=9800
François Revel [Sun, 3 Jan 2010 23:37:39 +0000 (23:37 -0000)]
For BeOS libxml2 is not part of the default devkit, try to find headers elsewhere.
svn path=/trunk/libsvgtiny/; revision=9785
François Revel [Sat, 2 Jan 2010 02:08:45 +0000 (02:08 -0000)]
More of the C89... really do test it please!
svn path=/trunk/libsvgtiny/; revision=9772
François Revel [Sat, 2 Jan 2010 01:54:45 +0000 (01:54 -0000)]
Lots of C89, please test...
svn path=/trunk/libsvgtiny/; revision=9771
François Revel [Sat, 2 Jan 2010 01:32:54 +0000 (01:32 -0000)]
C89: Fix for gcc2 "warning: comma at end of enumerator list".
svn path=/trunk/libsvgtiny/; revision=9770
James Bursa [Sat, 28 Nov 2009 04:08:19 +0000 (04:08 -0000)]
Round stroke widths to nearest integer instead of down, and force to 1 if it would be rounded to 0.
svn path=/trunk/libsvgtiny/; revision=9707
James Bursa [Sat, 28 Nov 2009 04:05:30 +0000 (04:05 -0000)]
Implement <ellipse> element. Improve error handling for <circle>.
svn path=/trunk/libsvgtiny/; revision=9706
Chris Young [Sun, 22 Nov 2009 15:57:10 +0000 (15:57 -0000)]
Despite M_PI being #defined in math.h, and math.h being #included, in certain
circumstances it doesn't get #defined. Catch this.
svn path=/trunk/libsvgtiny/; revision=9701
Chris Young [Sun, 22 Nov 2009 15:55:17 +0000 (15:55 -0000)]
AmigaOS4 standard library headers also create warnings
svn path=/trunk/libsvgtiny/; revision=9700
James Bursa [Sun, 22 Nov 2009 13:33:11 +0000 (13:33 -0000)]
Change svgtiny_display to build debug version.
svn path=/trunk/libsvgtiny/; revision=9683
James Bursa [Sun, 22 Nov 2009 13:32:37 +0000 (13:32 -0000)]
Start implementing arcs in paths. Fix crash when an empty path has a gradient fill.
svn path=/trunk/libsvgtiny/; revision=9682
James Bursa [Sun, 15 Nov 2009 23:02:06 +0000 (23:02 -0000)]
Fix svgtiny_display script to work with new makefiles.
svn path=/trunk/libsvgtiny/; revision=9676
John Mark Bell [Fri, 6 Nov 2009 07:05:12 +0000 (07:05 -0000)]
-Wextra is only understood by GCC 3.4.6 or later.
It is a more descriptive synonym for -W.
Use -W instead which is understood by all common versions of GCC
(i.e. GCC 2.95 supports it, which is the oldest GCC version we have to support)
Additionally, conditionalise our -Werror usage on whether we're building for
BeOS/Haiku. On these platforms, the standard library headers result in warnings.
GCC 2 is quite happy to build this code on other platforms, so shouldn't be
the trigger for dropping -Werror (even if BeOS is the only target where GCC2 is
likely to be used).
svn path=/trunk/libsvgtiny/; revision=9670
John Mark Bell [Tue, 8 Sep 2009 10:06:33 +0000 (10:06 -0000)]
Fix colour component macros on RISC OS.
svn path=/trunk/libsvgtiny/; revision=9558
John Mark Bell [Mon, 24 Aug 2009 09:25:11 +0000 (09:25 -0000)]
Something approximating a makefile for the test binary.
pkg-config control file.
svn path=/trunk/libsvgtiny/; revision=9426
John Mark Bell [Mon, 24 Aug 2009 09:14:08 +0000 (09:14 -0000)]
gperf -> .c rule. This isn't in the core buildsystem as nothing else requires this. We can migrate it when needed.
svn path=/trunk/libsvgtiny/; revision=9425
John Mark Bell [Mon, 24 Aug 2009 08:21:22 +0000 (08:21 -0000)]
Squash warnings
svn path=/trunk/libsvgtiny/; revision=9423
John Mark Bell [Mon, 24 Aug 2009 08:10:34 +0000 (08:10 -0000)]
Missed makefile
svn path=/trunk/libsvgtiny/; revision=9422
John Mark Bell [Mon, 24 Aug 2009 08:10:18 +0000 (08:10 -0000)]
Add libxml2 dep
svn path=/trunk/libsvgtiny/; revision=9421