Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A silly utility to apply Unicode effects to text

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 cmd
Octocat-spinner-32 pkg
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .lvimrc
Octocat-spinner-32 COPYING
Octocat-spinner-32 README.md
Octocat-spinner-32 all.bash
README.md

unifun: A Silly Unicode Text Transformer

Sometimes it is fun to abuse Unicode. For example, the phrase "The Quick Brown Fox jumped over the Lazy Dog" can be rendered using only Unicode codepoints as:

𝔗π”₯𝔒 𝔔𝔲𝔦𝔠𝔨 𝔅𝔯𝔬𝔴𝔫 𝔉𝔬𝔡 𝔧𝔲π”ͺ𝔭𝔒𝔑 𝔬𝔳𝔒𝔯 𝔱π”₯𝔒 π”π”žπ”·π”Ά 𝔇𝔬𝔀 (Blackletter)

π•Ώπ–π–Š π•Όπ–šπ–Žπ–ˆπ– π•­π–—π–”π–œπ–“ 𝕱𝖔𝖝 π–π–šπ–’π–•π–Šπ–‰ π–”π–›π–Šπ–— π–™π–π–Š π•·π–†π–Ÿπ–ž π•―π–”π–Œ (Blackletter bold)

Ι“oβ—– ʎzɐΛ₯ ǝΙ₯Κ‡ ɹǝʌo pǝdΙ―nΙΎ xoβ„² uʍoɹ𐐒 ΚžΙ”Δ±nΌ ǝΙ₯βŠ₯ (Fipped)

The unifun program allows you to convert text from vanilla Latin characters to these exotic Unicode beasts.

Compiling

You need to have the Go SDK installed. (See the getting started section of the Go website.) In addition, you'll need to have the gomake progam in your PATH.

If the SDK is installed, you should be able to compile and install the utility with one command:

$ cd /home/foo/bar/unifun # This is the source directory for unifun
$ ./all.bash install

Usage

usage: unifun [options] text
  -f="blackletter": Specify which 'font' to use. Use -l to see all.
  -l=false: List fonts and exit.
  -n=false: Don't print trailing newline.

Implementation

The command is implemented with the help of a package written in Go.

PACKAGE

package uctricks
import "."

A selection of fun unicode 'tricks' to apply to text


FUNCTIONS

func FontList() []string
Return a slice containing all font names.


TYPES

type Font struct {
// contains filtered or unexported fields
}
A 'font' is a mapping from rune to rune and (optionally) a function to apply to the text before mapping.

func FontNamed(name string) (*Font, os.Error)
Return a pointer to the font named.

func (f *Font) Apply(s string) string

License and Copyright

This code is Copyright 2011 Rich Wareham and is licensed under the 2-clause BSD-license. Full information can be found in the COPYING file.

Something went wrong with that request. Please try again.