stix

package module
v0.2.0 Latest Latest
Warning

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

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

README

stix

GitHub release GoDoc License

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

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

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

	// Output:
	// num glyphs: 5543
}

Documentation

Overview

Package stix holds TTF data of the STIX2 fonts.

Example
package main

import (
	"fmt"
	"log"

	"github.com/go-fonts/stix/stix2math"
	"golang.org/x/image/font/sfnt"
)

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

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

}
Output:
num glyphs: 5543

Directories

Path Synopsis
Package stix2math provides the "STIX2Math" TrueType font from the STIX2 font family.
Package stix2math provides the "STIX2Math" TrueType font from the STIX2 font family.
Package stix2textbold provides the "STIX2Text Bold" TrueType font from the STIX2 font family.
Package stix2textbold provides the "STIX2Text Bold" TrueType font from the STIX2 font family.
Package stix2textbolditalic provides the "STIX2Text BoldItalic" TrueType font from the STIX2 font family.
Package stix2textbolditalic provides the "STIX2Text BoldItalic" TrueType font from the STIX2 font family.
Package stix2textitalic provides the "STIX2Text Italic" TrueType font from the STIX2 font family.
Package stix2textitalic provides the "STIX2Text Italic" TrueType font from the STIX2 font family.
Package stix2textregular provides the "STIX2Text Regular" TrueType font from the STIX2 font family.
Package stix2textregular provides the "STIX2Text Regular" TrueType font from the STIX2 font family.

Jump to

Keyboard shortcuts

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