Skip to content

Commit

Permalink
Martian: Tweak naming
Browse files Browse the repository at this point in the history
[why]
With Martian Mono we have a font that uses aggressive abbreviation for
the weights and styles (two letters mostly) in all name fields. That is
very hard to parse.

[how]
We rewrite the filenames such that it contains all the necessary information
and use the new patcher flag use the filename as naming source.

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Nov 11, 2023
1 parent 178cda0 commit 4579b49
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 5 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions src/unpatched-fonts/MartianMono/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ The available widths at Nerd Fonts are:
* `Cn` stands for _Consensed_
* `Std` stands for _Standard_

The font filenames are changed to be a bit more expressive.

Version: 1.0.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions src/unpatched-fonts/MartianMono/config.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config_patch_flags="--name filename --makegroups 5"
19 changes: 14 additions & 5 deletions src/unpatched-fonts/MartianMono/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ curl -LOf "https://github.com/evilmartians/mono/releases/download/v${FONT_VERSIO
unzip -d "${TMP_DIR}" "${TMP_DIR}/*.zip"
ls -alh "${TMP_DIR}"

# Do some reconstruction on the names to be able to parse the name with the font-patcher...
# This is not needed for usual fonts.

# typefaces=(Cn Nr Std sWd) # Condensed Narrow Standard SemiWide
typefaces=(Cn Std)
typefaces1=(Cn Std)
typefaces2=(Condensed '')

# weights=(Th xLt Lt Rg Md Bd xBd) # Thin ExtraLight Light Regular Medium Bold ExtraBold
weights=(Rg Md Bd)
weights1=(Rg Md Bd)
weights2=(Regular Medium Bold)

for face in "${typefaces[@]}"; do
i=0
for face in "${typefaces1[@]}"; do
echo "Processing ${face} ..."
mkdir -p "${face}"
for weight in "${weights[@]}"; do
find "${TMP_DIR}" -name "MartianMono-${face}${weight}.ttf" -exec mv "{}" "${face}" \;
j=0
for weight in "${weights1[@]}"; do
find "${TMP_DIR}" -name "MartianMono-${face}${weight}.ttf" -exec mv "{}" "${face}/MartianMono-${typefaces2[$i]}${weights2[$j]}.ttf" \;
j=$((j + 1))
done
i=$((i + 1))
done

0 comments on commit 4579b49

Please sign in to comment.