Korean font glyphs crash the simulator and/or won't image

Windows, SDK 3.0.2

I’ve created a Playdate font from Google's Noto Sans Korean, specifically the static font NotoSansKR-SemiBold.ttf, using the PDFont tool.

When using the Playdate font the English glyphs image ok, but any attempt to use Korean glyphs either images nothing or crashes the Simulator.

I don’t know if this is a bug in the NotoSans font, the PDFont tool, or the SDK fontstuff.

(all resources to reproduce this issue are in the attached zipfile, including the original NotoSans font and the PDFont tool)

Steps to reproduce:

  1. Build the Playdate font:

  1. Set up a test project:

  1. Write some Lua code:

local gfx = playdate.graphics

local firstPass = true
local secondPass = false
local thirdPass = false

theFont = gfx.font.new("fonts/NSKRSemiBold16")
gfx.setFont(theFont)

gfx.setColor(gfx.kColorWhite)
gfx.setImageDrawMode(gfx.kDrawModeCopy)

firstText = "This is a test to see if\nKorean fonts work on Playdate.\nSo far so good. Tap A to continue..."

secondText = "Tap A again to try Korean glyphs,\nthis may crash the simulator."

thirdText = "The 한국어 글리프\nwon't be imaged and may\ncrash the simulator."
--^ "The Korean glyphs\nwon't be imaged and may\ncrash the simulator."

function playdate.AButtonUp()
if secondPass == true then thirdPass = true end
if firstPass == true then secondPass = true end
end

function playdate.update()
gfx.fillRect(0, 0, 400, 240)
if firstPass == true then gfx.drawText(firstText, 5, 10) end
if secondPass == true then gfx.drawText(secondText, 5, 90) end
if thirdPass == true then gfx.drawText(thirdText, 5, 145) end
playdate.drawFPS(0,0)
end

  1. Build and run the .pdx

  1. Tap tap crash:

Test project with .pdx and resources to reproduce here:

KoreanFontTest.zip (5.4 MB)

5 Likes

I can’t find error from your code but I refer below for generating korean fonts.

And here is the demo.

Here is the korean font I generated.

korean_font.zip (1.1 MB)

1 Like

This is amazing! Thank you :slight_smile: !

Can I ask why do you need korean glyph, btw?
I just got playdate and want to develop korean games but there isn’t much information.

I’m looking into adding Hangul (한글) support for Under The Tree 2 :slightly_smiling_face:

1 Like

I’m really looking forward to your new game! If you ever need any help, including Korean translation, feel free to reach out.

1 Like

Thank you very much for the offer!

I’m likely several months away from finishing the text and dialog, but when I do I’ll drop you a note.

Thanks again,

– Tengu

1 Like

Are you able to image the glyphs ‘한국어‘ with your fonts? I’m unable to (this is what I get with Mulmaru-12px):

I looked at the .fnt file for Mulmaru-12px and the hangul glyphs are actually all in there… here’s my test code:

local gfx = playdate.graphics

local firstPass = true
local secondPass = false
local thirdPass = false

theFont = gfx.font.new("fonts/Mulmaru-12px")
gfx.setFont(theFont)
gfx.setColor(gfx.kColorWhite)
gfx.setImageDrawMode(gfx.kDrawModeCopy)

firstText = "This is a test to see if\nKorean fonts work on Playdate.\nSo far so good. Tap A to continue..."
secondText = "Tap A again to try Korean glyphs,\nthis may crash the simulator."
thirdText = "The 한국어 글리프\nwon't be imaged and may\ncrash the simulator."
--^ "The Korean glyphs\nwon't be imaged and may\ncrash the simulator."

function playdate.AButtonUp()
if secondPass == true then thirdPass = true end
if firstPass == true then secondPass = true end
end

function playdate.update()
gfx.fillRect(0, 0, 400, 240)
if firstPass == true then gfx.drawText(firstText, 5, 10) end
if secondPass == true then gfx.drawText(secondText, 5, 90) end
if thirdPass == true then gfx.drawText(thirdText, 5, 145) end
--playdate.drawFPS(0,0)
end

Can you provide the code for your working Korean font test?

Thanks,

– Tengu

I just can’t get these fonts to work… but they’ll load into Tophat and display fine:

And Caps displays them also:

Ok, I exported the font from Caps and those glyphs won’t display:

I’m going to put together a test case and submit a new bug report. It’s new because there’s no crash involved, the Windows SDK (at least on Simulator) isn’t working properly with a font exported from Panic’s own font utility.

Ok, I’ve boiled this down to the absolute bare-bones, posted it here to keep things simple.

Fingers crossed :slight_smile:

Still unable to use the fonts… there may be an issue with the character codes not being in a supported range.

Can you share the Lua code you used to get them to display in your example? :slight_smile:

Thanks! :slight_smile:

pd-korean-testing.zip (3.9 MB)

@Tengu Here are the lua codes & korean converting script I used.

1 Like

Thank you!

I’ll take a look :slight_smile:

After a quick look:

The test/demo you just posted and the fonts in its ‘pd-korean-testing\playdate_test\source\font‘ directory do work.

The zipped up files you provided earlier (posted here) do not work:

I’ve run a difference (Diffchecker) between the .fnt files for Mulmaru-12pt, the left hand side being the one that doesn’t work (from ‘korean_font.zip’, your posted zip), and the right hand side (from the demo you just sent). They’re significantly different (zipped PDF):

Mulmaru-12px_diff_working_is_on_right.zip (2.5 MB)

Do you remember the difference in generating procedure between the fonts that work and the ones that don’t?

Thanks :slight_smile:

Edit: regardless, now I have a set of free-to-use Korean fonts that work on Playdate! Thank you very much! The other thread I started reporting a bug I believe is still relevant, Playdate Caps can produce asian fonts that do not render (so I believe there is still a bug in either pdc, the Playdate runtime, or both).