Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine my own unicode characters in c#?

Tags:

c#

.net

unicode

é is an acute accent letter. é can be also represented by ́ + e = é.

However, I was wondering whether I can combine any unicode chars?

For example:

I was looking for a unicode code point for question mark inside a circle like in here (picture):

enter image description here

But I couldn't find any. (I looked here)

So I was wondering whether I could combine these two:

? and (which is ◯ -- at a larger size of course).

Where ? is a regular question mark char (?), and is ◯ large circle - geometric shapes.

Is it possible to do so in C#?

edit like in here

enter image description here

where :

enter image description here

enter image description here

like image 848
Royi Namir Avatar asked May 07 '13 07:05

Royi Namir


People also ask

How do I merge Unicode characters?

Depending from the application or browser there are two ways to use the Unicode Combining Diacritical Marks: With ā (a macron) as example, you may try to type in the 'a' first followed by the decimal code ̄ or ALT+ (it must be the + from the numeric keypad) followed by the hexadecimal code 0304 (i.e U+0304).

How do you write C in Unicode?

Unicode Character “C” (U+0043)

Can you use Unicode in C?

It can represent all 1,114,112 Unicode characters. Most C code that deals with strings on a byte-by-byte basis still works, since UTF-8 is fully compatible with 7-bit ASCII. Characters usually require fewer than four bytes. String sort order is preserved.

Does C use Unicode or ASCII?

As far as I know, the standard C's char data type is ASCII, 1 byte (8 bits).


2 Answers

You can use combining characters on any other character if you like, but with the caveat that the font has a large role to play in how it displays. While common diacritics like the acute accent should work for pretty much all Latin characters in most fonts the more obscure ones, like U+20DD Combining Enclosing Circle are a little wonkier. But ?⃝ would be the sequence you need, it just needs font support.

And with that being said, font support is abysmal. All fonts I have here that have a glyph for that character (Arial Unicode MS, Calibri, Consolas) don't honor it's combiningness and just render a large circle next to a question mark. The only one that does render it somewhat correctly is Cambria and Cambria Math, that at least overlap the glyph to the previous one:

enter image description here

It looks a little better when having the sequence space, question mark, circle:

enter image description here

but still not quite right.

Regarding regular rendering support in a browser:


Your browser:

?⃝

enter image description here


To accurately answer your question, though: You can just overlay two glyphs in your code by either just placing two labels directly on top of each other or by drawing it yourself. With font and rendering support as poor as in this case this is really something I'd solve through an image. So theoretically it is possible (and from Unicode's standpoint it definitely is because you can represent a circled question mark – but Unicode doesn't concern itself with fonts and rendering) but it's not very practical in most cases.

like image 113
Joey Avatar answered Nov 03 '22 00:11

Joey


No, at least not in the sense of combining the way you write.

You will need to create a new font with the graphics of the circle and quotation mark, and you can assign that 'graphic' to one of the locations in a unicode table (substituting the default).

like image 34
Michel Keijzers Avatar answered Nov 03 '22 00:11

Michel Keijzers