Adrian: A platform for hosting web fonts
Meet my friend Adrian!
Adrian is a web server, like Apache or Nginx, but just for fonts. Really, just fonts. Point Adrian toward a directory of font files; it'll generate CSS to use all styles and weights you have, and serve everything up for your visitors. If you’ve used Google Fonts, you should find Adrian quite familiar.
Adrian supports these font formats:
Do you have a project that you’ve open-sourced but you can't put the commercial fonts you bought in your repo? Put your code up on GitHub and load your fonts off your private Adrian server.
- Grab the most recent Adrian release for your operating system. Extract the files somewhere on your server or local development environment.
adrian.yaml.exampleto a new file named
adrian.yamlto configure Adrian
adrianto begin serving
To use a YAML config file in a different location, specify it with the
--config parameter when starting Adrian. For example:
./adrian --config /etc/adrian/adrian.yaml
Test it by loading a font CSS file, such as http://example.com/font/Arial.css (replace
example.com with your server's hostname and
Arial with the name of a font available to Adrian.
Configuring Adrian with
global: # Port number Adrian responds to port: 80 # Adrian will only allow fonts to be used on these URLs (CORS functionality) domains: - example.com # Directories where Adrian should look for fonts directories: - /usr/share/fonts # If true, replace font filenames with hashes so they can't be guessed as easily obfuscate filenames: false # Used to set the cache-control header in responses cache-control lifetime: 2628000 # Paths for writing logs to disk logs: access: "/var/log/adrian/access.log"
The TCP/IP port Adrian will listen to. Defaults to port 80.
A whitelist of domains allowed to use fonts hosted by this instance
A list of directories where Adrian should look for font files. On Linux, system-wide fonts are usually found in
obfuscate filenames: <boolean>
If true, the filenames of font files are replaced with hashes so they can't be guessed as easily.
cache-control lifetime: <seconds>
Used to set the cache-control header sent to browsers. This header instructs browsers to cache Adrian's CSS and font files for this amount of time.
Path where Adrian should write an access log. Access logs use Common Log Format for easy parsing.
In your site's CSS, import Adrian's CSS for the fonts you want to use:
Generates CSS for including the Arial font and all of its variants in a web project.
Get one CSS file for muliple fonts by separating the names with pipe characters. For example: http://example.com/css?family=Arial|Courier%20New
display query parameter allows you to set the
font-display style for all of the requested fonts. For example, the
display=swap value tells browsers to render text with fallback fonts until custom ones are downloaded.
Please consider opening a Pull Request to submit changes to this project.
- Dave Ross - Initial work - daveross
This project is licensed under the MIT License - see the LICENSE.md file for details