printing the "£" pound sign

BlitzMax Forums/BlitzMax Beginners Area/printing the "£" pound sign

Juiceter(Posted 2016) [#1]
I made a font and it prints normal characters fine but refuses to print shift (characters) where characters are those in the top row (i.e. £$%^) etc.

Any thoughts? Thanks in advance.


' 8/16 pts

Graphics(640,480)
Global ITV=LoadImageFont("ZX-Vulcan.ttf",16) ' Fixed-width san-serif font. Made as close as poss. to original. Caps only.
'Global ITV=LoadImageFont("arial.ttf",16) ' Fixed-width san-serif font. Made as close as poss. to original. Caps only.

SetImageFont ITV

DrawText("ABCDEFGHIJKLMNOPQRSTUVWXYZ",20,20)
DrawText("abcdefghijklmnopqrstuvwxyz",20,40)
DrawText("1234567890",20,60)
DrawText("20th Panzer Division HQ",20,80)
text$="!4$%^&*()_+" ' cant do these? why?
DrawText(text,20,100)




Flip
WaitMouse


Brucey(Posted 2016) [#2]
The font will only draw glyphs that are in the ttf at the expected index.

I assume it is working okay with the arial font you commented out?


dw817(Posted 2016) [#3]


Works fine here. Must be the special font, "ZX-Vulcan."

Juiceter, not all fonts contain all characters. For instance, "WingDing" does not contain the space character, causing it to either crash in BlitzMAX or not display any characters at all.

If you have a paint program, bring it up, then select the font that is giving you trouble. Then try typing out those characters that don't display here. See if they will display there.


Yasha(Posted 2016) [#4]
Is your problem with all of the symbols on that row, or just £? Because £ isn't an ASCII character, despite its prominent position on the keyboard, and if you're trying to use a classic font from bygone decades (like the name ZX-Vulcan kinda implies), it might not be part of the character set.


Brucey(Posted 2016) [#5]
Well, he did start off with "I made a font..."


dw817(Posted 2016) [#6]
Well now Brucey THAT'S something I missed ! :) It could be that. I know when I saved a 3rd font for patched WingDing it was a bit of a nightmare to make sure all the characters would display correctly.


Juiceter(Posted 2016) [#7]
Wow! nice to see so many replies in a short space of time. Thanks for your help! Yes, I made the font using fontstruct (online). It is a problem with all on that row, yes.


Juiceter(Posted 2016) [#8]
Funnily enough it only works with some for the arial font. I guess it may be mapping problems. I do need to access all the characters though, so will persevere.


Juiceter(Posted 2016) [#9]
Yes using paint shows all is fine except for shift 3 and 4.


dw817(Posted 2016) [#10]
Juiceter, one thing you could do is copy over the unprintable character to a different character you are not using, say 129, and see if that will work.