Just want to print Extended ASCII characters ( CP437 ) on wxDC but I couldn't manage how to do it.
I just use wxDC::DrawText for converting string to image on wxDC.
I use "Monospace" font ("DejaVu Sans Mono" "Book" at my system).
I believe this font has required symbols in it since I could see those at my terminal while Monospace font is selected:
Code: Select all
death@triQuad:~>env printf '\u2501'
━death@triQuad:~>env printf '\u2503'
┃death@triQuad:~>env printf '\u2501'
━death@triQuad:~>env printf '\u2511'
┑death@triQuad:~>env printf '\u2519'
┙death@triQuad:~>
Code: Select all
wxString line;
for( int i=0; i<100; i++)
line +=buffer[i];//binary buffer
stdfont = wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, 0, wxT("Monospace"), wxFONTENCODING_CP437);
mydc->SetFont( stdfont );
mydc->DrawText( line, mx, my );
Also I see this error message on stdout when I put non printable character into wxDC::DrawText call.
Code: Select all
Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()
I add code like:
Code: Select all
line=wxString(buffer, wxCSConv(wxFONTENCODING_CP437), 100);
Could you help me on this?