aviks / GameZero.jl

Zero overhead game development library for the Julia programming language
Other
184 stars 23 forks source link

Unicode Chinese Characters (ttf) are not being shown #66

Closed Shum88 closed 1 year ago

Shum88 commented 1 year ago
if gameover == false
    display = "分數(Score) = $score"
else
    display = "GAME OVER! Final Score = $score"
    #play again instructions
    replay = TextActor("Click to play Again,  點擊...再玩", sDspFont; font_size = 26, color = Int[0, 0, 0, 255])
    replay.pos = (135, 390)
    draw(replay)
end

above Chinese Character are not being shown title_01

Shum88 commented 1 year ago

sDspFont::String = "wt009"

aviks commented 1 year ago

Some research suggests that the solution here is to use TTF_RenderUTF8_Blended rather than TTF_RenderText_Blended as we do currently in TextActor

Shum88 commented 1 year ago
#sf = SDL2.TTF_RenderText_Blended(font, text, SDL2.Color(color...))
sf = SDL2.TTF_RenderUTF8_Blended(font, text, SDL2.Color(color...))

After modified the actor.jl:TextSctor() function as above ... Chinese Characters can be shown correctly SnakeZero_01 SnakeZero_02

Shum88 commented 1 year ago

Hi Aviks,

Following your suggestion ... Chinese Characters can be shown correctly

Thanks again !

Shum


寄件者: Avik Sengupta @.> 寄件日期: 2023年3月25日 3:10 收件者: aviks/GameZero.jl @.> 副本: Shum @.>; Author @.> 主旨: Re: [aviks/GameZero.jl] Unicode Chinese Characters (ttf) are not being shown (Issue #66)

Some research suggests that the solution here is to use TTF_RenderUTF8_Blended rather than TTF_RenderText_Blended as we do currently in TextActor

— Reply to this email directly, view it on GitHubhttps://github.com/aviks/GameZero.jl/issues/66#issuecomment-1483288157, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA5SN7JLM4D6WLCW4MSJCADW5XWRLANCNFSM6AAAAAAWG5MVR4. You are receiving this because you authored the thread.Message ID: @.***>

aviks commented 1 year ago

Thank you for confirming. We do need to fix this in this project as well.