(07-21-2025, 11:39 AM)hsiangch_ong Wrote: thank you for this example. job well done!
Thank you!
(07-21-2025, 11:39 AM)hsiangch_ong Wrote: but how many times did you have to compile this program? on my computer. the 3.8mib file took a few minutes to complete. yes it works on linux without modification.
As is, the program is over 67,000 lines long, so it can take a while to compile.
This is only because the font definitions are in the source code.
This can be modified to instead have the font definitions saved in one or more separate files,
either as a text file or a binary format.
For an example of binary, see bplus's character editor example:
https://qb64phoenix.com/forum/showthread...h+Ascii%22
(07-21-2025, 11:39 AM)hsiangch_ong Wrote: i don't think it's a "standard" c64 character set. it has some weird characters. which don't follow a certain order. such as the four to create a circle in 2x2 grid. also there is no "open" trebol. the other "open" playing card symbols were consecutive. but then suddenly the filled-in trebol with them. (eh maybe that should be "club". "trebol" is what it's called in spanish.)
I said it was -based on- the C64 PETSCII character set, it's not an exact reproduction. If you want that, you'll need to edit the characters to match the ASCII order and all that of the real CBM character set.
(07-21-2025, 11:39 AM)hsiangch_ong Wrote: it's odd that you demonstrated an example of a font. which is taller in pixels than it is wide.
The default font in DOS and QB64/QB64PE screen 0 text mode is 8 pixels wide x 16 pixels high. The default font on the C64 is 8 pixels wide by 8 pixels high.
So this example has both kinds of those, from 8 pixels wide up to 64 pixels wide (the biggest 1:2 ration font is 32x64 pixels).
If you don't want to use the 1:2 ration fonts, you can just remove them and modify the code to just use the 1:1 ratio fonts.
You will need to modify Function GetTiles$ to comment out the portions in the If/Then that handle the 1:2 ration fonts, these lines:
Code: (Select All)
ElseIf iFontWidth% = 8 And iFontHeight% = 16 Then
sCode = "GetTileText8x16"
GetTileText8x16 arrTileText()
iBytesPerLine = 1
...
ElseIf iFontWidth% = 16 And iFontHeight% = 32 Then
sCode = "GetTileText16x32"
GetTileText16x32 arrTileText()
iBytesPerLine = 2
...
ElseIf iFontWidth% = 32 And iFontHeight% = 64 Then
sCode = "GetTileText32x64"
GetTileText32x64 arrTileText()
iBytesPerLine = 8
and add your own portion for 12x12, like:
Code: (Select All)
ElseIf iFontWidth% = 12 And iFontHeight% = 12 Then
sCode = "GetTileText12x12"
GetTileText12x12 arrTileText()
iBytesPerLine = 2
If you just want 12x12, then you should comment out all those except for the 12x12 block you add.
Then you need to add your own tile definition function
Code: (Select All)
Sub GetTileText12x12 (arrTileText() As String)
(07-21-2025, 11:39 AM)hsiangch_ong Wrote: i have a sprite sheet somewhere i used in a few programs. sadly it's for 12x12 glyphs. for this scheme to work well. it seems to want powers of two.
This can be made to work with 12x12 glyphs, you just need to make a copy of the 16x16 font, and edit it to be 12x12.
You can write a program to generate it - read in the image file containing the font, use the point(x,y) command to look at each 12x12 glyph, and output the source code, or a file, that contains the font definition.
Then you need to modify the code to generate a 12x12 BDF file from the data.
Read the comments in Function SaveBDF$ which explain the parameters for the BDF file, so you know what values to set.
It may take some trial and error - go online and search for one or more examples of a 12x12 BDF font, and use a program like Beyond Compare to compare it against the font the program generates, and you will see if there are any values which need to be different.
(07-21-2025, 11:39 AM)hsiangch_ong Wrote: what i wanted from it. was "cool numbers" like what used to be seen in newspapers.
You can do it, but you will need to modify the program. Again, Function SaveBDF$ is probably the starting point for getting it to work with a 12x12 font.
Good luck!