Commit Graph

104 Commits

Author SHA1 Message Date
Mikael Sand
f94e17e3be Implement correct transform parser (#507) 2017-11-30 17:32:16 -08:00
Lauren
6ed629af3d support rotations around defined points (#502)
This PR uses optional `cx` and `cy` props from `rotate` to change the origin of a transformation when given. Should fix https://github.com/react-native-community/react-native-svg/issues/242
2017-11-23 13:47:39 -08:00
James Ide
f9e774e03d Handle color parsing when alpha = 1 (#512)
The `color` library doesn't include alpha when accessing `color.rgb().array()` when the alpha value is 1. Since we always use the alpha value, make it default to 1 when parsing a color.
2017-11-23 13:47:01 -08:00
James Ide
235e132baf Update "color" dep to 2.x to fix RN minifier bug
There's a bug with the version of UglifyJS that RN/Metro uses which causes an error about "e.length" inside of "color" that was fixed in 2.x. One change to "color" is that `rgbaArray()` was removed and now the call is `rgb().array()`.
2017-11-09 12:28:13 -08:00
magicismight
7f88436332 Remove unused code 2017-09-24 15:59:18 +08:00
magicismight
2ddb0bddc6 Fix strokeDasharray.concat(strokeDasharray)
`strokeDasharray.concat(strokeDasharray)` has created a new array
should assign to strokeDasharray.
Remove devDependencies
2017-08-08 11:25:38 +08:00
Mikael Sand
a1b57d3f4f Implement default and required css 3 fonts features, fontFeatureSettings, sub-/super- script baseline-shift.
Activate OpenType localized forms and features required for proper display of composed characters and marks.
2017-08-07 18:26:45 +03:00
Mikael Sand
a97122a994 Initial support for OpenType.js font data/tables/metrics. 2017-08-04 21:17:02 +03:00
Mikael Sand
fe7e8b2b65 Implement baselineShift and verticalAlign (preferred).
Transverse Box Alignment, specifies how an inline-level box is aligned within the line, and by how much the box is shifted up from its alignment point.
 https://drafts.csswg.org/css-inline/#propdef-vertical-align
 https://www.w3.org/TR/css-inline-3/#propdef-baseline-shift
 https://www.w3.org/TR/css-inline-3/#transverse-alignment
2017-08-04 16:29:06 +03:00
Mikael Sand
2939584d1b Implement font-variant-ligatures.
https://developer.mozilla.org/en/docs/Web/CSS/font-variant-ligatures
https://www.w3.org/TR/css-fonts-3/#font-variant-ligatures-prop
2017-08-04 14:10:02 +03:00
Mikael Sand
786b5f2375 Implement strokeDasharray correctly.
Support units and percentages with whitespace separated and/or (possibly white-space surrounded) comma separated length lists.
2017-08-04 00:26:00 +03:00
Mikael Sand
3825bbd5c8 Fix startOfRendering calculation. Fix cursor position calculation. Refactor extractStroke strokeWidth handling. 2017-07-29 14:42:37 +03:00
Mikael Sand
a8fdf64828 Ensure strokeWidth is string 2017-07-25 22:37:13 +03:00
Mikael Sand
54efe3ad1e Fix strokeDasharray handling of odd number of length values and the 'none' value. 2017-07-25 21:58:07 +03:00
Mikael Sand
b140d673d7 Fix interpretation of alignmentBaseline (Shouldn't inherit). 2017-07-25 08:22:56 +03:00
Mikael Sand
c05c215496 Implement prop extraction for side and alignmentBaseline. Cleanup extractText, fix linting. 2017-07-25 07:45:08 +03:00
Mikael Sand
1a9a051ee9 Fix linting, warnings, add noinspection suppression comments. 2017-07-24 00:08:28 +03:00
Mikael Sand
80b9ff9d57 Fix font PropTypes 2017-07-23 22:55:39 +03:00
Mikael Sand
fc61c9dad2 Simplify textAnchor and textDecoration handling 2017-07-23 20:11:01 +03:00
Mikael Sand
dff02c3dbb Implement wordSpacing in extractFont 2017-07-23 08:30:28 +03:00
Mikael Sand
eaf7b5e88b Improve fontSize handling 2017-07-22 23:02:37 +03:00
Mikael Sand
ed9c0bd647 Restructure fontSize handling. 2017-07-22 22:05:38 +03:00
Mikael Sand
6b022ac861 Harmonize parseSVGLengthList usage and naming. Probably requires api change in ios as well. 2017-07-22 20:33:05 +03:00
Mikael Sand
5372355b11 Fix parsing of generic units in dx and dy, and percentages in rotate text attributes. 2017-07-22 19:11:41 +03:00
Mikael Sand
ebeb89beb5 Improve units and fontSize implementation.
Implement support for units in strokewidth based on relativeOnOther.
2017-07-19 23:35:34 +03:00
Mikael Sand
8e15791107 Fix extractTransform not to interpret text rotate attribute and transform rotation 2017-07-16 02:01:50 +03:00
Mikael Sand
2458a2f262 Implement rotate and textDecoration 2017-07-16 01:50:59 +03:00
Mikael Sand
c7039588f6 Improve coordinate system calculations for font-size, letter-spacing etc.
Fix parsing of transform to account for single parameter scale and translate correctly.
Fix skewX, had opposite of intended effect.
https://www.w3.org/TR/SVG/coords.html
https://www.w3.org/TR/SVG2/coords.html
https://www.w3.org/TR/SVGTiny12/coords.html
https://www.w3.org/TR/SVG/coords.html#TransformAttribute
https://www.w3.org/TR/SVG/coords.html#SkewXDefined
2017-06-27 20:45:04 +03:00
Mikael Sand
bd84f09a96 Implement correct path measurement, matrix calculation, getTextAnchorShift, startOffset.
Add method and spacing attributes to textPath.
Correct startOffset calculation.
Implement method="stretch".
2017-06-22 17:02:30 +03:00
Mikael Sand
dac969b944 First letterSpacing implementation attempt 2017-06-20 22:04:41 +03:00
Mikael Sand
155fa4b6ae Implement support for em in dx and dy attributes and font props for G element 2017-06-20 03:15:01 +03:00
Mikael Sand
e9747bee01 Revert 6b95d1a 2017-06-13 12:43:32 +03:00
Mikael Sand
77e54cfcfb Fix linting 2017-06-07 17:25:22 +03:00
Mikael Sand
b758d77a98 Transform fix 2017-06-06 00:14:02 +03:00
fxwan
67e072307c remove the y check 2017-06-05 16:54:25 +03:00
fxwan
6b95d1a33c Fix text position on Y-axis, we should take fontSize in mind to layout the Text/TSpan shapes, SVG coord tes case https://www.w3.org/TR/SVG/images/coords/OrigCoordSys.svg 2017-06-05 16:54:25 +03:00
fxwan
1e6f36053a Add Basic support to transform props, including translate, rotate, scale, skewX, skewY and matrix. Keep in mind that the current implementation doesn't support 3-arguments rotate(a, x, y) transform yet. 2017-06-05 16:54:25 +03:00
陈阳
9a07c4251d Fix polypoints RegExp. Close #303 2017-05-02 11:56:03 +08:00
Horcrux
bbe1964a42 Fix #284 2017-04-04 12:30:53 +08:00
Horcrux
ea1a87887e Fix polypoints RegExp 2017-04-04 11:59:59 +08:00
Horcrux
e3b2f4c71a Fix Polygon and Polyline 2017-04-04 11:56:38 +08:00
Horcrux
5bd9b40c17 refactor Components props extracting 2017-02-03 19:43:25 +08:00
Horcrux
cfaca8b3cb Add gradientUnits support 2017-01-24 22:24:36 +08:00
Horcrux
1b04e11ca4 Refactor Symbol on iOS 2017-01-22 17:51:47 +08:00
Horcrux
8582e076e4 Merge branch 'master' into percentage-props-refactor-ios 2017-01-20 14:59:14 +08:00
Horcrux
43e45b95c5 Fix #231 2017-01-16 21:01:12 +08:00
Horcrux
7c9f6b2d3d Remove unused public method 2017-01-16 14:38:43 +08:00
Horcrux
58823495d6 Fix #228 2017-01-15 20:17:21 +08:00
Horcrux
13e7595ab5 Remove unused files 2017-01-14 00:30:49 +08:00
Horcrux
b15d0791e0 Add startOffset support 2017-01-10 12:30:48 +08:00