Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fomts
#1
Ah, fonts. Gotta love 'em.

I am posting this problem in 'this' forum because, as you are well aware, the creating of fonts with Linux does not work the same as for Windows... yet... lol

The following is a list of steps taken to 'create' a font... perhaps 'convert' would be a better choice?

1. Goto https://snowb.org (this will start the online bitmap font converter)
2. Beneath the top menu bar, double-click "unnamed", to the font name of your choice (no extensions)
3. Far right of screen, click 'colour', select colour of choice.
4. Click "Add Font File" and navigate to the True Type Font of your choice.
5. Beneath "Add Font" change the font size as required.
6. All other settings (for me) can be left 'as is'.
7. Top menu bar, click 'Export'
8. Click 'save'. The 'zip' file should be placed in the 'Downloads' folder.
9. Extract the 'zip' file into a folder of choice. should produce 'filename.png' and 'filename.fnt')

The next steps will require the 'Tools' folder from N6...

10. Navigate to N6's 'tools' folder then the sub-folder 'font-tools'
11. Execute 'bmfont_converter'
12. Click 'Load FNT File'
13. Navigate to the extracted files (step 9) and select 'filename.fnt'.
14. Click 'Export'
15. For convenience, export to the same folder as 'step 9', just to keep all files together.
16. Enter a font name. A file extension of '.txt' will automatically be added.
(N7 will require 'filename.txt' and 'filename.png')

Using the above steps, all three files were created successfully. (see attached - ttf file included)

This is the 'test' file I used.

Code:
set window "Font Test", 640, 480
set color 0, 0, 0
cls

load font 0, "arial.txt", "arial.png"
set font 0

set color 255, 128, 0
wln "Testing"

redraw

wait 3000
cls
end

The program failed: n7: font_test.n7:5: error: Unexpected character ','


Attached Files
.zip   arial.zip (Size: 248.24 KB / Downloads: 3)
May your journey be free of incident.
Live long and prosper.
Reply
#2
Use:

Code:
load font 0, "arial"

or:

Code:
myfont = loadfont("arial")

Yes, one might wonder if I made some changes from n6 just to annoy people Smile
Reply
#3
Both methods worked like a charm... Will test with other fonts... Thank you for the assist. Much appreciated.

If memory serves correctly, using N6, new fonts were stored in the N6 font folder? N7 does not have a font folder. Can I assume that the .fnt and the .txt files would have to be in the same directory as the .n7 file?
May your journey be free of incident.
Live long and prosper.
Reply
#4
Loading a font is just like loading an image or a sound effect. If you keep your program's images and sounds files in a folder named 'boop', next to your program's n7/exe file, you can put the two font files (txt and png) there too and load the font with: myFont = loadfont("boop/arial")
Reply
#5
Cool... Thank you.
May your journey be free of incident.
Live long and prosper.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)