[cairo-commit] libsvg/src svg.h, 1.22, 1.23 svg_element.c, 1.38,
1.39 svg_style.c, 1.23, 1.24 svg_text.c, 1.15, 1.16 svgint.h,
1.47, 1.48
Keith Packard
commit at pdx.freedesktop.org
Tue Jul 19 09:56:02 PDT 2005
Committed by: keithp
Update of /cvs/cairo/libsvg/src
In directory gabe:/tmp/cvs-serv27482/src
Modified Files:
svg.h svg_element.c svg_style.c svg_text.c svgint.h
Log Message:
2005-07-19 Keith Packard <keithp at keithp.com>
* src/svg.h:
* src/svg_element.c: (_svg_element_apply_attributes):
* src/svg_style.c: (_svg_style_render):
* src/svg_text.c: (_svg_text_render):
* src/svgint.h:
Kludge - pull text_anchor out of backend as it's stacked there.
Index: svg.h
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- svg.h 18 Jul 2005 21:55:06 -0000 1.22
+++ svg.h 19 Jul 2005 16:56:00 -0000 1.23
@@ -317,6 +317,8 @@
svg_length_t *iy,
double *ox,
double *oy);
+ /* XXX yes, this is a kludge */
+ svg_status_t (* get_text_anchor) (void *closure, svg_text_anchor_t *text_anchor);
} svg_render_engine_t;
svg_status_t
Index: svg_element.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_element.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- svg_element.c 19 Jul 2005 14:34:54 -0000 1.38
+++ svg_element.c 19 Jul 2005 16:56:00 -0000 1.39
@@ -509,7 +509,6 @@
break;
case SVG_ELEMENT_TYPE_TEXT:
status = _svg_text_apply_attributes (&element->e.text, attributes);
- element->e.text.text_anchor = element->style.text_anchor;
break;
case SVG_ELEMENT_TYPE_TSPAN:
status = _svg_tspan_apply_attributes (&element->e.tspan, attributes);
Index: svg_style.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_style.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- svg_style.c 19 Jul 2005 14:34:54 -0000 1.23
+++ svg_style.c 19 Jul 2005 16:56:00 -0000 1.24
@@ -909,6 +909,12 @@
return status;
}
+ if (style->flags & SVG_STYLE_FLAG_TEXT_ANCHOR) {
+ status = (engine->set_text_anchor) (closure, style->text_anchor);
+ if (status)
+ return status;
+ }
+
return SVG_STATUS_SUCCESS;
}
Index: svg_text.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_text.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- svg_text.c 19 Jul 2005 14:34:54 -0000 1.15
+++ svg_text.c 19 Jul 2005 16:56:00 -0000 1.16
@@ -176,14 +176,17 @@
int e;
double w, h;
svg_status_t status = SVG_STATUS_SUCCESS;
+ svg_text_anchor_t text_anchor;
(engine->measure_position) (closure,
&text->group.x, &text->group.y, &x, &y);
- if (text->text_anchor != SVG_TEXT_ANCHOR_START) {
+ (engine->get_text_anchor) (closure, &text_anchor);
+
+ if (text_anchor != SVG_TEXT_ANCHOR_START) {
_svg_text_extents (text, &w, &h, engine, closure);
- switch (text->text_anchor) {
+ switch (text_anchor) {
case SVG_TEXT_ANCHOR_END:
x -= w;
y -= h;
@@ -192,6 +195,8 @@
x -= w/2;
y -= h/2;
break;
+ case SVG_TEXT_ANCHOR_START:
+ break;
}
}
Index: svgint.h
===================================================================
RCS file: /cvs/cairo/libsvg/src/svgint.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- svgint.h 19 Jul 2005 14:34:54 -0000 1.47
+++ svgint.h 19 Jul 2005 16:56:00 -0000 1.48
@@ -241,7 +241,6 @@
typedef struct svg_text {
struct svg_group group;
- svg_text_anchor_t text_anchor;
} svg_text_t;
typedef struct svg_ellipse {
More information about the cairo-commit
mailing list