textwrap

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

textwrap

Better text wrap algorithms

  • Wrap text without breaking words as much as possible
  • Support Chinese characters and super long words

Known problems

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseFont added in v0.0.2

func ParseFont(fontBody []byte, fontSize float64) (font.Face, error)

ParseFont Parse font file to FontFace

func TextWrap

func TextWrap(s string, over func(string) bool) []string

TextWrap Wrap text without breaking words as much as possible; Support Chinese characters and super long words

func TextWrapFont added in v0.0.2

func TextWrapFont(s string, f font.Face, width float64) []string

TextWrapFont measure and Wrap text

Types

This section is empty.

Jump to

Keyboard shortcuts

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