[HN Gopher] Fnt: apt for fonts
       ___________________________________________________________________
        
       Fnt: apt for fonts
        
       Author : alexmyczko
       Score  : 71 points
       Date   : 2021-02-08 13:14 UTC (2 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | dsr_ wrote:
       | "apt for fonts" is called apt.
       | 
       | If you want the testing fonts, you add:
       | 
       | /etc/apt/sources.d/fonts.list:
       | 
       | deb http://http.debian.net/debian sid main contrib non-free
       | 
       | and
       | 
       | /etc/apt/preferences.d/pinning:
       | 
       | Package: fonts-* Pin: release a=testing Pin-Priority: 600
       | 
       | (priority between 500 and 989 means "causes a version to be
       | installed unless there is a version available belonging to the
       | target release or the installed version is more recent")
       | 
       | and after you apt update, you have access to sid.
        
         | nerdponx wrote:
         | Maybe the problem is that there's no equivalent of the AUR for
         | Debian-based repos, and/or that packaging for Debian is a
         | serious pain the ass.
        
         | Kaze404 wrote:
         | ...unless you're not on a Debian-based distribution.
        
           | G4E wrote:
           | Then you won't have apt in the first place ;)
        
             | dividedbyzero wrote:
             | But you can have fnt, they support macOS too it seems
        
               | alexmyczko wrote:
               | THIS is the main reason I wrote it.
        
         | mikewhy wrote:
         | Yes why use this simple tool when you can:
         | 
         | 1. add a limited set of fonts (requires sudo privileges)
         | 
         | 2. pin those using an arbitrary number between two more
         | arbitrary numbers, hope it doesn't break anything else. if it
         | does break I'm sure there's a few pages of documentation you
         | can sift through (also requires sudo privileges)
         | 
         | 3. run another sudo command to update your local list of
         | available packages
         | 
         | 4. finally, use sudo to install your font
        
           | qbasic_forever wrote:
           | And god help you if you'd like to add a font. You'll need to
           | read hundreds of pages of mostly out of date documentation.
           | Then track down brusque gatekeepers on IRC and obscure
           | communication channels to plead your case, only to be mocked
           | and told simply, "No." You will be told it's not "the Debian
           | way" and hundreds of pages of more documentation will be
           | thrown at you. Almost certainly someone will quiz you on your
           | knowledge of obscure 90's unix minutia and the writings of
           | Eric S. Raymond. And once you pass that gauntlet your font
           | might be accepted in a few months, at which time it's already
           | way out of date and you start the whole process over again.
        
             | ramses0 wrote:
             | Don't forget getting ridiculed for a "Useless Use of Cat"
        
             | dsr_ wrote:
             | Pretty sure I just wrote out all the steps for you.
             | 
             | I'm glad I could save you from that nightmare. Next time
             | try posting to the debian-users mailing list, we hardly
             | ever mock anyone.
        
               | zerocrates wrote:
               | I believe they were talking in that comment about adding
               | a new font _to_ Debian.
        
               | dsr_ wrote:
               | It seems unlikely to be that difficult, given that there
               | are
               | 
               | apt search "font"|grep fonts-|wc -l
               | 
               | roughly 600 font families packaged in the Debian
               | repositories right now.
        
           | tazard wrote:
           | While I agree this looks like a nice simple tool for managing
           | fonts, bringing up the differences between it and apt is
           | hardly an argument for how this is the "apt for fonts".
           | 
           | I'm not the target user here since I'm usually happy enough
           | with whatever font is available by default from apt, but that
           | makes this tool (as nice as I'm sure it is for the intended
           | users):
           | 
           | 1. Install new package manager for a special category of
           | packages
           | 
           | 2. Learn/use different syntax for
           | installing/searching/updating/removing
           | 
           | 3. Remember in 6 months I even installed this thing, when I
           | feel like a font change
        
           | alexmyczko wrote:
           | not every linux or system has apt. not every user has root
           | permissions. not every system has sudo.
        
             | mikewhy wrote:
             | Yes, exactly. I think we're saying the same thing: the
             | submitted tool doesn't need apt or any sort of root
             | permissions. While the instructions the parent posted
             | required root, apt, knowledge of pinning, and acceptance of
             | any issues that brings up.
             | 
             | Much more complicated than just installing a font.
        
           | dsr_ wrote:
           | You don't need sudo for any of this.
           | 
           | You do need root privileges if you want to install font
           | packages so that everyone on the system can use them. If you
           | only have yourself as a user, you can just drop ttf or otf
           | files in an appropriate $HOME subdir.
           | 
           | You can also build yourself a read-only disk image and run
           | overlay, or run NIXos, or guix, or whatever. I find it
           | baffling that you find it desirable to sneer at instructions
           | on how to do things appropriately for the specific system
           | that is being referenced.
           | 
           | Hopefully other people will find some value in what I wrote.
        
             | netizen-9748 wrote:
             | Huh, so I bet someone could write a manager to handle that
             | in a single command right?
        
         | progval wrote:
         | And fnt has little to do with apt; it's a wrapper around curl +
         | ar + tar, that doesn't support any of the important features of
         | APT (signature checking, dependencies, updates, keeping track
         | of what is installed, uninstalls, ...)
        
           | alexmyczko wrote:
           | that is true. but everyone knows apt, so if you want to
           | explain something similar in usage, i'd refer to something
           | people know about. of course your description: "wrapper
           | around curl/ar/tar" is on point, but would anyone have
           | understood it? the missing important features are a good
           | idea.
        
         | dividedbyzero wrote:
         | To me, "apt for fonts" is something similar to apt, but
         | centered around and specialized in fonts. Like, say, eprairie,
         | the "ebay for bison" - I can list those rare bison I need to
         | get rid of on ebay, but people won't be able to search for horn
         | curvature, but I expect eprairie will have that.
         | 
         | Good to know there are some fonts on apt, though!
        
       | francis-io wrote:
       | Managing fonts is not great on Linux in general. I'll make sure I
       | give this a go.
       | 
       | A good font can make a big difference if you are in the terminal
       | or editor all day. It's a pain to get unity between them though.
        
         | brnt wrote:
         | Whats not great about chucking them in ~/.fonts and done? I
         | can't think of how it could be easier?
        
         | qbasic_forever wrote:
         | It's not too bad on modern Ubuntu-based variants in my
         | experience. There's a font manager GUI that lets you drag and
         | drop add stuff, one click install font, etc. like on Windows.
         | You can also just copy ttf or other files into your ~/.fonts
         | for your user and they work fine too (I like this since you can
         | just sync and backup your fonts across all your machines).
         | 
         | The real mess, sadly, is configuring all your apps and such to
         | use different fonts. There are an unbelievable amount of
         | obscure configs, tweak tools, etc. if you want to change system
         | fonts.
        
         | berkes wrote:
         | Once you start accumulating all the fonts you needed over
         | projects, your Inkscape and Gimp become terribly sluggish on
         | booting. Other programs maybe too, I don't know, I don't use
         | that many graphical tools or office programs.
         | 
         | And the font-selector dropdowns become unusable.
         | 
         | So I started manually moving stuff from /usr/share/fonts/ and
         | ./.local/share/fonts/ into per-project archive folders. A lot
         | of work, that a font-manager could easily do much better.
         | Worse: manually moving stuff from /usr/share/fonts/ can and
         | will bring them back "unexpected" on updates or reinstallation
         | - though there are probably hardly ever updates for font
         | packages.
         | 
         | I would love a tool like fnt to manage this for me, but it
         | seems fnt is more for installing and less for "dis- and
         | enabling" them per theme/project etc.
        
           | alexmyczko wrote:
           | fontmatrix has dis- and enabling fonts feature. good idea, I
           | will consider this.
        
       | caiob wrote:
       | How's this different than say
       | https://github.com/Homebrew/homebrew-cask-fonts on a Mac?
        
       | alexmyczko wrote:
       | You want the latest and greated fonts from Debian sid? Now you
       | can! No matter if you're on some strange Linux distribution or
       | some macOS! Single shell script for the rescue...
        
       | amirmasoudabdol wrote:
       | Homebrew on macOS supports fonts through 'cask'. I'm not sure
       | about Linux but since they run on Linux these days, I'd not
       | wonder if they have that covered as well.
        
       | revel wrote:
       | I really like this idea. Seems almost crazy that it hasn't been
       | done before
        
         | rovr138 wrote:
         | like.. actually using apt for fonts?
         | 
         | and for that matter, brew on mac
        
       | rememberlenny wrote:
       | Not related, but fun fact: when iOS jailbreaks were popular, a
       | primary vector was through an intentionally corrupted font file.
        
       | otabdeveloper4 wrote:
       | We seriously need a package manager for package managers, and I'm
       | not even joking.
        
         | viraptor wrote:
         | There you go: https://asdf-vm.com/
         | 
         | Doesn't support fnt yet, but after this post I give it a week
         | or so.
        
         | alexmyczko wrote:
         | I think we need less pakage managers, and more cooperation
         | between them. I mean all the resources wasted, look at
         | repology.org...
        
       | Wowfunhappy wrote:
       | If you're on macOS, I can't say I really see the advantage to
       | this over using the built-in Fontbook. Perhaps if you manage a
       | lot of machines...
        
         | igneo676 wrote:
         | Or, even better, https://github.com/Homebrew/homebrew-cask-
         | fonts
         | 
         | 1. No GUI needed
         | 
         | 2. Discoverable and searchable directly through Brew
        
           | alexmyczko wrote:
           | No preview, but yeah, see issues about why it didn't cut it
           | for me.
        
         | anamexis wrote:
         | You can't find and install new fonts using Fontbook, can you?
        
           | Wowfunhappy wrote:
           | ...Oh, I get it now. (You _can_ install new fonts, just not
           | find them.)
           | 
           | It's just, I personally can't imagine installing a new font
           | without actually looking at it first. I know this provides an
           | ascii art preview, but I'd need a more precise rendering.
        
             | alexmyczko wrote:
             | just replace chafa with open (macos) or feh (linux) and get
             | a nice preview.
        
               | Phrodo_00 wrote:
               | the linux equivalent to open is xdg-open
        
       ___________________________________________________________________
       (page generated 2021-02-10 23:01 UTC)