Sign in with
Sign up | Sign in
Your question

special characters

Last response: in Video Games
Share
Anonymous
May 6, 2005 6:42:01 PM

Archived from groups: rec.games.roguelike.development (More info?)

it might have been brought up before..

i'm trying to get those special characters (borders, see attachment,
#200 for example) written on the screen using c++ and curses.. i tried
using standard alt + # in editor and when i build the console
automaticaly changes the characters to + or - or | so i can't get those
fancy single- and doublelined borders.. i managed to get them in borland
delphi using the SetConsoleOutputCP function (the one provided from
microsoft for console support).. the same function can be used in c++
but as told i get the symbols simplified.. i'm using CP 437.. anyone
knows how could i get these with c++?


thanx



vooood

More about : special characters

Anonymous
May 6, 2005 7:21:37 PM

Archived from groups: rec.games.roguelike.development (More info?)

vooood wrote:
> here's the image.. forgot it in the first post

No attachments next time, man. This is a no-binary group -- people may
get really angry with you for that. Next time place the image somewhere
on a server and post a link ;-)
--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"Well, the philosophy of the World of Shadows is based on most of the
degenerate, immoral and foremost amoral philosophical beliefs of our
world exagarated to the maximum." --Anubis
Anonymous
May 6, 2005 7:21:38 PM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> No attachments next time, man. This is a no-binary group -- people may
> get really angry with you for that. Next time place the image somewhere
> on a server and post a link ;-)

There's no attachment in the post you're replying to. At least, none I
can see.

--
http://www.crisispapers.org/Editorials/germany-1933.htm
Reichstag fire -> 9/11
Communist "arsonist" -> Iraq "weapons of mass destruction"
Be afraid. Be very afraid.
Related resources
Can't find your answer ? Ask !
Anonymous
May 6, 2005 7:33:36 PM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> vooood wrote:
>
>> here's the image.. forgot it in the first post
>
>
> No attachments next time, man. This is a no-binary group -- people may
> get really angry with you for that. Next time place the image somewhere
> on a server and post a link ;-)


sorry.. i was really pissed :D  btw.. i solwed the problem.. is there a
faq or smthing for the group?



vooood
Anonymous
May 6, 2005 7:36:12 PM

Archived from groups: rec.games.roguelike.development (More info?)

vooood wrote:
> it might have been brought up before..
>
> i'm trying to get those special characters (borders, see attachment,
> #200 for example) written on the screen using c++ and curses.. i tried
> using standard alt + # in editor and when i build the console
> automaticaly changes the characters to + or - or | so i can't get those
> fancy single- and doublelined borders.. i managed to get them in borland
> delphi using the SetConsoleOutputCP function (the one provided from
> microsoft for console support).. the same function can be used in c++
> but as told i get the symbols simplified.. i'm using CP 437.. anyone
> knows how could i get these with c++?

problem solved.. there is an issue in the editor that automatically
converts these border characters to simplier ones (and does not show the
change until the file is reopened).. i bypassed this using hexadecimal
codes.. eg 0xBD for that double line that looks like the equals char
(=).. you also *have* to set to CP 437.. and as far as i'm aware every
windows system has it by default..



vooood
Anonymous
May 6, 2005 8:27:06 PM

Archived from groups: rec.games.roguelike.development (More info?)

vooood wrote:
> Kornel Kisielewicz wrote:
>
>> vooood wrote:
>>
>>> here's the image.. forgot it in the first post
>>
>>
>>
>> No attachments next time, man. This is a no-binary group -- people may
>> get really angry with you for that. Next time place the image
>> somewhere on a server and post a link ;-)
>
> sorry.. i was really pissed :D  btw.. i solwed the problem.. is there a
> faq or smthing for the group?

There are two even ;-).
The first one, which could be considered a general Roguelike Development
FAQ you can find at
http://www.roguelikedevelopment.org/development/FAQ.php

The other one, more group related, is seen
here:http://angband.oook.cz/rgrd.php?showpost=54676

--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"Come on, Kornel. 11 years and no binary? And it's not
vapourware?" -- Mike Blackney
Anonymous
May 7, 2005 4:18:10 AM

Archived from groups: rec.games.roguelike.development (More info?)

On Fri, 06 May 2005 15:36:12 +0200, vooood wrote:
> vooood wrote:
>> it might have been brought up before..
>>
>> i'm trying to get those special characters (borders, see attachment,
>> #200 for example) written on the screen using c++ and curses.. i tried
<cut>
> change until the file is reopened).. i bypassed this using hexadecimal
> codes.. eg 0xBD for that double line that looks like the equals char
> (=).. you also *have* to set to CP 437.. and as far as i'm aware every
> windows system has it by default..


