gofontweb

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Embeddable Go fonts in woff2 format.

Documentation

Overview

Package gofontweb provides embedded Go fonts in woff2 format.

Usage

You can plug it into your web server code like this:

mux := http.NewServeMux()
mux.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.FS(gofontweb.FS()))))

Then in your HTML link to the “go.css” file to set up all the supported font faces:

<link rel=stylesheet href=/assets/go.css>

This stylesheet declares the following font families:

  • Go
  • Go Medium
  • Go Smallcaps
  • Go Mono

You can find the full example in “example” subdirectory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FS

func FS() fs.FS

FS returns an embedded file system holding all the woff2 files. The “go.css” file in this filesystem configures supported font faces.

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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