Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Font creation on Linux
#1
The "create font" command doesn't work on Linux (yet). But there are two tools in the tools/font_tools folder with which you can create naalaa fonts.

font_ed let's you draw fonts from scratch. The default font and the fonts for NED were created with this tool. It's pretty hard work though Smile

bmfont_converter let's you convert fonts from a standard bitmap font format to naalaa's own format. There are some tools available for creating this type of fonts, but I'm not sure if they're available for Linux. This online tool seems to work though:

http://kvazars.com/littera/

There are lots of buttons and thingies to press, but I just went for the "Export" button directly to see if it worked, and it did.

Once you've downloaded the generated zip file, extract the files, (font.fnt and font.png), somewhere. Launch naalaa's bmfont_converter, press "Load FNT file" and select the extracted font.fnt. You should then see some sample text printed in the window.

[Image: bmfont_converter.png]

Click "Export font" and give the font a name, such as "my_font". This generates "my_font.txt" and "my_font.png". Now you have a font that works in naalaa!

In your naalaa program, you can load the font with:

Code:
load font 0, "my_font.txt", "my_font.png"

I haven't messed around with the online tool yet. But there seems to be lots of settings for gradients, shadows, strokes and stuff, very handy Smile


Edit  I guess bmfont_conveter could be useful on Windows too, since most tools that generate this type of fonts have many cool built in effects.
Reply
#2
If anyone with a working Windows computer and the latest version of naalaa (1.0.3) could give this a shot, I'd be very happy Smile

I've attached bmfont_converter from the Linux version.

Can bmfont_converter.txt be compiled and executed? If not, try to recompile the included NEDGUI.txt as a library (F8). Then try with bmfont_converter again. If it works, there's a test font in fnt format in the test_font folder that you can load and convert (see the above post for instructions).

I'm not sure if libraries compiled on Linux works on Windows and the other way around, never tried, that's why you may need to recompile NEDGUI.

Edit When I think about it, NEDGUI probably uses constants from Keycodes.lib that aren't defined on Window. But I'm not sure.


Attached Files
.zip   bmfont_converter.zip (Size: 191.45 KB / Downloads: 4)
Reply
#3
(04-28-2018, 09:47 AM)Marcus Wrote: If anyone with a working Windows computer and the latest version of naalaa (1.0.3) could give this a shot, I'd be very happy Smile

I've attached bmfont_converter from the Linux version.

Can bmfont_converter.txt be compiled and executed? If not, try to recompile the included NEDGUI.txt as a library (F8). Then try with bmfont_converter again. If it works, there's a test font in fnt format in the test_font folder that you can load and convert (see the above post for instructions).

I'm not sure if libraries compiled on Linux works on Windows and the other way around, never tried, that's why you may need to recompile NEDGUI.

Edit  When I think about it, NEDGUI probably uses constants from Keycodes.lib that aren't defined on Window. But I'm not sure.

  Windows has problems with this one. It will take a long study of NedGui to figure out what is going on.

Thanks for the puzzle. NEDGUI looks like an interesting read.
Reply
#4
Getting NEDGUI to work on Windows is probably not worth the effort. Or maybe it is, but for being an effort, it would be pretty big Smile

Anyhow, if you want to create naalaa fonts from fnt files on Windows, you can compile and use the attached program. If you run the program from the command prompt, the syntax is:

Code:
fnt2txt <source fnt filename> <destination txt filename>

If you run it with the included test fnt-file (font.fnt and font.png) to create a naalaa font named my_font (my_font.txt and my_font.png):

Code:
fnt2txt font.fnt my_font


You can also run the program without arguments. In that case two file dialogs are shown, the first one for selecting the input file (fnt), and the other one for selecting the destination filename (txt).

As I wrote in the first post, http://kvazars.com/littera/ is a great online tool for creating fonts in fnt format. You can also use this tool on Windows:

http://www.angelcode.com/products/bmfont/

It supports unicode, but when converted to naalaa fonts all but the characters included in extended ASCII will be stripped out. The online tool actually is a bit more user friendly.


Attached Files
.zip   fnt2txt.zip (Size: 54.51 KB / Downloads: 3)
Reply
#5
OK...
 
 That works, ( as long as you get the file names right)

 Now I need to practice making fonts for my programs, so they will run with Linux and Windows.
