# SDL\_TFF UTF8 codepoint checking

**URL:** <https://discourse.libsdl.org/t/sdl-tff-utf8-codepoint-checking/26751>\
**Category:** SDL Development\
**Created:** [October 22, 2019, 2:00am UTC](https://discourse.libsdl.org/t/sdl-tff-utf8-codepoint-checking/26751 "2019-10-22T02:00:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SnapperTT](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@SnapperTT](https://discourse.libsdl.org/u/SnapperTT)\
**Post date:** [October 22, 2019, 2:00am UTC](https://discourse.libsdl.org/t/sdl-tff-utf8-codepoint-checking/26751/1 "2019-10-22T02:00:15Z")

</div>

In SDL\_ttf.c:

```
int TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch)
{
    return FT_Get_Char_Index(font->face, ch);
}

```

The half of a Uint32 codepoint is being sliced off by converting to Uint16.

Can we have a “TTF\_GlyphIsProvided32(const TTF\_Font \*font, Uint32 codepoint)” added to SDL\_TFF? This will be very useful for determining if a font has a character and switching to another font if its missing.

Cheers,  
SnapperTT

---

<div class="post-metadata">

**Author:** ![Sylvain\_Becker](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@Sylvain\_Becker](https://discourse.libsdl.org/u/Sylvain_Becker)\
**Post date:** [October 22, 2019, 5:34am UTC](https://discourse.libsdl.org/t/sdl-tff-utf8-codepoint-checking/26751/2 "2019-10-22T05:34:04Z")

</div>

It was added recently, but your need the latest source version

> **[SDL\_ttf: changeset 408:ae83a705f5ab](https://hg.libsdl.org/SDL_ttf/rev/ae83a705f5ab)**
>
> Added additional emoji support in SDL\_ttf, contributed by Arthur Danskin

---

<div class="post-metadata">

**Author:** ![SnapperTT](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@SnapperTT](https://discourse.libsdl.org/u/SnapperTT)\
**Post date:** [October 22, 2019, 6:07am UTC](https://discourse.libsdl.org/t/sdl-tff-utf8-codepoint-checking/26751/3 "2019-10-22T06:07:49Z")

</div>

Excellent, cheers mate!
