Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/text/KoSvgTextChunkShape.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | * the inheritance of shape properties: every shape stores all the properties | 42 | * the inheritance of shape properties: every shape stores all the properties | ||
43 | * that were defined at the stage of loading/creation. KoSvgTextProperties is a | 43 | * that were defined at the stage of loading/creation. KoSvgTextProperties is a | ||
44 | * wrapper that allows the user to compare the properties of the two shapes and | 44 | * wrapper that allows the user to compare the properties of the two shapes and | ||
45 | * return only the ones that are unique for a child shape. That allows us to | 45 | * return only the ones that are unique for a child shape. That allows us to | ||
46 | * generate a correct SVG/markup code that can be edited by the user easily. | 46 | * generate a correct SVG/markup code that can be edited by the user easily. | ||
47 | * | 47 | * | ||
48 | * WARNING: beware the difference between "svg-text-chunk" and | 48 | * WARNING: beware the difference between "svg-text-chunk" and | ||
49 | * KoSvgTextChunkShape! The chunk shape is **not** a "text chunk" in SVG's | 49 | * KoSvgTextChunkShape! The chunk shape is **not** a "text chunk" in SVG's | ||
50 | * definition. Accrding to SVG, "text chunk" is a set of characters anchored to | 50 | * definition. According to SVG, "text chunk" is a set of characters anchored to | ||
51 | * a specific absolute position on canvas. And KoSvgTextChunkShape is just one | 51 | * a specific absolute position on canvas. And KoSvgTextChunkShape is just one | ||
52 | * <tspan> or <text> element. Obviously, one <tspan> can contain multiple "text | 52 | * <tspan> or <text> element. Obviously, one <tspan> can contain multiple "text | ||
53 | * chunks" and, vice versa, a "text chunk" can spread onto multiple <span>'s. | 53 | * chunks" and, vice versa, a "text chunk" can spread onto multiple <span>'s. | ||
54 | */ | 54 | */ | ||
55 | class KRITAFLAKE_EXPORT KoSvgTextChunkShape : public KoShapeContainer, public SvgShape | 55 | class KRITAFLAKE_EXPORT KoSvgTextChunkShape : public KoShapeContainer, public SvgShape | ||
56 | { | 56 | { | ||
57 | public: | 57 | public: | ||
58 | KoSvgTextChunkShape(); | 58 | KoSvgTextChunkShape(); | ||
Show All 37 Lines | |||||
96 | 96 | | |||
97 | /** | 97 | /** | ||
98 | * Compress the inheritance of 'fill' and 'stroke'. | 98 | * Compress the inheritance of 'fill' and 'stroke'. | ||
99 | * | 99 | * | ||
100 | * The loading code makes no difference if the fill or stroke was inherited | 100 | * The loading code makes no difference if the fill or stroke was inherited | ||
101 | * or not. That is not a problem for normal shapes, but it cannot work for | 101 | * or not. That is not a problem for normal shapes, but it cannot work for | ||
102 | * text shapes. The text has different inheritance rules: if the parent | 102 | * text shapes. The text has different inheritance rules: if the parent | ||
103 | * text chunk has a gradient fill, its inheriting descendants will | 103 | * text chunk has a gradient fill, its inheriting descendants will | ||
104 | * **smoothly continue** this grandient. They will not start a new gradient | 104 | * **smoothly continue** this gradient. They will not start a new gradient | ||
105 | * in their local coordinate system. | 105 | * in their local coordinate system. | ||
106 | * | 106 | * | ||
107 | * Therefore, after loading, the loading code calls | 107 | * Therefore, after loading, the loading code calls | ||
108 | * simplifyFillStrokeInheritance() which marks the coinciding strokes and | 108 | * simplifyFillStrokeInheritance() which marks the coinciding strokes and | ||
109 | * fills so that the rendering code will be able to distinguish them in the | 109 | * fills so that the rendering code will be able to distinguish them in the | ||
110 | * future. | 110 | * future. | ||
111 | * | 111 | * | ||
112 | * Proper fill inheritance is also needed for the GUI. When the user | 112 | * Proper fill inheritance is also needed for the GUI. When the user | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |