Crate math_text_transform [] [src]

Transform text from standard alphanumerical characters to it’s unicode equivalents of a certain variant in the mathematical alphanumeric symbols block (code block U+1D400–U+1D7FF).

use math_text_transform::math_italic;
use math_text_transform::MathTextTransform;

assert_eq!(math_italic('f'), Some('𝑓'));
assert_eq!("Bold".to_math_bold(), "𝐁𝐨𝐥𝐝");

Supported variants are:

  • 𝐛𝐨𝐥𝐝 (bold)
  • 𝑖𝑡𝑎𝑙𝑖𝑐 (italic)
  • 𝒃𝒐𝒍𝒅 𝒊𝒕𝒂𝒍𝒊𝒄 (bold italic)
  • 𝗌𝖺𝗇𝗌-𝗌𝖾𝗋𝗂𝖿 (sans-serif)
  • 𝘀𝗮𝗻𝘀-𝘀𝗲𝗿𝗶𝗳 𝗯𝗼𝗹𝗱 (sans-serif bold)
  • 𝘴𝘢𝘯𝘴-𝘴𝘦𝘳𝘪𝘧 𝘪𝘵𝘢𝘭𝘪𝘤 (sans-serif italic)
  • 𝙨𝙖𝙣𝙨-𝙨𝙚𝙧𝙞𝙛 𝙗𝙤𝙡𝙙 𝙞𝙩𝙖𝙡𝙞𝙘 (sans-serif bold italic)
  • 𝓈𝒸𝓇𝒾𝓅𝓉 (script)
  • 𝓫𝓸𝓵𝓭 𝓼𝓬𝓻𝓲𝓹𝓽 (bold script)
  • 𝔣𝔯𝔞𝔨𝔱𝔲𝔯 (fraktur)
  • 𝖇𝖔𝖑𝖉 𝖋𝖗𝖆𝖐𝖙𝖚𝖗 (bold fraktur)
  • 𝚖𝚘𝚗𝚘𝚜𝚙𝚊𝚌𝚎 (monospace)
  • 𝕕𝕠𝕦𝕓𝕝𝕖-𝕤𝕥𝕣𝕦𝕔𝕜 (double-struck)

References

Traits

MathTextTransform

Convenience trait that allows you to call the the transformation straight on a string slice. If a variant doesn't exist for a given character, it is left as is.

Functions

math_bold

Transform a character to it's mathematical bold equivalent.

math_bold_fraktur

Transform a character to it's mathematical bold fraktur equivalent.

math_bold_italic

Transform a character to it's mathematical bold italic equivalent.

math_bold_script

Transform a character to it's mathematical bold script equivalent.

math_double_struck

Transform a character to it's mathematical double-struck equivalent.

math_fraktur

Transform a character to it's mathematical fraktur equivalent.

math_italic

Transform a character to it's mathematical italic equivalent.

math_monospace

Transform a character to it's mathematical monospace equivalent.

math_sans_serif

Transform a character to it's mathematical sans-serif equivalent.

math_sans_serif_bold

Transform a character to it's mathematical sans-serif bold equivalent.

math_sans_serif_bold_italic

Transform a character to it's mathematical sans-serif bold italic equivalent.

math_sans_serif_italic

Transform a character to it's mathematical sans-serif italic equivalent.

math_script

Transform a character to it's mathematical script equivalent.