# Unicode hieroglyphic editor

## Introductory examples

Groups are generally constructed from the bottom up, and from left to right (or right to left, depending on the text direction). One can use a combination of mouse clicks and keyboard input. Starting with an empty encoding, after clicking on Clear, an example is:

1. Type l (the lower-case letter 'ell') or click on literal, and type `sw` into the text field
2. Type - (hyphen) or click on append
3. Type `t`
4. Type or click on :
5. Type `n`
6. Type - or click on append
7. Type `zA`
8. Press the Enter key and type i, or click on insert
9. Type `Z1`, or just `z1`

Now the desired groups are visible in the preview panel, the internal structure is represented in the tree panel, and the corresponding Unicode sequence is in the text panel at the bottom of the page.

Next we want to move the ideogram marker (Z1) to the bottom right corner:

1. Press the Enter key and press arrow-left or click on the insertion icon
2. Select be to indicate the place of insertion, or alternatively press `c` until the place of insertion becomes be

One can also enter an existing Unicode sequence into the text panel and click on Parse.

## Structure of the page

The page is divided into:

### Header

There is a spinner for changing the fontsizes in the preview and tree panels. There are also buttons to undo or redo edit operations, and to open this help page. Keyboard shortcuts for undo and redo are '<' and '>', respectively.

### Text direction panel

The panel for changing the text direction is located in the top-left or top-right corner of the page, immediately next to the preview panel. One may select the desired text direction by clicking on one of the four relevant buttons (hlr, hrl, vlr, vrl). The direction affects the view but not the encoding itself.

### Preview panel

The preview panel presents a fragment in graphical form, approximately as it would appear to the reader of a printed document or web page.

### Tree panel

The tree panel presents the fragment in an hierarchical form. Nodes connected by edges represent expressions and their subexpressions.

In each fragment there is at most one group that is the current focus. The focus is the target of edit operations. In the tree panel, the focus is indicated by a thick blue boundary around a node, as opposed to a thin gray boundary. In the preview panel, the top-most group containing the current focus is indicated by blue lines. The current focus can also be between two groups.

Top-level groups are separated by nodes labeled '-'. These are not part of the encoding, but serve to make certain structural changes.

In the tree panel, the focus can be changed by clicking on a node. In the preview panel, the root node of a top-level group can be made the focus by clicking on that group. Other ways to navigate rely on keyboard shortcuts, as explained further below.

### Control panel

The control panel contains buttons for changing the structure of the fragment and for changing the corners of insertions and other parameters. Only those buttons are shown that are relevant to the current focus.

### Text panel

The text panel contains the Unicode fragment. This fragment is updated every time an edit is made, for example through the buttons in the control panel. Alternatively, one can edit the text panel and click on Parse, which updates the preview and tree panels. By clicking on Clear, one obtains an empty fragment. By clicking on Copy, the encoding is copied to the clipboard, if you wish to include the encoding in another document.

Only if hieroglyphic fonts are installed in the operating system does the text panel actually display hieroglyphs (and default glyphs of control characters), as opposed to the "not defined" glyph (typically a box, a question mark, or a cross).

## Editing

### Changing the structure

Depending on the current focus, the following buttons may be available to change the structure of a fragment:

- literal creates a new group initially consisting of a sign, or changes a 'blank' or 'lost' symbol into a sign.
- blank and lost and singleton similarly create new blanks, placeholders for lost signs and stand-alone enclosure caps.
- append creates a new group following the current group, initially consisting of a single sign.
- prepend creates a new group preceding the current group.
- '*' generally appends a new subgroup of a horizontal group, initially consisting of a single sign. If the current focus is another operator such as ':' however, then the two groups on either side are combined into a horizontal group.
- ':' behaves similarly, but for vertical groups.
- '+' and ';' can be used to insert a new subgroup before the current focus, in a horizontal group and vertical group, respectively.
- '[' and ']' add a bracket before or after a sign.
- overlay and insert generally create a new element in the structure, of which the current focus becomes the first argument; the second argument initially consists of a sign. If the current focus is another operator such as ':' however, then the two groups on either side become the two arguments of an overlay or insert, respectively.
- enclosure creates an enclosure around a previously created group. Note that at least one group from among the enclosed groups must exist first before the enclosure itself can be created.
- swap swaps the name of the current literal and that of the next one.
- delete generally removes the node with the current focus. This may lead to further changes to preserve the integrity of the syntax. Larger groups need to be deleted one element at a time. In order to delete a literal preceded or followed by brackets, the brackets first need to be removed.

### Keyboard shortcuts

Use of the mouse can to a great extent be avoided by keyboard shortcuts. The four arrow keys can be used to move the focus in the tree panel. The Home and End keys transfer the focus to the first and last top-level group, respectively.

Buttons that change the structure of groups can be activated by entering characters such as '*', ':', the Delete key for delete, 'b' for blank, etc. (See the letters on the buttons that are underlined.) For signs, 'd' makes a sign 'damaged', 'm' makes it mirrored, and 'r' chooses the next rotation. For insertions, 'c' selects the next available place, for lost signs, 'x' toggles the expansion, etc.

The above keyboard shortcuts will work if the focus is on the tree panel, which is indicated by a blue border around the tree panel.

If the focus is on the text field of a literal, it can be transferred to the tree panel by pressing Enter. Conversely, if the focus is on the tree panel, and the focus is on a literal, then the focus can be transferred to the name field by pressing the space bar.

The name of a sign can be entered as a 'Gardiner name', or for some signs as a 'mnemonic', as for example `sw` in place of `M23`. After typing the name of a sign, typing `-` (hyphen) is the same as clicking on append; similarly one may type `*`, `:`, `+`, `;`.

## Sign chooser

The following is relevant when the editor's focus is on a sign (literal).

The menu of signs is activated by clicking on menu or by pressing the space bar when the focus is in the name field.

By clicking on the tabs at the top of the window, one may view categories of signs according to Gardiner's sign list. Three extra tabs show collections of signs according to shape. One may navigate through the tabs using the four arrow keys. A sign is selected by clicking on it.

With the categories tab, one may also type the name of a sign, by keyboard presses of letters and digits (there is no need for the Shift key). The name will appear in the upper left corner. After entering the first letter (or the first two letters for 'NL', 'NU', 'Aa'), signs in the relevant category will appear. One may then type the remaining digits, and possibly more letters, and press Enter to select the sign. Typed characters can be erased by pressing Backspace; this is not needed for switching between categories however. For example, by pressing 'a' and then 'b', one switches from category 'A' directly to category 'B'. By pressing Esc, or by clicking on Close, one exits the sign chooser without having selected a sign.

Information on signs can be obtained by selecting info and moving the mouse over a sign.

One can search for signs on the basis of their transliteration. A keyboard shortcut to select the transliteration tab is to press '!'. One can then type letters in the usual MdC alphabet (such as A for aleph, ...), and typed characters can be erased by pressing Backspace.

Lastly, one can search for signs on the basis of keywords from their descriptions. A keyboard shortcut to select the keywords tab is to press '?'. For each identified keyword, the number of signs are shown that have that keyword in their description.