{"id":22509187,"url":"https://github.com/adrg/sysfont","last_synced_at":"2025-08-03T13:31:21.276Z","repository":{"id":41903888,"uuid":"224836211","full_name":"adrg/sysfont","owner":"adrg","description":"Golang identification and matching of system fonts","archived":false,"fork":false,"pushed_at":"2024-04-10T08:36:08.000Z","size":113,"stargazers_count":41,"open_issues_count":8,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-18T15:38:28.141Z","etag":null,"topics":["cross-platform","font","font-alternatives","font-defaults","font-identification","font-list","font-match","fonts","go","golang","identification","installed-font-detection","installed-fonts","matching","multiple-os","os-fonts"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/adrg/sysfont","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"adrgb"}},"created_at":"2019-11-29T10:55:38.000Z","updated_at":"2024-05-30T08:00:53.000Z","dependencies_parsed_at":"2024-06-18T15:31:40.737Z","dependency_job_id":"1b182162-b85e-434c-b9c7-95883b9f7799","html_url":"https://github.com/adrg/sysfont","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsysfont","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsysfont/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsysfont/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsysfont/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrg","download_url":"https://codeload.github.com/adrg/sysfont/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228547949,"owners_count":17935151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","font","font-alternatives","font-defaults","font-identification","font-list","font-match","fonts","go","golang","identification","installed-font-detection","installed-fonts","matching","multiple-os","os-fonts"],"created_at":"2024-12-07T01:28:03.138Z","updated_at":"2024-12-07T01:28:03.772Z","avatar_url":"https://github.com/adrg.png","language":"Go","funding_links":["https://ko-fi.com/adrgb","https://ko-fi.com/T6T72WATK"],"categories":[],"sub_categories":[],"readme":"sysfont\n=======\n[![Build Status](https://github.com/adrg/sysfont/workflows/CI/badge.svg)](https://github.com/adrg/sysfont/actions?query=workflow%3ACI)\n[![pkg.go.dev documentation](https://pkg.go.dev/badge/github.com/adrg/sysfont)](https://pkg.go.dev/github.com/adrg/sysfont)\n[![MIT license](https://img.shields.io/github/license/adrg/sysfont)](https://opensource.org/licenses/MIT)\n[![Go report card](https://goreportcard.com/badge/github.com/adrg/sysfont)](https://goreportcard.com/report/github.com/adrg/sysfont)\n[![GitHub issues](https://img.shields.io/github/issues/adrg/sysfont)](https://github.com/adrg/sysfont/issues)\n[![Buy me a coffee](https://img.shields.io/static/v1.svg?label=%20\u0026message=Buy%20me%20a%20coffee\u0026color=579fbf\u0026logo=buy%20me%20a%20coffee\u0026logoColor=white)](https://ko-fi.com/T6T72WATK)\n\nsysfont is a small package that makes it easy to identify installed fonts. It\nis useful for listing installed fonts or for matching fonts based on user\nqueries. The matching process also suggests viable font alternatives.\n\nThe package uses a collection of standard fonts compiled from the\n[os-font-list](https://github.com/adrg/os-font-list) project along with string\nprocessing and similarity metrics for scoring font matches, in order to account\nfor partial or inexact input queries.\n\nFull documentation can be found at: https://pkg.go.dev/github.com/adrg/sysfont.\n\n## Installation\n\n```\ngo get github.com/adrg/sysfont\n```\n\n## Usage\n\n#### List fonts\n\n```go\nfinder := sysfont.NewFinder(nil)\n\nfor _, font := range finder.List() {\n    fmt.Println(font.Family, font.Name, font.Filename)\n}\n```\n\n#### Match fonts\n\nThe matching process has three steps. Identification of the best matching\ninstalled font, based on the specified query, is attempted first. If no close\nmatch is found, alternative fonts are searched. If no alternative font is\nfound, a suitable default font is returned.\n\n```go\nfinder := sysfont.NewFinder(nil)\n\nterms := []string{\n    \"AmericanTypewriter\",\n    \"AmericanTypewriter-Bold\",\n    \"Andale\",\n    \"Arial\",\n    \"Arial Bold\",\n    \"Arial-BoldItalicMT\",\n    \"ArialMT\",\n    \"Baskerville\",\n    \"Candara\",\n    \"Corbel\",\n    \"Gill Sans\",\n    \"Hoefler Text Bold\",\n    \"Impact\",\n    \"Palatino\",\n    \"Symbol\",\n    \"Tahoma\",\n    \"Times\",\n    \"Times Bold\",\n    \"Times BoldItalic\",\n    \"Times Italic Bold\",\n    \"Times Roman\",\n    \"Verdana\",\n    \"Verdana-Italic\",\n    \"Webdings\",\n    \"ZapfDingbats\",\n}\n\nfor _, term := range terms {\n    font := finder.Match(term)\n    fmt.Printf(\"%-30s -\u003e %-30s (%s)\\n\", term, font.Name, font.Filename)\n}\n```\n\nOutput:\n![sysfont test output minimal](https://raw.githubusercontent.com/adrg/adrg.github.io/master/assets/projects/sysfont/output_minimal.png)\n\nA more comprehensive test made on Ubuntu:\n![sysfont test output full](https://raw.githubusercontent.com/adrg/adrg.github.io/master/assets/projects/sysfont/output-full.png)\n\n## References\n\nFor more information see:\n- [os-font-list](https://github.com/adrg/os-font-list)\n- [strutil](https://github.com/adrg/strutil)\n- [xdg](https://github.com/adrg/xdg)\n\n## Contributing\n\nContributions in the form of pull requests, issues or just general feedback,\nare always welcome.  \nSee [CONTRIBUTING.MD](CONTRIBUTING.md).\n\n## License\nCopyright (c) 2019 Adrian-George Bostan.\n\nThis project is licensed under the [MIT license](https://opensource.org/licenses/MIT).\nSee [LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrg%2Fsysfont","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrg%2Fsysfont","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrg%2Fsysfont/lists"}