[solved] ofTrueTypeFont::drawString() does not render the £ sign

I’m in the UK with a UK keyboard and am having a problem displaying £ signs from a std::string variable which is populated from keyPressed(int key)
I’m using of_v0.10.1_vs2017_release with Windows 10 and VS2019

A £ sign is a shifted 3 generating 0xa3 which is a £ sign in most common fonts.
Using the Windows Arial truetype font this code does not display the £ sign
font.drawString(“This is a £ sign” , x, y)
The £ sign shows up OK in the string in the VS debugger

I found ofTrueTypeFont and full character set - #21 by Julian_Puppo which helps a little
So this code does display the £ sign
font.drawString(u8"This is a £ sign" , x, y)

That’s OK for literals but I have std:string variable.
How can I inform the font that it is a u8 string

I found ofUTF8Append(0 and ofUTF8Insert() which worked ok.

1 Like