[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  FANSI Follow-Up

FANSI Follow-Up

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Elkaintmoose   (3 posts)  [Biography] bio
Date Wed 13 Sep 2006 11:37 PM (UTC)

Amended on Wed 13 Sep 2006 11:38 PM (UTC) by Elkaintmoose

Message
Nick:

Following up on a support-ticket question:

Quote:
...there's a new MUSH client under development for Mac OSX (we've been *sorely* in need of one), and I mentioned the possibility of FANSI support to the developer...I know MUSHclient has supported FANSI for some time...do you know where I might get information about the FANSI spec. and FLAG implementation?


In checking, I realized my source for the information was this forum! http://mushclient.com/scripts/showbug.php?bugid=453&productid=0&searchfor=

Does that clear things up at all? I was probably asking the wrong question...

Thanks,
J.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 14 Sep 2006 12:46 AM (UTC)
Message
OK, I'm not totally sure what the question is now. It seems from what I can make out here that the ANSI support in MUSHclient happens to work with FANSI, whatever that is exactly.

I'm not sure what part I can help you with. Do you mean just the normal ANSI colour mappings? That is pretty-well documented in various places.

There is a checkbox in my output configuration: Alternative inverse/highlight display. Is that the relevant part?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Elkaintmoose   (3 posts)  [Biography] bio
Date Reply #2 on Thu 14 Sep 2006 01:08 AM (UTC)
Message
Well, now I guess I'm not sure, either. I suppose the main thing is support for...ehat would you call them...extended ascii characters? The special border characters, etc. in the Terminal font? I'm assuming, then, your "support" then was accidental/coincidental and not anything you had to go out of the way for? I'm no developer, though...when I mentioned it, I suppose she assumed a spec., and I assumed a spec. -- maybe there's no spec.!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 14 Sep 2006 02:58 AM (UTC)
Message
To be honest, I think you know as much about as I do. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Elkaintmoose   (3 posts)  [Biography] bio
Date Reply #4 on Thu 14 Sep 2006 10:28 AM (UTC)
Message
Awesome! Well, I'll take over from here, then, if you don't mind! ;) (Sorry to have troubled you!)
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #5 on Thu 14 Sep 2006 06:46 PM (UTC)

Amended on Sat 16 Sep 2006 01:31 AM (UTC) by Shadowfyr

Message
Those extended characters, for boxes, etc. are *only* supported via either a font like "Terminal", which has them, and has sadly never been converted to TTF, so can't be used in a truely scalable way, like the rest, or through unicode/UTF-8, in fonts that support the range they are in, like Lucida Console. Other fonts do not include the characters. But, if you are using a mud where they are used as part of the standard set, I.e., they expect you to be using Terminal, then they are unavailable when using any other font either.

This personally bugs the heck out of me, since the font layouts for most are imho incompletely and not always a 100% match from font to font. Since Terminal isn't truely scalable (it has fixed sizes, not the "any size you want" of TTF) people abandoned it in favor of others, so you never really know what the guy on the other end is using, or if it will display "anything" the same way as your client, unless its the standard set of symbols, numbers and letters. Any support for the extended characters that are in Terminal requires a) use of the effectively broken non-TTF Terminal font *or* a client that remaps that range into the Unicode characters that match it. Mushclient doesn't do the later, though its possible, using packet interception, that one "might" be able to do so through scripting.

Looking at google, this basically appears to be what people are talking about. Resurrecting the characters from x80 to xFF, which in the PC video cards and in terminal, as well as in the lower range, include things like smilly faces, box lines, hatch patterns, etc. For example, the only site specifically mentioning it as part of a client is:

http://www.moosh.net/mush/List/soc.shtml

At one time people use the hatch patterns and a mix of colors to produce pretty good mimics of pictures. If properly scalable, a client that wrapped at the window edge, instead of a specific column, could use something like a 6 point font, to produce a decent 160x120 image using the trick, for example. Mostly though, it was just used to draw boxes around things and stuff like that.

