How to display ancient Egyptian hieroglyphs in .NET?

Which font should I use? How can I display a specific character? Does this support .NET controls? Is there a limitation in .NET char and string types?

+4
source share
1 answer

Egyptian characters are in an extended version of Unicode: Optional Multilingual Plan (SMP). Here you can find the full link here . So, the first character begins with 0x13000 (hex).

Recommended Font: NewGardiner . Install the SMP font version. I installed this font in my RichTextBox or Label in a C # Windows Forms application. A font size of 30 makes the characters readable.

Setting the character to is charnot possible in .NET. This is because it is charnot intended to store the values โ€‹โ€‹that we need. char- 16 bits in .NET, and we want to refer to 0x1300 hex (77824 decimal). Stringon the other hand, it can handle this, but we need to use \ U (not \ u) and create a 32-bit character (note the leading zeros). The following code displays the first character in the table.

string single_character = "\U00013000";
label1.Text = single_character; 

Two hieroglyphs will be encoded as follows:

string two_characters = "\U00013000\U00013010";

Ancient Egyptian hieroglyphs on .NET

If you fixed the error, install the NewGardiner font, and then restart Visual Studio and try changing it again.

+4

Source: https://habr.com/ru/post/1622193/


All Articles