~earboxer/public-inbox

statusbar icons override alphanumeric characters v1 NEEDS REVISION

Zach DeCook: 1
 Scripts: Enable patching out invisible glyphs with another font

 1 files changed, 27 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~earboxer/public-inbox/patches/32427/mbox | git am -3
Learn more about email & git

[PATCH] Scripts: Enable patching out invisible glyphs with another font Export this patch

This is useful for mixing icons with text
without changing fonts midway through.

Only the blank glyphs are removed, so the rest need to be referenced from the donor font directly.

    font="DonorFont-statusbar, DonorFont"
in your application is an easy way to configure it.

Or that could be handled by fontconfig as an alias (see `man fonts.conf`)
---
 patchicons.pe | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 patchicons.pe

diff --git a/patchicons.pe b/patchicons.pe
new file mode 100755
index 0000000..594f1a9
--- /dev/null
+++ b/patchicons.pe
@@ -0,0 +1,27 @@
#!/usr/bin/fontforge

if ( $argc != 3 )
	Print("Replace blank glyphs with those from another font.")
	Print("Usage: " + $0 + " 'statusbar.sfd' 'DonorFont.ttf'")
	Quit(1)
endif

# Copy from the donor font.
Open($2)
Select("%", "%", "0", "9", "_", "_", "a", "z");
Copy()
weight = $weight
copyright = $copyright
version = $version
macstyle = $macstyle

# Paste into statusbar.
Open($1)
Select("%", "%", "0", "9", "_", "_", "a", "z");
Paste()
name = $2:t:r + "-statusbar"
SetFontNames(name, name, name, weight, copyright + "statusbar:" + $copyright, version + "-" + $version)
SetMacStyle(macstyle)

# Save into current directory as new font.
Generate("./" + $2:t:r + "-statusbar.otf")
-- 
2.36.1