gosysfonts

package module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 2 Imported by: 4

README

gosysfonts

GoDoc Build Status Coverage Status Go Report Card

Get system TTF fonts by name in Go. Currently only works for windows.

Installation

go get "github.com/LLKennedy/gosysfonts"

Basic Usage

font, err := gosysfonts.New().GetFont("arial")

Testing

On windows, the simplest way to test is to use the powershell script.

./test.ps1

To emulate the testing which occurs in build pipelines, run the following:

go test . -race -coverprofile=coverage.out;

Documentation

Overview

Package gosysfonts gets system TTF fonts by name

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinuxPool added in v0.0.3

type LinuxPool struct{}

LinuxPool is the linux implementation of Pool

func (LinuxPool) GetFont added in v0.0.4

func (pool LinuxPool) GetFont(name string) (*truetype.Font, error)

GetFont returns the truetype font corresponding to the font name passed in

type Pool

type Pool interface {
	GetFont(name string) (*truetype.Font, error)
}

Pool is a pool of system fonts

func New added in v0.0.3

func New() Pool

New returns a new Pool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL