Skip to content

How to show CJK chars or fonts in raylib #2562

Answered by raysan5
wlxmhls asked this question in Q&A
Discussion options

You must be logged in to vote

Here a more complete version. Not tested but it should work:

#include "raylib.h"

#include <stdlib.h>         // Required for: calloc(), realloc(), free()
#include <string.h>         // Required for: memcpy()

// Text to be displayed, must be UTF-8 (save this code file as UTF-8)
// NOTE: It can contain all the text to be rendered in the game to be scanned to
// get all the required codepoints
static char *text = "世界,你好!";

// Remove codepoint duplicates if requested
static int *CodepointRemoveDuplicates(int *codepoints, int codepointCount, int *codepointResultCount);


//------------------------------------------------------------------------------------
// Program main entry point
//----…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@raysan5
Comment options

Comment options

You must be logged in to vote
3 replies
@wlxmhls
Comment options

@enjoecn
Comment options

@enjoecn
Comment options

Answer selected by wlxmhls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants