I would to convert text to unicode bold format.
I found
How can I convert text to BOLD CAPITAL with unicode?
Thanks
Here is a quick code snippet which does what you are asking for:
let text = "This is a text: ABC";
function translate (char)
{
let diff;
if (/[A-Z]/.test (char))
{
diff = "𝗔".codePointAt (0) - "A".codePointAt (0);
}
else
{
diff = "𝗮".codePointAt (0) - "a".codePointAt (0);
}
return String.fromCodePoint (char.codePointAt (0) + diff);
}
let newText = text.replace (/[A-Za-z]/g, translate);
console.log (text);
console.log (newText); // -> "𝗧𝗵𝗶𝘀 𝗶𝘀 𝗮 𝘁𝗲𝘅𝘁: 𝗔𝗕𝗖"
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With