A4

Path doesn't handle correctly <text> tag.

Bug #595428 reported by Andrea Gasparini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
A4
Triaged
High
Unassigned

Bug Description

Using text ids inside a4 information metadata broke the presentation.

Traceback (most recent call last):
  File "/home/gaspa/Projects/a4/trunk/a4lib/app.py", line 155, in on_toolbutton_next_clicked
    self.set_current_animation(start, end)
  File "/home/gaspa/Projects/a4/trunk/a4lib/app.py", line 133, in set_current_animation
    end_props = self.svg_image.get_item_properties_by_id(end_id)
  File "/home/gaspa/Projects/a4/trunk/a4lib/presentation.py", line 172, in get_item_properties_by_id
    target_element[0].attrib.get('width'))
TypeError: float() argument must be a string or a number

Revision history for this message
Andrea Gasparini (gaspa) wrote :
Changed in a4:
milestone: none → 0.02
status: New → Triaged
Andrea Gasparini (gaspa)
Changed in a4:
assignee: Andrea Gasparini (gaspa) → A4 Developers (a4-dev)
Revision history for this message
Andrea Gasparini (gaspa) wrote :

Svg text elements are quite complex, and I'm asking if we really want to specifying text tags as point of an A4 presentation.
 First of all, they don't have width/height attributes, so we'd want to calculate them from other properties of the text inside the tag ( in first instance you'd need to know the starting point of the text [x,y] and the size of the text [font size * lenght in chars?] )

Moreover, they can be combined with <tspan> et similia, they can be many lines of text (each of them can have modifiers of the size and whatever...).

So, I'm just guessing if we can ignore <text> and surrender all the region of interests of an A4 presentation with a rectangle, even transparent/hidden/whatever , at least until we have to directly handle SVG internals.

Revision history for this message
Andrea Gasparini (gaspa) wrote :

uh, forgotten the link with documentation:
http://www.w3.org/TR/SVG/text.html

Revision history for this message
Andrea Gualano (andrea-gualano) wrote :

The size of a text object is not font_size * string_len: think "mmm" vs. "iii".

I think we should find some library to do these calculations for us.
For instance, see how easy it is to find a bounding box inside a browser, using DOM and Javascript:
http://my.opera.com/MacDev_ed/blog/2009/01/21/getting-boundingbox-of-svg-elements

Revision history for this message
Andrea Gasparini (gaspa) wrote :

we can't get BBox of elements without a proper DOM implementation, so I removed the milestone, till we'll found a dom library ( or implement it)

Changed in a4:
milestone: 0.02 → none
Changed in a4:
assignee: A4 Developers (a4-dev) → nobody
Revision history for this message
Andrea Colangelo (warp10) wrote :

Any update about this bug?

Revision history for this message
Alessandro Losavio (alo21) wrote : Re: [Bug 595428] Re: Path doesn't handle correctly <text> tag.

Il 25/09/2010 17:25, Andrea Colangelo ha scritto:
> Any update about this bug?
>
>

no I am sorry i only reported this bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.