To be more portable, you could use the ACS_* macros instead.
For example to draw a box:
mvaddch(y, x, ACS_ULCORNER); /* top-left */
mvhline(y, x + 1, ACS_HLINE, width - 2); /* top */
mvaddch(y, x + width - 1, ACS_URCORNER); /* top-right */
mvvline(y + 1, x, ACS_VLINE, height - 2); /* left */
mvvline(y + 1, x + width - 1, ACS_VLINE, height - 2); /* right */
mvaddch(y + height - 1, x, ACS_LLCORNER); /* bottom-left */
mvhline(y + height - 1, x + 1, ACS_HLINE, width - 2); /* bottom */
mvaddch(y + height - 1, x + width - 1, ACS_LRCORNER); /* bottom-right */


Regards,

--
joni
Anonymous
May 7, 2005 4:18:11 AM

Archived from groups: rec.games.roguelike.development (More info?)

Steve Yrjana wrote:
> To be more portable, you could use the ACS_* macros instead.
> For example to draw a box:
> mvaddch(y, x, ACS_ULCORNER); /* top-left */
> mvhline(y, x + 1, ACS_HLINE, width - 2); /* top */
> mvaddch(y, x + width - 1, ACS_URCORNER); /* top-right */
> mvvline(y + 1, x, ACS_VLINE, height - 2); /* left */
> mvvline(y + 1, x + width - 1, ACS_VLINE, height - 2); /* right */
> mvaddch(y + height - 1, x, ACS_LLCORNER); /* bottom-left */
> mvhline(y + height - 1, x + 1, ACS_HLINE, width - 2); /* bottom */
> mvaddch(y + height - 1, x + width - 1, ACS_LRCORNER); /* bottom-right */
>
>
> Regards,
>

thanks.. where could i find more info on this?


vooood
Anonymous
May 7, 2005 6:37:55 PM

Archived from groups: rec.games.roguelike.development (More info?)

Jim Strathmeyer wrote:
> vooood <vooood@ihatespamgmail.com> wrote:
>
>>thanks.. where could i find more info on this?
>
>
> The ncurses howto, for all of your ncurses how to needs:
>
> http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
> http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/mis...
>

i still have one question regardint to curses.. if using built-in
windows funcion WriteConsoleOutput i can get those nice smiley faces
with ascii numbers 1 and 2.. when using them in curses the first 32
(0-31) are some ^x characters.. can i bypass this somehow or something?

thanx



vooood
Anonymous
May 7, 2005 6:37:56 PM

Archived from groups: rec.games.roguelike.development (More info?)

Dnia Sat, 07 May 2005 14:37:55 +0200,
vooood napisal(a):

> i still have one question regardint to curses.. if using built-in
> windows funcion WriteConsoleOutput i can get those nice smiley faces
> with ascii numbers 1 and 2.. when using them in curses the first 32
> (0-31) are some ^x characters.. can i bypass this somehow or something?

No. Those are control characters, they have no appearance defined in ASCII
and other standards, displaying them on the terminal should trigger
certain behavior, not make them appear on the screen.

--
Radomir @**@_ Bee! .**._ .**._ .**._ .**._ zZ
`The Sheep' ('') 3 (..) 3 (..) 3 (..) 3 (--) 3
Dopieralski .vvVvVVVVVvVVVvVVVvVvVVvVvvVvVVVVVVvvVVvvVvvvvVVvVVvv.v.
Anonymous
May 7, 2005 9:37:00 PM

Archived from groups: rec.games.roguelike.development (More info?)

The Sheep wrote:
> No. Those are control characters, they have no appearance defined in ASCII
> and other standards, displaying them on the terminal should trigger
> certain behavior, not make them appear on the screen.
>

err.. depends.. i said i can get them written using ms libs.. want a
screenshot?



vooood
Anonymous
May 7, 2005 9:37:01 PM

Archived from groups: rec.games.roguelike.development (More info?)

Dnia Sat, 07 May 2005 17:37:00 +0200,
vooood napisal(a):

> The Sheep wrote:
>> No. Those are control characters, they have no appearance defined in ASCII
>> and other standards, displaying them on the terminal should trigger
>> certain behavior, not make them appear on the screen.
> err.. depends.. i said i can get them written using ms libs.. want a
> screenshot?

Note the words 'defined', 'standard' and 'should' used. ;) 

You can do it only because your libs talk directly to the graphics card
(or it's emulation, in case of windowed mode), most likely by writting
directly to video memory. This is only possible on the platforms that
has such possibilities.

It's rather impossible to get those characters displayed in a WYSE
terminal, or using rs-232, telnet, etc.
And because curses is designed to support those text 'terminals', the
control characters will act as control characters.

As a reward, your apps will work even on IBM mainframe, which has totally
weird character set. :) 

--
Radomir @**@_ Bee! .**._ .**._ .**._ .**._ zZ
`The Sheep' ('') 3 (..) 3 (..) 3 (..) 3 (--) 3
Dopieralski .vvVvVVVVVvVVVvVVVvVvVVvVvvVvVVVVVVvvVVvvVvvvvVVvVVvv.v.
Anonymous
May 8, 2005 10:08:23 AM

