liberation

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: BSD-3-Clause Imports: 0 Imported by: 0

README

liberation

GitHub release GoDoc License

liberation provides the liberation fonts as importable Go packages.

The fonts are released under the SIL Open Font license. The Go packages under the BSD-3 license.

Example

import (
	"fmt"
	"log"

	"github.com/go-fonts/liberation/liberationserifregular"
	"golang.org/x/image/font/sfnt"
)

func Example() {
	ttf, err := sfnt.Parse(liberationserifregular.TTF)
	if err != nil {
		log.Fatalf("could not parse Liberation Serif font: %+v", err)
	}

	var buf sfnt.Buffer
	v, err := ttf.Name(&buf, sfnt.NameIDVersion)
	if err != nil {
		log.Fatalf("could not retrieve font version: %+v", err)
	}

	fmt.Printf("version:    %s\n", v)
	fmt.Printf("num glyphs: %d\n", ttf.NumGlyphs())

	// Output:
	// version:    Version 2.1.4
	// num glyphs: 2601
}

Documentation

Overview

Package liberation holds TTF data of the Liberation fonts.

Example
package main

import (
	"fmt"
	"log"

	"github.com/go-fonts/liberation/liberationserifregular"
	"golang.org/x/image/font/sfnt"
)

func main() {
	ttf, err := sfnt.Parse(liberationserifregular.TTF)
	if err != nil {
		log.Fatalf("could not parse Liberation Serif font: %+v", err)
	}

	var buf sfnt.Buffer
	v, err := ttf.Name(&buf, sfnt.NameIDVersion)
	if err != nil {
		log.Fatalf("could not retrieve font version: %+v", err)
	}

	fmt.Printf("version:    %s\n", v)
	fmt.Printf("num glyphs: %d\n", ttf.NumGlyphs())

}
Output:

version:    Version 2.1.4
num glyphs: 2601

Directories

Path Synopsis
Package liberationmonobold provides the "LiberationMono Bold" TrueType font from the Liberation font family.
Package liberationmonobold provides the "LiberationMono Bold" TrueType font from the Liberation font family.
Package liberationmonobolditalic provides the "LiberationMono BoldItalic" TrueType font from the Liberation font family.
Package liberationmonobolditalic provides the "LiberationMono BoldItalic" TrueType font from the Liberation font family.
Package liberationmonoitalic provides the "LiberationMono Italic" TrueType font from the Liberation font family.
Package liberationmonoitalic provides the "LiberationMono Italic" TrueType font from the Liberation font family.
Package liberationmonoregular provides the "LiberationMono Regular" TrueType font from the Liberation font family.
Package liberationmonoregular provides the "LiberationMono Regular" TrueType font from the Liberation font family.
Package liberationsansbold provides the "LiberationSans Bold" TrueType font from the Liberation font family.
Package liberationsansbold provides the "LiberationSans Bold" TrueType font from the Liberation font family.
Package liberationsansbolditalic provides the "LiberationSans BoldItalic" TrueType font from the Liberation font family.
Package liberationsansbolditalic provides the "LiberationSans BoldItalic" TrueType font from the Liberation font family.
Package liberationsansitalic provides the "LiberationSans Italic" TrueType font from the Liberation font family.
Package liberationsansitalic provides the "LiberationSans Italic" TrueType font from the Liberation font family.
Package liberationsansregular provides the "LiberationSans Regular" TrueType font from the Liberation font family.
Package liberationsansregular provides the "LiberationSans Regular" TrueType font from the Liberation font family.
Package liberationserifbold provides the "LiberationSerif Bold" TrueType font from the Liberation font family.
Package liberationserifbold provides the "LiberationSerif Bold" TrueType font from the Liberation font family.
Package liberationserifbolditalic provides the "LiberationSerif BoldItalic" TrueType font from the Liberation font family.
Package liberationserifbolditalic provides the "LiberationSerif BoldItalic" TrueType font from the Liberation font family.
Package liberationserifitalic provides the "LiberationSerif Italic" TrueType font from the Liberation font family.
Package liberationserifitalic provides the "LiberationSerif Italic" TrueType font from the Liberation font family.
Package liberationserifregular provides the "LiberationSerif Regular" TrueType font from the Liberation font family.
Package liberationserifregular provides the "LiberationSerif Regular" TrueType font from the Liberation font family.

Jump to

Keyboard shortcuts

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