metrics

package
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 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.

Documentation

Overview

Package metrics provides font metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CharWidth

func CharWidth(fontName string, c int) int

CharWidth returns the character width for a char and font in glyph space units.

func FontBoundingBox

func FontBoundingBox(fontName string) *types.Rectangle

FontBoundingBox returns the font bounding box for a given font as specified in the corresponding AFM file.

func FontNames

func FontNames() []string

FontNames returns the list of supported font names.

func FontSize

func FontSize(text, fontName string, width float64) int

FontSize returns the needed font size (aka. font scaling factor) in points for rendering a given text string using a given font name with a given user space width.

func TextWidth

func TextWidth(text, fontName string, fontSize int) float64

TextWidth represents the width in user space units for a given text string, font name and font size.

func UserSpaceFontBBox

func UserSpaceFontBBox(fontName string, fontSize int) *types.Rectangle

UserSpaceFontBBox returns the font box for given font name and font size in user space coordinates.

Types

This section is empty.

Directories

Path Synopsis
Package standard provides font metrics for Adobe standard fonts.
Package standard provides font metrics for Adobe standard fonts.

Jump to

Keyboard shortcuts

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