Archived from groups: rec.games.roguelike.development (More info?)

Twisted One <twisted0n3@gmail.invalid> wrote:
> Kornel Kisielewicz wrote:
>> No attachments next time, man. This is a no-binary group --
>> people may get really angry with you for that. Next time place
>> the image somewhere on a server and post a link ;-)
>
> There's no attachment in the post you're replying to. At least,
> none I can see.

It was probably filtered out by your news server. Which is another
reason to post links instead of attachments: because many servers
do that in non-binary groups.

--
CalcRogue: TI-89, TI-92+, PalmOS, Windows and Linux.
http://calcrogue.jimrandomh.org/
Anonymous
May 8, 2005 10:14:35 PM

Archived from groups: rec.games.roguelike.development (More info?)

I've been working on incorporating unicode into Angband (it's easy
enough for terrain). It will be the default system in my own RL. You
can write utf8 with n/curses. But that requires your users to have utf8
compatible terminals or displays. The other way is to use wide
characters, but those are rarely supported except in Java.

Ncurses prodives the ACS_ variables, but those are deprecated,
nevermind issues of portability. Use utf8 or wide characters or none at
all. Utf8 is well supported for terminal needs, virtually every
"current" terminal emulator does (including, notably, the Linux
console).

However you will run into a problem with utf-8 because each character
is represented by multiple bytes. This will cause alignment problems if
your terminal structure is modeled to store one char byte per grid
cell. You could store the characters as wide characters, then translate
to utf-8 as needed.

This isn't a fun nor easy issue to deal with, I recommend staying away
from special characters if you're just tacking them on as an
afterthought. As a stopgap measure, you could use the ACS_ characters,
but those are _not_ guaranteed to render correctly. They don't show up
on several terminals I've tried, which is the original reason I began
my efforts.

For some background, check this out:
http://wiki.t-o-m-e.net/IdeaArchive_2fUnicodeSupport

- Leon
Anonymous
May 9, 2005 2:34:31 PM

Archived from groups: rec.games.roguelike.development (More info?)

On Sun, 08 May 2005 18:14:35 -0700, Leon Torres wrote:
> Ncurses prodives the ACS_ variables, but those are deprecated,

Interesting, would you care to tell where that is "officially" noted? I
couldn't find that information with a quick googling and grepping through
ncurses 5.4 source.


> afterthought. As a stopgap measure, you could use the ACS_ characters,
> but those are _not_ guaranteed to render correctly. They don't show up
> on several terminals I've tried, which is the original reason I began
> my efforts.

In those terminals that doesn't display ACS_ characters "correctly", did
you get the needed line drawing characters using UTF8? That is, did using
UTF8 actually fix the problem?
What were those terminals that didn't show them up? I guess you mean they
were shown with "-|+" -characters when you say "does not show up", right?

Sorry for so many questions =)


Regards,

--
joni
Anonymous
May 10, 2005 1:50:09 PM

Archived from groups: rec.games.roguelike.development (More info?)

The Sheep <sheep@atos.wmid.amu.edu.pl> wrote:
> Dnia Sat, 07 May 2005 14:37:55 +0200,
> vooood napisal(a):

>> i still have one question regardint to curses.. if using built-in
>> windows funcion WriteConsoleOutput i can get those nice smiley faces
>> with ascii numbers 1 and 2.. when using them in curses the first 32
>> (0-31) are some ^x characters.. can i bypass this somehow or something?

> No. Those are control characters, they have no appearance defined in ASCII
> and other standards, displaying them on the terminal should trigger
> certain behavior, not make them appear on the screen.

It depends - there's an example (test/blue.c) in ncurses which can demonstrate
this. The only terminal that I've seen which can support it is Linux console.

The current version of ncurses is 5.4 (20040208)
There's an faq at
http://invisible-island.net/ncurses/ncurses.faq.html

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Anonymous
May 10, 2005 1:51:35 PM

Archived from groups: rec.games.roguelike.development (More info?)

