Loading ...
Sorry, an error occurred while loading the content.

WCWIDTH

Expand Messages
  • seer26
    which wcwidth does gvim use when deciding how to render a character? I belive myself to be using the latest CVS vim, and when I insert a milcellaneous symbol
    Message 1 of 5 , Nov 14, 2002
    • 0 Attachment
      which wcwidth does gvim use when deciding how to render a character?

      I belive myself to be using the latest CVS vim, and when I insert
      a milcellaneous symbol (0x2600-0x2689), gvim uses guifont narrow,
      and renders it single width.

      Im am under the impression that these are unreadable in single
      width. The unicode "East Asian Width" spec is borderline useless
      because is steadfastly refuses to take an opinion on any character
      not encoded by some east asian legacy encoding.

      It would be easy to modify vim's utf_char2cells to consider the
      misc symbols to be wide.
    • Bram Moolenaar
      ... For Unicode, you mean? Vim has its own implementation. The library wcwidth() doesn t necessarily work for Unicode. ... Vim follows the standard. There
      Message 2 of 5 , Nov 15, 2002
      • 0 Attachment
        seer26 wrote:

        > which wcwidth does gvim use when deciding how to render a character?

        For Unicode, you mean? Vim has its own implementation. The library
        wcwidth() doesn't necessarily work for Unicode.

        > I belive myself to be using the latest CVS vim, and when I insert
        > a milcellaneous symbol (0x2600-0x2689), gvim uses guifont narrow,
        > and renders it single width.
        >
        > Im am under the impression that these are unreadable in single
        > width. The unicode "East Asian Width" spec is borderline useless
        > because is steadfastly refuses to take an opinion on any character
        > not encoded by some east asian legacy encoding.
        >
        > It would be easy to modify vim's utf_char2cells to consider the
        > misc symbols to be wide.

        Vim follows the standard. There are a number of ambiguous characters,
        the width could be made configurable for those (I have a patch for that
        somewhere). Otherwise you will just have to use a bigger font.

        --
        Portable Computer: A device invented to force businessmen
        to work at home, on vacation, and on business trips.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
        \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
        \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
      • Maiorana, Jason
        ... Right, the standard being though East Asian (Legacy) Character Width rather than Character Width . Also, vim doesnt follow it exactly, afaik, or there
        Message 3 of 5 , Nov 15, 2002
        • 0 Attachment
          > > It would be easy to modify vim's utf_char2cells to consider the
          > > misc symbols to be wide.

          >Vim follows the standard. There are a number of ambiguous characters,
          >the width could be made configurable for those (I have a patch for that
          >somewhere). Otherwise you will just have to use a bigger font.

          Right, the standard being though "East Asian (Legacy) Character Width"
          rather than "Character Width". Also, vim doesnt follow it exactly,
          afaik, or there would be one function or arg for "asian context" also.
          For example, the sjis star 0x2606, is always wide when used in
          japanese locales, but vim has no way to represent that.


          If you use any proportional font, then the biohazard symbol etc will
          be bigger than say, a lowercase "I".


          BTW, I applied a one-liner change to "utf_char2cells" to put chars
          (0x2600-0x2689) in the double-wide category. It works great in gvim
          on my linux box, because my wide font has some of these characters
          and my narrow font has none of them.

          Going through putty however, it seems to want to print these characters
          as narrow (despite how unreadable they become), so I guess this
          cant just be hardcoded...
        • Bram Moolenaar
          ... The patch that I mentioned will check the language used (through the locale) to adjust the default. That should already work a lot better. ... Vim always
          Message 4 of 5 , Nov 15, 2002
          • 0 Attachment
            Jason Maiorana wrote:

            > > > It would be easy to modify vim's utf_char2cells to consider the
            > > > misc symbols to be wide.
            >
            > >Vim follows the standard. There are a number of ambiguous characters,
            > >the width could be made configurable for those (I have a patch for that
            > >somewhere). Otherwise you will just have to use a bigger font.
            >
            > Right, the standard being though "East Asian (Legacy) Character Width"
            > rather than "Character Width". Also, vim doesnt follow it exactly,
            > afaik, or there would be one function or arg for "asian context" also.
            > For example, the sjis star 0x2606, is always wide when used in
            > japanese locales, but vim has no way to represent that.

            The patch that I mentioned will check the language used (through the
            locale) to adjust the default. That should already work a lot better.

            > If you use any proportional font, then the biohazard symbol etc will
            > be bigger than say, a lowercase "I".

            Vim always uses monospaced fonts.

            > BTW, I applied a one-liner change to "utf_char2cells" to put chars
            > (0x2600-0x2689) in the double-wide category. It works great in gvim
            > on my linux box, because my wide font has some of these characters
            > and my narrow font has none of them.

            What locale are you using?

            > Going through putty however, it seems to want to print these characters
            > as narrow (despite how unreadable they become), so I guess this
            > cant just be hardcoded...

            Xterm uses the same table as Vim does, thus it matches well there. I
            assume putty is doing a similar thing.

            --
            A fine is a tax for doing wrong. A tax is a fine for doing well.

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
            \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
            \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
          • Maiorana, Jason
            ... I meant that as an example for readability purposes ... regardless, the current vim I have doesnt consider locale in utf_char2cells, and I dont have the
            Message 5 of 5 , Nov 15, 2002
            • 0 Attachment
              >> If you use any proportional font, then the biohazard symbol etc will
              >> be bigger than say, a lowercase "I".
              >Vim always uses monospaced fonts.
              I meant that as an example for readability purposes

              >> BTW, I applied a one-liner change to "utf_char2cells" to put chars
              >> (0x2600-0x2689) in the double-wide category. It works great in gvim
              >> on my linux box, because my wide font has some of these characters
              >> and my narrow font has none of them.
              >What locale are you using?

              regardless, the current vim I have doesnt consider locale in
              utf_char2cells, and I dont have the patch you mentioned.


              > > Going through putty however, it seems to want to print these
              characters
              > > as narrow (despite how unreadable they become), so I guess this
              > > cant just be hardcoded...
              > Xterm uses the same table as Vim does, thus it matches well there. I
              > assume putty is doing a similar thing.

              That makes me wonder if there should then be some locale- specific
              width then, stored as part of the locale. Rather then configuring
              vim or xterm, both of those would just lookup the width in the
              locale configuration...
            Your message has been successfully submitted and would be delivered to recipients shortly.