Author Topic: Printing Unicode characters  (Read 2575 times)

Brian Reynolds

  • Newbie
  • *
  • Posts: 22
    • View Profile
Printing Unicode characters
« on: April 04, 2022, 09:50:17 pm »
Can anyone help me with printing very high HEX or UNICODE characters?

Using Windows Character Map, I select Arial and scroll down to about four-fifths of the depth and there's a "Full Block" (black block of character with and depth).

It shows at the bottom what I assume to be a Hex num,ber "U+2588"

I normally print these codes (255 and below) by converting them to a ASCII number but I can't figure how I can do this one.

Can anyone help? 

Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Printing Unicode characters
« Reply #1 on: April 05, 2022, 03:35:15 pm »
When you say printing do you mean to a printer or simply to the screen ?

Unicode characters require a unicode capable font and must be drawn using an API which supports unicode.

EZGUI is ASCI only.

That said, I current have two projects I am working on (one finished) which needs to display text in languages like Japanese which require Unicode and it was not that difficult to implement using the WIN32 API and integrate into an EZGUI app.

First I had to create my fonts using the CreateFontW API function.

Then I was able to draw the text using either the TextOutW or DrawtextW API functions.

The same API's can be used either the screen or a printer. You simply select the font handle into the DC you are drawing into and then select the previous one back in when done.

Both when drawing to the screen or printer EZGUI provides you with the DC handle (device context).

Brian Reynolds

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Printing Unicode characters
« Reply #2 on: April 05, 2022, 08:16:37 pm »
Chris,
I was using the Arial that came with my Windows 10.
However, I have just managed to overcome the problem, using the following:

EZ_DefFont 50, "Broadway", 11, "BV[48#]"

and Printing a capital "I"

Thank you for your trouble

Brian Reynolds.
 

Chris Boss

  • Administrator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Printing Unicode characters
« Reply #3 on: April 06, 2022, 10:07:49 pm »
If the character set you require fits in 256 characters then EZGUI's ascii based fonts are   fine.

I would suggest though using the Windows utility "Character Map" to browse the fonts and their character sets.
Very useful tool.

You will find it on the Windows menu under "Windows Accessories"