No text visible from svg files viewed from 'svgviewer' example.



  • hi,
    I used the 'svgviewer' project given in 'Qt/examples' to view svg files.
    But it does not shows any text involved in the image. we can view only lines and curves but not text!

    please help me how to make text visible.
    I think there may be some font related problems because the svg images containing some UTF fonts...


  • Moderators

    QtSVG module only implements SVGTiny specification, not full SVG specs, which is why it's deprecated.

    If you need full SVG support, use QtWebKit, or some third-party library.



  • any solutions to add UTF font family into svgview?


  • Moderators

    I don't know, I'm not using this module at all. You can always add a QLabel on top of it, but that is not really a good solution.


  • Moderators

    [quote author="Udayaravi" date="1381391412"]any solutions to add UTF font family into svgview?[/quote]
    yes implement it into QtSvg module...
    As sierdzio said, it's not implemented there. Thus you would need to use some alternative if you depend on it!



  • Thanks for the quick reply,

    but please give more details how to implement it in Qtsvg module,
    because I am new to Qt programming.


  • Moderators

    [quote author="Udayaravi" date="1381391675"]because I am new to Qt programming.[/quote]

    Don't bother yourself, then. It's not an easy task. You would need to analyse the source code for QtSVG, locate where the problem lies, then implement text support (with correct glyph painting, positioning etc), provide unit tests, submit it to qt-project for review (if you want it included in mainline Qt), and then integrate it once the sanity test and all reviews are done.


  • Moderators

    [quote author="Udayaravi" date="1381391675"]
    but please give more details how to implement it in Qtsvg module,
    because I am new to Qt programming.[/quote]

    in addition to sierdzio:
    If it would be a work that a Qt beginner could manage to implement, why shouldn't it be available yet?!



  • Thanx sierdzio: for giving more details,
    Then I can not find any solution for it!!!
    Now I got it, why I was getting some error messages in the output window of the Qt Creator, like,
    link glyph1-8 hasn't been detected!
    link glyph1-6 hasn't been detected!
    link glyph1-7 hasn't been detected!
    link glyph1-1 hasn't been detected!....

    Actually I was developing a gui tool, in which some svg outputs was required. I don't know what to do now?
    Please suggest Any alternatives...


  • Moderators

    [quote author="Udayaravi" date="1381398107"]
    Please suggest Any alternatives...
    [/quote]
    As sierdzio said:
    use an external lib for SVG rendering. Such as "LibRsvg":https://wiki.gnome.org/LibRsvg
    But i think this will probably rise new problems for a beginner...

    or QtWebkit if possible.

    Depending how you want to use the rendered svg in your application.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.