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

Jump to navigation Jump to search
m
Line 49: Line 49:
     .setSize(130, 130); # size of the image
     .setSize(130, 130); # size of the image
</syntaxhighlight>
</syntaxhighlight>
== Next ==
We can adapt the code by using a layout with a vertical scrollArea, so one image per font file can be added/shown.
To populate the vector of file names, we can use the [[Nasal_library#directory.28.29|directory()]] API:
<syntaxhighlight lang="nasal">
var fgroot = getprop("/sim/fg-root");
var font_dir = fgroot ~ "/Fonts/";
var files = directory(font_dir);
debug.dump( files );
<syntaxhighlight>


== See also ==
== See also ==

Navigation menu