You are not logged in.
I'm struggling to get the full glyph set to display in VIM. Particularly missed are the mathematical super- and sub-script. I've worked on the problem and tried various fixes for displaying UTF-8 characters without success.
(Code block bad form? Ok T. IMHO. There's that type of post where the OP doesn't know why something isn't working and they quote a dump truck of details, even though they're not sure what's relevant and what isn't. And the longer the quote, the harder it is to figure out what they're doing wrong. I didn't want to be that guy. I was hiding the verbosity, in the event my font problems are simpler than I've made it.)
1) Applied settings from these WIKI pages:
Fonts
Xterm
2) Apps I've installed
$ pacman -Qs font
local/dina-font 2.92-4
A monospace bitmap font, primarily aimed at programmers
local/fontconfig 2.11.1-1
A library for configuring and customizing font access
local/fontsproto 2.1.3-1
X11 font extension wire protocol
local/freetype2 2.5.3-2
TrueType font rendering library
local/gsfonts 1.0.7pre44-4
Standard Ghostscript Type1 fonts from URW
local/libfontenc 1.1.2-1
X11 font encoding library
local/libotf 0.9.13-2
OpenType Font library
local/libxfont 1.4.7-3
X11 font rasterisation library
local/libxft 2.3.2-1
FreeType-based font drawing library for X
local/t1lib 5.1.2-5
Library for generating character- and string-glyphs from Adobe Type 1 fonts
local/tamsyn-font 1.10-1
A monospaced bitmap font for the console and X11
local/terminus-font 4.39-1
Monospace bitmap font (for X11 and console)
local/ttf-bitstream-vera 1.10-10
Bitstream vera fonts
local/ttf-droid 20121017-3
General-purpose fonts released by Google as part of Android
local/xorg-bdftopcf 1.0.4-2 (xorg xorg-apps)
Convert X font from Bitmap Distribution Format to Portable Compiled Format
local/xorg-font-util 1.3.0-2 (xorg-fonts xorg)
X.Org font utilities
local/xorg-font-utils 7.6-4
Transitional package depending on xorg font utilities
local/xorg-fonts-100dpi 1.0.1-5 (xorg)
X.org 100dpi fonts
local/xorg-fonts-alias 1.0.3-1
X.org font alias files
local/xorg-fonts-encodings 1.0.4-4 (xorg-fonts xorg)
X.org font encoding files
local/xorg-fonts-misc 1.0.1-3
X.org misc fonts
local/xorg-fonts-type1 7.4-3
X.org Type1 fonts
local/xorg-mkfontdir 1.0.7-2 (xorg xorg-apps)
Create an index of X font files in a directory
local/xorg-mkfontscale 1.1.1-1 (xorg-apps xorg)
Create an index of scalable font files for X
3) A forum search found some common issues:
unicode symbols not working in my terminal
$ localectl
System Locale: LANG=en_US.UTF-8
LC_COLLATE=C
VC Keymap: US
X11 Layout: n/a
$ locale -a
C
en_US.utf8
POSIX
$ echo $TERM
xterm-256color
4) ~/.Xresources
! wiki.archlinux.org/.../Xterm
xterm*termName: xterm-256color
xterm*locale: true
xterm*saveLines: 4096
xterm*bellIsUrgent: false
xterm*VT100.geometry: 80x25
xterm*faceName: Droid:style=Regular:size=12
xterm*dynamicColors: true
xterm*utf8: 2
xterm*toolBar: false
5) ~/.xinitrc
# X11 Fonts
xset +fp /usr/share/fonts
Last edited by xtian (2014-07-27 14:43:23)
Offline
Why is your whole post in a code tag box? Please fix that (keep the CODE in code tags, but your description, wiki links, etc should not be).
My first thought is that it looks like you are using xterm - do you use uxterm, or just xterm? If the latter, do those symbols show up in the terminal outside of vim?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
xterm*faceName: Droid:style=Regular:size=12The above line will not necessarily call up a Droid font. To see which font is actually being used, from a shell prompt, type:
$ fc-match DroidI would think you would want the monospace Droid font. The X resource would then look like the following:
xterm*faceName: Droid Sans Mono:style=Regular:size=12You can then check the symbols in Vim with either of these two commands:
:digraphs
:h digraph-tableOffline
I used this test page (from the forum post linked to above together) with cat command in both Xwindows and in the non-X environment. Very few of the glyphs displayed (lots of square boxes) in both cases. When I'm in Xwindows, htop shows: `xterm -class UXTerm -title uxterm -8`. Not sure how to check this from the non-X environment.
$ fc-match Droid
Vera.ttf: "Bitstream Vera Sans" "Roman"
Why is fc-match determinant of which font is actually used?
(Man page: fc-match matches pattern ...using the normal fontconfig matching rules to find the best font available.)
Should the best font available for Droid be Droid itself?
// UPDATE
I made the change from `Droid` to `Droid Sans Mono` which did change the font, and also show some improvement in the glyph coverage--though still not nearly complete.
The `fc-match` command still returns the same output as before, even with the change.
The takeaway would be that the trouble with the Droid font was not using the correct name. The Font - Preview and Testing suggests using `setfont`to preview fonts. While the fonts change in the console, none show improvements with the UTF-8 demo page or in VIM. The followup question is to ask for font suggestions from users who also use VIM and digraphs.
Last edited by xtian (2014-07-25 18:06:02)
Offline
Linux fonts are a muddle. Consoles can only display 256 characters, maybe 512. You simply cannot display many texts in a console. To navigate through the font mess in X, you need some familiarity with fontconfig. Xft uses fontconfig to select fonts. Fontconfig documentation is not user-friendly.
Droid is a family of fonts. My installation of the Droid family includes 27 different fonts. The command fc-list will list fonts matching a pattern. I usually filter the output by piping through grep. To list the Droid fonts, file name first followed by the fontconfig name, I use:
$ fc-list | grep DroidYour fc-match results for Droid are from fontconfig doing its best to give you a readable display. Fontconfig cannot find a matching font for the name 'Droid', so it falls back to a "safe" font, 'Bitstream Vera Sans'.
XTerm or UXTerm or URxvt
I have my locale correctly configured, I think. I do not see any real advantage for uxterm over xterm. In my X resources, I include the lines,
xterm*termName: xterm-256color
XTerm*locale: trueFor good glyph coverage with xterm, I have found 'DejaVu Sans Mono' to be among the better fonts. If I truly need utf8 coverage, I use urxvt. Urxvt allows one to use a ladder of fonts. If the character is not found in the first font listed, urxvt will search through the other listed fonts until it finds a glyph that can be displayed.
urxvt*font: xft:DejaVu Sans Mono:style=Book:antialias=false:size=8, \
xft:WenQuanYi Bitmap Song:size=8, \
xft:FreeSerif:style=Regular, \
xft:unifont:style=Medium:antialias=falseHere's a screenshot with three xterms using Droid, DejaVu Sans Mono, and Liberation Mono, plus one urxvt using the fonts in the code above. They all show the same portion of Markus Kuhn's utf8 test text.
Offline
Your fc-match results for Droid are from fontconfig doing its best to give you a readable display. Fontconfig cannot find a matching font for the name 'Droid', so it falls back to a "safe" font, 'Bitstream Vera Sans'.
I'm not clear on why fontconfig would fall back with fc-match in this context, while `fc-list | grep` Droid did find the Droid fonts installed. No matter.
Interestingly, the human readable output from `fc-list` matches the .Xresource's `xterm*faceName` allowable human-readable string value. Which was the problem I had with Droid not displaying correctly.
I'm already familiar with VIM glyphs from a previous installs of Fedora and, most happily, Maemo Linux on my Nokia N900 smartphone. I don't expect much from VIM (coming from DTP on Macs), but I do wish my archive files to open and display all characters. I use the Nokia for typing notes on the go using vim in terminal, and its frustrating for the smartphone to display fonts better than my desktop.
I'm not knowledgeable about the various flavors of terminal apps. Thank you Tom for the very useful information on URXVT's ladder for font character display. I'm trying wait and see with DejaVu. Thanks for the help.
Last edited by xtian (2014-07-27 14:43:00)
Offline