[comp.sys.amiga.advocacy] Here's an EASY one for you Character Set Interpretation

dac@prolix.pub.uu.oz.au (Andrew Clayton) (04/12/91)

In article <1097@cbmger.UUCP>, Peter Kittel GERMANY writes:

> In article <18f73ee5.ARN18a5@prolix.pub.uu.oz.au> dac@prolix.pub.uu.oz.au writes:
> >In article <1080@cbmger.UUCP>, Peter Kittel GERMANY writes:
> >
> >> Ehm, I think here's a flame necessary: WHY THE H*LL DO YOU ONLY RECOGNIZE
> >> 95 CHARACTERS??? From my counting, the Amiga character set holds excatly
> >
> > and if I had a 'read the bitmap from the font'
> >program, I could do it, I guess. But I don't. Yet. Is anyone going to answer
> >that one? [Remember - Arexx solutions only!]
> 
> Sorry, not yet ARexx literate. In AmigaBasic:
> FOR i=2 to 15:IF i=8 then i=10  ' skip Ctrl chars
> PRINT i,:FOR j=0 to 15:PRINT CHR$(i*16+j);"  ";:NEXT:PRINT:NEXT

Err, yeah, but that isn't what I want to do, Peter.

Harking back to my original question; there are bitmaps for each character in
a font, available [somehow] via pointers to structures in the font.  I need to
access the bitmap - AND INTERPRET IT.

0xFFFF = 1 1 1 1   1 1 1 1   1 1 1 1   1 1 1 1 == ****************
0x2525 = 0 0 1 0   0 1 0 1   0 0 1 0   0 1 0 1 ==   *  * *  *  * *
0xACAC = 1 0 1 0   1 1 0 0   1 0 1 0   1 1 0 0 == * * **  * * **
0x7337 = 0 1 1 1   0 0 1 1   0 1 1 1   0 0 1 1 ==  ***  ** ***  **

(That pattern doesn't make any sense, I just picked the numbers out of thin
air)

This was, I can take the BITMAP for '@' and print it out as a BIG character.

Trouble is, I don't know how to access the bitmap from Arexx, which is what my
original question was.

> >Manipulating characters that are generated by deadkeys is, to my eyes, a
> >hardship that I don't want to go through.
> 
> You don't need to consider dead keys. You just design the final accented
> chars. And thus things get really easy: For most of these MSB chars, you
> can duplicate the entry for one pure char with MSB==0 and simply add a
> little accent or umlaut to it, easy!

We are working at odds here, Peter; if I want to convert some text to BIGCHAR
format, I pass a string to my program, and it uses the character passed as a
jump into the font structure, and then I examine what bitmap is available, and
print out that character.  In actuality, with a 8*8 font, I would construct
eight lines of text seperately.  Here is how I currently do it, with my
self-supplied array [which is a 6 * 7 array!];

LenStart = 1
DO Lines = 1 to NumLines
  DO Chars = 1 to MaxCharsOnLine
    TempChar = SUBSTR(ARGLine,LenStart,1)                 /* Get Char      */
    IF TempChar = " " THEN TempChar = ""                  /* Is it a " "?  */
    DO Loop = 1 to 6
      String = "N" || TempChar || "." || Loop             /* String = NC.n */
      TextLine.Loop = TextLine.Loop || VALUE(String)      /* Magic Value!!!*/
    END
    LenStart = LenStart + 1                               /* Increment ^Char*/
  END
  DO Loop = 1 to 6        /* Print out the formatted character */
    Say TextLine.Loop     /* One row of characters a time */
    TextLine.Loop = " "   /* Delete the TextLine variables */
  END
END

[example of character set]

NA.1 = "  ___  ";  NG.1 = "  ___  ";  NM.1 = " _   _ ";  NS.1 = "  _____"
NA.2 = " /***\ ";  NG.2 = " /***\ ";  NM.2 = "|*\_/*|";  NS.2 = " /****/"
NA.3 = "|*|_|*|";  NG.3 = "|*| ~~ ";  NM.3 = "|*\*/*|";  NS.3 = "<*<__  "
NA.4 = "|*****|";  NG.4 = "|*| __ ";  NM.4 = "|*\*/*|";  NS.4 = " \***\ "
NA.5 = "|*| |*|";  NG.5 = "|*||**|";  NM.5 = "|*| |*|";  NS.5 = "____>*>"
NA.6 = "|*| |*|";  NG.6 = " \***/ ";  NM.6 = "|*| |*|";  NS.6 = "\****/ "

(****)

Example output:

rx bigchar silly game

   _____ _____  _      _     __   __         ___    ___   _   _  _____  
  /****/|*****||*|    |*|    \*\ /*/        /***\  /***\ |*\_/*||*****| 
 <*<__    |*|  |*|    |*|     \*X*/        |*| ~~ |*|_|*||*\*/*||*|__
  \***\   |*|  |*|    |*|      |*|         |*| __ |*****||*\*/*||****|  
 ____>*> _|*|_ |*|___ |*|___   |*|         |*||**||*| |*||*| |*||*|___  
 \****/ |*****||*****||*****|  |*|          \***/ |*| |*||*| |*||*****|

(***)

Capische?

> >Who is going to use ASCII 193 in the normal scheme of things?
> 
> Well, it's like all those security checks in a program: Were you *really*
> able to allocate those 16 bytes? Many people don't check for such little
> things, but one day, on a special situation: poof!

The whole problem is irrelevant if I jump straight into the font array based
upon the character's ASCII value.

> >[Offhand, I don't know what ASCII 193 even is :-)]

     ********************************************************************
     *[Oops, 'ASCII 193' is a misnomer; ASCII / ANSI only defines 0-127]*
     ********************************************************************

> From AmigaBasic manual, appendix A: it's a capital A with aigu accent.

:-) I always knew that the AmigaBasic manual served SOME purpose!

> >Those things with accents, graves, and umlauts on them?  Removing all that
> >extraneous data makes [the ascii part of] dumps easier to read!  Obviously!
>                         ^^^^^^^^^^^^^^           ^^^^^^ AAARRRRGGH!!!
> 1. The "other" part is also ascii, 2. I find it more readable when there
> are not suddenly holes in plain text.

No, they aren't.  They are outside of the standard ASCII / ANSI character
range. I'm not interested in getting into an argument about character set
standards, I didn't come here for an argument, or for 'being hit on the head'
lessons :-).

I thank you for your efforts though. You at least tried. 

Dac
--
David Andrew Clayton. // _l _  _ dac@prolix.pub.uu.oz.au    *or*|I post.I am.
Canberra, Australia.\X/ (_](_l(_ ccadfa.cc.adfa.oz.au!prolix!dac@munnari.oz