~earboxer/statusbar

d1be142324f9d91a5da7aef358098b9565ad6f39 — Zach DeCook 2 years ago 575f23c
Scripts: Enable patching out invisible glyphs with another font

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`)
1 files changed, 27 insertions(+), 0 deletions(-)

A patchicons.pe
A patchicons.pe => patchicons.pe +27 -0
@@ 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")