Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
another variation of "10 PRINT"
#21
Hi @Jack002,

What version QB64(pe) are you using? You probably need a PE, something newer than v2.1 for sure.

IAnother look at your Windows Fonts shot, you should be able in Windows 10 to load the font by name alone, skip the path stuff. Check under properties what the font name is, it doesn't always match the file name!

Or try the code and zip Steve provided earlier.

Honestly IMHO it works better with a square font 1:1 ratio of height to width.
b = b + ...
Reply
#22
Jack002

did you read the second post i made on this thread?

(01-11-2025, 02:26 AM)hsiangch_ong Wrote: i don't expect someone to use boldfaced font.  the code line to load the font should read:

Code: (Select All)
mfont = _LOADFONT("C:\windows\fonts\CousineNerdFontMono-Regular.ttf", ps, "UNICODE")
this is for regular monospace font.  you could try with boldfaced instead.  instead of ps variable, try using point size of 16 or 24. (shrugs)

the "courier new" font might not have a lot of unicode symbols.  i don't know if "cyberbit.ttf" is still packaged with qb64.  it was with earlier versions.  especially before phoenix edition.  if you happen to have an early installation of qb64 then find that font and try with it.  however it's not monospaced.  it might not have the graphics characters employed in this topic's example.

"gucharmap" is the gnome character map viewer for linux.  windows should have an equivalent program called "character map" or similar found somewhere in the start menu.  it should show you information about a sigil that you click on with the mouse.  most important is the "U+xxxx" feature where "xxxx" is a 4-digit hexadecimal (base-16) number, which is the "utf-8" code to produce that character with _uprintstring in qb64 phoenix.  it is a bit tricky as you could notice in my program...

i should have posted windows-only path which was hard coded.

all of you trying to do it with screen 0 and as short as possible are missing the point.  there is no way to do it like on original commodore 64 with an original text mode!  so i ventured on doing it with graphics mode, with graphics characters that looked like the two from commodore 64 able to be produced with [b]chr$()[b].
Reply
#23
Jack002

you showed file properties of font that was downloaded.  you might have to check "unblock" in the dialog at the bottom.  sometimes windows is hard about this.

Code: (Select All)
ENVIRON$("HOME")
is the typical path that is used on unix and its descendants (especially linux) to indicate the user's home directory.  on my example program i indicated where is a good place to put fonts.  otherwise must put it into protected area like /usr/share/fonts.  which is a bigger hassle than what you are going through.

that's why i advised you to use hard coded full path in program for windows.

as i've said, i don't know if windows still allows installing fonts into C:\windows\fonts.  i took another look at the properties dialog to notice the font was installed in deep "local" area for user.  will have to get the entire path of that, or will have to move the font file to another location.
Reply
#24
Windows lets you install fonts still, but it's not necessary.

All one has to do is include the font in the same directory as the source code (or the qb64pe folder, if you're not saving it to some personalized folder), and then reference it without any paths whatsoever.

font = _LoadFont(fontname$, size, property$)   

For example: 

font = _LoadFont("courbd.ttf", 20, "monospace")

NOTE:  On Windows, this style format will resolve itself in two steps:
1) It checks the _CWD$ (current working directory) path for the file.
2) It checks "CWindows\Fonts\" as the path, in case the first fails and doesn't find the file.

You shouldn't need to hardcode paths in Windows unless you've just deliberately placed your font files into a resource folder somewhere relative to your BAS file.
Reply
#25
(01-12-2025, 09:02 PM)bplus Wrote: Hi @Jack002,

What version QB64(pe) are you using? You probably need a PE, something newer than v2.1 for sure.

IAnother look at your Windows Fonts shot, you should be able in Windows 10 to load the font by name alone, skip the path stuff. Check under properties what the font name is, it doesn't always match the file name!

Or try the code and zip Steve provided earlier.

Honestly IMHO it works better with a square font 1:1 ratio of height to width.
QB64 ver 2.1, I just installed it before all these problems
QB64pe is ver 4.0
Why is it I SEE the TTF file there in the dir in the file explorer and not in DOS?
For what it's worth, I use an app called Agent Ransack, it finds files, and sees inside txt files to find things, it also cannot see this ttf file
                                                                                                                 
MoreCowbell(everything)
Reply
#26
Oh heck graphics version! Why monkey around with fonts at all?
Code: (Select All)
Screen _NewImage(800, 600, 32)
For y = 0 To 600 Step 8: For x = 0 To 800 Step 8
        If Rnd < .5 Then Line (x, y)-Step(8, 8) Else Line (x + 8, y)-Step(-8, 8)
Next: Next: Sleep
b = b + ...
Reply
#27
LOL.  I was thinking someone might whittle it down to a single keyword, but soon we'll have an Enterprise-grade TenPrint instead.

Does anyone want to get started on the User's Guide & advertising campaign?
Reply
#28
(01-13-2025, 06:24 PM)JRace Wrote: LOL.  I was thinking someone might whittle it down to a single keyword, but soon we'll have an Enterprise-grade TenPrint instead.

Does anyone want to get started on the User's Guide & advertising campaign?

Just for you @JRace -- I'm adding a new _PrintMaze command to the language!
Reply
#29
Let's see the other guys beat that!

Ah, the power of being a dev.
Reply
#30
Code: (Select All)

_Title "Ten Print Infinity" ' b+ 2025-01-13
Randomize Timer
Do
__TenPrint Int(Rnd * 800 + 200), Int(Rnd * 400 + 200), Int(Rnd * 20 + 8)
_Delay .5
Loop Until _KeyDown(27)

Sub __TenPrint (w, h, sq)
Screen _NewImage(w, h, 32)
For y = 0 To h Step sq: For x = 0 To w Step sq
If Rnd < .5 Then Line (x, y)-Step(sq, sq) Else Line (x + sq, y)-Step(-sq, sq)
Next: Next
End Sub

Can someone beat Infinity?
b = b + ...
Reply




Users browsing this thread: JRace, 14 Guest(s)