Skip to content

unicodeUtils.js

Gecero edited this page Oct 8, 2018 · 2 revisions

unicodeUtils.js

unicodeUtils.js is a more or less small javascript library for converting normal text to different unicode text types.

code example and how to use

there is not much to explain so i'll just show you the outputs of the functions.
lets take the sentence The quick brown fox jumps over the lazy dog as input for the functions.

  • function toSupScript(text): ᵀʰᵉ qᵘⁱᶜᵏ ᵇʳᵒʷⁿ ᶠᵒˣ ʲᵘᵐᵖˢ ᵒᵛᵉʳ ᵗʰᵉ ˡᵃᶻʸ ᵈᵒᵍ
  • function toSubScript(text): Tₕₑ qᵤᵢcₖ bᵣₒwₙ fₒₓ ⱼᵤₘₚₛ ₒᵥₑᵣ ₜₕₑ ₗₐzy dₒg
    note that not every character is available as superscript or subscript character
  • function toFullWidth(text): The quick brown fox jumps over the lazy dog
  • function toSmallCaps(text): Tʜᴇ ǫᴜɪᴄᴋ ʙʀᴏᴡɴ ғᴏx ᴊᴜᴍᴘs ᴏᴠᴇʀ ᴛʜᴇ ʟᴀᴢʏ ᴅᴏɢ
Clone this wiki locally