Board index FlightGear Development Canvas

Font adaption

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.

Font adaption

Postby Thorsten » Mon Dec 12, 2016 5:56 pm

Not sure whether this is a canvas question or not, but:

I have a monospace font. I'd like to use it to (optionally) replace LiberationMono-Bold.ttf ( the canvas default). I can load the other font by defining a font mapper - but the sizes doesn't match, the new font is too large, the display layout is screwed.

Now, for monospace fonts this ought to be a piece of cake with at most two numbers (scale of the glyph bounding box in x and y). ttf fundamentally is a vector description, so it ought to be as easy as that.

But I don't want to apply this scaling for each text element.

So I need some advice - can canvas do it at font loading time? Or how would I go about changing it with an offline tool mapping the bounding boxes to a different ttf file? Does anyone have experience with font manipulation? I've never worked with ttf, I just know how to create fonts for LaTeX, which is conceptually similar, but has a completely different toolchain.
Thorsten
 
Posts: 11327
Joined: Mon Nov 02, 2009 8:33 am

Re: Font adaption

Postby Johan G » Wed Dec 14, 2016 9:18 pm

Sorry for getting off topic, but...
Thorsten wrote in Mon Dec 12, 2016 5:56 pm:I've never worked with ttf, I just know how to create fonts for LaTeX [...]

...could I guess that you have made fonts for two particular constructed languages? :wink:
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: Font adaption

Postby Thorsten » Thu Dec 15, 2016 6:15 am

Yeah, I did that one back when I was a student with too much time on my hands:

Image
Thorsten
 
Posts: 11327
Joined: Mon Nov 02, 2009 8:33 am


Return to Canvas

Who is online

Users browsing this forum: No registered users and 1 guest