xolonium

package module
v0.1.1 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

xolonium

GitHub release GoDoc License

xolonium provides the xolonium 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/xolonium/xoloniumregular"
	"golang.org/x/image/font/sfnt"
)

func Example() {
	ttf, err := sfnt.Parse(xoloniumregular.TTF)
	if err != nil {
		log.Fatalf("could not parse xolonium 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:    %q\n", v)
	fmt.Printf("num glyphs: %d\n", ttf.NumGlyphs())

	// Output:
	// version:    "Version 4.1 "
	// num glyphs: 836
}

Documentation

Overview

Package xolonium holds TTF data of the Xolonium fonts.

Example
package main

import (
	"fmt"
	"log"

	"github.com/go-fonts/xolonium/xoloniumregular"
	"golang.org/x/image/font/sfnt"
)

func main() {
	ttf, err := sfnt.Parse(xoloniumregular.TTF)
	if err != nil {
		log.Fatalf("could not parse xolonium 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:    %q\n", v)
	fmt.Printf("num glyphs: %d\n", ttf.NumGlyphs())

}
Output:

version:    "Version 4.1 "
num glyphs: 836

Directories

Path Synopsis
Package xoloniumbold provides the "Xolonium Bold" TrueType font from the Xolonium font family.
Package xoloniumbold provides the "Xolonium Bold" TrueType font from the Xolonium font family.
Package xoloniumregular provides the "Xolonium Regular" TrueType font from the Xolonium font family.
Package xoloniumregular provides the "Xolonium Regular" TrueType font from the Xolonium font family.

Jump to

Keyboard shortcuts

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