Royi Namir
Royi Namir

Reputation: 148514

Combine my own unicode characters in c#?

é 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

Upvotes: 17

Views: 3229

Answers (2)

Joey
Joey

Reputation: 354356

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.

Upvotes: 26

Michel Keijzers
Michel Keijzers

Reputation: 15347

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).

Upvotes: 3

Related Questions