gofontwoff: github.com/shurcooL/gofontwoff Index | Examples | Files

package gofontwoff

import "github.com/shurcooL/gofontwoff"

Package gofontwoff provides the Go font family in Web Open Font Format.

It's a Go package that statically embeds Go font family WOFF data, exposing it via an http.FileSystem.

These fonts were created by the Bigelow & Holmes foundry specifically for the Go project. See https://blog.golang.org/go-fonts for details.

Code:

fontsHandler := http.FileServer(gofontwoff.Assets)
http.Handle("/assets/fonts/", http.StripPrefix("/assets/fonts", fontsHandler))

Code:

fontsHandler := httpgzip.FileServer(gofontwoff.Assets, httpgzip.FileServerOptions{ServeError: httpgzip.Detailed})
http.Handle("/assets/fonts/", http.StripPrefix("/assets/fonts", fontsHandler))

Index

Examples

Package Files

assets_vfsdata.go doc.go

Variables

var Assets = func() http.FileSystem {
    fs := vfsgen۰FS{
        "/": &vfsgen۰DirInfo{
            name:    "/",
            modTime: time.Date(2018, 4, 20, 9, 16, 1, 2077308, time.UTC),
        },
        "/Go-Bold-Italic.woff2": &vfsgen۰FileInfo{
            name:    "Go-Bold-Italic.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 12, 0, time.UTC),
            content: []byte("" /* 193442 byte string literal not displayed */),
        },
        "/Go-Bold.woff2": &vfsgen۰FileInfo{
            name:    "Go-Bold.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 12, 0, time.UTC),
            content: []byte("" /* 185538 byte string literal not displayed */),
        },
        "/Go-Italic.woff2": &vfsgen۰FileInfo{
            name:    "Go-Italic.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 13, 0, time.UTC),
            content: []byte("" /* 192850 byte string literal not displayed */),
        },
        "/Go-Medium-Italic.woff2": &vfsgen۰FileInfo{
            name:    "Go-Medium-Italic.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 13, 0, time.UTC),
            content: []byte("" /* 217090 byte string literal not displayed */),
        },
        "/Go-Medium.woff2": &vfsgen۰FileInfo{
            name:    "Go-Medium.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 14, 0, time.UTC),
            content: []byte("" /* 207570 byte string literal not displayed */),
        },
        "/Go-Mono-Bold-Italic.woff2": &vfsgen۰FileInfo{
            name:    "Go-Mono-Bold-Italic.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 14, 0, time.UTC),
            content: []byte("" /* 220898 byte string literal not displayed */),
        },
        "/Go-Mono-Bold.woff2": &vfsgen۰FileInfo{
            name:    "Go-Mono-Bold.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 14, 0, time.UTC),
            content: []byte("" /* 210466 byte string literal not displayed */),
        },
        "/Go-Mono-Italic.woff2": &vfsgen۰FileInfo{
            name:    "Go-Mono-Italic.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 15, 0, time.UTC),
            content: []byte("" /* 221042 byte string literal not displayed */),
        },
        "/Go-Mono.woff2": &vfsgen۰FileInfo{
            name:    "Go-Mono.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 15, 0, time.UTC),
            content: []byte("" /* 212578 byte string literal not displayed */),
        },
        "/Go-Regular.woff2": &vfsgen۰FileInfo{
            name:    "Go-Regular.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 16, 0, time.UTC),
            content: []byte("" /* 184530 byte string literal not displayed */),
        },
        "/Go-Smallcaps-Italic.woff2": &vfsgen۰FileInfo{
            name:    "Go-Smallcaps-Italic.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 16, 0, time.UTC),
            content: []byte("" /* 176818 byte string literal not displayed */),
        },
        "/Go-Smallcaps.woff2": &vfsgen۰FileInfo{
            name:    "Go-Smallcaps.woff2",
            modTime: time.Date(2017, 7, 24, 6, 27, 16, 0, time.UTC),
            content: []byte("" /* 168866 byte string literal not displayed */),
        },
        "/fonts.css": &vfsgen۰CompressedFileInfo{
            name:             "fonts.css",
            modTime:          time.Date(2017, 7, 27, 22, 7, 46, 0, time.UTC),
            uncompressedSize: 1544,

            compressedContent: []byte("" /* 938 byte string literal not displayed */),
        },
    }
    fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
        fs["/Go-Bold-Italic.woff2"].(os.FileInfo),
        fs["/Go-Bold.woff2"].(os.FileInfo),
        fs["/Go-Italic.woff2"].(os.FileInfo),
        fs["/Go-Medium-Italic.woff2"].(os.FileInfo),
        fs["/Go-Medium.woff2"].(os.FileInfo),
        fs["/Go-Mono-Bold-Italic.woff2"].(os.FileInfo),
        fs["/Go-Mono-Bold.woff2"].(os.FileInfo),
        fs["/Go-Mono-Italic.woff2"].(os.FileInfo),
        fs["/Go-Mono.woff2"].(os.FileInfo),
        fs["/Go-Regular.woff2"].(os.FileInfo),
        fs["/Go-Smallcaps-Italic.woff2"].(os.FileInfo),
        fs["/Go-Smallcaps.woff2"].(os.FileInfo),
        fs["/fonts.css"].(os.FileInfo),
    }

    return fs
}()

Assets provides the Go font family WOFF data.

Package gofontwoff imports 9 packages (graph) and is imported by 5 packages. Updated 2018-11-22. Refresh now. Tools for package owners.