delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/02/03:45:41.2

From: rob89 AT my-deja DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Dos char set
Date: Fri, 02 Jun 2000 07:30:34 GMT
Organization: Deja.com - Before you buy.
Lines: 34
Message-ID: <8h7nqr$6u9$1@nnrp1.deja.com>
NNTP-Posting-Host: 24.64.21.150
X-Article-Creation-Date: Fri Jun 02 07:30:34 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)
X-Http-Proxy: 1.1 x54.deja.com:80 (Squid/1.1.22) for client 24.64.21.150
X-MyDeja-Info: XMYDJUIDrob89
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,
I am having problems understanding dos character set(fonts). So far I
have successfully copied the character set to my local array using the
dosmemget(..) function as follows:
dosmemget(0xffa6e, 128*8, ch_table);
I know that the whole character set(starting at location 0xffa6e) is in
my local array (i.e ch_table[128][8]). I was looking at a piece of code
and the idea was to process a string from the user (until the NULL was
reached). Lets say the string I want to display is string[]. Now
string['a'] could give me 'a' in the dos char set if I use something
like


ch_table[string['a']];

After this I could have some sort of for loop which goes through the
rows and columns and checks if there is a pixel there and if there is,
display it on the screen using some function(say putpixel.). The code
has the following line which checks if there is a pixel in the
corresponding location:

if((ch_table[string[index]][row] << column) & 0x80)

I completely understand ch_table[string[index]][row] part, which first
of all goes to the character to be displayed, but then I don't
understand why we have to shift left (<< column) and most importantly
why do we have to use masking (&0x80). I would really appreciate it if
someone could help me understand the check better.
Thanks,
Rob


Sent via Deja.com http://www.deja.com/
Before you buy.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019