In my video player app, I’m using playdate.graphics.drawTextInRect() to display the name of the video files (user content). But these can contain underscores, which automatically converts to italics. I know we can escape styling by doubling the style character. And I know we can also use playdate.graphics.font:drawText(), but I miss all the goodness from drawText functions there (truncation, drawInRect, …).
I feel like the SDK should provide a boolean option to the playdate.graphics.drawText to simply disable text styling.
Draws the text using the current font and font advance into the rect defined by (x, y, width, height) (or rect).
If truncationString is provided and the text cannot fit in the rect, truncationString will be appended to the last line.
alignment, if provided, should be one of one of kTextAlignment.left, kTextAlignment.center, kTextAlignment.right. Pass nil for leadingAdjustment and truncationString if those parameters are not required.
width and height indicate the size in pixels of the drawn text. These values may be smaller than the width and height specified when calling the function.
textWasTruncated indicates if the text was truncated to fit within the specified rect.
Oh my, you're right. Sorry for the confusion and my misunderstanding. I totally skipped this parameter to the function and it does exactly what I was looking for. Thank you for your help and your perseverance!