1
0
Fork
You've already forked gpft
0
GPU-rendering Proportional Font Terminal
  • C++ 52.6%
  • C 42.9%
  • Python 1.9%
  • Roff 1.5%
  • Makefile 0.9%
  • Other 0.1%
2026年06月30日 15:12:09 -07:00
tests tests/fill-stdout. 2024年12月13日 15:03:31 -08:00
utils Utils; README.md talks about elastic tabs. 2024年12月17日 09:45:26 -08:00
vendor nanovgXC: silencing a message if it's not requested. 2024年11月06日 10:37:16 -08:00
wayland-protocols Wayland: updated "wayland-protocols". 2025年03月06日 14:56:31 -08:00
widgets Early window title: XlibFreetype. 2026年06月30日 11:49:54 -07:00
.gitignore Makefile: Cairo version is call "cpft". 2024年12月24日 10:41:22 -08:00
ANSIColors.cpp Starting project. 2024年11月03日 14:28:54 -08:00
ANSIColors.h Starting project. 2024年11月03日 14:28:54 -08:00
AppSettings.cpp Settings: "window-size". 2024年12月17日 18:46:59 +00:00
AppSettings.h Settings: "window-size". 2024年12月17日 18:46:59 +00:00
Colors.cpp Starting project. 2024年11月03日 14:28:54 -08:00
Colors.h Hollow cursor when window is not focused. 2025年03月18日 16:16:42 -07:00
DataParser.cpp Starting project. 2024年11月03日 14:28:54 -08:00
DataParser.h Starting project. 2024年11月03日 14:28:54 -08:00
ElasticTabs.h Starting project. 2024年11月03日 14:28:54 -08:00
FontSet.cpp Fallback fonts. 2024年11月04日 21:23:03 -08:00
FontSet.h Fallback fonts. 2024年11月04日 21:23:03 -08:00
gpft.1 Monospace fallback fonts. 2025年03月06日 16:03:46 -08:00
History.cpp Better handling of bad UTF-8. 2025年04月07日 06:39:11 +00:00
History.h Starting project. 2024年11月03日 14:28:54 -08:00
LICENSE LICENSE. 2024年11月19日 14:55:59 -08:00
Line.cpp Starting project. 2024年11月03日 14:28:54 -08:00
Line.h Starting project. 2024年11月03日 14:28:54 -08:00
main.cpp Provision for setting the window title early. In progress. 2026年06月30日 11:49:54 -07:00
Makefile Wayland: updated "wayland-protocols". 2025年03月06日 14:56:31 -08:00
Owned.h Starting project. 2024年11月03日 14:28:54 -08:00
README.md README: binary names of "gpft-wayland" and "cpft". 2025年03月14日 13:54:26 -07:00
Run.cpp Starting project. 2024年11月03日 14:28:54 -08:00
Run.h Starting project. 2024年11月03日 14:28:54 -08:00
Settings.cpp Hollow cursor when window is not focused. 2025年03月18日 16:16:42 -07:00
Settings.h Hollow cursor when window is not focused. 2025年03月18日 16:16:42 -07:00
shell-wayland.nix Wayland: basic functionality. 2024年11月16日 14:17:47 -08:00
shell-xcb.nix Renamed "shell.nix" to "shell-xcb.nix". 2026年06月30日 15:12:09 -07:00
shell-xlib-cairo.nix shell-xlib-cairo.nix. 2024年11月25日 17:25:55 -08:00
shell-xlib-freetype.nix Experimental "xlib-freetype" backend. 2024年11月25日 17:25:55 -08:00
shell-xlib.nix shell.nix, shell-xlib.nix: Removed unneeded "pkg-config" dependency. 2024年11月20日 14:50:03 -08:00
Style.h Monospace "escape clause". 2024年11月06日 10:51:28 -08:00
Terminal.cpp Starting project. 2024年11月03日 14:28:54 -08:00
Terminal.h Starting project. 2024年11月03日 14:28:54 -08:00
TerminalWidget.cpp Hollow cursor when window is not focused. 2025年03月18日 16:16:42 -07:00
TerminalWidget.h Hollow cursor when window is not focused. 2025年03月18日 16:16:42 -07:00
UTF8.cpp Fixed UTF8::first_character(). 2026年01月18日 20:32:37 -08:00
UTF8.h Fixed UTF8::first_character(). 2026年01月18日 20:32:37 -08:00

gpft

GPU-rendering Proportional-Font Terminal

"gpft" is a terminal program that supports (and defaults to using) proportional rather than monospace fonts, and does its rendering on the GPU. It's essentially spft ported on top of nanovgXC. It also adds support for fallback fonts, Ctrl-Shift-C and Ctrl-Shift-V for copy and paste to/from the clipboard, and the ability to build for Wayland.

Thanks to nanovg and nanovgXC for doing the hard parts.

GPU "acceleration"

Because gpft uses the GPU to render everything, it ought to be faster than rendering on the CPU, right? But in my tests, Cairo (which uses the CPU) can render about 50% faster. And Freetype/Xft is almost twice as fast as the GPU. Any of them can draw much faster than a typical monitor refresh rate (on my unexceptional hardware).

Building

Just type make. By default, a version for X11 (using XCB) is built. To build the Wayland version, create a file called "Makefile.local" and add WINDOW_BACKEND := wayland to it. (If you've already built, make sure to do make clean after changing that before rebuilding.) When built for Wayland, the name of the binary is "gpft-wayland". WINDOW_BACKEND can also be set to "xlib".

There is also an "xlib-cairo" backend. This actually runs faster on my hardware, and, in my opinion, the text looks better. When built like this, the name of the binary is "cpft". (There is also an "xlib-freetype" backend, which runs the fastest of all, but this should be considered experimental.)

Take a peek at the appropriate "shell*.nix" file to see what the dependencies are for the backend you're building for.

Elastic Tabs

Like its predecessor spft, gpft supports elastic tabs.

Elastic tabs are enabled by a couple of special escape sequences. "\x1B[?5001h" starts a group of elastic-tabbed lines with the line that the cursor is on. "\x1B[?5001l" ends that group; the line containing the cursor is not part of it. There are also expanded versions of these: "\x1B[?5002;Nh", where N is the number of columns that will be right-justified; and "\x1B?5002;1l" which ends the group, but includes the line with the cursor (useful if you're right-justifying columns in a single line).

An "els" script is included in the "utils" directory; it wraps "ls" so the output is appropriate for elastic tabs. You might want to put something like this in your .bashrc:

if [ -n "$SPFT" ]; then
 alias ls='els --color=always'
 fi

There is also an "end-tabs" script that is useful when piping "els" or some other elastic-tabbed program through "head". It ensures that the group of elastic-tabbed lines is terminated.