Skip to content

β„±π’Άπ“ƒπ’Έπ“Ž π˜π—²π˜…π˜ 𝘴𝘡𝘺𝘭𝘦𝘴 𝔣𝔬𝔯 GΜ³oΜ³lΜ³aΜ³nΜ³gΜ³ in a compact, zero dependency library.

License

Notifications You must be signed in to change notification settings

danielgtaylor/unistyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Unistyle

GoDoc Go Report Card

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

How does this work?

These styles are split into two categories:

  1. 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.

  2. 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.

Usage Example

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"))
}

License

Copyright Β© 2019 Daniel G. Taylor

https://dgt.mit-license.org/

About

β„±π’Άπ“ƒπ’Έπ“Ž π˜π—²π˜…π˜ 𝘴𝘡𝘺𝘭𝘦𝘴 𝔣𝔬𝔯 GΜ³oΜ³lΜ³aΜ³nΜ³gΜ³ in a compact, zero dependency library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages