I played with this a bit a while ago.  I found a diff and an app-defaults
kicking around in my work directory (attached), that should give you an
idea of the configure options that I used.

IIRC you need to specify a comma before the font size.  Part of my diff is
to change that separator to a dash--I don't recall now if that was a
requirement to get it working, or just a preference.  There are a handful
of different ways to specify TrueType fonts in my .Xresources, but dash
seems to be a common delimiter between the face and the size.

As far as fonts go, I use Hack (Debian package fonts-hack) for
programming.  Source Code Pro (
https://fonts.google.com/specimen/Source+Code+Pro) is also good.

--bod



On Wed, 11 Dec 2024 at 08:49, Chris Green <[email protected]> wrote:

> On Tue, Dec 10, 2024 at 04:00:29PM -0500, Thomas Dickey wrote:
> > On Tue, Dec 10, 2024 at 08:07:51PM +0000, Chris Green wrote:
> > > On Tue, Dec 10, 2024 at 05:50:01PM +0000, Chris Green wrote:
> > > > I see that xvile can now be built to use TrueType fonts.
> > > >
> > > > Is this straightforward?  The xvile that comes in Debian 12 isn't
> > > > built for TrueType so I'll need to build it myself. I've built and
> > > > compiled it before so that's not a big problem but are there any
> > > > particular issues I should be aware of?
> > > >
> > > > Also, will it just allow me to select all the fonts I can see in the
> > > > rest of my GUI?
> >
> > not really - it needs more work.
> >
> > I mentioned it to Brendan O'Dea a couple of years ago, and he reported
> that
> > there was some problem repainting the screen.
> >
> > actually, in a quick check, it does run for me, but my configuration has
> > too much horizontal space (a second problem).
> >
> Yes, I have just configured and compiled with the options you
> attached and I see the same 'too much horizontal space', that's a
> pity.
>
> How does one specify a font in this case? I have tried things like
> "xvile -fn 'Liberation Mono Regular 20'" but it just says:-
>
>     Warning: Cannot convert string "Liberation Mono Regular 20" to type
> FontStruct
>
> "Liberation Mono Regular 20" does exist on my system, I can select it
> in xfce4-terminal.
>
>
>
> --
> Chris Green
>
>
diff -ur vile/debian/control vile-9.8v/debian/control
--- vile/debian/control	2021-12-13 17:31:19.818918872 +1100
+++ vile-9.8v/debian/control	2022-01-12 17:28:03.498033566 +1100
@@ -4,7 +4,7 @@
 Maintainer: Brendan O'Dea <[email protected]>
 Uploaders: Paul van Tilburg <[email protected]>
 Standards-Version: 4.1.3
-Build-Depends: dpkg-dev (>= 1.16.1), debhelper-compat (= 13), flex (>= 2.6.4), libncurses5-dev, libperl-dev (>= 5.8.1-3), libxaw7-dev (>= 4.3.0)
+Build-Depends: dpkg-dev (>= 1.16.1), debhelper-compat (= 13), flex (>= 2.6.4), libncurses5-dev, libperl-dev (>= 5.8.1-3), libxaw7-dev (>= 4.3.0), libxft-dev, libxaw3dxft8-dev
 Homepage: https://invisible-island.net/vile/
 Vcs-Browser: https://salsa.debian.org/debian/vile
 Vcs-Git: https://salsa.debian.org/debian/vile.git
@@ -33,7 +33,7 @@
 Package: xvile
 Architecture: any
 Depends: vile-common (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends}
-Recommends: xfonts-100dpi, xfonts-75dpi
+Recommends: fonts-dejavu
 Provides: editor
 Replaces: vile-common (<< 9.7x-1)
 Description: VI Like Emacs - vi work-alike (X11)
diff -ur vile/debian/rules vile-9.8v/debian/rules
--- vile/debian/rules	2021-12-13 17:31:19.854920259 +1100
+++ vile-9.8v/debian/rules	2022-01-12 14:48:25.554207458 +1100
@@ -47,7 +47,7 @@
 
 	# Configure xvile
 	dh_auto_configure --builddirectory=t/xvile -- $(configure_flags) \
-	    --with-xpm --with-screen=Xaw \
+	    --with-xpm --with-screen=Xaw3dxft --enable-freetype \
 	    --with-app-defaults=/etc/X11/app-defaults \
 	    --with-pixmapdir='$$(prefix)/share/pixmaps' \
 	    --with-icondir='$$(prefix)/share/icons' \
diff -ur vile/macros/vilemenu.rc vile-9.8v/macros/vilemenu.rc
--- vile/macros/vilemenu.rc	2021-12-13 17:31:54.620246767 +1100
+++ vile-9.8v/macros/vilemenu.rc	2022-01-12 17:41:04.857160427 +1100
@@ -37,13 +37,13 @@
 ;
 ~if &stoken 'xft' ',' $cfgopts
 C:Font Size
-B:8px:setv $font ,8
-B:10px:setv $font ,10
-B:12px:setv $font ,12
-B:14px:setv $font ,14
-B:16px:setv $font ,16
-B:18px:setv $font ,18
-B:20px:setv $font ,20
+B:8px:setv $font -8
+B:10px:setv $font -10
+B:12px:setv $font -12
+B:14px:setv $font -14
+B:16px:setv $font -16
+B:18px:setv $font -18
+B:20px:setv $font -20
 ~else
 C:Fixed Fonts
 B:default:setv $font &default font
diff -ur vile/xftplain.c vile-9.8v/xftplain.c
--- vile/xftplain.c	2021-12-13 17:31:54.740251303 +1100
+++ vile-9.8v/xftplain.c	2022-01-12 19:28:42.529476443 +1100
@@ -19,13 +19,13 @@
 
 #ifdef FC_COLOR
 #define NormXftPattern \
-	    XFT_FAMILY,     XftTypeString, "mono", \
+	    XFT_FAMILY,     XftTypeString, face_name ? face_name : "mono", \
 	    FC_COLOR,       XftTypeBool,   FcFalse, \
 	    FC_OUTLINE,     XftTypeBool,   FcTrue, \
 	    XFT_SIZE,       XftTypeDouble, face_size
 #else
 #define NormXftPattern \
-	    XFT_FAMILY,     XftTypeString, "mono", \
+	    XFT_FAMILY,     XftTypeString, face_name ? face_name : "mono", \
 	    FC_OUTLINE,     XftTypeBool,   FcTrue, \
 	    XFT_SIZE,       XftTypeDouble, face_size
 #endif
@@ -497,24 +497,24 @@
     XVileFont *pf;
     char fullname[MAX_FONTNAME + 2];
     char *copy_name;
-    char *comma;
+    char *dash;
 
     TRACE(("xft:query_font(%s)\n", fname));
 
     /*
      * fname is expected to be the font family name, optionally followed by
-     * a comma and the font size.  Either font family or font size may be
-     * missing, defaulting to the previous value used (or initially mono,12).
+     * a dash and the font size.  Either font family or font size may be
+     * missing, defaulting to the previous value used (or initially mono-12).
      */
     while (isspace(*fname))
 	++fname;
     copy_name = strdup(fname);
-    comma = strchr(copy_name, ',');
-    if (comma != NULL) {
+    dash = strchr(copy_name, '-');
+    if (dash != NULL) {
 	float value;
 	char ignore;
-	*comma++ = EOS;
-	if (sscanf(comma, "%f%c", &value, &ignore) == 1) {
+	*dash++ = EOS;
+	if (sscanf(dash, "%f%c", &value, &ignore) == 1) {
 	    face_size = value;
 	}
     }

Attachment: xft.ad
Description: Binary data

Reply via email to