So, Mushclient supports it "with the right font" or through some scripting tricks (maybe), but not natively, since that would require the client to have a setting for "Remap extended characters to FANSI.", and do substitution of the right font to have it work. Mushclient currently only allows one output font, so if you used something like Times Roman, which I don't think has those characters, it couldn't remap to Lucida Console when it needed those characters anyway.

Hope that clears things up for everyone involved.

*NOTE*: I have no idea if these clients are adding in something like MXP, where they go: "<fansi>abcdef</fansi>", instead of just doing a direct font mapping or even adding something new to the ANSI commands that activates the translation, then shuts it off. While it would possibly make more sense to do it that way, since you don't lose what ever the font already has in that range, if that is what is going on, then Mushclient "definitely" doesn't support it, again, unless you maybe did some scripting tricks to fake it and the font you use already had those characters hiding someplace in the unicode ranges.

In theory, the "fix" would work something like this (though its probably not what Nick intended when he made the command):

function OnPluginPacketRecieved(packet)
  if getvariable("sim") = "y" then
    setvariable "sim", "n"
    OnPluginPacketRecieved = vbTrue
  else
    for x = 1 to len(packet)
      if mid$(packet,x,7) = "<fansi>" then
        for y = x to len(packet)
          if mid$(packet,y,8) = "</fansi>" then
            x = y + 9
            exit for
          end if
          rpac = mid$(packet,y,1)
          select case rpac
            case ... 'Remap characters to the UTF-8 characters you need.
              npac = ... 'UTF-8 must be "on" for this to work.
            ...
          end select
          fpac = fpac + npac
        next y
      else
        fpac = fpac + mid$(packet,x,1)
      end if
    next x
    simulate fpac
    OnPluginPacketRecieved = vbFalse
  end if
end function


Note, I haven't ever used this function, so forgive me if I got its name or other things wrong about it (such as wether "simulate" triggers it). If "simulate" doesn't, then one of the if/then statements can be removed.

---Made a minor fix. Was using 'rmap', but figured that might be confusing since people elsewhere are working on mappers, but forgot to change one of the 'rmap' to 'rpac'. The code isn't complete anyway, but figured it was a good idea to fix it.
[Go to top] top

Posted by Onoitsu2   USA  (248 posts)  [Biography] bio
Date Reply #6 on Fri 15 Sep 2006 09:52 AM (UTC)

Amended on Fri 15 Sep 2006 09:53 AM (UTC) by Onoitsu2

Message
Simulate can and will trigger on packet recieved, to verify this turn on packet debugging, and do a simulate command, it will show up in the output from the debugged "packet" it simulated.

It was using simulate and debug packets, and on packet recieved that I was able to create my tier class name converter for aardwolf, as when you tier (remort through all possible classes, you can start over, and it is called a tier, and you get special tier benifits) the class names are different than a non-tiered character, such a mage = non-tier, and a tier 1 = sage, tier 2 = lich, etc.

Laterzzz,
Onoitsu2
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #7 on Sat 16 Sep 2006 01:32 AM (UTC)
Message
Nice to know. I thought it might, which is why I included a flag and a check to prevent it being re-tested, the next time the changed packet was processed.
[Go to top] top

Posted by Onoitsu2   USA  (248 posts)  [Biography] bio
Date Reply #8 on Sun 17 Sep 2006 08:06 AM (UTC)
Message
Further note on the Simulate command, if you wish to simulate colors, for instances where you have a color matching trigger you can do so using the same color codes as listed in the help file (ANSI, or ANSINOTE has these, cannot remember which), but use this form \27[XXm where XX is the color, or formatting option you wish to use.
Hope that that little tidbit will be benificial, and I feel it would be in a situation where you cannot omit it from output, just set it to make the text black (or whatever your "background" color is set to) and it will be less spammy, obviously you will still see a blank line, but a blank line is much less distracting.

Laterzzz,
Onoitsu2
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


25,734 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]