kdesc --typeface from the reflection klammerset; a missing font directory is a row, not an error
Assembled from klammertext-dev daad6273483a. The font-store listing is rendered from ref/ (one table per search directory, in search order, with the styles each typeface holds); the search path is described, not validated, so a KLAMMERTEXT_FONTS directory that does not exist -- the default ~/.klammertext/fonts on a fresh install -- is a row saying so and the command exits 0. A typeface an earlier directory also holds is marked shadowed, with the winning directory, in a column present only when needed. The store's layout convention has one reader, fonts_in_directory(). Six kdesc suite cases pin the listing.
This commit is contained in:
1 parent
c016b3e5f3
commit
f9af1ff869
7 files changed
+188
-103
No files matched your search
@@ -167,6 +167,32 @@ shows "27. an unknown katom word" 'Unrecognized katom command' "$KDE
|
||||
# the retired-name guard's entries did not match the bare word.
|
||||
shows "27a. --typeface help names --typeface install" '--typeface install' "$KDESC" --typeface help
|
||||
shows "27b. an unknown typeface word names the flag" 'Unrecognized typeface command: --typeface' "$KDESC" --typeface nonsense
|
||||
# --typeface lists the font store as one @table per search directory,
|
||||
# rendered from ref/ (@klammertext_fonts, 2026-09-23). The search path is
|
||||
# DESCRIBED, not validated: a directory that does not exist is a row, never
|
||||
# an error -- resolve_font skips one silently, and a fresh install has no
|
||||
# ~/.klammertext/fonts yet, so an error there would fail every new user's
|
||||
# first "kdesc --typeface". A typeface an earlier directory also holds is
|
||||
# shadowed, and the LATER row says by which directory.
|
||||
FONTS=$(mktemp -d /tmp/kdesc_fonts.XXXXXX)
|
||||
shows "27c. --typeface lists the default set" 'Klammertext default typefaces' "$KDESC" --typeface
|
||||
shows "27d. a missing search directory is a row" 'directory does not exist' \
|
||||
env KLAMMERTEXT_FONTS="$FONTS/none" "$KDESC" --typeface
|
||||
env KLAMMERTEXT_FONTS="$FONTS/none" "$KDESC" --typeface >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "${green}PASS${reset} 27e. ... and exits 0"; PASS=$((PASS+1))
|
||||
else
|
||||
echo "${red}FAIL${reset} 27e. a missing search directory exits nonzero"; FAIL=$((FAIL+1))
|
||||
fi
|
||||
shows "27f. an empty search directory says so" 'no fonts' env KLAMMERTEXT_FONTS="$FONTS" "$KDESC" --typeface
|
||||
mkdir -p "$FONTS/crimson-pro"
|
||||
printf "@font-face { font-family: 'Crimson Pro'; }\n" > "$FONTS/crimson-pro.css"
|
||||
shows "27g. an installed typeface shadows the default one, and the default row says so" \
|
||||
"^ *Crimson Pro .*$FONTS" env KLAMMERTEXT_FONTS="$FONTS" "$KDESC" --typeface
|
||||
# Under a search path that installs nothing (the machine's own fonts may
|
||||
# shadow a default one, so the default path is not a controlled case).
|
||||
absent "27h. ... and a table with nothing shadowed has no such column" 'Shadowed by' \
|
||||
env KLAMMERTEXT_FONTS="$FONTS/none" "$KDESC" --typeface
|
||||
|
||||
echo
|
||||
echo "-- provenance: -i shows what the INPUT defines --"
|
||||
|
||||
Reference in new issue
Block a user