# How "Fancy Text" Really Works: Unicode Cursive and Gothic Generators Explained

You've seen it in Instagram bios, Discord names and game tags: 𝓬𝓾𝓻𝓼𝓲𝓿𝓮, 𝔤𝔬𝔱𝔥𝔦𝔠, 𝟙𝟚𝟛. It looks like a custom font, but no font is involved. It is plain Unicode text, and you can build your own converter in about 15 lines of code.

### It's not a font, it's a character block

Unicode contains a block called **Mathematical Alphanumeric Symbols** (U+1D400 to U+1D7FF). It was added for math notation, and it includes complete alphabets in bold, italic, script, Fraktur (the "gothic" look) and double-struck styles.

Because they are real characters, they survive copy and paste into any app that supports Unicode. That's why a **unicode font generator** can work inside a text field where you can't pick a font. Tools like [Cursive Generator](https://cursivegenerator.info/) are built on exactly this idea.

Here are some useful starting points:

| Style | Uppercase "A" | Lowercase "a" |
| --- | --- | --- |
| Bold Script (cursive look) | U+1D4D0 | U+1D4EA |
| Bold Fraktur (gothic look) | U+1D56C | U+1D586 |
| Double-struck | U+1D538 | U+1D552 |

Digits work the same way. Double-struck zero starts at U+1D7D8, which is how a **number font generator** produces 𝟘𝟙𝟚𝟛.

### A minimal converter in JavaScript

The idea is to take the letter's offset from "A" or "a" and add it to the style's starting code point.

javascript

```javascript
const STYLES = {
  boldScript:  { upper: 0x1D4D0, lower: 0x1D4EA },
  boldFraktur: { upper: 0x1D56C, lower: 0x1D586 },
};

function toStyle(text, style) {
  const { upper, lower } = STYLES[style];
  return Array.from(text, (ch) => {
    const c = ch.codePointAt(0);
    if (c >= 65 && c <= 90)  return String.fromCodePoint(upper + (c - 65));
    if (c >= 97 && c <= 122) return String.fromCodePoint(lower + (c - 97));
    return ch; // leave everything else untouched
  }).join("");
}

console.log(toStyle("Hello World", "boldScript"));
console.log(toStyle("Hello World", "boldFraktur"));
```

Note `Array.from` and `codePointAt`. These characters sit outside the Basic Multilingual Plane, so in JavaScript each one is a **surrogate pair** (two UTF-16 code units). A naive `text.split("")` or `charCodeAt` will break them.

### The same thing in Python

python

```python
STYLES = {
    "bold_script":  (0x1D4D0, 0x1D4EA),
    "bold_fraktur": (0x1D56C, 0x1D586),
}

def to_style(text, style):
    upper, lower = STYLES[style]
    out = []
    for ch in text:
        if "A" <= ch <= "Z":
            out.append(chr(upper + ord(ch) - ord("A")))
        elif "a" <= ch <= "z":
            out.append(chr(lower + ord(ch) - ord("a")))
        else:
            out.append(ch)
    return "".join(out)

print(to_style("Hello World", "bold_script"))
```

Python 3 strings are code-point based, so this is simpler than the JS version.

### The gotcha: holes in some alphabets

Not every style is complete inside the math block. Plain (non-bold) **Script** and **Fraktur** have "holes": some letters were already encoded earlier in the *Letterlike Symbols* block (U+2100 range), so the math block leaves those slots reserved.

For Fraktur, for example, these capitals must be remapped:

python

```python
FRAKTUR_HOLES = {"C": "\u212D", "H": "\u210C", "I": "\u2111",
                 "R": "\u211C", "Z": "\u2128"}
```

If you skip this step, you get blank or broken glyphs for those letters. Bold Script and Bold Fraktur have no holes, which is why the examples above use them.

### Why you shouldn't use it everywhere

Treat styled Unicode as decoration, not content:

- **Accessibility:** Screen readers may spell out the characters by their Unicode names ("mathematical bold script capital H") or skip them. Never put important information in styled text.
- **Search and indexing:** Styled text doesn't match a normal search for the same word. Keep the real text available somewhere.
- **Fallback fonts:** A device without glyph coverage shows empty boxes (tofu). Always test on Android and older systems.
- **Normalization:** Applying `NFKC` normalization maps these characters back to plain ASCII letters. Many moderation and search systems do exactly this, so don't rely on styled text to bypass filters.

javascript

```javascript
"𝓗𝓮𝓵𝓵𝓸".normalize("NFKC"); // "Hello"
```

That last behavior is useful. If you accept user input, normalizing before validation or search keeps your logic consistent.

### Taking it further

- Add a style picker (script, Fraktur, double-struck, monospace) and render all outputs live.
- Add a copy-to-clipboard button with `navigator.clipboard.writeText()`.
- Build the **gothic font generator** and **cursive generator** modes from the same mapping table.
- Handle the Fraktur and Script holes with a lookup map, as shown above.

If you just want to try the result without coding, there's a free live demo at [cursivegenerator.info](http://cursivegenerator.info) where you can compare the styles side by side.

### Wrap-up

"Fancy fonts" are just a clever use of a Unicode block designed for mathematics. Once you see the offset pattern, building a converter is a quick weekend project, and you also learn useful lessons about code points, surrogate pairs and normalization.

#javascript #unicode #webdev #python
