• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A platform-agnostic go (golang) library to easily locate truetype font files in your system's user and system font directories

PkgGoDev Go Report Card License MIT

go-findfont

A platform-agnostic go (golang) library to easily locate truetype font files in your system's user and system font directories.

What?

go-findfont is a golang library that allows you to locate font file on your system. The library is currently aware of the default font directories on Linux/Unix, Windows, and MacOS.

How?

Installation

Installing go-findfont is as easy as

go get -u github.com/flopp/go-findfont

Library Usage

import (
  "fmt"
  "io/ioutil"
  
  "github.com/flopp/go-findfont"
  "github.com/golang/freetype/truetype"
)

func main() {
  fontPath, err := findfont.Find("arial.ttf")
  if err != nil {
    panic(err)
  }
  fmt.Printf("Found 'arial.ttf' in '%s'\n", fontPath)

  // load the font with the freetype library
  fontData, err := ioutil.ReadFile(fontPath)
  if err != nil {
    panic(err)
  }
  font, err := truetype.Parse(fontData)
  if err != nil {
    panic(err)
  }

  // use the font...
}

License

Copyright 2016 Florian Pigorsch. All rights reserved.

Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

More Repositories

1

GpxTrackPoster

Create a visually appealing poster from your GPX tracks
Python
358
star
2

go-staticmaps

A go (golang) library and command line tool to render static map images using OpenStreetMap tiles.
Go
312
star
3

py-staticmaps

A python module to create static map images with markers, geodesic lines, etc.
Python
107
star
4

FloppsMap

Online map with draggable markers, waypoint projection, geocaches, ...
JavaScript
27
star
5

activities

Your self-hosted activities overview (running, cycling, ...). Synced with Strava.
JavaScript
26
star
6

invisible-characters

A static website abou invisible Unicode characters
HTML
18
star
7

RandomWallpapers

Random geometric wallpaper generator
Python
14
star
8

unicode

A Flask-Based Web-App for Exploring Unicode
Python
11
star
9

DesktopJodel

A inofficial, Qt-based desktop client for the Jodel chat protocol
C++
11
star
10

alcazar-gen

SAT-based generator for Alcazar puzzles
C++
10
star
11

airports

Fullscreen satellite map randomly showing the world's airports
Python
8
star
12

QtAsciimage

QtAsciimage - Asciimage for Qt Applications
C++
7
star
13

fritz-switch-profiles

A (Python) script to remotely set device profiles of an AVM Fritz!Box
Python
7
star
14

dotter

Qt based viewer for GraphViz (.dot) files
C++
6
star
15

StravaExportToGPX

Convert the activites in a Strava export to GPX files
Python
6
star
16

map

TypeScript
5
star
17

exposure

A Leaflet-based heatmap showing exposure notification beacons
HTML
5
star
18

go-coordsparser

A library for parsing (geographic) coordinates in go (golang)
Go
4
star
19

QtDateTimeEditor

A user and keyboard friendly alternative to Qt's QDateTimeEdit
C++
4
star
20

pyqt5-cpp-widgets

PyQt5, Python3 and Custom C++ Widgets
Python
3
star
21

aoc2021

My solutions for Advent of Code 2021.
Go
2
star
22

camelsplit

Camel case aware word splitting.
Python
2
star
23

coordinates-toolbox

A single page web-app providing several (geographic) coordinate calculations
JavaScript
2
star
24

gpx-map

Online Map displaying GPX tracks and makers (client side only!)
JavaScript
2
star
25

RunalyzeVagrant

Vagrant configuration for a Runalyze development environment
Shell
2
star
26

mantis-enhancer-user-script

User script enhancing Mantis BT
JavaScript
1
star
27

gol-sat

A SAT-based forward/backwards solver for Conway's "Game of Life".
C++
1
star
28

tracks

A static map of your FIT/GPX tracks
Python
1
star
29

overpass-poi-map

Leaflet map with POIs from the Overpass API
JavaScript
1
star
30

git-repo-backup

Backup a git repository using rsync
Shell
1
star
31

aoc2022

Go solutions for Advent of Code 2022 (aoc2022)
Go
1
star
32

aoc2020

My solutions for Advent of Code 2020
Python
1
star
33

aoc2016

My solutions for 'Advent of Code' 2016
C++
1
star
34

ocdl.py

Python script for downloading opencaching.de's "saved queries"
Python
1
star
35

parkrun-milestones

Determine milestone candidates for a parkrun event
Go
1
star
36

whataweek-mastodon

Go
1
star
37

go-getfile

Go module to download files
Go
1
star