Commit graph

237 commits

Author SHA1 Message Date
Dane Springmeyer
4bc7ec73de fix spelling in svg parser error 2017-09-10 08:59:54 -07:00
artemp
a682cea51e svg-parser - unify error messages text + update unit test 2017-08-08 12:38:24 +01:00
artemp
6f73181e9b Enforce consistent error handling policy - always throw on fatal errors (both strict and non-strict). In strict mode throw on first parsing error. Remove return values from parse,parse_from_string and traverse_tree methods. Update unit tests. 2017-08-02 10:32:13 +01:00
artemp
a26723b4a5 add missing ' in error message. 2017-08-02 10:32:00 +01:00
artemp
b164117d99 disable handling unsupported attributes (leaving only well-known unsupported elements) to reduce verbosity. 2017-07-07 10:09:08 +02:00
artemp
1e8ec57593 add <image> and <switch> to unsupported elements. 2017-06-29 09:41:16 +02:00
artemp
47bfe7cb91 make unsupported elements/attributes arrays const. 2017-06-29 09:41:16 +02:00
artemp
5118220c4c handle "well-known" unsupported elements and attributes. 2017-06-29 09:41:16 +02:00
artemp
8f2961b9e2 svg_parser - implement preserveAspectRatio support (ref https://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute) 2017-06-29 09:41:16 +02:00
artemp
3edcd4afa2 fix viewBox coordinate system logic + apply transform in <use> element 2017-06-29 09:41:16 +02:00
artemp
fafc751e42 svg_parser - add support for "href" preserving deprecated (since SVG 2) "xlink:href" 2017-06-29 09:41:16 +02:00
artemp
c2ad505899 fix method name 2017-06-29 09:41:16 +02:00
artemp
aae7253ba1 SVG parser - refactor to use switch where appropriate + experimental support for <symbol> 2017-06-29 09:41:16 +02:00
artemp
2de8ce0eb7 svg_parser - don't log unsupported entities just yet (ref #763) 2017-06-29 09:41:16 +02:00
artemp
53a69463ea SVG parser - add support for <use> element (ref #763). 2017-06-29 09:41:16 +02:00
artemp
199a281627 remove debug stderr 2017-06-29 09:41:16 +02:00
artemp
ca4d140fb0 cleanup 2017-06-29 09:41:16 +02:00
artemp
b6aa45144c svg_parser - refactor => remove mutable temporary_gradient_ member variable + process stop elements from within linearGradient and radialGradient. 2017-06-29 09:41:16 +02:00
artemp
6da83bc986 svg_parser - store unresolved gradient nodes for deferred initalisation. 2017-06-29 09:41:16 +02:00
artemp
ef6c2e71b8 svg-parser : handle parsing failures via error_handler ( throw in strict mode and log+continue when strict==false) 2017-06-29 09:41:16 +02:00
artemp
e56233833e svg_parser - fix bug introduced in previous commit. 2017-06-29 09:41:16 +02:00
artemp
3f591af871 initial support for strict SVG parsing (WIP) 2017-06-29 09:41:16 +02:00
artemp
333ef9fde1 update copyright year 2017-05-05 13:02:01 +02:00
artemp
ed648ced46 SVG transform - implement in terms of boost::spirit::x3 2016-12-23 16:32:05 +01:00
artemp
95cc560167 SVG points - implement using boost::spirit::x3 + refactor parse_rule instantiations into separate *.cpp 2016-12-23 14:40:59 +01:00
artemp
30749031cf SVG path parser - boost::spirit::x3 based implementation 2016-12-22 14:57:26 +01:00
artemp
5745bedbd9 update copyright year to 2016 2016-12-20 17:57:22 +01:00
artemp
4ba87b1e9d c++14 support is not sufficient on windows: reverting back and start tracking Windows workarounds in separate branch
Revert "move BOOST_SPIRIT_DEFINE into separate headers + use across all grammar defs (#3573)"

This reverts commit 81cfa721db.

Revert "windows : fix errors C3259 + C3249"

This reverts commit 8327905aba.

Revert "Workaround for VC++ C2995 via redifining BOOST_SPIRIT_DEFINE macro (#3573)"

This reverts commit 2a2f0bf00a.
2016-12-14 17:11:59 +01:00
artemp
81cfa721db move BOOST_SPIRIT_DEFINE into separate headers + use across all grammar defs (#3573) 2016-12-14 16:35:24 +01:00
artemp
2a2f0bf00a Workaround for VC++ C2995 via redifining BOOST_SPIRIT_DEFINE macro (#3573) 2016-12-14 15:10:22 +01:00
artemp
e46785a063 wrap grammar into anonymous namespace - attempting to fix VC++ compilation issue (#3573) 2016-12-14 10:49:11 +01:00
artemp
ce0f87fb71 merge spirit-x3 2016-10-13 17:00:11 +02:00
artemp
923efd589c geometry_to_path.hpp => geometry/to_path.hpp 2016-10-11 18:01:30 +02:00
artemp
8ce7a1c43d refactor souce code files with the following rule: the physical filesytem path matches namespace structure
e.g `mapnik::geometry::centroid()` -> `$(MAPNIK_SOURCE)/include/mapnik/geometry/centroid.hpp`
2016-10-11 18:01:29 +02:00
artemp
3788b2781e tiny format 2016-08-16 15:36:43 +01:00
Mickey Rose
217d18a996 use std::deque to store svg::path_attributes
- refs #3453
2016-06-16 22:34:24 +02:00
Dane Springmeyer
192f5c26c1 use c++ style casts 2016-03-10 12:45:47 -08:00
Dane Springmeyer
341db51aa7 finish wrapping boost includes to suppress warnings - add agg wrapper - refs #2907 2016-03-09 16:42:15 -08:00
artemp
a5cfd27594 split svg_path_grammar,svg_points_grammar,svg_transform_grammar into *.hpp, *_impl.hpp + move boost::phoenix::function initialisation into ctor's
(ref #3343)
2016-03-04 15:34:45 +01:00
artemp
76bb2d9c01 make svg_transform_grammar stateless ref #3343
(https://github.com/mapnik/mapnik/pull/2231)
2016-03-04 13:15:11 +01:00
artemp
4659f40401 make svg_path_grammar and svg_points_grammar stateless ref #3343
(https://github.com/mapnik/mapnik/pull/2231)
2016-03-04 12:42:44 +01:00
Dane Springmeyer
a855a12532 make code comment about needing immutable grammars - refs #3342 [skip ci] 2016-03-03 09:14:06 -08:00
Mickey Rose
8a55eefbb5 derive virtual_renderer_common from renderer_common 2016-01-29 00:10:19 +01:00
Mickey Rose
8d7fca3236 svg_parse_value - add 'px' unit, report trailing garbage
- avoid operator comma in semantic action, refs #3249
2016-01-23 20:44:14 +01:00
artemp
1bfabec6be parse_svg_value - add DPI template parameter (default 90) (#3233) 2016-01-15 09:38:46 +00:00
artemp
cc635df7bc svg_parser - use parse_svg_value 2016-01-14 11:03:55 +00:00
artemp
48c043ec42 implement "parse_svg_value" supporting SVG units (https://www.w3.org/TR/SVG/coords.html#Units) (#3233) 2016-01-14 10:54:33 +00:00
artemp
1dff67e1fe fix namespace qualifiers 2016-01-14 10:24:40 +00:00
artemp
9e7f7917e3 export path_parse<svg_converter_type> 2016-01-12 15:06:30 +00:00
artemp
0a5f006bb9 SVG : add support for stroke-dashoffset 2016-01-11 10:56:04 +00:00
artemp
d3fc7f8fed Merge branch 'master' into svg-dash-array 2016-01-08 16:08:11 +00:00
artemp
479a657437 make SVG path parser stricter by failing if not all input parsed ref #3225 2016-01-08 11:59:59 +00:00
artemp
b1c22ba853 SVG :initial support for "stroke-dasharray" 2016-01-07 15:54:34 +00:00
Dane Springmeyer
7608040906 centralize warning suppression 2015-11-07 17:53:09 -08:00
artemp
d6d9e94e36 svg_parser - fix double_list grammar to handle whitespace | comma correctly 2015-09-28 14:22:30 +01:00
jakepruitt
344c5ae844 Fix boost parser for viewbox 2015-09-25 12:05:57 -07:00
jakepruitt
a787d20e36 Add viewbox fallback logic for dimension parsing
SVG's now have fallback on viewbox. Still debugging the boost Qi parser
2015-09-25 12:05:57 -07:00
jakepruitt
fcbb91a00e Add int list parser 2015-09-23 12:08:50 -07:00
bergwerkgis
9146f785f4 Windows: fix loading of SVG files from unicode paths. Surfaced in https://github.com/mapnik/node-mapnik/issues/517 2015-09-10 11:10:38 +00:00
artemp
42bf2303e0 fix parse_double_optional_percent grammar and update tests 2015-07-31 11:35:02 +02:00
artemp
9d43f69cf6 const correctness 2015-07-30 11:09:08 +02:00
artemp
e5c4dbf1c0 format 2015-07-30 11:04:17 +02:00
jakepruitt
b4bc16751c Adjusted error message logic for logging path ids 2015-07-29 22:37:30 -04:00
artemp
4cf6ce1866 correct error handling 2015-07-29 13:01:51 +02:00
artemp
9531adbf56 re-use attribute pointer and reduce number of local vars 2015-07-29 11:16:51 +02:00
artemp
a8f5ddff73 handle empty <g> element + fix visibity parsing 2015-07-28 19:37:55 +02:00
artemp
e9284ce62a c++ tidy 2015-07-28 16:50:06 +02:00
artemp
515da3f9a8 rapidxml based svg parser - initial impl 2015-07-28 16:33:39 +02:00
artemp
2e7d75f022 track errors parsing double values 2015-07-24 11:05:26 +02:00
artemp
6a1a25efbf remove duplicate if else 2015-07-23 11:14:13 +02:00
artemp
4b9b1b5401 fix err message 2015-07-22 16:38:45 +02:00
artemp
9eadd48d7b add tests for no-existing svg file + bogus color in fill and stroke 2015-07-22 11:52:18 +02:00
artemp
804115089b clamp rx/ry to valid range (<= 0.5*width/0.5*height)
SVG spec : ".. If 'rx' is greater than half of the width of the rectangle, then the user agent must process the 'rect' element with the effective value for 'rx' as half of the width of the rectangle. If 'ry' is greater than half of the height of the rectangle, then the user agent must process the 'rect' element with the effective value for 'ry' as half of the height of the rectangle.."
2015-07-21 20:48:43 +02:00
artemp
9af3313063 use parse_id_from_url for stroke 2015-07-21 14:56:23 +02:00
artemp
d1b39f5841 handle color parsing in one place 2015-07-21 11:45:11 +02:00
artemp
d7cf0d5bca add parse_id_from_url method 2015-07-21 11:30:04 +02:00
artemp
55a9855069 add xml:id support ( ref #2989 ) 2015-07-21 10:25:57 +02:00
artemp
52007b8019 Merge branch 'master' into svg-parser-errors 2015-07-21 09:46:38 +02:00
artemp
bb8b835618 calculate percentage value inside parser, reduce local vars 2015-07-17 20:00:14 +02:00
artemp
a8da31b765 make '%' sign optional ( was 0 or N) 2015-07-17 19:49:28 +02:00
artemp
c4d8af702d don't return early from parse_linear_gradient 2015-07-17 09:42:05 +02:00
artemp
62a58937a4 try to never fail (almost) 2015-07-16 16:55:41 +02:00
artemp
d2cfd0f0ea log all errors without throwing 2015-07-16 12:58:32 +02:00
artemp
a46af76216 initial commit - make parse and parse_from_string return boolean ,collect error messages 2015-07-14 19:45:50 +02:00
Dane Springmeyer
9a5cc81924 fix a few -Wunused-argument warnings [skip ci] 2015-06-22 13:29:57 -07:00
artemp
8c6bf0eef6 update copyright notice 2015-06-16 12:49:16 +02:00
Dane Springmeyer
b2c85e0c65 fix a slew of -Wsign-conversion, -Wconversion, -Wunused-argument warnings 2015-06-15 20:41:51 -07:00
Dane Springmeyer
c55662ab43 rename pixel_cast to safe_cast 2015-06-15 20:41:48 -07:00
Dane Springmeyer
0d86afff36 start using -Wsign-compare and -Wshadow + fix heaps of warnings - refs #2907 2015-06-12 14:51:18 -07:00
artemp
96f7120ecc add pixel_cast<T>() ref #2893
replace boost::numeric_cast with mapnik::pixel_cast
2015-06-11 13:10:02 +01:00
Dane Springmeyer
4ade976ee1 fix SVG rendering 2015-04-29 15:41:18 -07:00
artemp
2bc2e6b85e use geometry_to_path to convert geometry 2015-04-08 18:48:41 +02:00
artemp
54d8746aa8 svg_renderer - add generate_path vertex processor (work-in-progress) 2015-04-07 15:46:06 +02:00
Dane Springmeyer
dcc5632f82 svg_renderer is broken, disable temporarily 2015-03-24 14:15:57 -07:00
artemp
ac1ffa2bfb move geometry.hpp into path.hpp and update code base to reflect this change 2015-03-24 12:42:09 +01:00
artemp
1ecf3f0889 use const ref when iterating over geometries in feature 2015-02-09 13:46:01 +01:00
artemp
e19fdad3a6 implement vertex interface in vertex_adapter and make mapnik::geometry_type immutable 2015-02-06 16:45:51 +01:00
artemp
18554ec0b1 remove static_visitor usage and rely on automatic result type deduction
(NOTE: expression_evaluator requires  ```using result_type = T1;``` )

Conflicts:
	src/image.cpp
2015-01-07 11:39:06 +01:00
artemp
333965b588 update copyright year 2014-11-20 15:25:50 +01:00
Dane Springmeyer
aae4a20ec9 fix various -Wunused-parameter warnings 2014-10-21 20:23:17 -07:00