Re: Angband with an accent: displaying extended characters



On 2005-10-15 14:30:16, Leon Marrick <none@xxxxxxxxxxx> wrote:

*big snip*

> Now for some coding.
>
> In the text file pharser, we need something to look at a name.
> When it sees a " ^ ", it looks at the second character to figure out
> what accent to apply. In this case, we have a forward single quote (" '
> "), which means forward slant accent. The third character is the letter
> itself; in this case, a lowercase " u ".
>
> We now need a lookup table. Each character set will have a
> different character that shows a lowercase u with a forward slant
> accent. So we add a preference type, write up the various possible
> combinations for recognized accented characters, and let the game read
> them into a table on load. If two systems have differing character
> sets, then we just have different preference lists for them.

You may be planning this already, but if not, here's a suggestion:

Why not use a function hook to translate such things, rather than writing lookup
tables into the main game code? You would define your hook type [1] so that it
took the plain character and a code for the accent. Make a default function
that returns that character without any modification [2] (this means that by
default, if a system doesn't override the hook, they get plain, totally
compatible ASCII characters).

In your main-win.c file, you then write a function that converts it to Windows'
version of extended characters. Same goes for any other platforms that can
support it.

The only issue I can think of is how it will affect character dumps. You'd have
to convert back into ASCII for that, so it might be worthwhile doing another
hook for converting back. I just don't like the idea of trying to write lots
of conversion tables into the main game code.

(Examples)
[1] typedef unsigned byte (*hook_convert_accent)(unsigned char c, byte accent);
(where c is the character, and accent is an index for an accent; 1 could be an
acute, 2 for a grave, etc.)

[2] unsigned byte convert_dummy(unsigned char c, byte accent) { return c; }

--
We must aim for perfection, but settle for progress.

.



Relevant Pages

  • Re: This week on Dancing with the Stars Re: The Business Memoir - the ``whom question
    ... This was about an actor speaking with the express purpose of having ... An actor attempting to imitate an accent is absolutely, ... One character speaks with a Manchester ... Hugh Laurie's General American is impeccable in *House*, ...
    (sci.lang)
  • Re: Too few Asian Voice Actors
    ... one important issue is the right accent for the ... character is dubbed with a generic, ... The voice was changed by the time the film was released in the U.S. ... I have a kung fu movie where all the English dub voices are Asian VAs ...
    (rec.arts.anime.misc)
  • Re: Too few Asian Voice Actors
    ... > Relic watched a cat walk across the keyboard, randomly typing the ... and had the accent to prove it). ... > removed before the movie was filmed. ... He played a character called "Briar Gates", ...
    (rec.arts.anime.misc)
  • Re: strange character issues
    ... instead it becomes an accent mark on the next ... character I type, s' was typed as aprstophe s. ... Type the apostrophe once, and you'll get an accent. ...
    (Fedora)
  • Re: TRANSSIBERIAN (no spoilers)
    ... weaving her character, if we'd let it. ... lets Emily off the hook for her deed... ... in The Birds about Tipi Hedren's character doing charity work. ... Woody Harrelson at his geekiest, ...
    (rec.arts.movies.current-films)