Recent

Author Topic: RayLib 5.0  (Read 10867 times)

Guva

  • Full Member
  • ***
  • Posts: 127
  • 🌈 ZX-Spectrum !!!
Re: RayLib 5.0
« Reply #15 on: December 26, 2024, 02:54:26 pm »
DrawText('FONT SIZE字体: 30.0', GetScreenWidth() - 240, 20, 20, DARKGRAY);   
How can this engine support displaying Chinese and unicode when drawing text?
https://github.com/raysan5/raylib/blob/master/examples/text/text_unicode.c

fireboxsoft

  • New Member
  • *
  • Posts: 11
Re: RayLib 5.0
« Reply #16 on: December 27, 2024, 01:17:31 am »
Thank you for your reply and guidance. I don't know C language, only pascal, but I would like to try using lazarus+Raylib to develop games. I will try to see if I can successfully support unicode. But we still hope that the author of the engine will officially release a demo and example, so that we will avoid detours. Looking forward to it, thank you!
« Last Edit: December 27, 2024, 01:23:34 am by fireboxsoft »

Seenkao

  • Hero Member
  • *****
  • Posts: 652
    • New ZenGL.
Re: RayLib 5.0
« Reply #17 on: December 27, 2024, 07:55:16 am »
fireboxsoft,
{$codepage utf-8}
???
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Guva

  • Full Member
  • ***
  • Posts: 127
  • 🌈 ZX-Spectrum !!!
Re: RayLib 5.0
« Reply #18 on: December 27, 2024, 03:38:36 pm »
fireboxsoft,
{$codepage utf-8}
???

ru: Серж к сожалению в raylib так не работает для отображения юникода есть свои функции и процедуры.

en: Serge unfortunately raylib does not work like that for displaying Unicode has its own functions and procedures.


Code: Pascal  [Select][+][-]
  1. {Draw one character (codepoint)}
  2. procedure DrawTextCodepoint(font: TFont; codepoint: Integer; position: TVector2; fontSize: Single; tint: TColorB);
  3. {Draw multiple character (codepoint)}
  4. procedure DrawTextCodepoints(font: TFont; const codepoints: PInteger; codepointCount: Integer; position: TVector2; fontSize, spacing: Single; tint: TColorB);
  5.  
  6. {Load UTF-8 text encoded from codepoints array}
  7. function LoadUTF8(const codepoints: PInteger; length: Integer): PChar;
  8. {Unload UTF-8 text encoded from codepoints array}
  9. procedure UnloadUTF8(text: PChar);
  10. {Load all codepoints from a UTF-8 text string, codepoints count returned by parameter}
  11. function LoadCodepoints(const text: PChar; count: PInteger): PInteger;
  12. {Unload codepoints data from memory}
  13. procedure UnloadCodepoints(codepoints: PInteger);
  14. {Get total number of codepoints in a UTF-8 encoded string}
  15. function GetCodepointCount(const text: PChar): Integer;
  16. {Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure}
  17. function GetCodepoint(const text: PChar; codepointSize: PInteger): Integer;
  18. {Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure}
  19. function GetCodepointNext(const text: PChar; codepointSize: PInteger): Integer;
  20. {Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure}
  21. function GetCodepointPrevious(const text: PChar; codepointSize: PInteger): Integer;
  22. {Encode one codepoint into UTF-8 byte array (array length returned as parameter)}
  23. function CodepointToUTF8(codepoint: Integer; utf8Size: PInteger): PChar;
  24.  
     

fireboxsoft

  • New Member
  • *
  • Posts: 11
Re: RayLib 5.0
« Reply #19 on: December 28, 2024, 02:24:13 am »
thank you very much! :)

 

TinyPortal © 2005-2018