How "fancy fonts" actually work: Unicode tricks behind copy-paste text generators.
You've seen it on Instagram bios: ππ¨π₯π, πΈππππΎπβ―, π€π¬π±π₯π¦π . Instagram has no font menu, so how do people do it? The short answer: these aren't fonts at all. They're different Unicode characters that happen to look like sty
You've seen it on Instagram bios: ππ¨π₯π, πΈππππΎπβ―, π€π¬π±π₯π¦π . Instagram has no font menu, so how do people do it?
The short answer: these aren't fonts at all. They're different Unicode characters that happen to look like styled letters.
The Mathematical Alphanumeric Symbols block
Unicode has a block called Mathematical Alphanumeric Symbols (U+1D400 to U+1D7FF). It exists for mathematicians who need a bold A to mean something different from a normal A. The block includes full AβZ / aβz sets in bold, italic, bold italic, script, fraktur, double-struck, sans-serif, monospace and more.
Because each styled letter is its own character, it keeps its look when you paste it anywhere that accepts text.
Converting text with an offset
Bold capital A is U+1D400, and bold capitals run in order. So converting is just an offset:
function toBold(text) {
return [...text].map(ch => {
const c = ch.codePointAt(0);
if (c >= 65 && c <= 90) return String.fromCodePoint(0x1D400 + (c - 65)); // A-Z
if (c >= 97 && c <= 122) return String.fromCodePoint(0x1D41A + (c - 97)); // a-z
return ch; // leave everything else alone
}).join('');
}
toBold('Hello'); // πππ₯π₯π¨
Note the [...text] and codePointAt. These characters sit outside the Basic Multilingual Plane, so each one is two UTF-16 code units. Using text.length or split('') will break them.
The gotcha: holes in the alphabet
Script (cursive) looks like it should work the same way, starting at U+1D49C. But some letters are missing from the block, because they already existed earlier in Unicode's Letterlike Symbols block:
| Letter | Character | Code point |
|---|---|---|
| B | β¬ | U+212C |
| E | β° | U+2130 |
| H | β | U+210B |
| e | β― | U+212F |
| o | β΄ | U+2134 |
(and a few more: F, I, L, M, R, g). If you only use the offset, those positions are unassigned and render as empty boxes. A real generator needs an exceptions map:
const SCRIPT_EXCEPTIONS = { B:'β¬', E:'β°', F:'β±', H:'β', I:'β', L:'β', M:'β³', R:'β', e:'β―', g:'β', o:'β΄' };
Things worth knowing before you use them
- Only AβZ, aβz and 0β9 have styled versions. Accented letters (Γ©, Γ£), Hindi, Arabic and emoji stay as they are.
- Character counters disagree. A bio that looks like 23 characters can be 40 UTF-16 code units in bold, which is why some apps say "too long".
- Accessibility: screen readers may read these as "mathematical bold capital Hβ¦" or skip them. Use them for a name or one line, not whole paragraphs.
- Search: platforms usually don't match ππ§π to "Ana", so keep your real name somewhere in plain text.
Try it
I built a free tool that does all of this, with 120+ styles and the exceptions handled: FilesSnap Font Generator. It runs entirely in the browser and nothing is uploaded.
If you're building your own, start with the offset trick above, then add the exceptions map. That covers most of what you need.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.