Log In  


Features:

  • Print hangul strings on screen. Outlines and general control characters are supported, but most of the kana(Japanese characters) are disabled.
  • Import drag-dropped txt file(utf-8 only). p8scii special characters can be written in \000 ~ \256 (3 digits decimal) form.
  • Type hangul by keyboard. Keyboard layout is 두벌식(two-set).
    Cart #hangul_machine-0 | 2025-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
    2

Technical details:

  • Hangul characters are stored in 2 characters, which corresponds to 2-byte unicode, big endian. First byte of such code is 0xAC ~ 0xD7, so this blocks the usage of kana.
  • Originally single-consonants or single-vowels correspond to 0x1100 ~ 0x11FF, but storing such value will conflict with regular ASCII. It is replaced to codespace of 0xD800~. 0xD800~0xD812 is single (first) consonant, 0xD820~0xD834 is single vowel.
  • The position of each characters are subtly offset by each other. h_offset table holds the relevant data.
  • Whole cart is 1023 tokens, and if you only count the tokens needed to print hangul, it is around 370 tokens. It is quite bulky but it isn't optimized in tokenomics way, so I assume about 250~300 tokens, and probably 400 bytes in general use memory if the charcter bitmap is moved to there.
2


Interesting post!

I've also customized things in Japanese.

I haven't had much experience with Hangul characters, but perhaps it could be simplified a bit more by using a custom font. (Overwriting Japanese kana characters)


(Please paste this custom font in puny font mode.)

