# Chaedinth Unicode Language As a part of game development I found it quite useful to create renderable icons or symbols as part of a language set that we can render in unicode. This allows us to render these in-game symbols from text through a custom created font. The result are unique, properly sized symbols and icons that can be easily rendered from text alone. The general appraoch is: 1. Define what symbols you want to render and sketch them out. 2. Create a custom font placing those symbols at whatever byte positions are desirable, either replacing alphabetical character or more distant extended ascii or unicode characters. Use this wonderful [Bit Font Maker](https://www.pentacom.jp/pentacom/bitfontmaker2/) in your browser. 3. Designate the font for the output of text in your game engine. 4. Output the text with bytes associated with the symbols you want to use. ## Chaedinth Language To demonstrate this I created a custom glyphic language I called "Chaedinth" that created its own set of symbols for different language phenomes that are similar to english. These symbols sit in the byte-ranges from 200+ allowing me to create text with regular alphanumerical english as well as Chaedinth on the fly. I didn't want it to simply be a one-to-one transliteration of the Latin alphabet so I decided upon an alphabet that incorporated more sounds (language phenomes) as unique symbols. These are my original sketches showing this process: Photograph of a notebook with original ideas for Chaedinth language including new phenomes, a base-4 numbering system and symbols These were the general goals I designing for the language: 1. Each natural sound would have its own symbol removing duplicate Latin characters such as `s` and `c` or `c`, `k`, and `q`. 2. Each vowel should also have its own symbol extending from the base 6 vowels of Latin into more options. 3. Simplistic punctuation only representing comma, period and question marks. 4. Numbers are of Quaternary numeral system (base-4) instead of our standard Decimal (base-10) system. The resulting language was 18 consonants, 15 vowels, 4 numerical digits and 3 punctuation marks. | Consonants | Vowels | |-----|-----| | `b` as in ball | `ah` as in cat | | `d` as in deer | `ae` as in rain | | `f` as in fun | `eh` as in them | | `g` as in gear | `ee` as in see | | `h` as in heart | `ih` as in pig | | `j` as in jam | `ie` as in pie | | `k` as in king | `oo` as in food | | `l` as in language | `oe` as in show | | `m` as in math | `ow` as in cow | | `th` as in theme | `oh` as in top | | `sh` as in shade | `uh` as in under | | `ch` as in charm | `ue` as in blue | | `n` as in noon | | | `p` as in patience | | | `r` as in ram | | | `s` as in sun | | | `t` as in tool | | | `v` as in victory | | | `w` as in wayward | | | `y` as in ying-yang | | | `z` as in zebra | | With all of the consants, vowels, punctuation and numbers settled I created a set of runes to represent each one. Picture showing phenome replaced english and the chaedinth symbol The process for converting from English to Chaedinth is simple: 1. Write out the english. 2. Sound out the english and replace all consonants and vowels with their Chaedinth version. 3. Right the Chaedinth symbol for each sound. The result looks like this: Picture of example text showing english, phenome replaced english and the chaedinth rendering for text: For now we see but a poor reflection as in a mirror. Then we shall see face to face. Now we know in part, then we shall now fully, even as we are fully known. ## Chaedinth Font Now that we have designed our language or set of symbols how can we render them in a game or browser as a font? First step is to create the font! Using [Bit Font Maker](https://www.pentacom.jp/pentacom/bitfontmaker2/) I created a set of symbols within the font that sit on top of the extended latin symbols starting from decimal position 200. This allows me to keep the normal alphabetical characters of english that are in the lower range of ascii characters. Here is a screenshot showing the language symbols having been draw in Bit Fontmaker and which extended-latin character they replace. Screenshot of Bit Fontmaker 2 showing the Chaedinth symbols overwriting extended-latin byte positions Now, as long as the render system such as the video game or internet browser is set up with our Chaedinth.ttf font we can render the glyphs using any string that has the unicode positions related to our glyphs. We can do this directly in a string using escape characters. Take a look at this PHP script that converts any Chaedinth latin characters into our symbol positions in our font. ## Conversion Script Given our font, designate the utf-8 decimal positions for the start of the consonants, vowels, punctuation and numbers. ```php define("C", 200); # consonants define("V", 227); # vowels define("P", 248); # punctuation define("N", 259); # numbers ``` We then create a generic PHP function to convert a unicode decimal value into into its corresponding UTF-8 character. This will allow us to designate the decimal position of our chaedinth characters into the proper UTF-8 position in our font. ```php function unichr($dec) { if ($dec < 128) { # If $dec < 128, it’s a standard ASCII character $utf = chr($dec); } else if ($dec < 2048) { # For code points in this range, it constructs a two-byte UTF-8 sequence $utf = chr(192 + (($dec - ($dec % 64)) / 64)); # First byte $utf .= chr(128 + ($dec % 64)); # Second byte } else { # For code points in this range, it constructs a three-byte UTF-8 sequence $utf = chr(224 + (($dec - ($dec % 4096)) / 4096)); # First byte $utf .= chr(128 + ((($dec % 4096) - ($dec % 64)) / 64)); # Second byte $utf .= chr(128 + ($dec % 64)); # Third byte } return $utf; } ``` We then define our ascii alphebetical characters to their unicode position in our font. ```php $c = C; $v = V; $p = P; $n = N; $mapping = [ "b" => unichr($c++), "d" => unichr($c++), "f" => unichr($c++), "g" => unichr($c++), "h" => unichr($c++), "j" => unichr($c++), "k" => unichr($c++), "l" => unichr($c++), "m" => unichr($c++), "th" => unichr($c++), "sh" => unichr($c++), "ch" => unichr($c++), "n" => unichr($c++), "p" => unichr($c++), "r" => unichr($c++), "s" => unichr($c++), "t" => unichr($c++), "v" => unichr($c++), "w" => unichr($c++), "y" => unichr($c++), "z" => unichr($c++), "ah" => unichr($v++), "ae" => unichr($v++), "eh" => unichr($v++), "ee" => unichr($v++), "ih" => unichr($v++), "ie" => unichr($v++), "oo" => unichr($v++), "oe" => unichr($v++), "ow" => unichr($v++), "oh" => unichr($v++), "uh" => unichr($v++), "ue" => unichr($v++), "." => unichr($p++), "?" => unichr($p++), "," => unichr($p++), "0" => unichr($n++), "1" => unichr($n++), "2" => unichr($n++), "3" => unichr($n++), "4" => unichr($n++), ]; ``` Then with any Chaedinth latin string we can replace their characters with our UTF-8 Chaedinth symbols. But in this script we need to do a small trick before doing the string replacement. ``` $en = "For now we see but a poor reflection as in a mirror. Then we shall see face to face. Now we know in part, then we shall now fully, even as we are fully known."; $ch = "foor now wee see buht ae poor reeflehctuhn ahz ihn ah mihroor. thehn wee showl see faes too faes. now wee noh ihn pahrt thehn wee showl noh fuhlee, eevehn ahs wee ahr fuhlee nohn."; # to prevent PHP from replacing characters that belong to a pair of characters # such as replacing the "t" in the "th" we can cheat by sorting the mapping # from descending to ascending which puts the bigger strings first # e.g "AB" => "ABC" is -1 uksort($mapping, function($a, $b) { return strlen($b) <=> strlen($a); }); # get our UTF-8 string $ch2 = str_replace(array_keys($mapping), array_values($mapping), $ch); ``` Now the variables `$en` is our normal english, `$ch` is our Chaedinth latin and `$ch2` is our unicode positioned string. Lets set up some boilerplate HTML and CSS to render our text. ```html

``` This is where we get our output: Picture of example text showing english, phenome replaced english and the chaedinth rendering for text: For now we see but a poor reflection as in a mirror. Then we shall see face to face. Now we know in part, then we shall now fully, even as we are fully known. # Conclusion

׿ Ûî ÏäØÖ ãÏçËäØéÖú ãÊØÖ í ÚèÏ ÎÖìÎíÉèÏ