ffff

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 11 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ffff Build Status Go Reference

finder for font files

Usage

package main

import (
	"fmt"

	"github.com/beta/freetype/truetype"
	"github.com/k1LoW/ffff"
	"golang.org/x/image/font"
	"golang.org/x/image/font/opentype"
)

func main() {
	fontSize := 12.0
	dpi := 72.0
	to := &truetype.Options{
		Size:              fontSize,
		DPI:               dpi,
		Hinting:           font.HintingNone,
		GlyphCacheEntries: 0,
		SubPixelsX:        0,
		SubPixelsY:        0,
	}
	oo := &opentype.FaceOptions{
		Size:    fontSize,
		DPI:     dpi,
		Hinting: font.HintingNone,
	}

	face, err := ffff.FuzzyFindFace("Arial", to, oo)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%v", face)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuzzyFindFace

func FuzzyFindFace(keyword string, to *truetype.Options, oo *opentype.FaceOptions) (font.Face, error)

FuzzyFindFace find font.Face by keyword.

func FuzzyFindPath

func FuzzyFindPath(keyword string) (string, error)

FuzzyFindPath find font file path by keyword.

Types

type Font

type Font struct {
	Path string
	Face font.Face
}

func FuzzyFind

func FuzzyFind(keyword string, to *truetype.Options, oo *opentype.FaceOptions) (Font, error)

FuzzyFind find font by keyword.

Jump to

Keyboard shortcuts

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