Difference between revisions of "Howto:Creating a Font Browser using Nasal and Canvas"

From FlightGear wiki
Jump to: navigation, search
(https://forum.flightgear.org/viewtopic.php?f=37&t=36946)
 
m (https://forum.flightgear.org/viewtopic.php?f=37&t=36946&p=362269#p362150)
Line 1: Line 1:
 
{{Stub}}
 
{{Stub}}
 +
 +
== Background ==
 +
No easy way to browse a list of available fonts in the base package
 +
 +
== Idea ==
 +
Implement a simple font browser using Nasal and Canvas
 +
 +
== Approach ==
 +
since FlightGear uses OpenSceneGraph, and since [http://www.openscenegraph.org/index.php/documentation/user-guides/61-osgplugins OSG supports TXF ],  we might use Nasal/Canvas to display a list of fonts and even preview them inside fgfs (?)
 +
 +
To see for yourself, modify the Canvas image example to point to a font file:
 +
 +
* [[Canvas_Snippets#Adding_Raster_Images]]
 +
* [[Canvas_Image]]
 +
 +
If this works, this can be trivially extended to show a list of all fonts including a preview, by adapting this snippet: [[Canvas_Snippets#Canvas_ScrollArea]]
 +
 +
Alternatively, it would be possible to render the menubar completely using the Canvas system: [[Howto:Making_a_Canvas_Menubar]]

Revision as of 07:02, 24 February 2020

This article is a stub. You can help the wiki by expanding it.

Background

No easy way to browse a list of available fonts in the base package

Idea

Implement a simple font browser using Nasal and Canvas

Approach

since FlightGear uses OpenSceneGraph, and since OSG supports TXF , we might use Nasal/Canvas to display a list of fonts and even preview them inside fgfs (?)

To see for yourself, modify the Canvas image example to point to a font file:

If this works, this can be trivially extended to show a list of all fonts including a preview, by adapting this snippet: Canvas_Snippets#Canvas_ScrollArea

Alternatively, it would be possible to render the menubar completely using the Canvas system: Howto:Making_a_Canvas_Menubar