UTF8 and the visual menu

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9634

    UTF8 and the visual menu

    I've been looking at how to make the visuals menu (in the knowledge menus) play nicely with UTF8, and I think I know technically what to do. However, it seems to me that that's the wrong thing to do.

    The visuals menu was all fine when you were dealing with 128 (or with xchars, 256) possible glyphs for a monster/object/feature, but with UTF8 there are thousands to choose from. So it seems to me that once all the front ends have moved to UTF8, the visual menu will really be kind of useless - except maybe for changing colours. A shame, but there it is.

    Opinions?
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    Seems like you should be able to know which symbols are actually used by the game and only display those. Perhaps put a hook into the file loaders to add all 'G' lines to a structure that tracks used characters. Deciding on the size of that structure would be tricky; optimally there'd be an entry for every possible character but there's over a million of those and 99+% would go unused. I guess you could add it to limits.txt.

    Comment

    • ekolis
      Knight
      • Apr 2007
      • 921

      #3
      But isn't the point of the menu to CHANGE the symbols? Why would you want to limit it to only those that are already being used?

      I think another possibility might be to let the user type in the Unicode hex code for the symbol he wants to use; he can always look it up in an external location such as charmap.exe on Windows, or the Unicode spec online...
      You read the scroll labeled NOBIMUS UPSCOTI...
      You are surrounded by a stasis field!
      The tengu tries to teleport, but fails!

      Comment

      • Derakon
        Prophet
        • Dec 2009
        • 9022

        #4
        I was thinking specifically about the use case where you want to find a glyph that is currently in use. I agree that letting the user write in the hex value for the glyph they want would be a good idea as far as selecting new glyphs is concerned. Writing our own glyph browser seems excessive when there are plenty of resources online to accomplish the same goal with a much less limited UI.

        Comment

        • nppangband
          NPPAngband Maintainer
          • Dec 2008
          • 926

          #5
          Originally posted by Nick
          I've been looking at how to make the visuals menu (in the knowledge menus) play nicely with UTF8, and I think I know technically what to do. However, it seems to me that that's the wrong thing to do.

          The visuals menu was all fine when you were dealing with 128 (or with xchars, 256) possible glyphs for a monster/object/feature, but with UTF8 there are thousands to choose from. So it seems to me that once all the front ends have moved to UTF8, the visual menu will really be kind of useless - except maybe for changing colours. A shame, but there it is.

          Opinions?
          For the symbol, instead of displaying all of the possible characters and let them scroll, just ask them to enter the new character as a prompt?
          NPPAngband current home page: http://nppangband.bitshepherd.net/
          Source code repository:
          https://github.com/nppangband/NPPAngband_QT
          Downloads:
          https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

          Comment

          • Nick
            Vanilla maintainer
            • Apr 2007
            • 9634

            #6
            Thanks to everyone for the replies (here and #angband-dev). Plan is:
            1. For ascii utf8, you can choose colour from displayed options, and enter unicode symbols as U+xxxx, where the x's are hex digits (this is the format unicode is most commonly shown in if you look up a table)
            2. For tiles, the existing visual tile picker
            One for the Dark Lord on his dark throne
            In the Land of Mordor where the Shadows lie.

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