Board index FlightGear Development Canvas

Bundle Font with Aircraft  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.

Bundle Font with Aircraft

Postby xcvb » Sun Nov 27, 2016 6:29 pm

I'm not really happy with the available fonts in FlightGear so I wonder if there is a way to include the correct font (osifont-gpl2fe.ttf) in the directory of the aircraft (also GPL2). Is there a way that the font-mapper can find it?
xcvb
 
Posts: 122
Joined: Sat Mar 14, 2015 2:08 pm
Version: GIT
OS: Linux

Re: Bundle Font with Aircraft

Postby Thorsten » Sun Nov 27, 2016 6:34 pm

It'd be generally preferred to add the font to FGData if it is GPL. Though it is possible to include it with the aircraft, you just have to specify the path.
Thorsten
 
Posts: 11748
Joined: Mon Nov 02, 2009 8:33 am

Re: Bundle Font with Aircraft

Postby xcvb » Sun Nov 27, 2016 6:51 pm

I wonder how this should work. I tried the following:

Code: Select all
      var font_mapper = func(family, weight)
      {
         if(family == "'Liberation Sans'" and weight == "normal") {
            return "Aircraft/do328/Models/osifont-gpl2fe.ttf";
         }
      };

but then I get the following error:

canvas::Text: No such font: Aircraft/do328/Models/osifont-gpl2fe.ttf

If I copy the the font to the fgdata/Fonts folder then it works but this is not an optimal solution.
I cannot commit something to fgdata but if you are interested you can find it here: https://github.com/hikikomori82/osifont
xcvb
 
Posts: 122
Joined: Sat Mar 14, 2015 2:08 pm
Version: GIT
OS: Linux

Re: Bundle Font with Aircraft

Postby erik » Mon Nov 28, 2016 8:20 am

I'm almost certain I got that working at one day, before the font was moved tot FGData.
You might want to experiment with the path (omitting it entirely or removing Aircraft/do328)

Erik
erik
 
Posts: 1688
Joined: Thu Nov 01, 2007 1:41 pm

Re: Bundle Font with Aircraft

Postby sanhozay » Mon Nov 28, 2016 8:25 am

Long shot: it's not the old 1 vs l misspelling bug is it?
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 11:57 am
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Bundle Font with Aircraft

Postby xcvb » Mon Nov 28, 2016 7:42 pm

erik wrote in Mon Nov 28, 2016 8:20 am:I'm almost certain I got that working at one day, before the font was moved tot FGData.
You might want to experiment with the path (omitting it entirely or removing Aircraft/do328)

Erik


Do you know on which aircraft? If it was on git or svn maybe it is possible to recover an old version. I also placed it to "Aircraft/do328/osifont-gpl2fe.ttf" and also tried it with and without "Aircraft/do328/" but still no success.

sanhozay wrote in Mon Nov 28, 2016 8:25 am:Long shot: it's not the old 1 vs l misspelling bug is it?


I double checked it:

$ ls Aircraft/do328/osifont-gpl2fe.ttf
Aircraft/do328/osifont-gpl2fe.ttf
xcvb
 
Posts: 122
Joined: Sat Mar 14, 2015 2:08 pm
Version: GIT
OS: Linux

Re: Bundle Font with Aircraft

Postby erik » Sat Dec 03, 2016 11:39 am

xcvb wrote in Mon Nov 28, 2016 7:42 pm:Do you know on which aircraft? If it was on git or svn maybe it is possible to recover an old version. I also placed it to "Aircraft/do328/osifont-gpl2fe.ttf" and also tried it with and without "Aircraft/do328/" but still no success.


Sorry for the late response, I've been busy lately.
It was a local version before I committed it to FGAddon (of the paraglider).
To bad I don't seem to remember the details.

But if it's not working it would be worthwhile to have this option.

Erik
erik
 
Posts: 1688
Joined: Thu Nov 01, 2007 1:41 pm

Re: Bundle Font with Aircraft  

Postby TheTom » Sun Dec 11, 2016 6:50 pm

It should be possible to put the font in a 'Fonts' subdirectory of the aircraft and then just use the font's filename.
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 10:20 am

Re: Bundle Font with Aircraft

Postby xcvb » Sun Dec 11, 2016 9:57 pm

TheTom wrote in Sun Dec 11, 2016 6:50 pm:It should be possible to put the font in a 'Fonts' subdirectory of the aircraft and then just use the font's filename.

This works! Thank you very much! :D
xcvb
 
Posts: 122
Joined: Sat Mar 14, 2015 2:08 pm
Version: GIT
OS: Linux


Return to Canvas

Who is online

Users browsing this forum: No registered users and 3 guests