diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b34dbf1..96cb109 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Contributions to Scour are welcome, feel free to create a pull request! In order to be able to merge your PR as fast as possible please try to stick to the following guidelines. -> _**TL;DR** (if you now what you're doing) – Always run [`make check`](https://github.com/scour-project/scour/blob/master/Makefile) before creating a PR to check for common problems._ +> _**TL;DR** (if you now what you're doing) – Always run [`make check`](https://github.com/scour-project/scour/blob/master/Makefile) before creating a PR to check for common problems._ ## Code Style @@ -32,4 +32,4 @@ To ensure that all possible code conditions are covered by a test you can use [` make coverage ``` -These reports are also created automatically by our TravisCI builds and are accessible via [Codecov](https://codecov.io/gh/scour-project/scour) \ No newline at end of file +These reports are also created automatically by our TravisCI builds and are accessible via [Codecov](https://codecov.io/gh/scour-project/scour) diff --git a/HISTORY.md b/HISTORY.md index 1661d5a..de0b503 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -47,7 +47,7 @@ ## Version 0.35 (2016-09-14) * Drop official support for Python 2.6. (While it will probably continue to work for a while compatibility is not guaranteed anymore. If you continue to use Scour with Python 2.6 and should find/fix any compatibility issues pull requests are welcome, though.) -* Fix: Unused IDs were not shortended when `--shorten-ids` was used. ([#19](https://github.com/scour-project/scour/issues/62)) +* Fix: Unused IDs were not shortened when `--shorten-ids` was used. ([#19](https://github.com/scour-project/scour/issues/62)) * Fix: Most elements were still removed from `` when `--keep-unreferenced-defs` was used. ([#62](https://github.com/scour-project/scour/issues/62)) * Improve escaping of single/double quotes ('/") in attributes. ([#64](https://github.com/scour-project/scour/issues/64)) * Print usage information if no input file was specified (and no data is available from `stdin`). ([#65](https://github.com/scour-project/scour/issues/65)) @@ -56,13 +56,13 @@ * Improve code to remove default attribute values and add a lot of new default values. ([#70](https://github.com/scour-project/scour/issues/70)) * Fix: Only attempt to group elements that the content model allows to be children of a `` when `--create-groups` is specified. ([#98](https://github.com/scour-project/scour/issues/98)) * Fix: Update list of SVG presentation attributes allowing more styles to be converted to attributes and remove two entries (`line-height` and `visibility`) that were actually invalid. ([#99](https://github.com/scour-project/scour/issues/99)) -* Add three options that work analoguous to `--remove-metadata` (removes `` elements) ([#102](https://github.com/scour-project/scour/issues/102)) +* Add three options that work analogous to `--remove-metadata` (removes `` elements) ([#102](https://github.com/scour-project/scour/issues/102)) * `--remove-titles` (removes `` elements) * `--remove-descriptions` (removes `<desc>` elements) * `--remove-descriptive-elements` (removes all of the descriptive elements, i.e. `<title>`, `<desc>` and `<metadata>`) * Fix removal rules for the `overflow` attribute. ([#104](https://github.com/scour-project/scour/issues/104)) * Improvement: Automatically order all attributes ([#105](https://github.com/scour-project/scour/issues/105)), as well as `style` declarations ([#107](https://github.com/scour-project/scour/issues/107)) allowing for a constant output across multiple runs of Scour. Before order could change arbitrarily. -* Improve path scouring. ([#108](https://github.com/scour-project/scour/issues/108))<br>Notably Scour performs all caculations with enhanced precision now, guaranteeing maximum accuracy when optimizing path data. Numerical precision is reduced as a last step of the optimization according to the `--precision` option. +* Improve path scouring. ([#108](https://github.com/scour-project/scour/issues/108))<br>Notably Scour performs all calculations with enhanced precision now, guaranteeing maximum accuracy when optimizing path data. Numerical precision is reduced as a last step of the optimization according to the `--precision` option. * Fix replacement of removed duplicate gradients if the `fill`/`stroke` properties contained a fallback. ([#109](https://github.com/scour-project/scour/issues/109)) * Fix conversion of cubic BĂ©zier "curveto" commands into "shorthand/smooth curveto" commands. ([#110](https://github.com/scour-project/scour/issues/110)) * Fix some issues due to removal of properties without considering inheritance rules. ([#111](https://github.com/scour-project/scour/issues/111)) @@ -74,7 +74,7 @@ * Input/output file can now be specified as positional arguments (e.g. `scour input.svg output.svg`). ([#46](https://github.com/scour-project/scour/issues/46)) * Improve `--help` output by intuitively arranging options in groups. ([#46](https://github.com/scour-project/scour/issues/46)) * Add option `--error-on-flowtext` to raise an exception whenever a non-standard `<flowText>` element is found (which is only supported in Inkscape). If this option is not specified a warning will be shown. ([#53](https://github.com/scour-project/scour/issues/53)) -* Automate tests with continouous integration via Travis. ([#52](https://github.com/scour-project/scour/issues/52)) +* Automate tests with continuous integration via Travis. ([#52](https://github.com/scour-project/scour/issues/52)) ## Version 0.33 (2016-01-29) @@ -90,7 +90,7 @@ * Fix a potential regex matching issue in `points` attribute of `<polygon>` and `<polyline>` elements. ([#24](https://github.com/scour-project/scour/issues/24)) * Fix a crash with `points` attribute of `<polygon>` and `<polyline>` starting with a negative number. ([#24](https://github.com/scour-project/scour/issues/24)) * Fix encoding issues when input file contained unicode characters. ([#27](https://github.com/scour-project/scour/issues/27)) -* Fix encoding issues when using `stding`/`stdout` as input/output. ([#27](https://github.com/scour-project/scour/issues/27)) +* Fix encoding issues when using `stding`/`stdout` as input/output. ([#27](https://github.com/scour-project/scour/issues/27)) * Fix removal of comments. If a node contained multiple comments usually not all of them were removed. ([#28](https://github.com/scour-project/scour/issues/28)) @@ -104,7 +104,7 @@ ## Version 0.30 (2014-08-05) -* Fix ingoring of additional args when invoked from scons. +* Fix ignoring of additional args when invoked from scons. ## Version 0.29 (2014-07-26) diff --git a/scour/scour.py b/scour/scour.py index 91326c6..9d19906 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -1484,7 +1484,7 @@ def collapse_singly_referenced_gradients(doc, stats): if target_href: # If the elem node had an xlink:href, then the # refElem have to point to it as well to - # perserve the semantics of the image. + # preserve the semantics of the image. refElem.setAttributeNS(NS['XLINK'], 'href', target_href) else: # The elem node had no xlink:href reference, @@ -1883,7 +1883,7 @@ def styleInheritedByChild(node, style, nodeIsChild=False): 'missing-glyph', 'pattern', 'svg', 'switch', 'symbol']: return False - # in all other cases we have to assume the inherited value of 'style' is meaningfull and has to be kept + # in all other cases we have to assume the inherited value of 'style' is meaningful and has to be kept # (e.g nodes without children at the end of the DOM tree, text nodes, ...) return True @@ -2925,7 +2925,7 @@ def scourCoordinates(data, options, force_whitespace=False, control_points=[], f # - this number starts with a dot but the previous number had *no* dot or exponent # i.e. '1.3 0.5' -> '1.3.5' or '1e3 0.5' -> '1e3.5' is fine but '123 0.5' -> '123.5' is obviously not # - 'force_whitespace' is explicitly set to 'True' - # we never need a space after flags (occuring in elliptical arcs), but librsvg struggles without it + # we never need a space after flags (occurring in elliptical arcs), but librsvg struggles without it if (c > 0 and (force_whitespace or scouredCoord[0].isdigit() diff --git a/setup.py b/setup.py index cf3ed08..990b596 100644 --- a/setup.py +++ b/setup.py @@ -28,10 +28,10 @@ vector graphics by optimizing structure and removing unnecessary data. It can be used to create streamlined vector graphics suitable for web deployment, publishing/sharing or further processing. -The goal of Scour is to output a file that renderes identically at a +The goal of Scour is to output a file that renders identically at a fraction of the size by removing a lot of redundant information created by most SVG editors. Optimization options are typically lossless but can -be tweaked for more agressive cleaning. +be tweaked for more aggressive cleaning. Website - http://www.codedread.com/scour/ (original website)