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

wide letter spacing when using gvim (GUI mode)

Expand Messages
  • Alex Dong Li
    Dear Vim Experts, I have a quick question: when I use vim in an xterm, everything looks fine. However, when I use gvim (GUI mode), the space between letters is
    Message 1 of 12 , Feb 20, 2013
    • 0 Attachment
      Dear Vim Experts,

      I have a quick question:
      when I use vim in an xterm, everything looks fine. However, when I use gvim (GUI mode), the space between letters is big and wide. Is there a way to make gvim display the text in vim (non-GUI) way? Tried different ways to solve the issue such as changing font or size but they do not work.

      I am using gvim v7.2 that comes with redhat distribution.

      Thanks in advance!

      Alex Li

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
       
      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Ben Fritz
      ... I ve never seen this problem on Windows or Ubuntu. Can you supply a screenshot? What font are you using? Does that font not show big spaces in other
      Message 2 of 12 , Feb 20, 2013
      • 0 Attachment
        On Wednesday, February 20, 2013 10:23:52 AM UTC-6, alexdongli wrote:
        > Dear Vim Experts,
        >
        >
        > I have a quick question:
        >
        > when I use vim in an xterm, everything looks fine. However, when I use gvim (GUI mode), the space between letters is big and wide. Is there a way to make gvim display the text in vim (non-GUI) way? Tried different ways to solve the issue such as changing font or size but they do not work.
        >
        >
        >
        > I am using gvim v7.2 that comes with redhat distribution.
        >

        I've never seen this problem on Windows or Ubuntu. Can you supply a screenshot? What font are you using? Does that font not show big spaces in other applications? Is it the same as the font used by your xterm? Is it all letters or just some of them? If it's just some of them, which ones? The only setting I know of that affects character width is 'ambiwidth' but I may be missing some, and that only affects some characters.

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • John Little
        That s what you get if you use a non-monospace font with the GTK2 build of vim (that build is the default). Try switching to a font that has mono in its
        Message 3 of 12 , Feb 20, 2013
        • 0 Attachment
          That's what you get if you use a non-monospace font with the GTK2 build of vim (that build is the default). Try switching to a font that has "mono" in its name.


          Regards, John Little

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Sven Guckes
          ... can you make the problem visible to us by taking a screenshot and posting its link? which monospaced fonts have you tried? courier, monaco, profont...
          Message 4 of 12 , Feb 20, 2013
          • 0 Attachment
            * Alex Dong Li <alexdongli@...> [2013-02-20 19:14]:
            > Dear Vim Experts, I have a quick question:
            > [I am using gvim v7.2 that comes with redhat distribution.]
            >
            > when I use vim in an xterm, everything looks fine.
            > However, when I use gvim (GUI mode), the space
            > between letters is big and wide. Is there a way to
            > make gvim display the text in vim (non-GUI) way?
            >
            > Tried different ways to solve the issue such
            > as changing font or size but they do not work.

            can you make the problem visible to us by
            taking a screenshot and posting its link?

            which monospaced fonts have you tried?

            courier, monaco, profont... Bitstream Vera Sans Mono?
            Inconsolata?: http://levien.com/type/myfonts/inconsolata.html
            TheSansMono?: http://www.fontfabrik.com/fofafon4.html

            more info, please!

            Sven

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Alex Dong Li
            Dear Sirs, I am adding more details to my problem. I use monospace. I access gvim using xterm via reflectionX (an xterm app). I am attaching two files vim.png
            Message 5 of 12 , Feb 20, 2013
            • 0 Attachment
              Dear Sirs,

              I am adding more details to my problem.

              I use monospace. I access gvim using xterm via reflectionX (an xterm app). I am attaching two files vim.png and gvim.png generated using the same vimrc and the same xterm. You will immediately see what I mean. Now I know it probably has something to do with guifontwide, but just cannot get the problem solved. 
              My .vimrc file is simple:
              " set fileencodings=latin1          " tried this too but it does not work.
              set hlsearch
              set cinoptions=:0,p0,t0
              set cinwords=if,elsif,else,while,do,for,switch,case,foreach,unless,until
              set guifont=Monospace\ 8
              "set guifontset=Monospace \8      " tried this too but it does not work
              "set guifontwide=Monospace\ 8    " tried this too but it does not work.

              Here is vim detail:
              VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 17 2012 10:22:22)
              Included patches: 1-411
              Modified by <bugzilla@...>
              Compiled by <bugzilla@...>
              Huge version with GTK2 GUI.  Features included (+) or not (-):
              +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver
              +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape
               +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search
              +farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input
              +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds
              +localmap +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm
              -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme
               +netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python
              +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +startuptime
              +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo
              +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual
              +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset
              +xim +xsmp_interact +xterm_clipboard -xterm_save
                 system vimrc file: "/etc/vimrc"
                   user vimrc file: "$HOME/.vimrc"
                    user exrc file: "$HOME/.exrc"
                system gvimrc file: "/etc/gvimrc"
                  user gvimrc file: "$HOME/.gvimrc"
                  system menu file: "$VIMRUNTIME/menu.vim"
                fall-back for $VIM: "/usr/share/vim"
              Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-2.0 -I/usr
              /lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -
              I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/f
              reetype2 -I/usr/include/libpng12     -O2 -g -pipe -Wall  -fexceptions -fstack-protector --par
              am=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -D_FORTIFY_SOU
              RCE=1    -D_REENTRANT -D_GNU_SOURCE  -fstack-protector -I/usr/local/include -D_LARGEFILE_SOUR
              CE -D_FILE_OFFSET_BITS=64  -I/usr/lib64/perl5/CORE  -I/usr/include/python2.6 -pthread
              Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE   -L/usr/local/lib -o vim   -lgtk-x11-
              2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcair
              o -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   -lXt -lselinux
                -lncurses -lacl -lgpm   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE  -fstack-protector  -L/usr/
              lib64/perl5/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.6/config -lpython2.6 -lutil
              -lm -Xlinker -export-dynamic


              Thanks!

              Alex


              On Wed, Feb 20, 2013 at 12:25 PM, John Little <John.B.Little@...> wrote:
              That's what you get if you use a non-monospace font with the GTK2 build of vim (that build is the default).  Try switching to a font that has "mono" in its name.


              Regards, John Little

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.



              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
               
              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
               
               
            • Tony Mechelynck
              ... …or a font with Courier Console Fixed or Typewriter in its name: examples: Bitstream Vera Sans Mono DejaVu Sans Mono Luxi Mono Mitra Mono
              Message 6 of 12 , Feb 20, 2013
              • 0 Attachment
                On 20/02/13 19:25, John Little wrote:
                > That's what you get if you use a non-monospace font with the GTK2 build of vim (that build is the default). Try switching to a font that has "mono" in its name.
                >
                >
                > Regards, John Little
                >

                …or a font with "Courier" "Console" "Fixed" or "Typewriter" in its name:
                examples:

                Bitstream Vera Sans Mono
                DejaVu Sans Mono
                Luxi Mono
                Mitra Mono
                Monospace

                Courier New
                Courier New KOI-8

                Misc Console

                Misc Fixed

                Lucida Sans Typewriter


                I don't recommend Lucida if you have (or could have) text with bold
                Cyrillic text: in my experience, such glyphs are one pixel too wide in
                that font.


                Best regards,
                Tony.
                --
                Why does New Jersey have more toxic waste dumps and California have
                more lawyers?

                New Jersey had first choice.

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Ben Fritz
                ... Thanks, those details and the screenshots help a lot. I m not 100% certain your set guifont line in your .vimrc is doing what you want; the exact string
                Message 7 of 12 , Feb 20, 2013
                • 0 Attachment
                  On Wednesday, February 20, 2013 12:48:28 PM UTC-6, alexdongli wrote:
                  > Dear Sirs,
                  >
                  >
                  > I am adding more details to my problem.
                  >
                  >
                  > I use monospace. I access gvim using xterm via reflectionX (an xterm app). I am attaching two files vim.png and gvim.png generated using the same vimrc and the same xterm. You will immediately see what I mean. Now I know it probably has something to do with guifontwide, but just cannot get the problem solved. 
                  >
                  > My .vimrc file is simple:
                  >
                  > " set fileencodings=latin1          " tried this too but it does not work.
                  > set hlsearch
                  >
                  > set cinoptions=:0,p0,t0
                  > set cinwords=if,elsif,else,while,do,for,switch,case,foreach,unless,until
                  >
                  > set guifont=Monospace\ 8
                  >
                  > "set guifontset=Monospace \8      " tried this too but it does not work
                  > "set guifontwide=Monospace\ 8    " tried this too but it does not work.
                  >
                  >
                  >

                  Thanks, those details and the screenshots help a lot.

                  I'm not 100% certain your "set guifont" line in your .vimrc is doing what you want; the exact string needed depends very much on your system.

                  Can you try, from gvim, the following command to select a font?

                  :set guifont=*

                  This should bring up a dialog where you can choose a font from a list of supported fonts and sizes.

                  If selecting a font in this way makes your issue go away, do:

                  :set guifont?

                  or

                  :echo getfontname()

                  to see what string you should put in your .vimrc to set the font permanently.

                  See http://vim.wikia.com/wiki/Change_font if any of this confuses you.

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Alex Dong Li
                  Ben, I tried and 4 fonts showed up: DejaVu Sans, Monospace, Sans, Serif, same as if I use GUI s menu to set the font. I have tried each of them but it does not
                  Message 8 of 12 , Feb 20, 2013
                  • 0 Attachment
                    Ben,

                    I tried and 4 fonts showed up: DejaVu Sans, Monospace, Sans, Serif, same as if I use GUI's menu to set the font. I have tried each of them but it does not work either.
                    I wishes I had the root access to our company linux servers so that I could compile vim with multi-byte disabled. Too many libraries/headers are missing for me to compile gvim myself.

                    Thank you very much for your help anyway!

                    Alex.


                    On Wed, Feb 20, 2013 at 1:27 PM, Ben Fritz <fritzophrenic@...> wrote:
                    On Wednesday, February 20, 2013 12:48:28 PM UTC-6, alexdongli wrote:
                    > Dear Sirs,
                    >
                    >
                    > I am adding more details to my problem.
                    >
                    >
                    > I use monospace. I access gvim using xterm via reflectionX (an xterm app). I am attaching two files vim.png and gvim.png generated using the same vimrc and the same xterm. You will immediately see what I mean. Now I know it probably has something to do with guifontwide, but just cannot get the problem solved. 
                    >
                    > My .vimrc file is simple:
                    >
                    > " set fileencodings=latin1          " tried this too but it does not work.
                    > set hlsearch
                    >
                    > set cinoptions=:0,p0,t0
                    > set cinwords=if,elsif,else,while,do,for,switch,case,foreach,unless,until
                    >
                    > set guifont=Monospace\ 8
                    >
                    > "set guifontset=Monospace \8      " tried this too but it does not work
                    > "set guifontwide=Monospace\ 8    " tried this too but it does not work.
                    >
                    >
                    >

                    Thanks, those details and the screenshots help a lot.

                    I'm not 100% certain your "set guifont" line in your .vimrc is doing what you want; the exact string needed depends very much on your system.

                    Can you try, from gvim, the following command to select a font?

                      :set guifont=*

                    This should bring up a dialog where you can choose a font from a list of supported fonts and sizes.

                    If selecting a font in this way makes your issue go away, do:

                      :set guifont?

                    or

                      :echo getfontname()

                    to see what string you should put in your .vimrc to set the font permanently.

                    See http://vim.wikia.com/wiki/Change_font if any of this confuses you.

                    --
                    --
                    You received this message from the "vim_use" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php
                     
                    ---
                    You received this message because you are subscribed to the Google Groups "vim_use" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                     
                     
                  • Ben Fritz
                    ... There should be absolutely no need to strip out multibyte support. Thousands of people use gvim with multibyte every day without ever seeing your issue.
                    Message 9 of 12 , Feb 20, 2013
                    • 0 Attachment
                      On Wednesday, February 20, 2013 2:21:54 PM UTC-6, alexdongli wrote:
                      > Ben,
                      >
                      >
                      > I tried and 4 fonts showed up: DejaVu Sans, Monospace, Sans, Serif, same as if I use GUI's menu to set the font. I have tried each of them but it does not work either.
                      >
                      > I wishes I had the root access to our company linux servers so that I could compile vim with multi-byte disabled. Too many libraries/headers are missing for me to compile gvim myself.
                      >
                      >
                      > Thank you very much for your help anyway!
                      >

                      There should be absolutely no need to strip out multibyte support. Thousands of people use gvim with multibyte every day without ever seeing your issue.

                      Can you please respond with what font name Vim is actually using, the output of :set guifont? and :echo getfontname() as I mentioned before? We may still be able to help.

                      --
                      --
                      You received this message from the "vim_use" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      ---
                      You received this message because you are subscribed to the Google Groups "vim_use" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • Tony Mechelynck
                      ... If :set gfn=* shows only those four and nothing else (and no way to scroll to bring more font names into view) and what is called Monospace on your
                      Message 10 of 12 , Feb 20, 2013
                      • 0 Attachment
                        On 20/02/13 21:21, Alex Dong Li wrote:
                        > Ben,
                        >
                        > I tried and 4 fonts showed up: DejaVu Sans, Monospace, Sans, Serif, same
                        > as if I use GUI's menu to set the font. I have tried each of them but it
                        > does not work either.
                        > I wishes I had the root access to our company linux servers so that I
                        > could compile vim with multi-byte disabled. Too many libraries/headers
                        > are missing for me to compile gvim myself.
                        >
                        > Thank you very much for your help anyway!
                        >
                        > Alex.

                        If ":set gfn=*" shows only those four and nothing else (and no way to
                        scroll to bring more font names into view) and what is called Monospace
                        on your computer is what you showed in the gvim screenshot, then it
                        means there is _no_ monospaced font on your computer that gvim can see
                        (that font in the gvim screenshot isn't a monospace font: it's a
                        proportional sans-serif font, maybe "DejaVu Sans" but not "DejaVu Sans
                        Mono" which would be the "real" monospaced font in the same family).

                        So, you could either complain to your sysadmin, that there is no
                        fixed-width typewriter-like font that you can reach from gvim…

                        …or use console vim. Or, on Linux, use gvim in console mode by means of
                        a softlink, to make sure you have a full-featured Console Vim with X11
                        support:

                        pushd ~/bin
                        ln -sv `which vim` vim-orig
                        ln -sv `which gvim` vim
                        popd


                        Best regards,
                        Tony.
                        --
                        "All my friends and I are crazy. That's the only thing that keeps us
                        sane."

                        --
                        --
                        You received this message from the "vim_use" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php

                        ---
                        You received this message because you are subscribed to the Google Groups "vim_use" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • Alex Dong Li
                        I think Tony has got the point: Monospace on my system is a proportional font, not a width-fixed font. Sorry for my wrong assumption! As matter of the fact, I
                        Message 11 of 12 , Feb 20, 2013
                        • 0 Attachment
                          I think Tony has got the point: Monospace on my system is a proportional font, not a width-fixed font. Sorry for my wrong assumption! As matter of the fact, I do not have any width-fixed fonts available to gvim.

                          Thank everyone who has helped very much! Also sorry for sending file attachments to everyone!

                          Alex.

                          --
                          --
                          You received this message from the "vim_use" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php
                           
                          ---
                          You received this message because you are subscribed to the Google Groups "vim_use" group.
                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                          For more options, visit https://groups.google.com/groups/opt_out.
                           
                           
                        • John Little
                          ... You don t need root access to install a font for your own use. - Download a .ttf or .otf to wherever. - With KDE, open it with kfontviewer, click install,
                          Message 12 of 12 , Feb 20, 2013
                          • 0 Attachment
                            On Thursday, February 21, 2013 9:21:54 AM UTC+13, alexdongli wrote:
                            > I wishes I had the root access to our company linux servers so that I could >compile vim with multi-byte disabled. Too many libraries/headers are missing >for me to compile gvim myself.

                            You don't need root access to install a font for your own use.
                            - Download a .ttf or .otf to wherever.
                            - With KDE, open it with kfontviewer, click install, click personal.
                            - With Gnome3, I think nautilus has support. Gnome 2 had gnome-font-viewer.

                            This just copies the font file to .fonts in your home directory, in a directory whose name is the first letter of the font file name. I just downloaded monofur.ttf, and copied it to ~/.fonts/m, and gvim found it without further ado. (Unpleasant font, IMO).

                            Regards, John Little

                            --
                            --
                            You received this message from the "vim_use" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php

                            ---
                            You received this message because you are subscribed to the Google Groups "vim_use" group.
                            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.
                          Your message has been successfully submitted and would be delivered to recipients shortly.