?"\^!5600⁴\t⁶\0\0³\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0⁶²³\0⁷\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0⁷⁷⁷⁷⁷\0\0\0\0⁷⁷⁷\0\0\0\0\0⁷⁵⁷\0\0\0\0\0⁵²⁵\0\0\0\0\0⁵\0⁵\0\0\0\0\0⁵⁵⁵\0\0\0\0⁴⁶⁷⁶⁴\0\0\0¹³⁷³¹\0\0\0⁷¹¹¹\0\0\0\0\0⁴⁴⁴⁷\0\0\0⁵⁷²⁷²\0\0\0\0\0²\0\0\0\0\0\0\0\0¹²\0\0\0\0\0\0³³\0\0\0⁵⁵\0\0\0\0\0\0²⁵²\0\0\0\0\0\0\0\0\0\0\0\0\0²²²\0²\0\0\0⁵⁵\0\0\0\0\0\0⁵⁷⁵⁷⁵\0\0\0⁷³⁶⁷²\0\0\0⁵⁴²¹⁵\0\0\0³³⁶⁵⁷\0\0\0²¹\0\0\0\0\0\0²¹¹¹²\0\0\0²⁴⁴⁴²\0\0\0⁵²⁷²⁵\0\0\0\0²⁷²\0\0\0\0\0\0\0²¹\0\0\0\0\0⁷\0\0\0\0\0\0\0\0\0²\0\0\0⁴²²²¹\0\0\0⁷⁵⁵⁵⁷\0\0\0³²²²⁷\0\0\0⁷⁴⁷¹⁷\0\0\0⁷⁴⁶⁴⁷\0\0\0⁵⁵⁷⁴⁴\0\0\0⁷¹⁷⁴⁷\0\0\0¹¹⁷⁵⁷\0\0\0⁷⁴⁴⁴⁴\0\0\0⁷⁵⁷⁵⁷\0\0\0⁷⁵⁷⁴⁴\0\0\0\0²\0²\0\0\0\0\0²\0²¹\0\0\0⁴²¹²⁴\0\0\0\0⁷\0⁷\0\0\0\0¹²⁴²¹\0\0\0⁷⁴⁶\0²\0\0\0²⁵⁵¹⁶\0\0\0\0⁶⁵⁷⁵\0\0\0\0³³⁵⁷\0\0\0\0⁶¹¹⁶\0\0\0\0³⁵⁵³\0\0\0\0⁷³¹⁶\0\0\0\0⁷³¹¹\0\0\0\0⁶¹⁵⁷\0\0\0\0⁵⁵⁷⁵\0\0\0\0⁷²²⁷\0\0\0\0⁷²²³\0\0\0\0⁵³⁵⁵\0\0\0\0¹¹¹⁶\0\0\0\0⁷⁷⁵⁵\0\0\0\0³⁵⁵⁵\0\0\0\0⁶⁵⁵³\0\0\0\0⁶⁵⁷¹\0\0\0\0²⁵³⁶\0\0\0\0³⁵³⁵\0\0\0\0⁶¹⁴³\0\0\0\0⁷²²²\0\0\0\0⁵⁵⁵⁶\0\0\0\0⁵⁵⁷²\0\0\0\0⁵⁵⁷⁷\0\0\0\0⁵²²⁵\0\0\0\0⁵⁷⁴³\0\0\0\0⁷⁴¹⁷\0\0\0³¹¹¹³\0\0\0¹²²²⁴\0\0\0⁶⁴⁴⁴⁶\0\0\0²⁵\0\0\0\0\0\0\0\0\0\0⁷\0\0\0²⁴\0\0\0\0\0\0⁷⁵⁷⁵⁵\0\0\0⁷⁵³⁵⁷\0\0\0⁶¹¹¹⁶\0\0\0³⁵⁵⁵⁷\0\0\0⁷¹³¹⁷\0\0\0⁷¹³¹¹\0\0\0⁶¹¹⁵⁷\0\0\0⁵⁵⁷⁵⁵\0\0\0⁷²²²⁷\0\0\0⁷²²²³\0\0\0⁵⁵³⁵⁵\0\0\0¹¹¹¹⁷\0\0\0⁷⁷⁵⁵⁵\0\0\0³⁵⁵⁵⁵\0\0\0⁶⁵⁵⁵³\0\0\0⁷⁵⁷¹¹\0\0\0²⁵⁵³⁶\0\0\0⁷⁵³⁵⁵\0\0\0⁶¹⁷⁴³\0\0\0⁷²²²²\0\0\0⁵⁵⁵⁵⁶\0\0\0⁵⁵⁵⁷²\0\0\0⁵⁵⁵⁷⁷\0\0\0⁵⁵²⁵⁵\0\0\0⁵⁵⁷⁴⁷\0\0\0⁷⁴²¹⁷\0\0\0⁶²³²⁶\0\0\0²²²²²\0\0\0³²⁶²³\0\0\0\0⁴⁷¹\0\0\0\0\0²⁵²\0\0\0\0○○○○○\0\0\0𝘶*𝘶*𝘶\0\0\0𝘢○]]>\0\0\0>ccw>\0\0\0■𝘥■𝘥■\0\0\0⁴<、゛▮\0\0\0、.>>、\0\0\0006>>、⁸\0\0\0、6w6、\0\0\0、、>、⁘\0\0\0、>○*:\0\0\0>gcg>\0\0\0○]○𝘢○\0\0\0008⁸⁸ᵉᵉ\0\0\0>ckc>\0\0\0⁸、>、⁸\0\0\0\0\0𝘶\0\0\0\0\0>scs>\0\0\0⁸、○>\"\0\0\0>、⁸、>\0\0\0>wcc>\0\0\0\0⁵𝘳 \0\0\0\0\0■*𝘥\0\0\0\0>kwk>\0\0\0○\0○\0○\0\0\0𝘶𝘶𝘶𝘶𝘶\0\0\0⁷⁴⁴\0\0\0\0\0ᶠ\n\n\0\0\0\0\0¹¹⁷\0\0\0\0\0⁷¹⁷\0\0\0\0\0ᶠ⁵ᶠ\0\0\0\0\0⁷⁶ᵉ\0\0\0\0\0⁷⁵⁷\0\0\0\0\0⁵⁷⁷\0\0\0\0\0ᵇᶠᶠ\0\0\0\0\0²⁵⁴\0\0\0\0\0⁶ᵉ\r\0\0\0\0\0³⁵⁶\0\0\0\0\0⁷²⁵\0\0\0\0\0ᶠ⁶ᵇ\0\0\0\0\0²⁷\n\0\0\0\0\0⁷⁶⁴\0\0\0\0\0⁷³⁷\0\0\0\0\0⁷²⁷\0\0\0\0\0⁶⁷⁶\0\0\0\0\0▮0▮▮\0\0\0\0𝘱p𝘱𝘱\0\0\0\0000▮0▮\0\0\0\0p𝘱p𝘱\0\0\0\0▮「▮▮\0\0\0\0⁷⁵⁷⁵⁷\0\0\0007%5%⁷\0\0\0p`p`@\0\0\0\0\0\0⁴゜\0\0\0▮0▮□゜\0\0\0𝘱p𝘱𝘳_\0\0\0▮▮▮□゜\0\0\0\0\0\0⁵゜\0\0\0\0\0\0゜⁴\0\0\0   /4\0\0\0𝘱𝘱𝘱𝘸𝘻\0\0\0▮▮▮゜⁘\0\0\0\0\0\0゜⁘\0\0\0\0\0\0゜\0\0\0\0▮▮▮゜▮\0\0\0▮▮▮▮\0\0\0\0\0\0\0\0\0\0\0\0゛▮▮\0\0\0\0\0゛⁘⁘\0\0\0\0\0ᵉᶜ⁘\0\0\0\0\0²²゛\0\0\0\0\0¥\n◀\0\0\0\0\0\n¥゛\0\0\0\0\0゛²゛\0\0\0\0\0ᵉᶜ、\0\0\0\0\0¥◀⁘\0\0\0\0\0¥◀、\0\0\0\0\0◀゛、\0\0\0\0\0\n◀⁘\0\0\0\0\0、ᵉ¥\0\0\0\0\0、゛¥\0\0\0\0\0、◀\n\0\0\0\0\0゛□゛\0\0\0\0\0□゛゛\0\0\0\0\0\nᵉ◀\0\0\0\0\0⁴\n□\0\0\0\0\0ᵉ゛¥\0\0\0\0\0、□ᵉ\0\0\0\0\0゛ᶜ□\0\0\0\0\0⁴ᵉ⁘\0\0\0\0\0゛、▮\0\0\0\0\0゛ᵉ゛\0\0\0\0\0゛ᶜ゛\0\0\0\0\0ᶜ゛ᶜ\0\0\0\0\0、\0>⁸⁴\0\0\0⁴⁴、$⁴\0\0\0⁸>⁸⁸⁴\0\0\0\0、\0\0>\0\0\0> (▮,\0\0\0⁸>0^⁸\0\0\0   ▮ᵉ\0\0\0▮$$𝘥𝘣\0\0\0²゛²²、\0\0\0>  ▮ᶜ\0\0\0ᶜ□!@\0\0\0\0⁸>⁸**\0\0\0> ⁘⁸▮\0\0\0<\0>\0゛\0\0\0⁸⁴$𝘣~\0\0\0@(▮h⁶\0\0\0゛⁴゛⁴<\0\0\0⁴>$⁴⁴\0\0\0、▮▮▮>\0\0\0゛▮゛▮゛\0\0\0>\0> 「\0\0\0$$$ ▮\0\0\0⁘⁘⁘𝘵2\0\0\0²²\"□ᵉ\0\0\0>\"\"\">\0\0\0>\" ▮ᶜ\0\0\0> < 「\0\0\0⁶  ▮ᵉ\0\0\0\0‖▮⁸⁶\0\0\0\0⁴゛⁘⁴\0\0\0\0\0ᶜ⁸゛\0\0\0\0、「▮、\0\0\0⁸⁴c▮⁸\0\0\0⁸▮c⁴⁸\0\0\0"
poke(0x5f58,0x81)

Code source
https://www.lexaloffle.com/bbs/?pid=134967#p



[Please log in to post a comment]