Board index FlightGear Development Canvas

Text in Inkscape  Topic is solved

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Text in Inkscape

Postby Gijs » Sat Feb 23, 2013 11:45 am

Hi,

just started porting the 744's lower EICAS to Canvas. All works fine, except for text. Somehow it seems to be very (very!) sensible to just about everything. If I change the object ID, adjust the colour, move the text, adjust the size (all in InkScape, so before loading the SVG file in FlightGear), most of the time the text no longer shows up in FlightGear.

What is the advised method to add text to SVG for Canvas?

Cheers,
Gijs

EDIT: Just found the problem (but no solution yet). For some reason, InkScape moves the text from y=475 to y=-522 when saving as SVG. Therefore, the text falls of the screen in FlightGear :?:
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9386
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Text in Inkscape

Postby TheTom » Sat Feb 23, 2013 11:55 am

That sounds very strange. I've created an EICAS display with inkscape and had no problems with text. If you give me a file which doesn't work I can have a look at it.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Text in Inkscape

Postby gooneybird » Sat Feb 23, 2013 12:02 pm

You could turn the text into a path, (Path - Object To Path), that way it will handled as a regular vector object.
gooneybird
 
Posts: 2971
Joined: Sat May 31, 2008 1:57 pm

Re: Text in Inkscape

Postby Gijs » Sat Feb 23, 2013 12:04 pm

@Thomas, I will email you the file.
@Gooneybird, right, but then I can no longer edit it as it looses the "text" status. And actually I just tried that: same issue.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9386
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Text in Inkscape

Postby gooneybird » Sat Feb 23, 2013 12:07 pm

Ok, I didn't realise you wanted it kept as text. :)
gooneybird
 
Posts: 2971
Joined: Sat May 31, 2008 1:57 pm

Re: Text in Inkscape  

Postby TheTom » Sat Feb 23, 2013 1:52 pm

Seems like you are using a scale transformation which the SVG parser hasn't recognized yet. I've pushed a fix for this (and another bug I've found by rechecking the parser) to git.

Note to myself, and maybe others with strange output: Have a look at the log/console output:

['unknown transform', 'scale', [1, -1]]
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Text in Inkscape

Postby Gijs » Sat Feb 23, 2013 2:01 pm

Oops, should've checked the console :oops:
I didn't add these scales on purpose, so maybe my method is still the real culprit?

At least your fix seems to make them visible again.Thanks!

Did notice another issues though. Only the last line of multi-line textblocks is shown. Getting these errors in the console, but they maybe unrelated:
Code: Select all
parsesvg: skipping unknown element 'sodipodi:namedview'
parsesvg: skipping unknown element 'metadata'
parsesvg: skipping unknown element 'defs'
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9386
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Text in Inkscape

Postby TheTom » Sat Feb 23, 2013 2:09 pm

Gijs wrote in Sat Feb 23, 2013 2:01 pm:I didn't add these scales on purpose, so maybe my method is still the real culprit?

Inkscape likes to create strange transformation hierarchies. It doesn't really matter for rendering, but you will get unnecessary transforms and won't see the same coordinates than used inside Inkscape, due to the additional transforms applied.

Sometimes I clean up my SVGs manually, but it doesn't really matter. I just want to parser to get as robust as possible :)

Gijs wrote in Sat Feb 23, 2013 2:01 pm:Did notice another issues though. Only the last line of multi-line textblocks is shown.

/* edit */ I've now pushed an update which improves handling text elements, and among other things supports multi-line textblocks.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Text in Inkscape

Postby Johan G » Mon Feb 25, 2013 10:29 pm

Speaking of transformations I have noted that (at least) in the previous version, manipulating simple two-node straight lines would dramatically change their appearance if exported to PDF unless the only were manipulated only using the node tool. In essence, extending a line would make it wider if using the "arrow". Extending it more would make it even wider.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5546
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit

Re: Text in Inkscape

Postby Philosopher » Mon Feb 25, 2013 11:02 pm

That's configurable, Johan, in the toolbar towards the right when you have it selected using the F1 tool, there are some settings like "scale line width with size" that you might want to play with ;). You'll have to use the mouse-hover-tooltip to decode them as they have rather obscure icons that I don't remember ATM.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Text in Inkscape

Postby Johan G » Fri Mar 01, 2013 10:16 pm

I don't know whether I had that enabled or not, but I do know that I did not see a changed line size when working in Inkscape, the change was visible only in the exported file. :?
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5546
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit


Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest