Unicode text styles for Go:
- ππΌπΉπ±
- ππ΅π’ππͺπ€
- UΜ²nΜ²dΜ²eΜ²rΜ²lΜ²iΜ²nΜ²eΜ²
- SΜΆtΜΆrΜΆiΜΆkΜΆeΜΆtΜΆhΜΆrΜΆoΜΆuΜΆgΜΆhΜΆ
- πππππΎπβ―
- ππ¬π±π₯π¦π
- And more! See the docs
These styles are split into two categories:
-
Unicode includes a table of combining diacritical marks that can be used to modify the previous character in a string. This allows for effects like underline, overline, and strikethrough.
-
Unicode includes multiple styles for most common characters. Using a character offset replacement mapping you can transform strings into their bold, italic, cursive or other styled equivalents.
Here is a small example. See the tests for more.
package main
import (
"fmt"
"github.com/danielgtaylor/unistyle"
)
func main() {
// Diacritic examples
fmt.Println(unistyle.Bold("Bold text"))
fmt.Println(unistyle.Strikethrough("Strike", unistyle.StrikeStrokeLong))
// Character mapping examples
fmt.Println(unistyle.Cursive("Cursive"))
fmt.Println(unistyle.Fraktur("Gothic"))
}
Copyright Β© 2019 Daniel G. Taylor