groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Potential enhancements to install-font.sh from https://www.schaffter.ca/


From: T . Kurt Bond
Subject: Potential enhancements to install-font.sh from https://www.schaffter.ca/mom/bin/install-font.sh
Date: Mon, 27 Apr 2020 22:42:14 -0400
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-apple-darwin18.2.0) MULE/6.0 (HANACHIRUSATO)

Hello.

Today I finally took the time to figure out how to install groff fonts using
the shell script https://www.schaffter.ca/mom/bin/install-font.sh .

It was way easier than following the manual steps.

In doing so I made some changes to script that made it easier for me to
use.  I'm sending this e-mail so folks can look at the changes and see
if they would be useful in general.

I changed the documentation of the -l and -s options to refer to the
prefixes /usr/local/share/groff and /usr/share/groff respectively
because those are the directories they actually use.

I added a -P option that lets you specify the prefix to use.  I often
install software into places like /sw/versions/groff/git (so I can
have multiple versions of software installed), which means
that the I'd specify "-P /sw/versions/groff/git/share/groff".

I added a -n option that stops the source font file from being
installed anywhere.  This is useful if you don't have
/usr/local/share/fonts/truetype or /usr/local/share/fonts/opentype or
/usr/local/share/fonts/type1, which, if you didn't specify -C and
depending on the type of font file, is where the source file is copied
to.  (For instance, on my macOS laptop, I've usually already got the
source font file in ~/Library/Fonts, so I don't need to copy it
anywhere.)

I changed the script so it checks if has write access to the
prefix directory specified, rather than checking if it is running as
root, because if you've installed groff into a location you have
access to as a normal user it will be writable.  And if you are
running it as root it will also be writable.  I also moved the check
after the parsing of the command line options, so it uses the user
specified prefix directory, whether that was set with -l or -s.

I've attached the patch.

Also, wouldn't this script be useful to include in the groff
distribution?

Attachment: install-font.patch
Description: Text document

-- 
T. Kurt Bond, address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]