Results 1 to 4 of 4

Thread: SVG rendering problems and doubs

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: SVG rendering problems and doubs

    I've done exactly this myself.
    Quote Originally Posted by GuS View Post
    1. Does Qt supports very will <tspan> inside <text>?:
    QtSvg only supports the static features of SVG Tiny. From that spec on wrapping text:
    Each 'text' element causes a single string of text to be rendered. The 'text' element performs no automatic line breaking or word wrapping. To achieve the effect of multiple lines of text, use one of the following methods:
    * Use the 'textArea' element to specify a rectangular area in which to flow the text.
    * Pre-compute the line breaks (which can be done by the author or authoring tool) and use individual 'text' elements to manually place the lines of text. (Note: this is discouraged for accessibility reasons.)
    * Express the text to be rendered in another XML namespace such as XHTML [XHTML] embedded inline within a 'foreignObject' element. (Note: the exact semantics of this approach are not completely defined at this time.)
    Unfortunately Inkscape does none of these things in its multi-line text. If memory serves it uses an attribute from the draft SVG Full 1.2 (flowRoot and flowRegion). I simply created multiple text objects for multi-line fixed text. For columns of variable text I retrieved a named bounding box and rendered the text within the rectangle after rendering the template. You could try manually using a textarea.
    2. Another related to rendering, as you can see in the SVG, I have a background in which represents the receipt structure. Well, Qt only is rendering only the backgrond color and the external borders. The lines inside the background, does not appear (which again, it works in all browsers and SVG viewers).
    In my application background shading was optional and only rendered when requested (I painted selected SVG objects by id). I had to be careful that the background was painted before the overlying lines or it would obscure them. If you do something similar this is something to watch for.

    When I get to my Qt dev machine I'll try your code and see if I can see the the same problem.

    Edit:
    It does that for me too.
    Last edited by ChrisW67; 4th October 2009 at 09:08.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.