All Projects → adrg → sysfont

adrg / sysfont

Licence: MIT license
Golang identification and matching of system fonts

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to sysfont

Work Sans
A grotesque sans.
Stars: ✭ 1,319 (+4448.28%)
Mutual labels:  font, fonts
Webfont
Awesome generator of webfont
Stars: ✭ 170 (+486.21%)
Mutual labels:  font, fonts
Free Fonts
Free fonts available under the Apache license
Stars: ✭ 110 (+279.31%)
Mutual labels:  font, fonts
Open Relay
Free and open source fonts from Kreative Software
Stars: ✭ 48 (+65.52%)
Mutual labels:  font, fonts
Urbanist
Urbanist is a low-contrast, geometric sans-serif inspired by Modernist design and typography.
Stars: ✭ 374 (+1189.66%)
Mutual labels:  font, fonts
Swifticonfont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon)
Stars: ✭ 1,094 (+3672.41%)
Mutual labels:  font, fonts
Inkwell
An inkwell to use custom fonts on the fly.
Stars: ✭ 146 (+403.45%)
Mutual labels:  font, fonts
Firasystemfontreplacement
Modified version of the Fira Sans fonts to replace the default system font on macOS
Stars: ✭ 730 (+2417.24%)
Mutual labels:  font, fonts
Yrsa Rasa
Yrsa & Rasa: fonts for Latin and Gujarati
Stars: ✭ 200 (+589.66%)
Mutual labels:  font, fonts
Avfonts
AVFonts for change/swap fontname throughout app.
Stars: ✭ 200 (+589.66%)
Mutual labels:  font, fonts
Iosevka-Mayukai
Font based on Iosevka Custom Build, with combination from Iosevka SS04 Menlo, SS07 Monaco, SS09 Source Code Pro, SS12 Ubuntu Mono, SS14 Jetbrains Mono, Hack Style, and some Nerd Font Patching.
Stars: ✭ 149 (+413.79%)
Mutual labels:  font, fonts
FontRegister
FontRegister is a small Windows utility to install fonts and/or repair the font registry via commandline.
Stars: ✭ 17 (-41.38%)
Mutual labels:  font, fonts
Opendyslexic Chrome
Offical OpenDyslexic chrome extension
Stars: ✭ 36 (+24.14%)
Mutual labels:  font, fonts
Linearicons
Linearicons is the highest quality set of line icons, matching with minimalist UI designs in iOS.
Stars: ✭ 64 (+120.69%)
Mutual labels:  font, fonts
Fontsource
Self-host Open Source fonts in neatly bundled NPM packages.
Stars: ✭ 836 (+2782.76%)
Mutual labels:  font, fonts
San Francisco Family
All the fonts in San Francisco family font, developed by Apple. Including new SF Camera font from iOS 13!
Stars: ✭ 141 (+386.21%)
Mutual labels:  font, fonts
Codeface
Typefaces for source code beautification
Stars: ✭ 5,612 (+19251.72%)
Mutual labels:  font, fonts
Nerd Fonts
Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
Stars: ✭ 31,778 (+109479.31%)
Mutual labels:  font, fonts
Powerline Web Fonts
Powerline Web Fonts for Chromebook
Stars: ✭ 178 (+513.79%)
Mutual labels:  font, fonts
fdiff
An OpenType table diff tool for fonts. Based on the fontTools TTX format.
Stars: ✭ 33 (+13.79%)
Mutual labels:  font, fonts

sysfont

Build Status pkg.go.dev documentation MIT license Go report card GitHub issues Buy me a coffee

sysfont is a small package that makes it easy to identify installed fonts. It is useful for listing installed fonts or for matching fonts based on user queries. The matching process also suggests viable font alternatives.

The package uses a collection of standard fonts compiled from the os-font-list project along with string processing and similarity metrics for scoring font matches, in order to account for partial or inexact input queries.

Full documentation can be found at: https://pkg.go.dev/github.com/adrg/sysfont.

Installation

go get github.com/adrg/sysfont

Usage

List fonts

finder := sysfont.NewFinder(nil)

for _, font := range finder.List() {
    fmt.Println(font.Family, font.Name, font.Filename)
}

Match fonts

The matching process has three steps. Identification of the best matching installed font, based on the specified query, is attempted first. If no close match is found, alternative fonts are searched. If no alternative font is found, a suitable default font is returned.

finder := sysfont.NewFinder(nil)

terms := []string{
    "AmericanTypewriter",
    "AmericanTypewriter-Bold",
    "Andale",
    "Arial",
    "Arial Bold",
    "Arial-BoldItalicMT",
    "ArialMT",
    "Baskerville",
    "Candara",
    "Corbel",
    "Gill Sans",
    "Hoefler Text Bold",
    "Impact",
    "Palatino",
    "Symbol",
    "Tahoma",
    "Times",
    "Times Bold",
    "Times BoldItalic",
    "Times Italic Bold",
    "Times Roman",
    "Verdana",
    "Verdana-Italic",
    "Webdings",
    "ZapfDingbats",
}

for _, term := range terms {
    font := finder.Match(term)
    fmt.Printf("%-30s -> %-30s (%s)\n", term, font.Name, font.Filename)
}

Output: sysfont test output minimal

A more comprehensive test made on Ubuntu: sysfont test output full

References

For more information see:

Contributing

Contributions in the form of pull requests, issues or just general feedback, are always welcome.
See CONTRIBUTING.MD.

License

Copyright (c) 2019 Adrian-George Bostan.

This project is licensed under the MIT license. See LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].