Re: gradient angles
On 29/07/12 19:25, Regina Henschel wrote: > Hi Christine, > > continuing.. > > Christina Roßmanith schrieb: >> Hi, >> >> just to be sure before I continue my work: >> >> SVG gradient with angle=0° changes color from left to right >> (I'm taking this from >> http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement) >> >> ODF gradient with angle=0° changes color from top to bottom >> (I can't find any meaning of the angle attribute here >> http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1416460_253892949) > > I have now looked, which way PowerPoint2013 does it: > The angle of 0° in the UI means that the gradient vector goes from left > to right. > The angle in the UI rotates this gradient vector clockwise on screen. > Values from 0 to 359.9 are allowed. > > In file format it is the same as from LO, for example: > draw:angle="700" results from >PP UI-angle=20° clockwise on screen >LO UI-angle=70° counterclockwise on screen > draw:angle="3300" results form >PP UI-angle=120° clockwise on screen >LO UI-angle=330° counterclockwise on screen that is a very interesting discovery! so it seems MSO also has the defect of storing draw:angle with the wrong units of 0.1°. i've installed Calligra Stage 2.4.3 and played with it, and in the .odp file i get linear gradients like this: >svg:x1="65.9558%" svg:x2="39.8039%" svg:y1="24.8957%" svg:y2="70.0815%"> > svg:offset="0.473324" svg:stop-color="#00ced1"/> svg:offset="0.589196" svg:stop-color="#00ff00"/> > >svg:x1="0%" svg:x2="166.923%" svg:y1="0%" svg:y2="164.085%"> > svg:offset="1" svg:stop-color="#00ff00"/> > so it appears there is another way to represent gradients in ODF 1.2 that is directly from SVG and doesn't use draw:angle at all; the UI for it doesn't display an angle either but you see a line where you can move start/end points and double click on the line at a position to insert color stops. it appears OOo and derived suites like LO don't support reading svg:linearGradient/svg:radialGradient at all. > So it seems, that PP follows the way how it is stored in file, but has a > different UI. > > My conclusion is, that a mail to OASIS is needed with the points: > (1) Define "axis at which the gradient values are interpolated" as vector > (2) Define untransformed direction of this vector as going in positive > y-axis direction. > (3) Define direction of rotation as clockwise in respect to the internal > coordinate system > (4) Do not define draw:angle as SVG-angle but as double to be multiplied > with 0.1°. > > What do you think? so it seems that all office suites that implement draw:angle do it wrong in the same way, by using 0.1° as the unit instead of 1°, and one of the affected suites is from MSFT which we have no way to fix. therefore i retract my earlier suggestion to fix the defect in LO, and second your proposal to suggest OASIS to change the spec. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: gradient angles
Hi Christina, Christina Roßmanith schrieb: Am 29.07.2012 18:25, schrieb Regina Henschel: Hi Christina, I'm not sure about what you want to know. Christina Roßmanith schrieb: Hi, just to be sure before I continue my work: SVG gradient with angle=0° changes color from left to right (I'm taking this from http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement) The svg:gradient does not has an angle, but a start point and an end point. The start point has the color of the 0%-stop color and the end point has the color of the 100%-stop color. You are right, there is no angle but transforms are applied to the gradient vector (and normal). So the question is what is the direction of the gradient vector in absence of any transform and the w3c test suite gives the answer: from left to right (along the positive x axis?) There is a picture which explains it in SVG 1.1 Section 13 Gradients and Patterns http://www.w3.org/TR/SVG/pservers.html ODF gradient with angle=0° changes color from top to bottom (I can't find any meaning of the angle attribute here http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1416460_253892949) I think, that the specification is not clear about the untransformed direction of the gradient vector. "Gradient vector" is for me the direction from start color to end color in the way, that a line with points of same color is perpendicular to the gradient vector. LibreOffice handles it in the way, that the untransformed gradient vector is in direction of the positive y-axis, that is on screen from top to bottom. That means I have to rotate the gradient orientation 90° ccw when importing svg gradients. Do you want to import a svg-picture? Or do you want to implement feature "ODF1.2 16.40.2"? Or what are you working on? I ask, because there are further attributes, which cannot be impressed directly in a LO gradient: intermediate stop-colors, spreadMethod, and gradientUnits, which has to be considered to, when calculating an angle. It is no rotation at all. But you have to convert between two-point vector and angle. The draw:angle is the angle the gradient vector is rotated. Where it has the same rule as other rotations, that it is on screen against clock, which will be clockwise in calculation because of the top-down direction of the y-axis. LibreOffice handles the angle unit as 0.1°, whereas in ODF1.2 the angle unit defaults to 1°. That might explain why in a fodg file which I've modified by hand a gradient angle of "90" is interpreted as "9". The spec has to be changed to meet the practice. Do you know an ODF1.2 application, that interprets the angle in degree? Shall I write a mail to OASIS to change it to 0.1°? Kind regards Regina ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: gradient angles
Am 29.07.2012 18:25, schrieb Regina Henschel: Hi Christina, I'm not sure about what you want to know. Christina Roßmanith schrieb: Hi, just to be sure before I continue my work: SVG gradient with angle=0° changes color from left to right (I'm taking this from http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement) The svg:gradient does not has an angle, but a start point and an end point. The start point has the color of the 0%-stop color and the end point has the color of the 100%-stop color. You are right, there is no angle but transforms are applied to the gradient vector (and normal). So the question is what is the direction of the gradient vector in absence of any transform and the w3c test suite gives the answer: from left to right (along the positive x axis?) ODF gradient with angle=0° changes color from top to bottom (I can't find any meaning of the angle attribute here http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1416460_253892949) I think, that the specification is not clear about the untransformed direction of the gradient vector. "Gradient vector" is for me the direction from start color to end color in the way, that a line with points of same color is perpendicular to the gradient vector. LibreOffice handles it in the way, that the untransformed gradient vector is in direction of the positive y-axis, that is on screen from top to bottom. That means I have to rotate the gradient orientation 90° ccw when importing svg gradients. The draw:angle is the angle the gradient vector is rotated. Where it has the same rule as other rotations, that it is on screen against clock, which will be clockwise in calculation because of the top-down direction of the y-axis. LibreOffice handles the angle unit as 0.1°, whereas in ODF1.2 the angle unit defaults to 1°. That might explain why in a fodg file which I've modified by hand a gradient angle of "90" is interpreted as "9". Christina ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: gradient angles
Hi Christine, continuing.. Christina Roßmanith schrieb: Hi, just to be sure before I continue my work: SVG gradient with angle=0° changes color from left to right (I'm taking this from http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement) ODF gradient with angle=0° changes color from top to bottom (I can't find any meaning of the angle attribute here http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1416460_253892949) I have now looked, which way PowerPoint2013 does it: The angle of 0° in the UI means that the gradient vector goes from left to right. The angle in the UI rotates this gradient vector clockwise on screen. Values from 0 to 359.9 are allowed. In file format it is the same as from LO, for example: draw:angle="700" results from PP UI-angle=20° clockwise on screen LO UI-angle=70° counterclockwise on screen draw:angle="3300" results form PP UI-angle=120° clockwise on screen LO UI-angle=330° counterclockwise on screen So it seems, that PP follows the way how it is stored in file, but has a different UI. My conclusion is, that a mail to OASIS is needed with the points: (1) Define "axis at which the gradient values are interpolated" as vector (2) Define untransformed direction of this vector as going in positive y-axis direction. (3) Define direction of rotation as clockwise in respect to the internal coordinate system (4) Do not define draw:angle as SVG-angle but as double to be multiplied with 0.1°. What do you think? Kind regards Regina ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: gradient angles
Hi Christina, I'm not sure about what you want to know. Christina Roßmanith schrieb: Hi, just to be sure before I continue my work: SVG gradient with angle=0° changes color from left to right (I'm taking this from http://www.w3.org/TR/SVG/pservers.html#LinearGradientElement) The svg:gradient does not has an angle, but a start point and an end point. The start point has the color of the 0%-stop color and the end point has the color of the 100%-stop color. ODF gradient with angle=0° changes color from top to bottom (I can't find any meaning of the angle attribute here http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1416460_253892949) I think, that the specification is not clear about the untransformed direction of the gradient vector. "Gradient vector" is for me the direction from start color to end color in the way, that a line with points of same color is perpendicular to the gradient vector. LibreOffice handles it in the way, that the untransformed gradient vector is in direction of the positive y-axis, that is on screen from top to bottom. The draw:angle is the angle the gradient vector is rotated. Where it has the same rule as other rotations, that it is on screen against clock, which will be clockwise in calculation because of the top-down direction of the y-axis. LibreOffice handles the angle unit as 0.1°, whereas in ODF1.2 the angle unit defaults to 1°. I need to look in which way PowerPoint writes the gradient in ODF1.2 format. Kind regards Regina ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice