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

Re: why proportional fonts can't work with gvim?

Expand Messages
  • fei huang
    On Nov 30, 2007 12:19 PM, Tony Mechelynck ... why is character-cell fixed-width? in text editor like notepad, when I type with a
    Message 1 of 6 , Nov 29, 2007
    • 0 Attachment
      On Nov 30, 2007 12:19 PM, Tony Mechelynck <antoine.mechelynck@...> wrote:

      fei huang wrote:
      > I downloaded several nice japanese fonts days ago, not sure if it's
      > fixed-width or not, one of them called IPAPGothic similar with MS Gothic
      > in name,  but neither the font  can be  set with :set guifont nor
      > selectable  through the gui,  though some says fixed-width is the de
      > facto standard for programming, but doesn't vim a universal text editor?
      > The fact is any editors except vim works with proportional fonts, UE or
      > editplus, or even notepad!
      >
      > did I miss something or any reasons for vim not support it?
      >
      > thanks a lot
      >
      > daniel

      Gvim with GTK2 GUI can use any fonts; but on variable-width fonts, "larger"
      glyphs are clipped at the character-cell edge and "smaller" glyphs get blank
      pixels to "fill them out". The result is usually quite ugly (though less so in
      CJK fonts, which are usually fixed-width in practice
      why is character-cell fixed-width? in text editor like notepad, when I type with a variable-width font like Tahoma, the string "aiw" for example will be nicely arranged, that is no extra spaces around the 'i' and 'w' is not clipped or made narrower, a character cell should be resizable to fit the glyph, that's why proportional font is preferable in modern gui systems
       
      -- well,
      single-and-double-width to be precise). Of course, this gvim version works
      only under X11: this means Unix/Linux, MacOsX with X11 server, or Cygwin with
      X11 server, meaning it isn't very practical on non-Unix-like systems.

      The reason gvim (other than for GTK2) doesn't support variable-width fonts, is
      (IIUC) that its character cell is fixed-size while sending a string to the
      display takes every character's width into account. On some fonts like
      Cyrillic Lucida_Console, which declares itself as monospace but actually has
      one horizontal pixel too many in its bold glyphs, some glyphs may get painted
      over part of the next character's cell, causing extremely ugly clippings or
      overpaintings. 
      does it mean that vim purposely make its character cell fixed-size to avoid any performance drawbacks or unnecessary mistakes? ( sorry, what is a IIUC by the way?)


      About GTK2: The various GUI interfaces were written at different times and by
      different people: maybe the GTK2 GUI, which is (I think) the latest of them,
      could benefit from a more advanced text-displaying backend.
      I've been using gentoo at home, and Chinese characters can be displayed nicely, but
      they are naturally fixed-width, not sure about Japanese, will try it at home.

      BTW, I'm surprised to read that Notepad supports variable-width fonts: to the
      best of my memory, at the time I was on Windows it displayed everything in
      Fixedsys.
      hehe, have to use Windows at office, prefer linux though,  it's already Vista era now, fortunately, bill didn't  forget to upgrade notepad

      thanks for your reply

      daniel
       

      Best regards,
      Tony.
      --
      Fog Lamps, n.:
             Excessively (often obnoxiously) bright lamps mounted on the
      fronts of automobiles; used on dry, clear nights to indicate that the
      driver's brain is in a fog.

      See also "Idiot Lights".


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---

    • Tony Mechelynck
      ... Well, I suppose part of the reason is historical; but it has its advantages too: moving vertically (with j and k) has a more obvious meaning, and text
      Message 2 of 6 , Nov 29, 2007
      • 0 Attachment
        fei huang wrote:
        >
        >
        > On Nov 30, 2007 12:19 PM, Tony Mechelynck <antoine.mechelynck@...
        > <mailto:antoine.mechelynck@...>> wrote:
        >
        >
        > fei huang wrote:
        > > I downloaded several nice japanese fonts days ago, not sure if it's
        > > fixed-width or not, one of them called IPAPGothic similar with MS
        > Gothic
        > > in name, but neither the font can be set with :set guifont nor
        > > selectable through the gui, though some says fixed-width is the de
        > > facto standard for programming, but doesn't vim a universal text
        > editor?
        > > The fact is any editors except vim works with proportional fonts,
        > UE or
        > > editplus, or even notepad!
        > >
        > > did I miss something or any reasons for vim not support it?
        > >
        > > thanks a lot
        > >
        > > daniel
        >
        > Gvim with GTK2 GUI can use any fonts; but on variable-width fonts,
        > "larger"
        > glyphs are clipped at the character-cell edge and "smaller" glyphs
        > get blank
        > pixels to "fill them out". The result is usually quite ugly (though
        > less so in
        > CJK fonts, which are usually fixed-width in practice
        >
        > why is character-cell fixed-width? in text editor like notepad, when I
        > type with a variable-width font like Tahoma, the string "aiw" for
        > example will be nicely arranged, that is no extra spaces around the 'i'
        > and 'w' is not clipped or made narrower, a character cell should be
        > resizable to fit the glyph, that's why proportional font is preferable
        > in modern gui systems

        Well, I suppose part of the reason is historical; but it has its advantages
        too: moving vertically (with j and k) has a more obvious meaning, and "text
        columns" are actually vertical. For "blockwise visual mode" it would be a
        headache otherwise.

        >
        >
        > -- well,
        > single-and-double-width to be precise). Of course, this gvim version
        > works
        > only under X11: this means Unix/Linux, MacOsX with X11 server, or
        > Cygwin with
        > X11 server, meaning it isn't very practical on non-Unix-like systems.
        >
        > The reason gvim (other than for GTK2) doesn't support variable-width
        > fonts, is
        > (IIUC) that its character cell is fixed-size while sending a string
        > to the
        > display takes every character's width into account. On some fonts like
        > Cyrillic Lucida_Console, which declares itself as monospace but
        > actually has
        > one horizontal pixel too many in its bold glyphs, some glyphs may
        > get painted
        > over part of the next character's cell, causing extremely ugly
        > clippings or
        > overpaintings.
        >
        > does it mean that vim purposely make its character cell fixed-size to
        > avoid any performance drawbacks or unnecessary mistakes? ( sorry, what
        > is a IIUC by the way?)

        I don't know about performance drawbacks etc., but the Vim character cell is
        indeed fixed-size (at any moment: modifying the 'guifont' changes the cell
        size for the whole GUI).

        IIUC = If I Understand Correctly. Similarly: IIRC = If I Remember Correctly;
        YMMV = Your Mileage May Wary; BTW = By The Way: ATM = At The Moment; IMHO = In
        My Humble Opinion; etc.

        >
        >
        >
        > About GTK2: The various GUI interfaces were written at different
        > times and by
        > different people: maybe the GTK2 GUI, which is (I think) the latest
        > of them,
        > could benefit from a more advanced text-displaying backend.
        >
        > I've been using gentoo at home, and Chinese characters can be displayed
        > nicely, but
        > they are naturally fixed-width, not sure about Japanese, will try it at
        > home.
        >
        >
        > BTW, I'm surprised to read that Notepad supports variable-width
        > fonts: to the
        > best of my memory, at the time I was on Windows it displayed
        > everything in
        > Fixedsys.
        >
        > hehe, have to use Windows at office, prefer linux though, it's already
        > Vista era now, fortunately, bill didn't forget to upgrade notepad
        >
        > thanks for your reply
        >
        > daniel
        >
        >
        >
        > Best regards,
        > Tony.
        > --
        > Fog Lamps, n.:
        > Excessively (often obnoxiously) bright lamps mounted on the
        > fronts of automobiles; used on dry, clear nights to indicate that the
        > driver's brain is in a fog.
        >
        > See also "Idiot Lights".
        >
        >
        >
        > >

        Best regards,
        Tony.
        --
        The United States Army;
        194 years of proud service,
        unhampered by progress.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • fei huang
        On Nov 30, 2007 1:36 PM, Tony Mechelynck ... yes, from a programmer s perspective, I understand it. anyway, still wondering how
        Message 3 of 6 , Nov 29, 2007
        • 0 Attachment
          On Nov 30, 2007 1:36 PM, Tony Mechelynck <antoine.mechelynck@...> wrote:

          fei huang wrote:
          >
          >
          > On Nov 30, 2007 12:19 PM, Tony Mechelynck <antoine.mechelynck@...
          > <mailto:antoine.mechelynck@...>> wrote:
          >
          >
          >     fei huang wrote:
          >      > I downloaded several nice japanese fonts days ago, not sure if it's
          >      > fixed-width or not, one of them called IPAPGothic similar with MS
          >     Gothic
          >      > in name,  but neither the font  can be  set with :set guifont nor
          >      > selectable  through the gui,  though some says fixed-width is the de
          >      > facto standard for programming, but doesn't vim a universal text
          >     editor?
          >      > The fact is any editors except vim works with proportional fonts,
          >     UE or
          >      > editplus, or even notepad!
          >      >
          >      > did I miss something or any reasons for vim not support it?
          >      >
          >      > thanks a lot
          >      >
          >      > daniel
          >
          >     Gvim with GTK2 GUI can use any fonts; but on variable-width fonts,
          >     "larger"
          >     glyphs are clipped at the character-cell edge and "smaller" glyphs
          >     get blank
          >     pixels to "fill them out". The result is usually quite ugly (though
          >     less so in
          >     CJK fonts, which are usually fixed-width in practice
          >
          > why is character-cell fixed-width? in text editor like notepad, when I
          > type with a variable-width font like Tahoma, the string "aiw" for
          > example will be nicely arranged, that is no extra spaces around the 'i'
          > and 'w' is not clipped or made narrower, a character cell should be
          > resizable to fit the glyph, that's why proportional font is preferable
          > in modern gui systems

          Well, I suppose part of the reason is historical; but it has its advantages
          too: moving vertically (with j and k) has a more obvious meaning, and "text
          columns" are actually vertical. For "blockwise visual mode" it would be a
          headache otherwise.

          yes, from a programmer's perspective, I understand  it. anyway, still wondering how editors
          like editplus handles such tricky problems.

          >
          >
          >     -- well,
          >     single-and-double-width to be precise). Of course, this gvim version
          >     works
          >     only under X11: this means Unix/Linux, MacOsX with X11 server, or
          >     Cygwin with
          >     X11 server, meaning it isn't very practical on non-Unix-like systems.
          >
          >     The reason gvim (other than for GTK2) doesn't support variable-width
          >     fonts, is
          >     (IIUC) that its character cell is fixed-size while sending a string
          >     to the
          >     display takes every character's width into account. On some fonts like
          >     Cyrillic Lucida_Console, which declares itself as monospace but
          >     actually has
          >     one horizontal pixel too many in its bold glyphs, some glyphs may
          >     get painted
          >     over part of the next character's cell, causing extremely ugly
          >     clippings or
          >     overpaintings.
          >
          > does it mean that vim purposely make its character cell fixed-size to
          > avoid any performance drawbacks or unnecessary mistakes? ( sorry, what
          > is a IIUC by the way?)

          I don't know about performance drawbacks etc., but the Vim character cell is
          indeed fixed-size (at any moment: modifying  the 'guifont' changes the cell
          size for the whole GUI).
          mm, indeed,  I googled a lot for the answer before this post, seems I'm the only one in the world complains about this? ha, incrediable.

          IIUC = If I Understand Correctly. Similarly: IIRC = If I Remember Correctly;
          YMMV = Your Mileage May Wary; BTW = By The Way: ATM = At The Moment; IMHO = In My Humble Opinion; etc.
          haha, tks, I'll keep them in my notebook, all are new to me except IMHO and BTW

          >
          >
          >
          >     About GTK2: The various GUI interfaces were written at different
          >     times and by
          >     different people: maybe the GTK2 GUI, which is (I think) the latest
          >     of them,
          >     could benefit from a more advanced text-displaying backend.
          >
          > I've been using gentoo at home, and Chinese characters can be displayed
          > nicely, but
          > they are naturally fixed-width, not sure about Japanese, will try it at
          > home.
          >
          >
          >     BTW, I'm surprised to read that Notepad supports variable-width
          >     fonts: to the
          >     best of my memory, at the time I was on Windows it displayed
          >     everything in
          >     Fixedsys.
          >
          > hehe, have to use Windows at office, prefer linux though,  it's already
          > Vista era now, fortunately, bill didn't  forget to upgrade notepad
          >
          > thanks for your reply
          >
          > daniel
          >
          >
          >
          >     Best regards,
          >     Tony.
          >     --
          >     Fog Lamps, n.:
          >            Excessively (often obnoxiously) bright lamps mounted on the
          >     fronts of automobiles; used on dry, clear nights to indicate that the
          >     driver's brain is in a fog.
          >
          >     See also "Idiot Lights".
          >
          >
          >
          >     >

          thank you so much Tony.

          best regards

          daniel


          Best regards,
          Tony.
          --
          The United States Army;
          194 years of proud service,
          unhampered by progress.





          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---

        • Charles E Campbell Jr
          ... Proportional fonts war against the notion of columns. Using arrow keys or the jk keys to go up and down in the text would presumably result in the cursor
          Message 4 of 6 , Nov 30, 2007
          • 0 Attachment
            fei huang wrote:

            > I downloaded several nice japanese fonts days ago, not sure if it's
            > fixed-width or not, one of them called IPAPGothic similar with MS
            > Gothic in name, but neither the font can be set with :set guifont
            > nor selectable through the gui, though some says fixed-width is the
            > de facto standard for programming, but doesn't vim a universal text
            > editor? The fact is any editors except vim works with proportional
            > fonts, UE or editplus, or even notepad!
            >
            > did I miss something or any reasons for vim not support it?

            Proportional fonts war against the notion of columns. Using arrow keys
            or the jk keys to go up and down in the text would presumably result in
            the cursor jumping left and right. Visual blocks would be difficult to
            set up and would have ragged right and left edges. Attempts to align
            things would fail, except for leading whitespace only (as I wrote
            Align.vim and AlignMaps.vim, you might guess that I'm somewhat fond of
            aligning text!). Proportional fonts probably wouldn't work in a console
            vim and, if it did, that left-right jumping of the cursor as one
            attempted to go up/down lines would be visually much worse as the
            "cursor" in console vim is an entire character -- presumably the
            "cursor" size would be changing, too.

            Regards,
            Chip Campbell


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          Your message has been successfully submitted and would be delivered to recipients shortly.