Double asterisk / double underscore not converting in drawTextInRect when setting font twice

Here's a real bug that came from this fake bug I just filed and then immediately closed :clown_face: (Additional text glyphs added to a drawTextInRect string)

drawTextInRect() doesn't seem to be properly converting double ** __ as it should if you set the font on it after having already set it.

This might be vaguely related to this (Font parameter is ignored for playdate.graphics.drawTextInRect(text, rect, [leadingAdjustment, [truncationString, [alignment, [font]]]]))

Although I wasn't using a Rect at all, so it's something separate. Here's some code to repro it:

import 'CoreLibs/graphics'
local gfx <const> = playdate.graphics

fontSystem = gfx.getSystemFont()
text = "Two Underscores: __ Two Asterisks: **"

gfx.setFont(fontSystem)
gfx.drawText(text, 50, 25)
gfx.drawTextInRect(text, 50, 75, 300, 20, nil, "...", kTextAlignment.left, fontSystem)
-- ^ setting fontSystem a second time here causes this

function playdate.update() end

asterisk-underscore

Thanks,

Interesting. About the vague relation to the one I found: the bottom line might be that it would be wise to carefully review all parameter handling in this function