Skip to content

Commit 22486b6

Browse files
committed
Reorder and drop numbers. Not in ranked order
1 parent 42f61c2 commit 22486b6

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

docs/discord-social-sdk/how-to/handle-special-characters-display-names.mdx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@ The Social SDK [recommends](https://discord.com/developers/docs/discord-social-s
1010

1111
There are several options to address this:
1212

13-
## 1. Map the Unicode characters to ASCII
13+
## Use a font family that supports Unicode
14+
15+
A family such as [Noto](https://notofonts.github.io/) aims to have broad Unicode support. If a font cannot render a Display Name, consider rendering it with a fallback font, or in the extreme case, choose a font with broad Unicode support for the Friends List.
16+
17+
**Tradeoffs:**
18+
19+
- One font family may not include 100% overlap with what Discord supports.
20+
- A font that supports Unicode may not mesh with your game's aesthetics.
21+
- Engine support is limited, especially for characters that rely on UTF surrogate pairs.
22+
23+
## Map the Unicode characters to ASCII
1424

1525
A library such as [Unidecode](https://metacpan.org/pod/Text::Unidecode) (which has been ported to many different languages) can map many Unicode characters to an ASCII equivalent. If you detect that a Display Name has characters that cannot be rendered, consider passing it through a library to transliterate the Display Name to ASCII.
1626

@@ -21,17 +31,8 @@ A library such as [Unidecode](https://metacpan.org/pod/Text::Unidecode) (which h
2131
- Similarly, most libraries assume English is the target language.
2232
- Users may not appreciate their display names being changed without their knowledge or consent.
2333

24-
## 2. Use a font family that supports Unicode
25-
26-
A family such as [Noto](https://notofonts.github.io/) aims to have broad Unicode support. If a font cannot render a Display Name, consider rendering it with a fallback font, or in the extreme case, choose a font with broad Unicode support for the Friends List.
27-
28-
**Tradeoffs:**
29-
30-
- One font family may not include 100% overlap with what Discord supports.
31-
- A font that supports Unicode may not mesh with your game's aesthetics.
32-
- Engine support is limited, especially for characters that rely on UTF surrogate pairs.
3334

34-
## 3. Use the Discord Username as a Fallback
35+
## Use the Discord Username as a Fallback
3536

3637
If a Display Name is not renderable at all, consider falling back to the user's [`Username`](https://discord.com/developers/docs/slayer-sdk/classdiscordpp_1_1UserHandle.html#a0eda41fe18b50bce373fb5a1b88cb411).
3738

0 commit comments

Comments
 (0)