Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Can't load codepoints needed for Unicode text rendering

Abierto
#427 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
cpp

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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...?

Lenguaje dominante
C++
Estrellas
960
Forks
120
Merge medio
10 min
PR fusionados (30 d)
1

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RobLoach/raylib-cpp

Todos los issues de RobLoach/raylib-cpp

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.