Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   What exactly is a text character in the computer? (http://www.velocityreviews.com/forums/t439631-what-exactly-is-a-text-character-in-the-computer.html)

thenightfly@comcast.net 10-02-2005 02:53 PM

What exactly is a text character in the computer?
 
Ok, I know all about how binary numbers translate into text characters.
My question is what exactly IS a text character? Is it a bitmap?


Martijn 10-02-2005 03:04 PM

Re: What exactly is a text character in the computer?
 
thenightfly@comcast.net wrote:
> My question is what exactly IS a text character? Is it a
> bitmap?


This is so off-topic, you wouldn't believe it. Although I shouldn't do this
(because it may encourage others to post OT here as well):

<OT>
In the old days (and still today if you switch to CLI/DOS mode or run a
UNIX-like OS without a GUI like X) the characters were stored in memory in a
special location (setting some pointers in the BIOS memory, you could
override these) as bitmaps. The characters (or glyphs) used in GUI's like
Windows and X use more often than not a combination of curves (and sometimes
hints) to describe what they should look like.
</OT>
--
Martijn
http://www.sereneconcepts.nl



Eric Sosman 10-02-2005 03:14 PM

[OT] Re: What exactly is a text character in the computer?
 
Martijn wrote:

> thenightfly@comcast.net wrote:
>
>>My question is what exactly IS a text character? Is it a
>>bitmap?

>
>
> This is so off-topic, you wouldn't believe it. Although I shouldn't do this
> (because it may encourage others to post OT here as well):
>
> <OT>
> In the old days (and still today if you switch to CLI/DOS mode or run a
> UNIX-like OS without a GUI like X) the characters were stored in memory in a
> special location (setting some pointers in the BIOS memory, you could
> override these) as bitmaps. The characters (or glyphs) used in GUI's like
> Windows and X use more often than not a combination of curves (and sometimes
> hints) to describe what they should look like.
> </OT>


Nonsense. In the old days, characters were little metal
dies that pressed an inked ribbon against paper (various
mechanical arrangements were used). With the right sequences of
characters you could get some printers to emit sounds that had
pitch and could produce recognizable tunes, but that tended to
eat holes in the ribbon and earn you a stern talking-to from the
computer operators.

--
Eric Sosman
esosman@acm-dot-org.invalid

Rouben Rostamian 10-02-2005 03:41 PM

Re: [OT] Re: What exactly is a text character in the computer?
 
In article <-O6dnQxz94bZZKLeRVn-2Q@comcast.com>,
Eric Sosman <esosman@acm-dot-org.invalid> wrote:
>Martijn wrote:
>
>> thenightfly@comcast.net wrote:
>>
>>>My question is what exactly IS a text character? Is it a
>>>bitmap?

>>
>>
>> This is so off-topic, you wouldn't believe it. Although I shouldn't do this
>> (because it may encourage others to post OT here as well):
>>
>> <OT>
>> In the old days (and still today if you switch to CLI/DOS mode or run a
>> UNIX-like OS without a GUI like X) the characters were stored in memory in a
>> special location (setting some pointers in the BIOS memory, you could
>> override these) as bitmaps. The characters (or glyphs) used in GUI's like
>> Windows and X use more often than not a combination of curves (and sometimes
>> hints) to describe what they should look like.
>> </OT>

>
> Nonsense. In the old days, characters were little metal
>dies that pressed an inked ribbon against paper (various
>mechanical arrangements were used). With the right sequences of
>characters you could get some printers to emit sounds that had
>pitch and could produce recognizable tunes, but that tended to
>eat holes in the ribbon and earn you a stern talking-to from the
>computer operators.


Nonsense. Everyone knows that in the old days, characters
were shapes chiseled in stone.

--
rr

Emmanuel Delahaye 10-02-2005 03:54 PM

Re: What exactly is a text character in the computer?
 
thenightfly@comcast.net wrote on 02/10/05 :
> Ok, I know all about how binary numbers translate into text characters.
> My question is what exactly IS a text character? Is it a bitmap?


A text file is just another binary file. What counts is the way it is
opened and read. Use fopen() with "r", so that the end of line markers
and end of file marker (if exist) will be correctly interpreted.

I recommend fgets() for a line-oriented reading

Similary, when you create a text file, be sure to open it in text mode
("w" or "a") so that the '\n' character is properly encoded on the
file.
(The actual value is compiler dependent). Not to mention that some
system (say MS-DOS) append a special character (say Ctrl-Z) to mark the
end of text files.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

..sig under repair



Malcolm 10-02-2005 07:37 PM

Re: What exactly is a text character in the computer?
 
"Martijn" <subscription-remove-101@hot-remove-mail.com> wrote
>
>> My question is what exactly IS a text character? Is it a
>> bitmap?

>
> This is so off-topic, you wouldn't believe it. Although I shouldn't do
> this
> (because it may encourage others to post OT here as well):
>

The question is not actually off topic. It's a bit like "what does the add
sign mean?", or "when I multiply two negative numbers the program outputs a
positive, why?".

In pre-computer days a "text character" was defined by the topology of
lines. So a reasonably geometric circles with a hole in it is an "O", a
vertical triangle with a raised lower bar is a "A", and so on.

It is extremely difficult to get computers to use this system. So instead of
using writing pads, we usually use keyboards. Each key generates a character
code - for English you only need about a hundred codes to represent each
character. Internally, the computer uses these codes, almost always ASCII in
an English-speaking environment. That's why a char is usually an 8 bit
integer.

However when it comes to output, humans don't want codes. They want to see
the glyphs. These could easily be stored as bitmaps (rasters giving the dot
pattern of the character) somewhere in the computer. Alternatively you could
hook the computer up to a teletext, in which case the metal key is carved
into the shape of the character. If the computer is being used by a blind
person, you could have a device that converts the ASCII code into a pattern
of raised bumps.

These days fonts tend to be rather sophisticated, with variable pitch, anti
aliasing, kerning, sometimes other features. So the usual answer is that a
fairly complicated program writes the characters to a raster display.

However if you want to implement printf() yourself, an easy way of doing it
is to define each character by an 8 by 8 block. This gives readable output.



Mark McIntyre 10-02-2005 08:50 PM

Re: [OT] Re: What exactly is a text character in the computer?
 
On Sun, 02 Oct 2005 11:14:07 -0400, in comp.lang.c , Eric Sosman
<esosman@acm-dot-org.invalid> wrote:

> Nonsense. In the old days, characters were little metal
>dies that pressed an inked ribbon against paper


Goodness me, whats with this ribbon thing? Characters were set into
great plates by highly paid typesetters, put onto a press, inked and
the paper rolled over them. This happened up until the 1980s in the
UK.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Walter Roberson 10-02-2005 09:06 PM

Re: What exactly is a text character in the computer?
 
In article <433ff6f4$0$11071$e4fe514c@news.xs4all.nl>,
Martijn <subscription-remove-101@hot-remove-mail.com> wrote:
>thenightfly@comcast.net wrote:
>> My question is what exactly IS a text character? Is it a
>> bitmap?


><OT>
>In the old days (and still today if you switch to CLI/DOS mode or run a
>UNIX-like OS without a GUI like X) the characters were stored in memory in a
>special location (setting some pointers in the BIOS memory, you could
>override these) as bitmaps.


Character bitmaps stored in BIOS-accessible memory is a new-fangled
innovation. Real video character bitmaps are pulled from ROM in a
character-generator circuit. Provided, that is, that you can
get a high enough yield on the ROMs -- otherwise you Do The Right Thing
and use AND and NOT chips and shift registers.
--
Programming is what happens while you're busy making other plans.

Skarmander 10-02-2005 09:25 PM

Re: What exactly is a text character in the computer?
 
Malcolm wrote:
> "Martijn" <subscription-remove-101@hot-remove-mail.com> wrote
>
>>>My question is what exactly IS a text character? Is it a
>>>bitmap?

>>
>>This is so off-topic, you wouldn't believe it. Although I shouldn't do
>>this
>>(because it may encourage others to post OT here as well):
>>

>
> The question is not actually off topic. It's a bit like "what does the add
> sign mean?", or "when I multiply two negative numbers the program outputs a
> positive, why?".
>

<snip>
Riiiight. That's not far from claiming that just about any topic
involving programming is alright for c.l.c, since C is a programming
language.

It definitely has nothing to do with C specifically, since obviously,
the rest of what you posted applies to computers in general, whether
you're using C, Pascal, Ada, or a Turing machine. The question of how C
handles characters is another matter.

But if we're on that track, let's pull in the whole
character/glyph/encoding story, rather than stick to the ASCII world.
http://www.cs.tut.fi/~jkorpela/chars.html seems like a nice start.

Dealing with characters in terms of what they represent on an abstract
level tends to be more common than having to know how they're displayed,
but of course that's an important area of study as well. See
http://redsun.com/type/abriefhistoryoftype/ for a nice overview of the
history of typography, including early digital typography.

S.

Joe Wright 10-02-2005 09:35 PM

Re: What exactly is a text character in the computer?
 
Emmanuel Delahaye wrote:
> thenightfly@comcast.net wrote on 02/10/05 :
>
>> Ok, I know all about how binary numbers translate into text characters.
>> My question is what exactly IS a text character? Is it a bitmap?

>
>
> A text file is just another binary file. What counts is the way it is
> opened and read. Use fopen() with "r", so that the end of line markers
> and end of file marker (if exist) will be correctly interpreted.
>
> I recommend fgets() for a line-oriented reading
>
> Similary, when you create a text file, be sure to open it in text mode
> ("w" or "a") so that the '\n' character is properly encoded on the file.
> (The actual value is compiler dependent). Not to mention that some
> system (say MS-DOS) append a special character (say Ctrl-Z) to mark the
> end of text files.
>


Don't frighten the children. If you fopen() a text file with mode "r"
you will never see '\r' nor 0x1a (^Z). Trust me on this. :-)

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---


All times are GMT. The time now is 11:23 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.