Special Chars in Android and the IDE ?

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,

I need a special character in my app, like a check mark.

In the old DOS days there was one with ALT + 251 (square root).
In ANSI I could find something in the ZapfDingBats ...
or in UNICODE: U+2713 or U+2714 are nice hooks.

By now, I do create a bitmap with the right color and paint a line inside to show "This record is done OK", but they want nicer symbols ... :sign0085:

Does Android use the hole UNICODE characters ?
How can I define the U+2713 in the IDE, by now I get only small boxes ?

I don't want to create 10 bitmaps with all colors an this sign and they have to be small ... (10x10dip).
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The question is whether the installed font supports this character. My guess is that it does support it.

You can paste the character directly in the IDE:
SS-2013-03-20_16.56.12.png


I found the character here: Unicode Character 'CHECK MARK' (U+2713)
You can also write this line:
B4X:
Label1.Text = Chr(2713)
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
I have the "Courier NEW" Font in the IDE, so the U+2713 (with chr() or paste) will not work (only a rectangle is shown). But this font do have the square root (found in the link) and this works.

cvs.DrawText("√", 2dip,8dip,Typeface.DEFAULT,8,Colors.Black,"LEFT")

will do what I need. If I could set the Typeface to a font like "Arial Unicode MS" it would be nicer, is this possible ? ;-)

Is there a list of fonts on a Androidsmartphone ?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I found that Chr(8730) gives a tick on all the devices I tried, if you need it.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Ahh OK, the checkmark does look nicer.
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
Of course, the normal Values are HEX ones ...

Chr(10003) looks nicer, but needs more space as √ so I use √ in the normal Listbox with normal Text and Chr(10003) in my bitmap button.
After I changed the size to 100dip it looks realy nice :sign0060:

Thanks a lot.
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
I can paste the sign from the "Fontlist"-dialog (I do not know the right english name, I have a german Windows).

Ⓐ = Arial Unicode MS = 9398 or in HEX 24B6

here and in the B4A-IDE - or use the chr() :

Dim stxt As String = Chr(9398) & " is a sign" ' 9398 = 24B6
Msgbox(stxt,"sign")

but on my Samsung Galaxy S+

I only see the [] (one sign as a empty box), so there must be something with the font too ...

On my Windows PC with PowerBasic (unicode) I see what you want

MSGBOX CHR$$(9398)+" test"$$ ,,"test"
MSGBOX CHR$$(&H24B6)+" test"$$ ,,"test"

Ⓐ test

Chr(10003) worked here ...
 
Upvote 0

Croïd

Active Member
Licensed User
Longtime User
Thanks Hubert,

I think I'll leave this solution (typeface) for my symbol button ;)
 

Attachments

  • Symbol.zip
    434.2 KB · Views: 298
Upvote 0
Top