Leon Torres <Fando.Angband@gmail.com> wrote:
> I've been working on incorporating unicode into Angband (it's easy
> enough for terrain). It will be the default system in my own RL. You
> can write utf8 with n/curses. But that requires your users to have utf8
> compatible terminals or displays. The other way is to use wide
> characters, but those are rarely supported except in Java.

> Ncurses prodives the ACS_ variables, but those are deprecated,

I doubt that (no point in arguing since this posting is so far from reality).

The current version of ncurses is 5.4 (20040208)
There's an faq at
http://invisible-island.net/ncurses/ncurses.faq.html

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Anonymous
May 11, 2005 3:35:50 AM

Archived from groups: rec.games.roguelike.development (More info?)

Steve Yrjana wrote:
> On Sun, 08 May 2005 18:14:35 -0700, Leon Torres wrote:
> > Ncurses prodives the ACS_ variables, but those are deprecated,
>
> Interesting, would you care to tell where that is "officially" noted?


It was on the ncurses mailing list IIRC. There was also probably a note
in the ncurses.h file. Ncurses documenatation is really sparse and hard
to parse, but to summarize there is a push to support wchar and utf8
unicode in ncurses. That's what ncurses 5 (-lncursesw) is about.
However, things are currently in flux, so either one stays with the
older implementation or uses the newer one.



> In those terminals that doesn't display ACS_ characters "correctly",
did
> you get the needed line drawing characters using UTF8? That is, did
using
> UTF8 actually fix the problem?

Yes. There seems to be some problems using ACS in utf8 mode, which may
be the source of my problems. There's also an issue with assumptions in
the gcu code in Angband, which I tinker with, and library semantic
confusion due to the ncurses upgrade.

> What were those terminals that didn't show them up? I guess you mean
they
> were shown with "-|+" -characters when you say "does not show up",
right?

No, they were garbled or just didn't show up. I didn't intend to give a
full exposition of the issues I encountered, just some advice about
using unicode without researching thoroughly.

>
> Sorry for so many questions =)
> Regards,
>
> --
> joni

NP, but I won't be able to answer more questions, which I'll address in
a reply to the next poster.

- Leon
Anonymous
May 11, 2005 4:11:35 AM

Archived from groups: rec.games.roguelike.development (More info?)

Thomas Dickey wrote:
> I doubt that (no point in arguing since this posting is so far from
reality).
>
> The current version of ncurses is 5.4 (20040208)

Whoops, might've been wrong about the deprecation, I got that info from
some mailing list where the author must've assumed deprecation. I
noticed the wide versions of the ACS constants, so they're here to
stay. It would help to know what else you feel is incorrect, so I may
be informed. The FAQ doesn't shed much more info, nor does your
drive-by post. I know you post on the ncurses list, but I still don't
know who you are nor do I have the time to worry bout it. It helps not
to be so vague, introduce yourself.

To be specific, the issues I encountered _are not_ about Ncurses
itself, but about code assumptions in Angband's gcu code and linking
issues with multiple ncurses implementations. I'll concede that ACS_
use is viable, unfortunately I still recommend against it because it
puts the code in a mindset that discourages full use of unicode symbols
that may be useful. Draw solid blocks with utf8 or whcar explicitly.
For RL's, it's probably best to use wchar universally and let the view
handle utf8. This has already been discussed to death in the wiki link
I posted.

- Leon
Anonymous
May 11, 2005 3:35:52 PM

Archived from groups: rec.games.roguelike.development (More info?)

Leon Torres <Fando.Angband@gmail.com> wrote:

> Steve Yrjana wrote:
>> On Sun, 08 May 2005 18:14:35 -0700, Leon Torres wrote:
>> > Ncurses prodives the ACS_ variables, but those are deprecated,
>>
>> Interesting, would you care to tell where that is "officially" noted?


> It was on the ncurses mailing list IIRC. There was also probably a note

not that I recall.

> in the ncurses.h file. Ncurses documenatation is really sparse and hard
> to parse, but to summarize there is a push to support wchar and utf8

send a patch.

> unicode in ncurses. That's what ncurses 5 (-lncursesw) is about.
> However, things are currently in flux, so either one stays with the
> older implementation or uses the newer one.

not many people use ncurses 4 anymore.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Anonymous
May 11, 2005 5:39:25 PM

Archived from groups: rec.games.roguelike.development (More info?)

Leon Torres <Fando.Angband@gmail.com> wrote:
> be informed. The FAQ doesn't shed much more info, nor does your
> drive-by post. I know you post on the ncurses list, but I still don't
> know who you are nor do I have the time to worry bout it. It helps not
> to be so vague, introduce yourself.

I'm the fellow who develops and maintains ncurses (as well as several other
programs as noted on my home page ;-)

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
!