Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / ASCII character display problems...

Author
Message
Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 9th Dec 2014 22:52
Hello, everyone. I am having a problem with displaying the correct ASCII characters for an old school looking ASCII game. I am trying to get #176-#178, #219, etc. to display as shaded block characters, but instead they display as things like a capital U with a ` over it and such.
I've tried quite a few things, such as changing the char set to "graphics" with the optional set text font flag. Changing fonts. Changing font sizes. Etc.
My questions are: Why can't I display them correctly? Does it have to be ANSI encoding to display the correct extended ASCII? Is DBP only Unicode? Is it only UTF-8? Do I need to create a bitmap font, and replicate the characters?

Thanks in advance.
-Non S

Formerly: Amo Deus Man
TheViking
14
Years of Service
User Offline
Joined: 16th Feb 2012
Location:
Posted: 10th Dec 2014 01:14
Have you tried D3D Fonts? I haven't tried anything with ASCII characters yet... but, maybe using that plugin may help...
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Dec 2014 01:21 Edited at: 10th Dec 2014 01:22
This will do it.

Attila
FPSC Reloaded TGC Backer
21
Years of Service
User Offline
Joined: 17th Aug 2004
Location:
Posted: 10th Dec 2014 01:35
Ascii is only defined from char(32) to char(128). below 32 are control-characters and above 128 the characters are defined by the font, the ASCII-set and the code-page (locale in windows) in use.

DB uses a compromise when displaying characters above 128 (mostly for international characters). You could try to use fonts like wingdings or webdings, maybe on of this font will contain the needed characters.
Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 10th Dec 2014 04:33
Thanks, Wicked. I tinkered with terminal before, and nothing changed. Then, I took a hard look at your code. I didn't know the optional flag had to be set to 1 on the font command. I thought 1 should be the default for some reason. Haha.

Thanks for your responses, everyone.

Formerly: Amo Deus Man
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Dec 2014 05:17
Looking at the source code the set text font function calls the window API function CreateFont(). This is the list of international character codes from the Windows API Reference Documentation. DBPro uses the ANSI_CHARSET by default.

ANSI_CHARSET - 0
DEFAULT_CHARSET - 1
SYMBOL_CHARSET - 2
MAC_CHARSET - 77
SHIFTJIS_CHARSET - 128
HANGEUL_CHARSET - 129
JOHAB_CHARSET - 130
GB2312_CHARSET - 134
CHINESEBIG5_CHARSET - 136
GREEK_CHARSET - 161
TURKISH_CHARSET - 162
HEBREW_CHARSET - 177
ARABIC_CHARSET - 178
BALTIC_CHARSET - 186
RUSSIAN_CHARSET - 204
THAI_CHARSET - 222
EASTEUROPE_CHARSET - 238
OEM_CHARSET - 255
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Dec 2014 11:50
Quote: "I thought 1 should be the default for some reason"


That would have been my assumption from the Help file snippet posted by WickedX.

When is a default not a default? When it's a DBPro default I guess.



Powered by Free Banners
Non Sequitur M
17
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 11th Dec 2014 00:42
What's even more odd is the default "ANSI charset" won't display the ANSI encoded characters! But, the "default" charset does!! That makes no sense.

Formerly: Amo Deus Man
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Dec 2014 01:39
This link shows how Windows defines the ANSI_CHARSET.
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 11th Dec 2014 03:06
Quote: "for an old school looking ASCII game"


LoL.. hell, I'd just find a copy of QuickBASIC for that.
It'd be more nostalgic!

WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 11th Dec 2014 03:33 Edited at: 11th Dec 2014 03:34
Quote: "
LoL.. hell, I'd just find a copy of QuickBASIC for that.
"


Or download a copy of FreeBasic or QB64.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Dec 2014 12:29 Edited at: 11th Dec 2014 12:30
And while you're at it, buy one of these:





Powered by Free Banners
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 12th Dec 2014 00:16
That takes me back. An Atari 800XL was the second computer I owned. I would love to buy one of those.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Dec 2014 12:26
Mine is still in our loft. No idea whether it still works though.



Powered by Free Banners

Login to post a reply

Server time is: 2026-07-06 02:14:07
Your offset time is: 2026-07-06 02:14:07