1. equalsraf
  2. vim-qt
Issue #49 open

Remote X display & fonts.

Anonymous created an issue

I suspect that this a whole number of issues. But I guess I'll get the ball rolling....

Running on linux but setting X display to remote Free BSD machine warns of fake monospace font.

Setting remote display to Windows host running Xming reports X Error: BadRequest (invalid request code or no such operation) 1 Extension: 130 (XInputExtension) Minor opcode: 48 () Resource id: 0x0 X Error: BadRequest (invalid request code or no such operation) 1 Extension: 130 (XInputExtension) Minor opcode: 48 () Resource id: 0x3f Warning, fake monospace font?

The problem would appear to be centred around the fonts referenced are those of the executing host not the display. Hence to run vim-qt on linux but display on freebsd :set guifont=* displays the fonts available via the linux box not bsd.

The gtk version does this correctly.

<opinion> This is important. The main reason I want to see a qt version of gvim is for remote display. Gtk has forgotten that X is a network protocol since about 1.3. The gtk performance of large text windows (more than ~20 lines) makes gvim unusable remotely (this didn't used to be the case). It's not the case with Qt. The remote performance of vim-Qt is an order of magnitude better that standard Gtk version. Thus getting remote fonts working too would be a considerable boon. </opinion>

Cheers,

AMP

Comments (7)

  1. equalsraf repo owner

    Hey thanks for the issue report

    I did some quick testing, so far I can't replicate this, can you provide some further input?

    • The "fake monospace font" warning is normal, depending on the font being used - so no worries there - it just means that whatever font is used it not really monospace.
    • I've tested this from a Linux box to a OpenBSD box using "ssh -X" and it is working - are you using ssh X forwarding, or are you setting the DISPLAY to a remote host?
    • I haven't tested with XMing yet, I'll need a bit to set that up
  2. equalsraf repo owner
    • changed status to open

    Ok I can confirm this, the fonts displayed by set guifont are those of the machine hosting the qvim binary rather than the ones from the display machine - I'm running XMing as display and a Linux box as client.

    What I've seen so far:

    • There are some minor rendering issues(on the titlebar icon, for example)
    • It seems X has an extension to use client side fonts, and Qt enables this by default(http://lists.trolltech.com/qt-interest/2004-05/thread00336-0.html) but I don't know how to disable this.
    • For me both vim-qt and vim-gtk show the same fonts - is it possible that your vim-gtk is built without Xft support?
    • As far as performance I'm seeing similar performance for both gtk and qt versions.
    • A side note about performance, make sure Qt is using the "native" graphicssystem, in Qt 4.8 the default is "raster" which is terribly slow for remote X.
  3. Anonymous

    I'm using DISPLAY to the remote host.

    The gtk version is s debian release:

    VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 24 2011 07:07:00)
    Included patches: 1-35
    Modified by pkg-vim-maintainers@lists.alioth.debian.org
    Compiled by buildd@
    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 +conceal
    +cryptv +cscope +cursorbind +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 +lua/dyn
     +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/dyn +persistent_undo +postscript +printer +profile +python/dyn +python3/dyn +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: "$VIM/vimrc"
         user vimrc file: "$HOME/.vimrc"
          user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/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  -pthread -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/
    glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/
    include -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1     -Wall -g -O2 -D_FORTIFY_SOURCE=1    -I/usr/include/tcl8.4  -D_REENTRANT=1  -D_
    THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  -I/usr/lib/ruby/1.8/i686-linux -DRUBY_VERSION=18
    Linking: gcc -L/usr/lib/i386-linux-gnu    -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,--as-needed -o vim   -pthread -L/usr/lib/i386-linux
    -gnu -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmo
    dule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lXt -lncurses -lselinux   -lacl -lgpm -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.10/CORE -L/usr/lib -ltc
    l8.4 -lieee -lruby1.8 -lrt -lm
    

    Qt version is similar.

    VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb 10 2012 11:22:16)
    Included patches: 1-382
    Compiled by andrew@GT-PICKIN-DT
    Huge version   Features included (+) or not (-):
    +arabic +autocmd -balloon_eval +browse ++builtin_terms +byte_offset +cindent -clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
    +conceal +cryptv +cscope +cursorbind +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 -lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm
    +mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl +persistent_undo +postscript +printer +profile -python -python3 +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 -xterm_clipboard -xterm_save
       system vimrc file: "$VIM/vimrc"
         user vimrc file: "$HOME/.vimrc"
          user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/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_QT  -Iqt -I. -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtN
    etwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I.    -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
    Linking:
    gcc   -L/usr/local/lib  -Wl,-O1 -lstdc++ -Wl,--as-needed -o vim   -L/usr/lib -lQtGui -lQtNetwork -lQtCore -lpthread       -lm -lncurses -lnsl
    

    Is your linux box a fontserver?

    AMP

  4. equalsraf repo owner

    No, my linux box is not a X font server, and even if it were Xming should not use one by default.

    Ok I think I got it. Can you try calling qvim as

    QT_X11_NO_FONTCONFIG=1 qvim
    

    With this :set guifont=* displays the fonts installed in XMing. If Xming-fonts is not installed all chars will be squares.

  5. Anonymous

    Well that lists a different set of fonts. But I don't think the problem is that straight forward. For example I can run vim-gtk (painfully slowing) using Monospace (a standard ubuntu desktop font). This font doesn't appear in the list for vim-qt.

    However which fonts appear in the list aren't the problem. The problem is the torrent of warnings sent to terminal from where the editor is started.

    andrew@GT-PICKIN-DT:~/Linux/bin$ QT_X11_NO_FONTCONFIG=1 qvim -u NONE
    X Error: BadRequest (invalid request code or no such operation) 1
      Extension:    130 (XInputExtension)
      Minor opcode: 48 ()
      Resource id:  0x0
    X Error: BadRequest (invalid request code or no such operation) 1
      Extension:    130 (XInputExtension)
      Minor opcode: 48 ()
      Resource id:  0x3f
    Warning, fake monospace font?  
    

    It gets worse. But these happen every time.

  6. equalsraf repo owner

    Short version:

    • You are correct that the Monospace font should show up on the list of fonts, but the list will always be different from vim-Gtk (see bellow)
    • I am not seeing the X errors (BadRequest), not sure what to make of them, what version of Qt are you running? Do these show up when running on the host or just the remote display?
    • Be careful with "Monospace", it is not a "real" font

    Long version:

    Sorry I clearly misunderstood, let me clarify something about fonts in vim-Qt. The font list is supposed to be different between vim-Qt and vim-Gtk. The reason for this is that we always reject non fixed-width fonts in vim-Qt, so those fonts should not show up in the list. It works like this

    (the following also applies to calling set guifont directly)

    1. If the font exists and is a fixed-width font them load it
    2. If the fon't does not exist or it is not a fixed-width then don't load it
    3. We open one exception to (2) if and only if the font is called Monospace

    I know it is a little bit annoying that we behave differently from vim-Gtk, but this also the behaviour from some other vim-GUIs(phonon, windows?) as well and I think it is a lot more sane - rendering non fixed-width fonts in Vim results in poor performance.

    Also the font that is usually called "Monospace" is a virtual font that the operating system provides as a last resort. It should be a fixed-width font, but sometimes that is not the case - Try something like DejaVu Sans Mono and see if the performance for vim-Gtk improves.

  7. Anonymous

    OK. To answer your questions first:

    QMake version 2.01a Using Qt version 4.7.2 in /usr/lib

    They only appear when using remote display.

    I'm not 'using' Monospace font. Or at least I'm not knowingly trying to call it. Within gnome my fixed width font is set to DejaVu Sans Mono.

    The Bad Request error happens with every invocation of vim-qt (on remote X display).

    Other errors I see (this is the mainly of the following type, and usually when scrolling or switching between vim split panes.

    $ drawString rect mismatch, this is serious, please poke a developer about this 26 24 " i_" 3 QFont( "Monospace,10,-1,2,50,0,0,0,1,0" ) 
    drawString rect mismatch, this is serious, please poke a developer about this 26 24 " c_" 3 QFont( "Monospace,10,-1,2,50,0,0,0,1,0" ) 
    drawString rect mismatch, this is serious, please poke a developer about this 26 24 " v_" 3 QFont( "Monospace,10,-1,2,50,0,0,0,1,0" ) 
    

    I don't necessarily expect to see the same font in QT as GTk. I'd just like to lose the errors to the invoking terminal.

    AMP

  8. Log in to comment