Alright

Alright:
./font-nexus -h
Font-Nexus [https://github.com/Arcitec/font-nexus]

Usage: "./font-nexus" [ARGS]

Available arguments:
-b Perform a clean build before the installation.
-i Install the fonts (system-wide by default, unless modified by another flag).
-l Install to local home-path (~/.local/share/fonts) instead.
-p <path> Install to custom path instead (a "font-nexus" sub-dir is automatically created).
-h Display help.
./font-nexus -h
Font-Nexus [https://github.com/Arcitec/font-nexus]

Usage: "./font-nexus" [ARGS]

Available arguments:
-b Perform a clean build before the installation.
-i Install the fonts (system-wide by default, unless modified by another flag).
-l Install to local home-path (~/.local/share/fonts) instead.
-p <path> Install to custom path instead (a "font-nexus" sub-dir is automatically created).
-h Display help.
So if you wanted to add it to your local user if it wasn't part of your custom uBlue image, you could just do ./font-nexus -b -l now (to use the standardized ~/.local/share/fonts path), or ./font-nexus -b -p ~/.fonts if you like the old-school path. This is sure to make @j0rge more happy, since it provides a method to add them to existing systems without modifying the uBlue images. ❤️ 🧐 Edit: There's now a release zip for easier downloading without having to clone the repo (https://github.com/Arcitec/font-nexus/releases/latest).
88 Replies
bsherman
bsherman13mo ago
sad panda
Missing "source/windows/Fonts/SegoeIcons.ttf" for group "win11". Please fix your source Fonts directory, and ensure that it comes from a fully updated Windows 11 installation.
Missing "source/windows/Fonts/SegoeIcons.ttf" for group "win11". Please fix your source Fonts directory, and ensure that it comes from a fully updated Windows 11 installation.
i have windows 11... legit and updated oooooh it's case sensitive
Arcitec
Arcitec13mo ago
Oi. Why is your file named incorrectly? 😮
bsherman
bsherman13mo ago
because i mounted the windows partition from linux, and by default it mounts case insensitive ntfs
Arcitec
Arcitec13mo ago
I used a VM, just went to C:\Windows, right-clicked Fonts and picked "Compress" and it placed Fonts.zip on the desktop, then moved that to Linux. All name cases were preserved 🙂
bsherman
bsherman13mo ago
this is my dual boot drive 🙂
Arcitec
Arcitec13mo ago
I am aware of a method to extract the fonts from a windows .iso too, thought about adding it but seems like hassle, because they are inside two layers -> .iso -> install.win -> windows/fonts You may be able to extract the fonts from the ISO if that's convenient, maybe with 7zip
bsherman
bsherman13mo ago
yeah, so i'll either reboot and grab a zip file or get the ntfs mount options correct question: why require 7zip? doesn't this just use zip format?
Arcitec
Arcitec13mo ago
Yeah, reboot seems fine and easy. Just right-click Fonts and pick Compress, windows will place a zip o nteh desktop. 🙂 7zip is required for the Apple DMG format
bsherman
bsherman13mo ago
ahhhh
Arcitec
Arcitec13mo ago
And the Apple PKG format too ^^
bsherman
bsherman13mo ago
i wonder if my mac is updated new enough to have the SF fonts
Arcitec
Arcitec13mo ago
In 2020 they changed to the most modern SF fonts
bsherman
bsherman13mo ago
nope LOL i'm too old
Arcitec
Arcitec13mo ago
If you have issues building this, just make a fedora container and build it in there 🙂 If you dont hve 7zip on teh host It will grab the apple fonts from apple's developer site btw
bsherman
bsherman13mo ago
hah, i didn't read down to line 226 stopped at process windows from local directory
Arcitec
Arcitec13mo ago
🙂 I wish I could do the same for Windows fonts but MS changes URLs too often and their ISOs are huge Windows is the only part that requires a manual copy.
bsherman
bsherman13mo ago
no problem rebooted already but... i am curious why 7z not working i install p7zip
Arcitec
Arcitec13mo ago
Use the install command from the readme.md 🙂 It's called p7zip-plugins
bsherman
bsherman13mo ago
facepalm all complain that no one reads docs and then we don't either
Arcitec
Arcitec13mo ago
haha 😄 no problem 7zip is a bit messy but is a powerhouse for unpacking all kinds of esoteric formats, so I added it to my own uBlue image After you build the output/ directory, you can simply copy that to other computers for instant installation there.
bsherman
bsherman13mo ago
FYI - using python3 instead of python is a bit more universal some python3 packages won't provide a symlink for simply python
Arcitec
Arcitec13mo ago
Hmm yeah I will do that change. I forgot because I use some python manager (pyenv) that names the installed one python
~  which python3
~/.pyenv/shims/python3
~  which python
~/.pyenv/shims/python
~  which python3
~/.pyenv/shims/python3
~  which python
~/.pyenv/shims/python
All good actually Will switch that now
bsherman
bsherman13mo ago
yep, i use pyenv too 🙂 it's pretty nice
Arcitec
Arcitec13mo ago
It's hot sauce 🙂 I love being able to override fedora's outdated stuff
bsherman
bsherman13mo ago
lol python 3.11.3 is outdated?
Arcitec
Arcitec13mo ago
No but thats because F38 just released a month ago 😄 Wait 5-10 months 😄 Then it will feel old
bsherman
bsherman13mo ago
yeah, so even booted to windows, those segoe fonts are still lower cased
Arcitec
Arcitec13mo ago
Interesting, that's very unexpected but it is possible that you installed it from an old Win10 or something and hten Microsoft changed the case, but since NTFS is case-insensitive the old case is kept. So I can code something that treats every filename as lowercase instead, and scans the folder. If you can wait 30 minutes since I am eating. 😄
bsherman
bsherman13mo ago
yeah, no worries, i'm capable of working around a lot, but this is giving you feedback on how your script is working in other environments
Arcitec
Arcitec13mo ago
Yeah it's useful. Anonfiles works if you want something that works immediately in the meantime
bsherman
bsherman13mo ago
nope, i'm patient 🙂 sometimes
Arcitec
Arcitec13mo ago
Hehe 🙂 I will get started on it now, might take a little bit since I have the idea of fixing the case of the orphaned files.
bsherman
bsherman13mo ago
fix whatever you want, happy to test
Arcitec
Arcitec13mo ago
@bsherman I did a bunch of small tweaks first (pushed), just got started on the case-sensitivity issue and I'd say it's like 20 minutes from finishing. @bsherman I've done thorough testing and pushed it. It'll write the filenames to their correct, up-to-date names when it copies even from your "messy" source. 🙂 You'll have to clone for the latest code, I am preparing the release after your results are in. 🙂
bsherman
bsherman13mo ago
k, checking it out now
Arcitec
Arcitec13mo ago
Excellent 🙂
bsherman
bsherman13mo ago
huh
ls -l sego*
-rw-r--r--. 1 benjamin benjamin 168404 Dec 7 2019 segoepr.ttf
-rw-r--r--. 1 benjamin benjamin 167800 Dec 7 2019 segoeprb.ttf
-rw-r--r--. 1 benjamin benjamin 596948 Dec 7 2019 segoesc.ttf
-rw-r--r--. 1 benjamin benjamin 581252 Dec 7 2019 segoescb.ttf
-rw-r--r--. 1 benjamin benjamin 955804 Dec 7 2019 segoeui.ttf
-rw-r--r--. 1 benjamin benjamin 951724 Dec 7 2019 segoeuib.ttf
-rw-r--r--. 1 benjamin benjamin 529712 Dec 7 2019 segoeuii.ttf
-rw-r--r--. 1 benjamin benjamin 913712 Dec 7 2019 segoeuil.ttf
-rw-r--r--. 1 benjamin benjamin 854140 Dec 7 2019 segoeuisl.ttf
-rw-r--r--. 1 benjamin benjamin 541468 Dec 7 2019 segoeuiz.ttf
ls -l sego*
-rw-r--r--. 1 benjamin benjamin 168404 Dec 7 2019 segoepr.ttf
-rw-r--r--. 1 benjamin benjamin 167800 Dec 7 2019 segoeprb.ttf
-rw-r--r--. 1 benjamin benjamin 596948 Dec 7 2019 segoesc.ttf
-rw-r--r--. 1 benjamin benjamin 581252 Dec 7 2019 segoescb.ttf
-rw-r--r--. 1 benjamin benjamin 955804 Dec 7 2019 segoeui.ttf
-rw-r--r--. 1 benjamin benjamin 951724 Dec 7 2019 segoeuib.ttf
-rw-r--r--. 1 benjamin benjamin 529712 Dec 7 2019 segoeuii.ttf
-rw-r--r--. 1 benjamin benjamin 913712 Dec 7 2019 segoeuil.ttf
-rw-r--r--. 1 benjamin benjamin 854140 Dec 7 2019 segoeuisl.ttf
-rw-r--r--. 1 benjamin benjamin 541468 Dec 7 2019 segoeuiz.ttf
Arcitec
Arcitec13mo ago
yeah?
bsherman
bsherman13mo ago
it's not just that they are lower case... they are actually the 8.3 versions of the filename
Arcitec
Arcitec13mo ago
Oh Did you dual-boot to get them via Windows?
bsherman
bsherman13mo ago
yeah, probably hard for you to fix that yes, that's from a zip file i made in windows OH! LOL because it's windows 10
Arcitec
Arcitec13mo ago
Those 8.3 files make no sense Ohhh You can tweak 1 thing to force yourself to use win10 fonts
bsherman
bsherman13mo ago
i do have windows 11 on a different machine
Arcitec
Arcitec13mo ago
I would recommend win11 instead It's newer versions
bsherman
bsherman13mo ago
but i imagine you could run into this again but yeah, wow, i feel silly LOL
Arcitec
Arcitec13mo ago
def process_microsoft(windows_version: int = 11) -> int
def process_microsoft(windows_version: int = 11) -> int
It takes an argument, you can change the last lines of build.py to put a (10) there
bsherman
bsherman13mo ago
i'll do that to test
Arcitec
Arcitec13mo ago
I added it just in case but I don't imagine that people want old fonts so it's not exposed 😄
bsherman
bsherman13mo ago
and i'll get win11 booted on the other machine, and test that out sometime
Arcitec
Arcitec13mo ago
I've never tried it with win10 btw so this will be interesting
bsherman
bsherman13mo ago
i've wondered about upgrading to win11 finally, but really, i just like using linux a lot better windows only still exists on my machine for edge cases, like... if i really can't get a game to work, or what to try some VR thing
Arcitec
Arcitec13mo ago
Win11 is better, it's just annoying how they try to force you to get a Microsoft account 😄
bsherman
bsherman13mo ago
it may be "better" now... but 9 months ago i was unhappy with laggy UI performance, but i think they've fixed some of that
Arcitec
Arcitec13mo ago
Btw, even if the case-sensitivity issue was really just that the files came from Win10, I don't see the implementation as wasted, because now it's fully case-insensitive and it cleans up the target filename, so it's more robust either way 😄 Yeah Win11 was awful at launch
bsherman
bsherman13mo ago
i did this:
$ git diff
diff --git a/build.py b/build.py
index b6d8b5a..b2d8dd1 100644
--- a/build.py
+++ b/build.py
@@ -493,7 +493,7 @@ time_start = time.time()

rmtree(OUTPUT_PATH) # Remove any leftover files.
output_size = 0
-output_size += process_microsoft()
+output_size += process_microsoft(10)
output_size += process_apple()
rmtree(TEMP_PATH)
print(f"Output font size (Total): {bytes_to_mib(output_size)}.\n")
$ git diff
diff --git a/build.py b/build.py
index b6d8b5a..b2d8dd1 100644
--- a/build.py
+++ b/build.py
@@ -493,7 +493,7 @@ time_start = time.time()

rmtree(OUTPUT_PATH) # Remove any leftover files.
output_size = 0
-output_size += process_microsoft()
+output_size += process_microsoft(10)
output_size += process_apple()
rmtree(TEMP_PATH)
print(f"Output font size (Total): {bytes_to_mib(output_size)}.\n")
that's nice and easy could be an override from the shell script
Arcitec
Arcitec13mo ago
Oh yeah I noticed 1 more thing, when you try Win10 files you will also need to pass the environment variable, as seen at bottom of README.md, the groups are named win10,win10_other.
bsherman
bsherman13mo ago
yep env WINDOWS_FONT_GROUPS="win10,win10_other" ./font-nexus -b
Arcitec
Arcitec13mo ago
Yeah, any luck with that? 🙂
bsherman
bsherman13mo ago
Output font size (Microsoft): 59.86 MiB. it worked!
Arcitec
Arcitec13mo ago
Perfect, I'll make two changes, to make it auto-select the win10 versions of those groups, and make it possible to specify the windows version.
bsherman
bsherman13mo ago
sounds good true confessions though, i don't think i'll use the "fancy" fonts for UI interfaces... though, I'm probably going to change my gnome defaults from Cantarell to Noto
Arcitec
Arcitec13mo ago
Yeah. You'll get better rendering of websites and documents, that's the main benefit
bsherman
bsherman13mo ago
i'm mildly annoyed that this font stuff nerd-sniped me lol but i allow one a week, so this has to be it for the week https://github.com/bsherman/ublue-custom/commit/cd0b4bada4a024c5863e2bba4d6dfd8798667de9
bsherman
bsherman13mo ago
I've used Hack before, but I decided to try it again after chosing it with hiden font names on test: https://www.codingfont.com/
bsherman
bsherman13mo ago
i used Hack back when i was coding on a Mac
Arcitec
Arcitec13mo ago
Hack back on a Mac 😄 Yeah, I used to look at and try so many fonts, until SF Pro and SF Mono. Now I'm settled for a year 😄
bsherman
bsherman13mo ago
i had been settled on Fira Code for the last few years... not sure why i tried JetBrainsMono again
Arcitec
Arcitec13mo ago
@bsherman https://github.com/Arcitec/font-nexus/releases/latest There we go, you're set. 🙂 Latest release has a secret env var, since I don't recommend using older fonts but definitely agree that it should be doable!
env WINDOWS_VERSION=10 ./font-nexus -b
env WINDOWS_VERSION=10 ./font-nexus -b
Thanks for all the help finding these win10 compatibility things, so they're out of the way now. 🙂 Agreed, Fira Code is awesome 🙂
bsherman
bsherman13mo ago
sweet! nice tool! good work
Arcitec
Arcitec13mo ago
Thanks. 🙂 Glad to help. I used to be crazy about creating shell aliases and was against making tools. You know all that code where it performs downloads of Apple fonts? I used to have this alias instead. Not even joking, I used this for a year. But when I wanted to get rid of LPF (a Fedora tool that grabs old MS fonts from 2002), and wanted to install the freshest Microsoft fonts instead, I decided it's finally time to escape from shell aliases. 😄
alias apple-fonts-update="sudo dnf -y in p7zip p7zip-plugins wget rsync && mkdir -p ~/Code/ThirdParty/Fonts/Apple-Fonts && cd ~/Code/ThirdParty/Fonts/Apple-Fonts && wget -q -O - https://developer.apple.com/fonts/ | grep -Eo 'http[^\\\"]+?\.dmg' | xargs wget --timestamping && rm -rf ./extract && for f in *.dmg; do 7z e -o./extract -ir'!*Fonts.pkg' -aoa \"\$f\"; done && for f in extract/*.pkg; do 7z e -so \"\$f\" 'Payload~' > \"\$f.payload\"; done && for f in extract/*.payload; do 7z l \"\$f\" && 7z e -o./extract/fonts -ir'!*.otf' -ir'!*.ttf' -aoa \"\$f\"; done && rm -rfv ./extract/fonts/SF-Pro-{Text,Display}*.otf ./extract/fonts/NewYork{Small,Medium,Large,ExtraLarge}*.otf ./extract/fonts/SF-Compact-{Text,Display}*.otf && sudo rsync -av --no-p --no-o --no-g --chmod=ugo=rwX --delete --mkpath ./extract/fonts/ /usr/share/fonts/apple-fonts/ && rm -rf ./extract && sudo restorecon -RFv /usr/share/fonts/apple-fonts && sudo fc-cache -v"
alias apple-fonts-update="sudo dnf -y in p7zip p7zip-plugins wget rsync && mkdir -p ~/Code/ThirdParty/Fonts/Apple-Fonts && cd ~/Code/ThirdParty/Fonts/Apple-Fonts && wget -q -O - https://developer.apple.com/fonts/ | grep -Eo 'http[^\\\"]+?\.dmg' | xargs wget --timestamping && rm -rf ./extract && for f in *.dmg; do 7z e -o./extract -ir'!*Fonts.pkg' -aoa \"\$f\"; done && for f in extract/*.pkg; do 7z e -so \"\$f\" 'Payload~' > \"\$f.payload\"; done && for f in extract/*.payload; do 7z l \"\$f\" && 7z e -o./extract/fonts -ir'!*.otf' -ir'!*.ttf' -aoa \"\$f\"; done && rm -rfv ./extract/fonts/SF-Pro-{Text,Display}*.otf ./extract/fonts/NewYork{Small,Medium,Large,ExtraLarge}*.otf ./extract/fonts/SF-Compact-{Text,Display}*.otf && sudo rsync -av --no-p --no-o --no-g --chmod=ugo=rwX --delete --mkpath ./extract/fonts/ /usr/share/fonts/apple-fonts/ && rm -rf ./extract && sudo restorecon -RFv /usr/share/fonts/apple-fonts && sudo fc-cache -v"
As long as you use &&, aliases can guarantee correctness too. It's pretty funny. 😄
bsherman
bsherman13mo ago
that's an impressive alias
Arcitec
Arcitec13mo ago
😂 👍 I was so against installing software in /bin just for stuff like this. But I'm preparing a full move to uBlue so I needed some new strategies. Next step is probably to make the tool build an RPM that rpm-ostree can install to add the fonts globally, but I haven't used mock enough to know how to do that off-hand. So for now, I'm shelving that idea.
bsherman
bsherman13mo ago
i think Jorge mentioned, but the biggest concern about using 3rd party, non-free fonts, etc in your image is you could end up getting a takedown request
Arcitec
Arcitec13mo ago
Yeah exactly. I really want to make a layered RPM.
bsherman
bsherman13mo ago
so having a tool to set it up automatically is smart... if flatpak is able to use arbitrary font paths, you could probably do something like use a first-time boot script (like yafti) and run font-nexus to install to /var/lib/fonts or something like that... but you'd need to make sure that path was configured globally int /etc/fonts/fonts.d that's pretty easy... the trick might be if selinux limits something or, maybe /usr/local/share/fonts
Arcitec
Arcitec13mo ago
Flatpak has a few hardcoded font paths, all the standardized ones. So /usr and ~/ locations are the available ones Their source is not flexible on this
bsherman
bsherman13mo ago
so ONLY /usr/share/fonts/* and ~/.local/fonts ? kinda lame that /usr/local/share/fonts/* wouldn't work
Arcitec
Arcitec13mo ago
Both paths under /usr work 🙂 support for /usr/local was added in 2022
bsherman
bsherman13mo ago
good, i thought i saw you say that earlier
Arcitec
Arcitec13mo ago
And ~/.fonts and ~/.local/share/fonts Yeah it used to be broken
bsherman
bsherman13mo ago
so, you can do that 🙂 just needs sudo
Arcitec
Arcitec13mo ago
Isn't /usr entirely immutable after installation?
bsherman
bsherman13mo ago
it's "sorta" standard /usr/local is mutable
Arcitec
Arcitec13mo ago
Oh that's awesome 🙂 Then this means I don't need to bundle fonts in the disk image.
bsherman
bsherman13mo ago
personally, i'm trying to stay away from using /usr/local, but this is exactly the kind of situation where I'm willing
Arcitec
Arcitec13mo ago
Yep. Of course the ultimate thing may be to figure out how to make an .rpm file that can layer itself to /usr/share/fonts. To avoid the mess in /usr/local
bsherman
bsherman13mo ago
ah, you could do that i guess ... but if you are pretty strict in your use of /usr/local just for fonts... i think the layered RPM may actually be worse i only locally layer RPMs for testing, then remove them ASAP when I am done or add them to image
Arcitec
Arcitec13mo ago
Hmm, yeah I guess it's fine to just let it install statically in /usr/local/share/fonts without RPM, to avoid the layering performance issue. It's the correct path for anything installed via make install anyway, so it's not like it's an unusual installation method 🙂 Moving to #💾ublue-dev