Try to match a fallback font if needed

Fixes #276

Instead of rendering the entire filename at once, Xft will let us do it
character by character. This will allow sxiv to query fontconfig for
a font that can provide any missing codepoints, if needed.

A known issue of this patch is that the "..." dots rendering will not
work properly for very long multibyte filenames. That is because we
cannot easily predict the final width of the rendered filename before
drawing it. I couldn't figure out a clean way to deal with this, so I
ended up just truncating the offending filenames.
This commit is contained in:
Squibby
2017-12-06 16:56:00 -03:00
parent f02661879f
commit eb96c71725
5 changed files with 75 additions and 10 deletions

View File

@ -28,7 +28,7 @@ LIB_EXIF_0 =
LIB_EXIF_1 = -lexif
LIB_GIF_0 =
LIB_GIF_1 = -lgif
LDLIBS = -lImlib2 -lX11 -lXft \
LDLIBS = -lImlib2 -lX11 -lXft -lfontconfig \
$(LIB_EXIF_$(HAVE_LIBEXIF)) $(LIB_GIF_$(HAVE_GIFLIB))
OBJS = autoreload_$(AUTORELOAD).o commands.o image.o main.o options.o \