|
Fonts
Oct 10, 2019 14:29:42 GMT -6
Post by johnno56 on Oct 10, 2019 14:29:42 GMT -6
I have, what may seem like a too simple sounding question, about 'printing' text on a screen. I am not talking about the DrawText() command but the PrintS() command. I know that text can be "Drawn" on the canvas using different fonts but the Font() command does not seem to have any effect on the PrintS() command. I'm going to guess that, because the DrawText() 'draws' on the graphics canvas, the Font() command is interpreted as 'graphical'. Whereas the PrintS() 'prints' on the screen using some hideous 'squashed' font... best way I could describe it.... My question is: The 'squashed' font that is used is obviously part of RC. Where is that font located... and the obvious... Can it be changed? Reason: I am attempting a 'text only' game and would prefer not to be squinting at squashed characters... lol J xmax = 640 ymax = 480 title$ = "Font Test"
WindowOpen(1,title$,0,0,xmax,ymax,0) CanvasOpen(1,xmax,ymax,0,0,xmax,ymax,0) ClearCanvas
arial24 = 1 loadFont(1,"arial.ttf",24)
font(arial24)
do ClearCanvas
locate(13, 10) setColor(rgb(255,255,0)) prints("This is a font test.") setColor(rgb(0,191,0)) DrawText("This is a font test.", 100, 100) Update() loop until key(k_escape) = 1 arial.ttf (358.5 KB)
|
|
|
Fonts
Oct 10, 2019 15:43:26 GMT -6
Post by n00b on Oct 10, 2019 15:43:26 GMT -6
Hey Johnno, the PrintS() and InputS() functions use a bitmap font that is built-in to the SDL2_gfx library. They can't be changed. If you want to use different fonts you will need to use the DrawText() function.
|
|
|
Fonts
Oct 10, 2019 16:07:58 GMT -6
Post by johnno56 on Oct 10, 2019 16:07:58 GMT -6
Yeah... I figured that this might be the case... but wasn't sure... Many thanks for the info... Cheers.
J
|
|