BlueAmulet / picolove

Pico-8 Reimplementation in Love2D
zlib License
101 stars 12 forks source link

Emojis map to the wrong glyphs #27

Open tobiasvl opened 6 years ago

tobiasvl commented 6 years ago

In the PICO-8 editor, you can insert glyphs directly by "writing" uppercase letters. For example, pressing shifth inserts the heart glyph. These glyphs are actually emojis – the heart glyph is represented in the .p8 file as ♥.

Note that you can also insert glyphs in strings with an escape sequence, and that seems to work fine. For example, you can insert the heart glyph with the escape sequence \135, which renders correctly in picolove.

However, when loading a PICO-8 cartridge file that has emojis in it, the emojis will display as the wrong glyph. For example, the heart emoji will be displayed as the \153 glyph, which you normally get with shiftz or ▥.

As far as I can see none of the emojis map to their correct glyph, and some of them map to multiple glyphs, probably because of multi-byte emojis.

Quick and simple test:

picolove glyphs

First column is just the escape sequence, second column is the key that (together with shift) inserts the glyph in the editor, third column is the result of the escape sequence and fourth column is the result of the emoji.

Compare to PICO-8's output:

pico-8 glyphs

x2nie commented 3 years ago

@tobiasvl , can you show the code to test with glyphs above?

tobiasvl commented 3 years ago

@x2nie Had to dig around a bit to find it, but here's the code I used back then:

function _draw()
  cls()
  print("144 q \144…")
  print("150 w \150∧")
  print("132 e \132░")
  print("145 r \145➡️")
  print("147 t \147⧗")
  print("152 y \152▤")
  print("148 u \148⬆️")
  print("136 i \136☉")
  print("142 o \142🅾️ ")
  print("143 p \143◆")
  print("128 a \128█")
  print("146 s \146★")
  print("131 d \131⬇️")
  print("133 f \133✽")
  print("134 g \134●")
  print("135 h \135♥")
  print("137 j \137웃")
  print("138 k \138⌂")
  cursor(64,0)
  print("139 l \139⬅️")
  print("153 z \153▥")
  print("151 x \151❎")
  print("130 c \130🐱")
  print("149 v \149ˇ")
  print("129 b \129▒")
  print("141 n \141♪")
  print("140 m \140😐")
end

ie. nothing fancy.