Skip to content

Instantly share code, notes, and snippets.

@anson-vandoren
anson-vandoren / GetSmallCapsString.java
Created January 22, 2016 18:56 — forked from markormesher/GetSmallCapsString.java
Create a small-caps spannable string that will work with any font
/**
* Produce a formatted SpannableString object from a given String
* input, with all lowercase characters converted to smallcap
* characters. Uses only standard A-Z characters, so works with
* any font.
*
* @param input The input string, e.g. "Small Caps"
* @return A formatted SpannableString, e.g. "Sᴍᴀʟʟ Cᴀᴘs"
*/
public static SpannableString getSmallCapsString(String input) {