How to print pseudographic symbols?
How to print pseudographic symbols?
I tried to print it just like normal character, but it displays me a blank white character. Can i print them by printing their ASCII codes?
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: How to print pseudographic symbols?
Define "normal". Which exact character are you trying to print using which method? There are many ways I know of, all of which considered normal depending on context, and several of them work fundamentally different when it comes to non-alphanumeric characters.just like normal character
Re: How to print pseudographic symbols?
I'm using standard terminal_putchar function, normal chars is 'a', '!', '_', just anything except pseudographic. I'm trying to print a borders for my window, but it displays me blank chars.Combuster wrote:Define "normal". Which exact character are you trying to print using which method? There are many ways I know of, all of which considered normal depending on context, and several of them work fundamentally different when it comes to non-alphanumeric characters.just like normal character
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: How to print pseudographic symbols?
Well, that's what you get for blindly trusting tutorials. It was pretty easy to find though, here's a hint:
Code: Select all
-uint16_t c16 = c;
+uint16_t c16 = (uint8_t)c;
Re: How to print pseudographic symbols?
Are you typing/pasting the pseudographic characters directly into your source code, or are you using character codes? The former won't work since the character encodings (some form of Unicode, probably UTF-8) used by your editor/IDE won't match the character positions in the VGA ROM (the "IBM extended ASCII" set)...
Re: How to print pseudographic symbols?
Are you sure, you use pseudographics from ASCII, not Unicode?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: How to print pseudographic symbols?
Isn't UTF-8 compatible with ASCII (i.e. ASCII symbols in Unicode are just one-byte ASCII)?mallard wrote:Are you typing/pasting the pseudographic characters directly into your source code, or are you using character codes? The former won't work since the character encodings (some form of Unicode, probably UTF-8) used by your editor/IDE won't match the character positions in the VGA ROM (the "IBM extended ASCII" set)...
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: How to print pseudographic symbols?
UTF-8 is compatible with standard 7-bit ASCII, but not the full 8-bit "IBM extended ASCII" set.Roman wrote:Isn't UTF-8 compatible with ASCII (i.e. ASCII symbols in Unicode are just one-byte ASCII)?
Re: How to print pseudographic symbols?
Thanks! I didn't know about the extended set. I always thought ASCII only takes 7 bits.mallard wrote:UTF-8 is compatible with standard 7-bit ASCII, but not the full 8-bit "IBM extended ASCII" set.Roman wrote:Isn't UTF-8 compatible with ASCII (i.e. ASCII symbols in Unicode are just one-byte ASCII)?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
Re: How to print pseudographic symbols?
I'm now tried to print char code, but now it displays me that: (' ' is the blank char, and * is some char that i can't print)
LLLLLLLLLLLLLLLLLLL
;window caption ;
<LLLLLLLLLLLLLLLLLK
;window text ;
; ;
; ;
; ;
; ;
*LLLLLLLLLLLLLLLLLL
It displays me a wrong characters! There's a code of drawObj function:
LLLLLLLLLLLLLLLLLLL
;window caption ;
<LLLLLLLLLLLLLLLLLK
;window text ;
; ;
; ;
; ;
; ;
*LLLLLLLLLLLLLLLLLL
It displays me a wrong characters! There's a code of drawObj function:
Code: Select all
void drawObj(window target)
{
terminal_setcolor(26);
goToPos(target.x, target.y);
terminal_putchar(0xAD);
for(size_t topcount = 0; topcount < target.width - 2; topcount++)
{
terminal_putchar(0x4C);
}
terminal_putchar(0xFB);
for(size_t middlecount = 1; middlecount < target.height - 2; middlecount++)
{
goToPos(target.x, target.y+middlecount);
terminal_putchar(0x3B);
for(size_t middlecount2 = 0; middlecount2 < target.width - 2; middlecount2++)
{
terminal_putchar(' ');
}
terminal_putchar(0x3B);
}
goToPos(target.x, target.y+target.height-2);
terminal_putchar(0x0C);
for(size_t bcount = 0; bcount < target.width - 2; bcount++)
{
terminal_putchar(0x4C);
}
terminal_putchar(0x9D);
goToPos(target.x, target.y+2);
terminal_putchar(0x3C);
for(size_t captioncount = 0; captioncount < target.width - 2; captioncount++)
{
terminal_putchar(0x4C);
}
terminal_putchar(0x4B);
terminal_setcolor(26);
goToPos(target.x,target.y);
size_t newy = 0;
terminal_setcolor(26);
goToPos(target.x+1, target.y+1);
terminal_writestring(target.caption);
terminal_setcolor(26);
goToPos(target.x+1, target.y + 3);
terminal_writestring(target.text);
}
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Re: How to print pseudographic symbols?
Oops, phpBB deleted repeated spaces.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
-
- Member
- Posts: 5560
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How to print pseudographic symbols?
Looks right to me.catnikita255 wrote:It displays me a wrong characters!
Code: Select all
0C ♀
3B ;
3C <
4B K
4C L
9D ¥
AD ¡
FB √
Re: How to print pseudographic symbols?
I don't know, i'm found ASCII codes of pseudographic in Wikipedia, and it dispayed me a blank chars, then i'm typed their ASCII codes in reverse order, and it showed me that. I'll try to type them in normal order.Octocontrabass wrote:Looks right to me.catnikita255 wrote:It displays me a wrong characters!What kind of ASCII chart are you using, anyway?Code: Select all
0C ♀ 3B ; 3C < 4B K 4C L 9D ¥ AD ¡ FB √
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Re: How to print pseudographic symbols?
Now it displays me only blank chars instead of window borders.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing
OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: How to print pseudographic symbols?
Did you fix this yet?Combuster wrote:Well, that's what you get for blindly trusting tutorials. It was pretty easy to find though, here's a hint:Code: Select all
-uint16_t c16 = c; +uint16_t c16 = (uint8_t)c;