Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Draw::WrawText to paint ASCII sequence
Draw::WrawText to paint ASCII sequence [message #25779] Thu, 11 March 2010 15:09 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I have rather exotic task of painting ASCII sequence within control.
Imagine, you have a String with a sequence of bytes: D1 91. And you paint your string with DrawText. You don't get two symbols painted, instead you have only one, because this combination of bytes is actually a UTF-8 symbol. What is needed here is painting two simbols: ASCII(D1) and ASCII(91).

My question is how to paint it that way?
Re: Draw::WrawText to paint ASCII sequence [message #25782 is a reply to message #25779] Thu, 11 March 2010 15:26 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Senior Contributor
AFAIK, painting ASCII characters is not very easy under Windows. You need a font that supports these characters. Wingdings does this, but with strange characters, not he ones you want. Bytes over 128 are extended ASCII and do not map to Unicode the same as in e.g. DOS and are used for the legacy code pages under modern windows if you application is not Unicode. If your setting is some European language, D1 91 will probably be something significant for you language in such application.

But in U++ it will Unicode. But most Extended Original characters are found in Unicode.

Try box drawing and block elements.

PS: If you send me more precise info about what you want your glyphs to look like, I can give you the codes. 91 is private use non glyph, D1 is in Unicode.

[Updated on: Thu, 11 March 2010 15:29]

Report message to a moderator

Re: Draw::WrawText to paint ASCII sequence [message #25783 is a reply to message #25782] Thu, 11 March 2010 15:37 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Thank you for quick response.
In my case there is no need to paint EXACT characters as they look in ASCII. Instead I just want to draw ANY suitable characters. What is really needed is painting 1 character per 1 byte of String (different characters for different bytes) instead of painting 1 character from a sequence of bytes. That is the primary task now.

Also I'm unable to use Windows fonts because I want to keep application cross-platform.

[Updated on: Thu, 11 March 2010 15:38]

Report message to a moderator

Re: Draw::WrawText to paint ASCII sequence [message #25784 is a reply to message #25783] Thu, 11 March 2010 15:50 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1400
Registered: September 2007
Senior Contributor
Just a quick note:

First there was ASCII with 128 characters and standardized.

Later came extended ASCII, with 256 and unstandardized. Under DOS it was alphanumeric characters and a lot of blocks.

Then came windows code-pages, where there values 128-255 where in a given code-page, and generally alphanumeric covering a family of scripts.

Then came Unicode. Now, with Unicode and DrawText, you can't draw 0x91. You can draw it with a WString variant, or you can convert 0x91 to Utf8.

All codepages and probably all DOS characters have mapping to Unicode. For codepages standard U++ conversion is enough.
Re: Draw::WrawText to paint ASCII sequence [message #25791 is a reply to message #25784] Thu, 11 March 2010 21:21 Go to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 916
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Thanks.
Solved with FromOEMCharset() function.
Previous Topic: How to know if I am drawing on screen?
Next Topic: Toolbar images vanishing [SOLVED]
Goto Forum:
  


Current Time: Fri Nov 22 21:27:37 CET 2019

Total time taken to generate the page: 0.00856 seconds