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 7: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: 132
Joined: Sat Mar 14, 2015 3:08 pm
Version: Next
OS: Fedora Kinoite

Re: Bundle Font with Aircraft

Postby Thorsten » Sun Nov 27, 2016 7: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Bundle Font with Aircraft

Postby xcvb » Sun Nov 27, 2016 7: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: 132
Joined: Sat Mar 14, 2015 3:08 pm
Version: Next
OS: Fedora Kinoite

Re: Bundle Font with Aircraft

Postby erik » Mon Nov 28, 2016 9: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
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2248
Joined: Thu Nov 01, 2007 2:41 pm

Re: Bundle Font with Aircraft

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

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

Re: Bundle Font with Aircraft

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

erik wrote in Mon Nov 28, 2016 9: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 9: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: 132
Joined: Sat Mar 14, 2015 3:08 pm
Version: Next
OS: Fedora Kinoite

Re: Bundle Font with Aircraft

Postby erik » Sat Dec 03, 2016 12:39 pm

xcvb wrote in Mon Nov 28, 2016 8: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
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2248
Joined: Thu Nov 01, 2007 2:41 pm

Re: Bundle Font with Aircraft  

Postby TheTom » Sun Dec 11, 2016 7: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 11:20 am

Re: Bundle Font with Aircraft

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

TheTom wrote in Sun Dec 11, 2016 7: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: 132
Joined: Sat Mar 14, 2015 3:08 pm
Version: Next
OS: Fedora Kinoite


Return to Canvas

Who is online

Users browsing this forum: No registered users and 4 guests