Reply
#6
(05-05-2018, 03:46 PM)Rick3137 Wrote: OK...
 
 That works, ( as long as you get the file names right)

 Now I need to practice making fonts for my programs, so they will run with Linux and Windows.

Glad it works Smile
Reply
#7
Just as an aside, although may not be directly related, Windows fonts can be installed on Linux. If you are using Ubuntu (or any of it's offshoots) the repository has "ttf-mscorefonts-installer". It won't include 'all' of MS fonts but will give you the "core" fonts.

J
Reply
#8
I get confused real easy.  Too many font formats.

 That last program made fonts, but Windows did not like it, ( or I did something wrong). Time will tell.

 I ended up with a file called  Font.fnt that looked like this:

Code:
<font>
 <info face="font" size="32" bold="0" italic="0" charset="" unicode="" stretchH="100" smooth="1" aa="1" padding="2,2,2,2" spacing="0,0" outline="0"/>
 <common lineHeight="36" base="25" scaleW="162" scaleH="504" pages="1" packed="0"/>
 <pages>
   <page id="0" file="font.png"/>
 </pages>
 <chars count="80">
   <char id="97" x="2" y="2" width="22" height="24" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="98" x="2" y="28" width="21" height="30" xoffset="2" yoffset="2" xadvance="18" page="0" chnl="15"/>
   <char id="99" x="2" y="60" width="21" height="24" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15"/>
   <char id="100" x="2" y="86" width="21" height="30" xoffset="1" yoffset="2" xadvance="18" page="0" chnl="15"/>
   <char id="101" x="2" y="118" width="22" height="24" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="102" x="25" y="28" width="16" height="30" xoffset="0" yoffset="2" xadvance="9" page="0" chnl="15"/>
   <char id="103" x="25" y="60" width="21" height="30" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="104" x="43" y="2" width="20" height="29" xoffset="2" yoffset="2" xadvance="18" page="0" chnl="15"/>
   <char id="105" x="2" y="144" width="9" height="29" xoffset="2" yoffset="2" xadvance="7" page="0" chnl="15"/>
   <char id="106" x="2" y="175" width="13" height="36" xoffset="-1" yoffset="2" xadvance="7" page="0" chnl="15"/>
   <char id="107" x="13" y="144" width="20" height="29" xoffset="2" yoffset="2" xadvance="16" page="0" chnl="15"/>
   <char id="108" x="26" y="92" width="9" height="29" xoffset="2" yoffset="2" xadvance="7" page="0" chnl="15"/>
   <char id="109" x="43" y="33" width="29" height="23" xoffset="2" yoffset="8" xadvance="27" page="0" chnl="15"/>
   <char id="110" x="65" y="2" width="20" height="23" xoffset="2" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="111" x="2" y="213" width="22" height="24" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="112" x="17" y="175" width="21" height="30" xoffset="2" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="113" x="35" y="123" width="21" height="30" xoffset="1" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="114" x="26" y="2" width="15" height="23" xoffset="2" yoffset="8" xadvance="11" page="0" chnl="15"/>
   <char id="115" x="37" y="92" width="20" height="24" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15"/>
   <char id="116" x="48" y="58" width="14" height="29" xoffset="1" yoffset="3" xadvance="9" page="0" chnl="15"/>
   <char id="117" x="2" y="239" width="20" height="23" xoffset="2" yoffset="8" xadvance="18" page="0" chnl="15"/>
   <char id="118" x="2" y="264" width="22" height="23" xoffset="0" yoffset="8" xadvance="16" page="0" chnl="15"/>
   <char id="119" x="24" y="239" width="29" height="23" xoffset="0" yoffset="8" xadvance="23" page="0" chnl="15"/>
   <char id="120" x="26" y="207" width="22" height="23" xoffset="0" yoffset="8" xadvance="16" page="0" chnl="15"/>
   <char id="121" x="40" y="155" width="22" height="30" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15"/>
   <char id="122" x="58" y="118" width="21" height="23" xoffset="1" yoffset="8" xadvance="16" page="0" chnl="15"/>
   <char id="65" x="50" y="187" width="28" height="29" xoffset="0" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="66" x="64" y="143" width="24" height="29" xoffset="2" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="67" x="64" y="58" width="27" height="30" xoffset="2" yoffset="2" xadvance="23" page="0" chnl="15"/>
   <char id="68" x="74" y="27" width="25" height="29" xoffset="2" yoffset="2" xadvance="23" page="0" chnl="15"/>
   <char id="69" x="81" y="90" width="23" height="29" xoffset="3" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="70" x="93" y="58" width="22" height="29" xoffset="3" yoffset="2" xadvance="20" page="0" chnl="15"/>
   <char id="71" x="101" y="2" width="27" height="30" xoffset="2" yoffset="2" xadvance="25" page="0" chnl="15"/>
   <char id="72" x="2" y="289" width="24" height="29" xoffset="3" yoffset="2" xadvance="23" page="0" chnl="15"/>
   <char id="73" x="2" y="320" width="9" height="29" xoffset="3" yoffset="2" xadvance="9" page="0" chnl="15"/>
   <char id="74" x="2" y="351" width="19" height="30" xoffset="1" yoffset="2" xadvance="16" page="0" chnl="15"/>
   <char id="75" x="13" y="320" width="25" height="29" xoffset="2" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="76" x="28" y="264" width="21" height="29" xoffset="2" yoffset="2" xadvance="18" page="0" chnl="15"/>
   <char id="77" x="2" y="383" width="28" height="29" xoffset="2" yoffset="2" xadvance="27" page="0" chnl="15"/>
   <char id="78" x="23" y="351" width="24" height="29" xoffset="2" yoffset="2" xadvance="23" page="0" chnl="15"/>
   <char id="79" x="40" y="295" width="28" height="30" xoffset="2" yoffset="2" xadvance="25" page="0" chnl="15"/>
   <char id="80" x="51" y="264" width="24" height="29" xoffset="2" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="81" x="55" y="218" width="29" height="31" xoffset="1" yoffset="2" xadvance="25" page="0" chnl="15"/>
   <char id="82" x="80" y="174" width="26" height="29" xoffset="3" yoffset="2" xadvance="23" page="0" chnl="15"/>
   <char id="83" x="90" y="121" width="25" height="30" xoffset="1" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="84" x="106" y="89" width="25" height="29" xoffset="1" yoffset="2" xadvance="20" page="0" chnl="15"/>
   <char id="85" x="117" y="34" width="24" height="30" xoffset="3" yoffset="2" xadvance="23" page="0" chnl="15"/>
   <char id="86" x="130" y="2" width="28" height="29" xoffset="0" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="87" x="2" y="414" width="36" height="29" xoffset="0" yoffset="2" xadvance="30" page="0" chnl="15"/>
   <char id="88" x="32" y="382" width="28" height="29" xoffset="0" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="89" x="49" y="327" width="27" height="29" xoffset="0" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="90" x="70" y="295" width="24" height="29" xoffset="1" yoffset="2" xadvance="20" page="0" chnl="15"/>
   <char id="33" x="77" y="251" width="10" height="29" xoffset="3" yoffset="2" xadvance="9" page="0" chnl="15"/>
   <char id="8470" x="86" y="205" width="37" height="29" xoffset="3" yoffset="2" xadvance="34" page="0" chnl="15"/>
   <char id="59" x="108" y="153" width="10" height="27" xoffset="3" yoffset="8" xadvance="9" page="0" chnl="15"/>
   <char id="37" x="117" y="120" width="31" height="30" xoffset="2" yoffset="2" xadvance="28" page="0" chnl="15"/>
   <char id="58" x="28" y="295" width="10" height="23" xoffset="3" yoffset="8" xadvance="9" page="0" chnl="15"/>
   <char id="63" x="120" y="152" width="21" height="29" xoffset="1" yoffset="2" xadvance="18" page="0" chnl="15"/>
   <char id="42" x="59" y="90" width="18" height="16" xoffset="0" yoffset="2" xadvance="12" page="0" chnl="15"/>
   <char id="40" x="133" y="66" width="14" height="36" xoffset="2" yoffset="2" xadvance="11" page="0" chnl="15"/>
   <char id="41" x="89" y="236" width="14" height="36" xoffset="2" yoffset="2" xadvance="11" page="0" chnl="15"/>
   <char id="95" x="77" y="282" width="25" height="8" xoffset="0" yoffset="29" xadvance="18" page="0" chnl="15"/>
   <char id="43" x="49" y="358" width="21" height="21" xoffset="2" yoffset="6" xadvance="19" page="0" chnl="15"/>
   <char id="45" x="90" y="153" width="15" height="9" xoffset="1" yoffset="15" xadvance="11" page="0" chnl="15"/>
   <char id="61" x="108" y="183" width="21" height="16" xoffset="2" yoffset="9" xadvance="19" page="0" chnl="15"/>
   <char id="46" x="64" y="174" width="9" height="9" xoffset="3" yoffset="22" xadvance="9" page="0" chnl="15"/>
   <char id="44" x="133" y="104" width="10" height="14" xoffset="3" yoffset="22" xadvance="9" page="0" chnl="15"/>
   <char id="47" x="143" y="33" width="15" height="30" xoffset="0" yoffset="2" xadvance="9" page="0" chnl="15"/>
   <char id="124" x="149" y="65" width="9" height="36" xoffset="3" yoffset="2" xadvance="8" page="0" chnl="15"/>
   <char id="34" x="145" y="104" width="15" height="14" xoffset="1" yoffset="2" xadvance="11" page="0" chnl="15"/>
   <char id="39" x="87" y="2" width="10" height="14" xoffset="1" yoffset="2" xadvance="6" page="0" chnl="15"/>
   <char id="64" x="2" y="445" width="36" height="36" xoffset="2" yoffset="2" xadvance="32" page="0" chnl="15"/>
   <char id="35" x="40" y="413" width="23" height="30" xoffset="0" yoffset="2" xadvance="18" page="0" chnl="15"/>
   <char id="36" x="40" y="445" width="22" height="35" xoffset="1" yoffset="0" xadvance="18" page="0" chnl="15"/>
   <char id="94" x="2" y="483" width="20" height="19" xoffset="1" yoffset="2" xadvance="15" page="0" chnl="15"/>
   <char id="38" x="62" y="381" width="25" height="30" xoffset="1" yoffset="2" xadvance="21" page="0" chnl="15"/>
   <char id="123" x="78" y="326" width="15" height="36" xoffset="1" yoffset="2" xadvance="11" page="0" chnl="15"/>
   <char id="125" x="64" y="445" width="15" height="36" xoffset="1" yoffset="2" xadvance="11" page="0" chnl="15"/>
   <char id="91" x="81" y="413" width="13" height="35" xoffset="2" yoffset="2" xadvance="9" page="0" chnl="15"/>
   <char id="93" x="89" y="364" width="12" height="35" xoffset="1" yoffset="2" xadvance="9" page="0" chnl="15"/>
   <char id="32" x="0" y="0" width="0" height="0" xoffset="1" yoffset="2" xadvance="9" page="0" chnl="15"/>
 </chars>
 <kernings count="96">
   <kerning first="32" second="65" amount="-2"/>
   <kerning first="32" second="84" amount="-1"/>
   <kerning first="32" second="89" amount="-1"/>
   <kerning first="65" second="32" amount="-2"/>
   <kerning first="65" second="84" amount="-2"/>
   <kerning first="65" second="86" amount="-2"/>
   <kerning first="65" second="87" amount="-1"/>
   <kerning first="65" second="89" amount="-2"/>
   <kerning first="65" second="118" amount="-1"/>
   <kerning first="65" second="119" amount="-1"/>
   <kerning first="65" second="121" amount="-1"/>
   <kerning first="70" second="44" amount="-4"/>
   <kerning first="70" second="46" amount="-4"/>
   <kerning first="70" second="65" amount="-2"/>
   <kerning first="76" second="32" amount="-1"/>
   <kerning first="76" second="84" amount="-2"/>
   <kerning first="76" second="86" amount="-2"/>
   <kerning first="76" second="87" amount="-2"/>
   <kerning first="76" second="89" amount="-2"/>
   <kerning first="76" second="121" amount="-1"/>
   <kerning first="80" second="32" amount="-1"/>
   <kerning first="80" second="44" amount="-4"/>
   <kerning first="80" second="46" amount="-4"/>
   <kerning first="80" second="65" amount="-2"/>
   <kerning first="82" second="84" amount="-1"/>
   <kerning first="82" second="86" amount="-1"/>
   <kerning first="82" second="87" amount="-1"/>
   <kerning first="82" second="89" amount="-1"/>
   <kerning first="84" second="32" amount="-1"/>
   <kerning first="84" second="44" amount="-4"/>
   <kerning first="84" second="45" amount="-2"/>
   <kerning first="84" second="46" amount="-4"/>
   <kerning first="84" second="58" amount="-4"/>
   <kerning first="84" second="59" amount="-4"/>
   <kerning first="84" second="65" amount="-2"/>
   <kerning first="84" second="79" amount="-1"/>
   <kerning first="84" second="97" amount="-4"/>
   <kerning first="84" second="99" amount="-4"/>
   <kerning first="84" second="101" amount="-4"/>
   <kerning first="84" second="105" amount="-1"/>
   <kerning first="84" second="111" amount="-4"/>
   <kerning first="84" second="114" amount="-1"/>
   <kerning first="84" second="115" amount="-4"/>
   <kerning first="84" second="117" amount="-1"/>
   <kerning first="84" second="119" amount="-2"/>
   <kerning first="84" second="121" amount="-2"/>
   <kerning first="86" second="44" amount="-3"/>
   <kerning first="86" second="45" amount="-2"/>
   <kerning first="86" second="46" amount="-3"/>
   <kerning first="86" second="58" amount="-1"/>
   <kerning first="86" second="59" amount="-1"/>
   <kerning first="86" second="65" amount="-2"/>
   <kerning first="86" second="97" amount="-2"/>
   <kerning first="86" second="101" amount="-2"/>
   <kerning first="86" second="105" amount="-1"/>
   <kerning first="86" second="111" amount="-2"/>
   <kerning first="86" second="114" amount="-1"/>
   <kerning first="86" second="117" amount="-1"/>
   <kerning first="86" second="121" amount="-1"/>
   <kerning first="87" second="44" amount="-2"/>
   <kerning first="87" second="45" amount="-1"/>
   <kerning first="87" second="46" amount="-2"/>
   <kerning first="87" second="58" amount="-1"/>
   <kerning first="87" second="59" amount="-1"/>
   <kerning first="87" second="65" amount="-1"/>
   <kerning first="87" second="97" amount="-1"/>
   <kerning first="87" second="101" amount="-1"/>
   <kerning first="87" second="105" amount="0"/>
   <kerning first="87" second="111" amount="-1"/>
   <kerning first="87" second="114" amount="-1"/>
   <kerning first="87" second="117" amount="-1"/>
   <kerning first="87" second="121" amount="0"/>
   <kerning first="89" second="32" amount="-1"/>
   <kerning first="89" second="44" amount="-4"/>
   <kerning first="89" second="45" amount="-3"/>
   <kerning first="89" second="46" amount="-4"/>
   <kerning first="89" second="58" amount="-2"/>
   <kerning first="89" second="59" amount="-2"/>
   <kerning first="89" second="65" amount="-2"/>
   <kerning first="89" second="97" amount="-2"/>
   <kerning first="89" second="101" amount="-3"/>
   <kerning first="89" second="105" amount="-1"/>
   <kerning first="89" second="111" amount="-3"/>
   <kerning first="89" second="112" amount="-2"/>
   <kerning first="89" second="113" amount="-3"/>
   <kerning first="89" second="117" amount="-2"/>
   <kerning first="89" second="118" amount="-2"/>
   <kerning first="102" second="102" amount="-1"/>
   <kerning first="114" second="44" amount="-2"/>
   <kerning first="114" second="46" amount="-2"/>
   <kerning first="118" second="44" amount="-2"/>
   <kerning first="118" second="46" amount="-2"/>
   <kerning first="119" second="44" amount="-2"/>
   <kerning first="119" second="46" amount="-2"/>
   <kerning first="121" second="44" amount="-2"/>
   <kerning first="121" second="46" amount="-2"/>
 </kernings>
</font>
  
   What windows NaaLaa wanted was something like this:
Code:
0 1 5
2 2 2
1 6 0
0 12 0
1 9 2
1 17 1
1 13 0
1 2 1
1 5 1
1 5 1
0 8 0
1 10 1
2 2 2
0 6 1
2 2 2
0 6 0
1 10 1
2 6 4
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
2 2 2
2 2 2
1 10 1
1 10 1
1 10 1
1 10 1
1 19 1
0 13 0
2 11 1
1 13 1
2 12 1
2 11 1
2 10 1
1 14 1
1 12 1
2 2 2
1 8 2
2 12 0
2 9 1
1 15 1
1 12 1
1 14 1
2 11 1
1 14 1
2 12 1
1 12 1
0 12 0
1 12 1
0 13 0
0 21 0
0 14 0
0 14 0
0 12 1
1 4 1
0 6 0
1 4 1
0 8 0
0 12 0
1 3 3
1 10 1
1 9 1
1 9 1
1 9 1
1 10 1
0 7 -1
1 9 1
1 9 1
1 2 2
-1 4 1
1 9 0
1 2 1
1 14 1
1 9 1
1 10 1
1 9 1
1 9 1
1 6 0
1 9 1
0 5 1
1 9 1
0 11 0
-1 17 -1
0 10 0
1 9 1
0 9 0
0 6 1
2 2 2
1 6 0
1 10 1
2 11 3
0 11 1
2 11 3
1 2 2
0 11 1
1 5 1
2 16 3
1 10 1
1 10 1
0 8 -1
0 21 0
1 12 1
1 5 1
1 19 1
2 11 3
0 12 1
2 11 3
2 11 3
1 2 2
1 2 2
1 5 1
1 5 1
1 5 1
0 12 0
0 21 0
0 7 0
2 15 4
1 9 1
1 5 1
1 18 1
2 11 3
0 9 0
0 14 0
0 1 5
2 2 2
1 10 1
0 11 1
1 10 1
0 12 0
2 2 2
1 10 1
1 6 0
0 15 0
0 7 0
1 9 2
1 10 1
0 6 1
0 15 0
-1 13 0
1 6 1
1 10 1
0 6 1
0 6 1
2 3 2
1 9 1
0 11 0
2 2 3
1 5 1
1 4 2
0 8 0
2 9 1
2 16 0
2 16 0
0 18 0
2 9 2
0 13 0
0 13 0
0 13 0
0 13 0
0 13 0
0 13 0
-1 21 1
1 13 1
2 11 1
2 11 1
2 11 1
2 11 1
1 3 2
2 3 1
-1 8 -1
0 6 0
0 14 1
1 12 1
1 14 1
1 14 1
1 14 1
1 14 1
1 14 1
1 9 2
1 14 1
1 12 1
1 12 1
1 12 1
1 12 1
0 14 0
2 11 1
2 11 0
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 17 1
1 9 1
1 10 1
1 10 1
1 10 1
1 10 1
1 3 2
2 3 1
-1 8 -1
0 6 0
1 10 1
1 9 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 10 1
1 9 1
1 9 1
1 9 1
1 9 1
1 9 1
1 10 1
1 9 1
24

I went back to the NaaLaa examples and came up with something that does work.

  Here's a snippit that makes code that prints on Windows:

set window 0, 0, 1200, 700
set redraw off
set color 250,250,250
cls
     
  create font 0, "arial", 24
   save font 0,  "arial24.txt", "arial24.bmp"
redraw
wait keydown
end

 Here's the part that prints it:

set window 0, 0, 1200, 700
set redraw off
set color 250,250,250
cls
set color 0,0,0     
   load font 0, "arial24.txt", "arial24.bmp"
   set font 0
    set caret 20, 100
    wln " a b c d e f g h i j k l m n o p q r s t u v w x y z "
    wln
    wln " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "
    set caret 20, 200
 
redraw
wait keydown
end
Reply
#9
The thing is that you can't use 'create font' on Linux (yet). Instead you gotta load a pre-made font with 'load font'. 

Creating a font with 'create font' on Windows and then saving it with 'save font', just like you show, creates a font (txt + png) that can be loaded with 'load font' on both Linux and Windows.

But if you don't have a Windows computer or just want to create cooler looking fonts, you can use the programs I've linked to to create fonts in a commonly used bitmap format (fnt + png). Then you can use the tools I've written to convert those fonts to naalaa's format (txt + png) that can be loaded with 'load font'.

When you use my tools for converting, it creates a NEW png file and a txt file. So don't use the same filename for the destination font.

It's confusing, I admit Smile

Edit There is a default font on Linux that's baked into every compiled program. So even if you don't load a font, you can still output text. This font was made by me, but it resembles and has the same size as Courier New (which is the default font on Windows).
Reply
#10
Naalaa fonts can be saved as single binary files too, by the way. 

Code:
create font 0, "arial", 24
save font 0, "my_font.bin"

Code:
load font 0, "my_font.bin"

This works with fonts that you've loaded from the two-files format (txt + png) too. So if you've created a font with any of the tools that I posted links to and converted it to naalaa's format (txt + png), you can load it in a naalaa program, save it as a binary file and throw away the txt and png files.

That probably didn't make things less complicated.

The reason that naalaa even HAS a two-files format and not just the binary one is that I like adding effects to my fonts in The GIMP Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)