What exactly is a text character in the computer?

Discussion in 'C Programming' started by thenightfly@comcast.net, Oct 2, 2005.

  1. Guest

    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?
     
    , Oct 2, 2005
    #1
    1. Advertising

  2. Martijn Guest

    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
     
    Martijn, Oct 2, 2005
    #2
    1. Advertising

  3. Eric Sosman Guest

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

    Martijn wrote:

    > 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
    lid
     
    Eric Sosman, Oct 2, 2005
    #3
  4. Re: [OT] Re: What exactly is a text character in the computer?

    In article <>,
    Eric Sosman <> wrote:
    >Martijn wrote:
    >
    >> 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
     
    Rouben Rostamian, Oct 2, 2005
    #4
  5. 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
     
    Emmanuel Delahaye, Oct 2, 2005
    #5
  6. Malcolm Guest

    "Martijn" <> 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.
     
    Malcolm, Oct 2, 2005
    #6
  7. 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
    <> 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 =----
     
    Mark McIntyre, Oct 2, 2005
    #7
  8. In article <433ff6f4$0$11071$4all.nl>,
    Martijn <> wrote:
    > 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.
     
    Walter Roberson, Oct 2, 2005
    #8
  9. Skarmander Guest

    Malcolm wrote:
    > "Martijn" <> 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.
     
    Skarmander, Oct 2, 2005
    #9
  10. Joe Wright Guest

    Emmanuel Delahaye wrote:
    > 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 ---
     
    Joe Wright, Oct 2, 2005
    #10
  11. Simon Biber Guest

    Joe Wright wrote:
    > Emmanuel Delahaye wrote:
    >
    >> 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. :)


    Unfortunately, if you try to open an MS-DOS, Windows or Mac OS text file
    on a Unix-style system with fopen mode "r", you will see '\r'
    characters. If people used tools like ftp to transfer files between
    computers, which can be told to handle files as text or binary, then if
    told to use text it will handle the format conversion properly. However,
    most recent methods of file transfer just copy the files exactly, and
    don't convert text formats. It is left up to the destination application
    to be robust to different formats.

    My point is that portable C applications can no longer afford to just
    use fopen in text mode and hope that the file is in the same format that
    the local C library was expecting. It makes more sense to read files as
    binary, and be robust to all the competing text file formats. Not just
    different line endings (CR, CRLF and LF), but different character
    encodings as well. I have text files in UTF-8, UTF-16, ISO-8859-1,
    GB2312 and Big5 here. Wherever possible, I expect programs to not barf
    on any of those formats.

    --
    Simon.
     
    Simon Biber, Oct 3, 2005
    #11
  12. John Bode Guest

    wrote:
    > 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?


    That depends *entirely* on the output device. A bitmap works for a
    raster display, but not so well for a vector display or a teletype.

    This is way beyond the scope of the C programming language, btw.
     
    John Bode, Oct 3, 2005
    #12
  13. Martijn Guest

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

    Eric Sosman wrote:
    > Martijn wrote:
    >
    >> 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.


    Characters? In the old days?

    :p

    --
    Martijn
    http://www.sereneconcepts.nl
     
    Martijn, Oct 4, 2005
    #13
  14. Martijn Guest

    Walter Roberson wrote:
    > In article <433ff6f4$0$11071$4all.nl>,
    > Martijn <> wrote:
    >> 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.


    You are right - I remember specifically liking the glyphs of one video card,
    while disliking those of another (I think the latter was the Diamond Fire).
    Either way I was saying that setting some pointers in the mapped BIOS memory
    space - I am not sure which ones anymore - allowed you to specify one or two
    alternate sets, not that they were actually stored in the BIOS. Hopefully I
    am using proper nomenclature here, because I am not sure that I am.

    --
    Martijn
    http://www.sereneconcepts.nl
     
    Martijn, Oct 4, 2005
    #14
  15. In article <434418e1$0$11069$4all.nl>,
    Martijn <> wrote:
    >Walter Roberson wrote:
    >> 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.


    >You are right - I remember specifically liking the glyphs of one video card,
    >while disliking those of another (I think the latter was the Diamond Fire).
    >Either way I was saying that setting some pointers in the mapped BIOS memory
    >space - I am not sure which ones anymore - allowed you to specify one or two
    >alternate sets, not that they were actually stored in the BIOS. Hopefully I
    >am using proper nomenclature here, because I am not sure that I am.


    BIOS?? You must be one of them Pro-gress-ives chaps. You probably
    didn't even build your own terminal !! Back in my day, we had to worry
    about re-using scan lines in the ROM because 256 byte ROMs were so
    expensive.
    --
    I was very young in those days, but I was also rather dim.
    -- Christopher Priest
     
    Walter Roberson, Oct 5, 2005
    #15
  16. Lew Pitcher Guest

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Walter Roberson wrote:
    > In article <434418e1$0$11069$4all.nl>,
    > Martijn <> wrote:
    >
    >>Walter Roberson wrote:
    >>
    >>>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.

    >
    >
    >>You are right - I remember specifically liking the glyphs of one video card,
    >>while disliking those of another (I think the latter was the Diamond Fire).
    >>Either way I was saying that setting some pointers in the mapped BIOS memory
    >>space - I am not sure which ones anymore - allowed you to specify one or two
    >>alternate sets, not that they were actually stored in the BIOS. Hopefully I
    >>am using proper nomenclature here, because I am not sure that I am.

    >
    >
    > BIOS?? You must be one of them Pro-gress-ives chaps. You probably
    > didn't even build your own terminal !! Back in my day, we had to worry
    > about re-using scan lines in the ROM because 256 byte ROMs were so
    > expensive.


    Well, ain't you fancy!!

    I still have a printer that you can change the print head on to get different
    characters for the same codepoint. The one I have downstairs is a
    "daisy-wheel" printer that used a print head shaped like a 100-petal daisy.
    Each petal has a different glyph embossed in it's surface, and the printer
    rotates the print head to position each glyph behind a hammer.

    My old Teletype ASR33 used a cylinder which had 60 or so glyphs embossed on
    it. The hardware rotated the cylinder so that the proper glyph was positioned
    behind the print hammer.

    In both cases, the hammer whacked the print head, which drove the embossed
    glyph into the print ribbon, and smacked the ribbon against the paper, leaving
    an imprint of the glyph in ribbon ink on the paper. No fancy ROMs or BIOS for
    those babies. Just good old typewriter and printing press technology.

    :)


    - --
    Lew Pitcher

    Master Codewright & JOAT-in-training | GPG public key available on request
    Registered Linux User #112576 (http://counter.li.org/)
    Slackware - Because I know what I'm doing.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.7 (GNU/Linux)

    iD8DBQFDRHcAagVFX4UWr64RAprpAKCfIqxj1jRFt2CV99IV4W6Df0PatACglSEj
    vWHiYCccKxvErfyEdqJnq0Y=
    =3dqM
    -----END PGP SIGNATURE-----
     
    Lew Pitcher, Oct 6, 2005
    #16
  17. Mabden Guest

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

    "Rouben Rostamian" <> wrote in message
    news:dhov40$di3$...
    > In article <>,
    > Eric Sosman <> wrote:
    > >Martijn wrote:
    > >> 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):
    > >> 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.

    > > 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.


    Chisels? You were lucky.
    In the old days, we had to lick shapes into the stones with our tongues.
    Whole villages were forced into slavery for 5 years just to make one
    "Keep Left" sign.

    --
    Mabden
     
    Mabden, Oct 8, 2005
    #17
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A. M. G. Solo
    Replies:
    0
    Views:
    557
    A. M. G. Solo
    Jan 13, 2006
  2. A. M. G. Solo
    Replies:
    0
    Views:
    795
    A. M. G. Solo
    Jun 8, 2006
  3. Replies:
    0
    Views:
    353
  4. A. M. G. Solo (do not reply to this email address)
    Replies:
    0
    Views:
    733
    A. M. G. Solo (do not reply to this email address)
    Nov 8, 2006
  5. A. M. G. Solo
    Replies:
    0
    Views:
    742
    A. M. G. Solo
    Dec 5, 2006
Loading...

Share This Page