Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Can't load codepoints needed for Unicode text rendering

Aperta
#427 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start by reviewing the raylib-cpp Font usage shown in the issue and the raylib GetCodepoints() API it references. Determine how Unicode text and codepoints should be exposed through the wrapper, then verify that the recommended approach works for the reported rendering case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

As far as I've looked, if you want to use text with foreign characters you need to specify codepoints --the conversion codes from UTF-x to real Unicode-- in the Font object. The examples I've looked include iterating for a specific range of characters to match the language you want (for C Raylib).

// Source - https://stackoverflow.com/q/73248125
// Posted by Dmitriy, modified by community. See post 'Timeline' for change history
// Retrieved 2026-09-18, License - CC BY-SA 4.0

int codepoints[512] = { 0 };
for (int i = 0; i < 95; i++) codepoints[i] = 32 + i;
for (int i = 0; i < 255; i++) codepoints[96 + i] = 0x400 + i;
Font font = LoadFontEx("arial.ttf", 32, codepoints, 512);

I've tried something similar in a project:

 // codepoints
  std::vector<int> codepoints;
  // Load codepoints from a Unicode subset (Basic Latin)
  for (int cp = 0x20; cp <= 0x7E; ++cp)
    codepoints.push_back(cp);

  raylib::Font font{"src/Milonga-Regular.ttf", 30, codepoints.data(),
                    static_cast<int>(codepoints.size())};

  raylib::Text text{text_str, 30, WHITE, font};

  (...)
  while (!w.ShouldClose()) // Detect window close button or ESC key
  {
    // Update
    // TODO: Update your variables here
	(...)

    // Draw
    BeginDrawing();
    ClearBackground(GetColor(gunmetalGray));

	(...)
    text.Draw(Vector2{20, 20});

    EndDrawing();
  }

...but it doesn't work.

Image

Another solution in Raylib is using GetCodepoints() for a string, but there's no bindings for that.
There's a recommended approach for raylib-cpp or...?

Lingua principale
C++
Stelle
960
Fork
120
Merge medio
10m
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RobLoach/raylib-cpp

Tutte le issue di RobLoach/raylib-cpp

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.