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

Font handling issues/suggestions/bugs

Expand Messages
  • Ron Aaron
    I am currently working on three OSes at the same time: Win32, Linux and Mac OS/X - and I am using the same vimrc settings on all three. Mostly the same,
    Message 1 of 9 , Apr 1 11:23 PM
    View Source
    • 0 Attachment
      I am currently working on three OSes at the same time: Win32, Linux
      and Mac OS/X - and I am using the same vimrc settings on all three.
      Mostly the same, anyway.

      One area which causes problems is font handling. All three systems
      (GTK2 on Linux) have very similar font handling, but not similar
      enough to be easy to make work on all at once.

      ":help setting-guifont" illustrates this problem. Why not use the
      same fontspec on Win32, GTK and Mac OS/X? I propose that the spec:

      set guifont=Luxi_Mono:h13

      be the 'canonical' font format for these systems; then only GTK2
      support needs to be modified. If the font isn't found, then
      substitute spaces for the underscores and try again. It would make
      cross-platform vimrc files much easier to maintain.

      Further, it would be helpful to have a "getfontsize()" function to
      parallel "getfontname()". It would return the current font size being
      used. Currently, the "getfontname()" will not also return font size
      if e.g. "set gfn=Courier" is set (then "Courier" is returned, not
      "Courier:h12" or whatever).

      Also: "getfontname()" doesn't always work (Mac OS/X, anyway). After
      my gvim has started, "getfontname()" returns an empty string.

      It would also be "really nice" to allow a per-window font. That is,
      make 'gfn' a window-specific setting. That might not be too hard, but
      I don't know if Bram will agree to it.

      That's all for now :)
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • George V. Reilly
      ... If you had Courier:h12 in one window and Monaco:h15 in another, how would you reconcile the two grids? On a related note, it would be nice if it were
      Message 2 of 9 , Apr 1 11:57 PM
      View Source
      • 0 Attachment
        On Wed, Apr 1, 2009 at 11:23 PM, Ron Aaron <rambamist@...> wrote:
        >
        > I am currently working on three OSes at the same time: Win32, Linux
        > and Mac OS/X - and I am using the same vimrc settings on all three.
        > Mostly the same, anyway.
        >
        > One area which causes problems is font handling. All three systems
        > (GTK2 on Linux) have very similar font handling, but not similar
        > enough to be easy to make work on all at once.
        >
        > ":help setting-guifont" illustrates this problem. Why not use the
        > same fontspec on Win32, GTK and Mac OS/X? I propose that the spec:
        >
        > set guifont=Luxi_Mono:h13
        >
        > be the 'canonical' font format for these systems; then only GTK2
        > support needs to be modified. If the font isn't found, then
        > substitute spaces for the underscores and try again. It would make
        > cross-platform vimrc files much easier to maintain.
        >
        > Further, it would be helpful to have a "getfontsize()" function to
        > parallel "getfontname()". It would return the current font size being
        > used. Currently, the "getfontname()" will not also return font size
        > if e.g. "set gfn=Courier" is set (then "Courier" is returned, not
        > "Courier:h12" or whatever).
        >
        > Also: "getfontname()" doesn't always work (Mac OS/X, anyway). After
        > my gvim has started, "getfontname()" returns an empty string.
        >
        > It would also be "really nice" to allow a per-window font. That is,
        > make 'gfn' a window-specific setting. That might not be too hard, but
        > I don't know if Bram will agree to it.

        If you had Courier:h12 in one window and Monaco:h15 in another, how
        would you reconcile the two grids?

        On a related note, it would be nice if it were possible to supply a
        set of alternatives to guifont, as in CSS. GVim would work its way
        down the list until it found one that was present on the system; e.g.,

        :set guifont=Consolas:h12,Monaco:h12,Andale_Mono:h13,Lucida_Console,Courier:h13

        And then maybe the Vim-supplied fallback value of guifont could be
        changed to something pleasanter, especially on Windows, to, say
        Consolas,Lucida Console,Terminal.

        --
        /George V. Reilly george@...
        http://www.georgevreilly.com/blog http://blogs.cozi.com/tech

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Ron Aaron
        guifont already does exactly this - see help guifont . I ve got gfn set to something like what you list already. Why do you need to reconcile two grids? Have
        Message 3 of 9 , Apr 2 12:05 AM
        View Source
        • 0 Attachment
          guifont already does exactly this - see 'help guifont'. I've got gfn
          set to something like what you list already.

          Why do you need to reconcile two grids? Have different grids in
          different windows - what is the problem with that?

          On Apr 2, 9:57 am, "George V. Reilly" <geo...@...> wrote:
          > On Wed, Apr 1, 2009 at 11:23 PM, Ron Aaron <rambam...@...> wrote:
          >
          > > I am currently working on three OSes at the same time: Win32, Linux
          > > and Mac OS/X - and I am using the same vimrc settings on all three.
          > > Mostly the same, anyway.
          >
          > > One area which causes problems is font handling.  All three systems
          > > (GTK2 on Linux) have very similar font handling, but not similar
          > > enough to be easy to make work on all at once.
          >
          > > ":help setting-guifont" illustrates this problem.  Why not use the
          > > same fontspec on Win32, GTK and Mac OS/X?  I propose that the spec:
          >
          > >   set guifont=Luxi_Mono:h13
          >
          > > be the 'canonical' font format for these systems; then only GTK2
          > > support needs to be modified.  If the font isn't found, then
          > > substitute spaces for the underscores and try again.  It would make
          > > cross-platform vimrc files much easier to maintain.
          >
          > > Further, it would be helpful to have a "getfontsize()" function to
          > > parallel "getfontname()".  It would return the current font size being
          > > used.  Currently, the "getfontname()" will not also return font size
          > > if e.g. "set gfn=Courier" is set (then "Courier" is returned, not
          > > "Courier:h12" or whatever).
          >
          > > Also: "getfontname()" doesn't always work (Mac OS/X, anyway).  After
          > > my gvim has started, "getfontname()" returns an empty string.
          >
          > > It would also be "really nice" to allow a per-window font.  That is,
          > > make 'gfn' a window-specific setting.  That might not be too hard, but
          > > I don't know if Bram will agree to it.
          >
          > If you had Courier:h12 in one window and Monaco:h15 in another, how
          > would you reconcile the two grids?
          >
          > On a related note, it would be nice if it were possible to supply a
          > set of alternatives to guifont, as in CSS. GVim would work its way
          > down the list until it found one that was present on the system; e.g.,
          >
          > :set guifont=Consolas:h12,Monaco:h12,Andale_Mono:h13,Lucida_Console,Courier:h13
          >
          > And then maybe the Vim-supplied fallback value of guifont could be
          > changed to something pleasanter, especially on Windows, to, say
          > Consolas,Lucida Console,Terminal.
          >
          > --
          > /George V. Reilly  geo...@...http://www.georgevreilly.com/blog%c2%a0http://blogs.cozi.com/tech
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Matt Wozniski
          ... But :h13 is only supported for win32, right? And what about the X11-motif gui, the photon gui, the athena gui? ... This wouldn t even be possible without
          Message 4 of 9 , Apr 2 12:12 AM
          View Source
          • 0 Attachment
            On Thu, Apr 2, 2009 at 2:57 AM, George V. Reilly wrote:
            >
            > On Wed, Apr 1, 2009 at 11:23 PM, Ron Aaron wrote:
            >>
            >> I am currently working on three OSes at the same time: Win32, Linux
            >> and Mac OS/X - and I am using the same vimrc settings on all three.
            >> Mostly the same, anyway.
            >>
            >> One area which causes problems is font handling.  All three systems
            >> (GTK2 on Linux) have very similar font handling, but not similar
            >> enough to be easy to make work on all at once.
            >>
            >> ":help setting-guifont" illustrates this problem.  Why not use the
            >> same fontspec on Win32, GTK and Mac OS/X?  I propose that the spec:
            >>
            >>   set guifont=Luxi_Mono:h13
            >>
            >> be the 'canonical' font format for these systems; then only GTK2
            >> support needs to be modified.  If the font isn't found, then
            >> substitute spaces for the underscores and try again.  It would make
            >> cross-platform vimrc files much easier to maintain.

            But :h13 is only supported for win32, right? And what about the
            X11-motif gui, the photon gui, the athena gui?

            >> Further, it would be helpful to have a "getfontsize()" function to
            >> parallel "getfontname()".  It would return the current font size being
            >> used.  Currently, the "getfontname()" will not also return font size
            >> if e.g. "set gfn=Courier" is set (then "Courier" is returned, not
            >> "Courier:h12" or whatever).
            >>
            >> Also: "getfontname()" doesn't always work (Mac OS/X, anyway).  After
            >> my gvim has started, "getfontname()" returns an empty string.
            >>
            >> It would also be "really nice" to allow a per-window font.  That is,
            >> make 'gfn' a window-specific setting.  That might not be too hard, but
            >> I don't know if Bram will agree to it.
            >
            > If you had Courier:h12 in one window and Monaco:h15 in another, how
            > would you reconcile the two grids?

            This wouldn't even be possible without changing the fact that vim's
            GUIs really just provide a kind of terminal emulator to run vim
            functionality in.

            > On a related note, it would be nice if it were possible to supply a
            > set of alternatives to guifont, as in CSS. GVim would work its way
            > down the list until it found one that was present on the system; e.g.,
            >
            > :set guifont=Consolas:h12,Monaco:h12,Andale_Mono:h13,Lucida_Console,Courier:h13

            That exact example should work, shouldn't it?

            > And then maybe the Vim-supplied fallback value of guifont could be
            > changed to something pleasanter, especially on Windows, to, say
            > Consolas,Lucida Console,Terminal.

            Might be a reasonable change for the default systemwide vimrc?

            ~Matt

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Ron Aaron
            ... Right - no change there, I said just Win32, Mac and GTK since they are similar in how they work. ... I don t understand why it would be a problem. On
            Message 5 of 9 , Apr 2 12:21 AM
            View Source
            • 0 Attachment
              On Apr 2, 10:12 am, Matt Wozniski <m...@...> wrote:

              > But :h13 is only supported for win32, right?  And what about the
              > X11-motif gui, the photon gui, the athena gui?

              Right - no change there, I said just Win32, Mac and GTK since they are
              similar in how they work.


              > > If you had Courier:h12 in one window and Monaco:h15 in another, how
              > > would you reconcile the two grids?
              >
              > This wouldn't even be possible without changing the fact that vim's
              > GUIs really just provide a kind of terminal emulator to run vim
              > functionality in.

              I don't understand why it would be a problem. On entering a window,
              look up the correct cell size and font for that window... that should
              be quite easy to program.


              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • George V. Reilly
              ... I think the assumption that the entire canvas is a grid of same-sized character cells is baked deep into Vim. (I m using window in the Vim sense, as in
              Message 6 of 9 , Apr 2 12:25 AM
              View Source
              • 0 Attachment
                On Thu, Apr 2, 2009 at 12:05 AM, Ron Aaron <rambamist@...> wrote:
                > On Apr 2, 9:57 am, "George V. Reilly" <geo...@...> wrote:
                >> On Wed, Apr 1, 2009 at 11:23 PM, Ron Aaron <rambam...@...> wrote:

                >> > It would also be "really nice" to allow a per-window font. That is,
                >> > make 'gfn' a window-specific setting. That might not be too hard, but
                >> > I don't know if Bram will agree to it.

                >> If you had Courier:h12 in one window and Monaco:h15 in another, how
                >> would you reconcile the two grids?

                > Why do you need to reconcile two grids? Have different grids in
                > different windows - what is the problem with that?

                I think the assumption that the entire canvas is a grid of same-sized
                character cells is baked deep into Vim. (I'm using "window" in the Vim
                sense, as in :split.)

                >> On a related note, it would be nice if it were possible to supply a
                >> set of alternatives to guifont, as in CSS. GVim would work its way
                >> down the list until it found one that was present on the system; e.g.,
                >>
                >> :set guifont=Consolas:h12,Monaco:h12,Andale_Mono:h13,Lucida_Console,Courier:h13
                >>
                >> And then maybe the Vim-supplied fallback value of guifont could be
                >> changed to something pleasanter, especially on Windows, to, say
                >> Consolas,Lucida Console,Terminal.

                > guifont already does exactly this - see 'help guifont'. I've got gfn
                > set to something like what you list already.

                Damn! I can't believe that I missed that all these years.
                --
                /George V. Reilly george@...
                http://www.georgevreilly.com/blog http://blogs.cozi.com/tech

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Ron Aaron
                ... vim is a veritable treasure-trove ;) --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_dev maillist. For more
                Message 7 of 9 , Apr 2 1:59 AM
                View Source
                • 0 Attachment
                  > > guifont already does exactly this - see 'help guifont'. I've got gfn
                  > > set to something like what you list already.
                  >
                  > Damn! I can't believe that I missed that all these years.


                  vim is a veritable treasure-trove ;)
                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_dev" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Ben Fritz
                  ... Maybe it would be possible to have guifont local to a tab? There aren t currently any tab-local options, but maybe there should be :-) This might not be
                  Message 8 of 9 , Apr 2 8:38 AM
                  View Source
                  • 0 Attachment
                    On Apr 2, 2:25 am, "George V. Reilly" <geo...@...> wrote:

                    > I think the assumption that the entire canvas is a grid of same-sized
                    > character cells is baked deep into Vim. (I'm using "window" in the Vim
                    > sense, as in :split.)
                    >

                    Maybe it would be possible to have guifont local to a tab? There
                    aren't currently any tab-local options, but maybe there should be :-)

                    This might not be possible, because I notice that the GUI window (as
                    opposed to the Vim window) changes sizes when you change the guifont
                    option.

                    But, I know tabs need some sort of independence, because you can have
                    a separate diff in each tab, for example.

                    One of these days I need to start hacking the C code so I know what
                    I'm talking about in situations like these...
                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_dev" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • Tony Mechelynck
                    ... [...] ... The difference between Vim and HTML/CSS is that in Vim the list search is global (the list will be searched once when you set the option, and the
                    Message 9 of 9 , Apr 2 3:20 PM
                    View Source
                    • 0 Attachment
                      On 02/04/09 09:25, George V. Reilly wrote:
                      >
                      > On Thu, Apr 2, 2009 at 12:05 AM, Ron Aaron<rambamist@...> wrote:
                      >> On Apr 2, 9:57 am, "George V. Reilly"<geo...@...> wrote:
                      [...]
                      >>> On a related note, it would be nice if it were possible to supply a
                      >>> set of alternatives to guifont, as in CSS. GVim would work its way
                      >>> down the list until it found one that was present on the system; e.g.,
                      >>>
                      >>> :set guifont=Consolas:h12,Monaco:h12,Andale_Mono:h13,Lucida_Console,Courier:h13
                      >>>
                      >>> And then maybe the Vim-supplied fallback value of guifont could be
                      >>> changed to something pleasanter, especially on Windows, to, say
                      >>> Consolas,Lucida Console,Terminal.
                      >
                      >> guifont already does exactly this - see 'help guifont'. I've got gfn
                      >> set to something like what you list already.
                      >
                      > Damn! I can't believe that I missed that all these years.

                      The difference between Vim and HTML/CSS is that in Vim the list search
                      is global (the list will be searched once when you set the option, and
                      the leftmost font found on the system will be applied to the whole of
                      Vim) while in HTML and CSS it is characterwise (for every character, the
                      first font in the list which has a nondefault glyph for that character
                      will be applied to it).


                      Best regards,
                      Tony.
                      --
                      The Army has carried the American ... ideal to its logical conclusion.
                      Not only do they prohibit discrimination on the grounds of race, creed
                      and color, but also on ability.
                      -- T. Lehrer

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