JSesh 9 Documentation

Lines, pages, zones and files

Lines, pages and zones

Lines and pages

Code Meaning
! end of line (end of column in vertical text)
!=150% end of line, with the skip to the next line scaled to 150 %
!! end of page
![align=center] end of a centred line
!=150%[align=end] both options together
!![align=justify] end of page, which ends a justified line

The align option gives the alignment of the line which the break ends: start (the default), end, center or justify. Start and end follow the direction of the text: in right-to-left text, a start line is on the right. An unknown value is read as start.

  • The last line of a text or of a zone, when it has no line break, takes the alignment of the line before it: in anx-![align=center]-pA-nTr, pA-nTr is centred too.
  • Lines are aligned on the width of their container when it has one (the page, or a zone with a width), else on the longest line of the text or zone.
  • A justify line is always stretched to the whole width, however short it is (a line with a single element stays at the start). When such a line is wrapped by the layout, its last part is not justified: it stays at the start, as the end of a paragraph.
  • When the editor wraps the lines to the width of its window, the alignments of lines are ignored.
  • In text written in columns (or in a %zone[layout=columns]), the same option aligns the column which the break ends: start is the top, end the bottom, justify spreads the quadrats over the whole height. Columns are aligned on the height of their container when it has one (a page with a height, or a zone with a height), else on the longest column. Columns are never wrapped, and they stay aligned when the editor wraps lines to the width of its window.

Zones

A zone is an area of the text with its own layout. It sits in the line or column of its parent like a large quadrat:

%zone[layout=columns,dir=rl,height=300,frame](A1-A2-!-B1-B2)

A zone holds anything a text holds, including line breaks and other zones. Zones are top-level items: they cannot appear in a quadrat, a group or a cartouche.

Option Value Meaning
layout lines or columns orientation of the zone's text
dir lr or rl writing direction
width length fixed width; for a zone in lines, also the width at which lines wrap
height length fixed height
linegap length space between two lines of text (two columns, in a zone in columns)
quadratgap length space between two successive quadrats of a line (or of a column)
separator length thickness of the rules between lines or columns; no rule if unset
quadratwidth length maximum width of quadrats
quadratheight length maximum height of quadrats
fitsigns yes or no enlarge a low broad sign alone on a line of a quadrat (as a lone n in a column) to the quadrat width
frame no value draws a frame around the zone
fill yes or no the zone stretches to fill the free space of its line in its parent (see below)
tabgap length minimal space between a tab cell and the next tab stop (see Tabs below)

Lengths are integers, in percent of the height of a quadrat: width=1200 is twelve quadrats wide. An unset option is inherited from the enclosing zone, or from the document preferences for an outermost zone. There are three exceptions: without width or height the zone takes its natural size, and without separator there is no rule. Unknown options are ignored and are not saved.

fill=yes. The zone stretches along the lines of its parent: its width if the parent (zone or text) is in lines, its height if it is in columns. It takes the free space of its line: alone on its line, the whole length; after or before other items, what they leave; several fill zones on one line share the free space equally. The length of the line is the one of the parent if it has one (the page, the width of the editor when it wraps lines, a zone with a width, or a height for columns), else the length of the longest line (or column) of the parent, as for the alignment of lines (above).

%zone[fill=yes,layout=columns,frame](A1-A2)-!-A1-A1-A1-A1-A1

draws a framed column as wide as the line below it. The stretched zone is laid out as if it had this length as width (or height): its own lines are aligned in it, its rules span it, and the fill zones it contains fill it in turn. Its height (its width, in columns) doesn't change.

  • fill wins over the alignment of the line: the line is full, so justify, center and end have nothing left to share, and the gaps stay natural.
  • It is ignored when the zone has a fixed size along the lines of its parent (width in a parent in lines, height in a parent in columns), in a line with %tab, and in lines whose alignment is ignored (main text when the editor wraps lines to its window; zones keep their alignment, and columns too).
  • A bare fill is read as fill=yes; fill=no is the default and is not written.

Tabs

%tab aligns the text of the lines of a zone on shared tab stops, as in a table:

%zone(A1-%tab-B1-!-A1-A1-A1-%tab-B1)
Form Meaning
%tab go to the next tab stop
%tab[n=3] go to stop 3 (stops are numbered from 1; by default, the previous one + 1)
%tab[align=end] the cell before the tab is aligned at its end (start, end, center, justify)

Each stop is placed after the longest cell before it, in all the lines of the zone, plus the tabgap of the zone. %tab is only laid out in zones: in the main text, it is read and saved, but ignored. In a line wrapped by the layout, only the tabs before the first wrap count.

Running annotations

%haplography and %lacuna draw a line along the text, to mark a stretch of it: a running variant (haplography) and a running lacuna.

A1-%haplography-B1       a line two quadrats long between two signs
A1-%lacuna-B1           a dashed line up to the end of the line
A1-^-..-..-^-B1                    the same as %haplography (legacy form)
Form Drawing
%haplography solid line with an arrow head at each end
%lacuna dashed line, without arrows

The line is horizontal in text written in lines, vertical in columns. Both are top-level items, between two -, and take room in the line like a sign (one quadrat across).

size is either a length, in percent of a quadrat (size=200 is two quadrats long), or fill. A missing, zero or unreadable size is 100. The option is always written.

size=fill. The annotation has no length of its own, and takes the free length around it:

  • in a line without %tab, the rest of the line, as a fill zone (above) does: after or before other items, what they leave; several of them share the free length equally. The length of the line is the one of the parent if it has one, else the one of the longest line;
  • in a line with %tab, the rest of its tab cell: up to the next tab stop, minus the tabgap; in the last cell of the line, up to the end of the table. It does not push the stop: the stop is computed from the other items of the cell. This differs from %zone[fill=yes], which is ignored in a line with %tab;
  • it keeps its natural length (none) in lines whose alignment is ignored (main text when the editor wraps lines to its window), as the fill zones do.

The old forms ^-..-..-^ and ?-..-..-? are read as these annotations, see Older forms of the code.

Forms accepted without effect

These forms are not legacy, but they do nothing yet.

Form Status
%quadrat[options](a:b) Same as a:b. The options are parsed and thrown away, and the %quadrat wrapper is not written back.
Options of %hkern and %vkern Kept as written and saved, but unused.
\? and unknown modifiers Kept and saved, but not drawn.
Unknown options of %zone and %insert Ignored and lost on saving.

Files

A JSesh file has the .gly extension and is encoded in UTF-8. It starts with a header of comment lines, followed by the MdC text:

++JSesh_Info 1.0 +s
++JSesh_page_direction RIGHT_TO_LEFT +s
++JSesh_small_sign_centered false +s
A1-B1-!

Each header line is ++, a property name starting with JSesh_, a value, and +s. They hold the document preferences: page direction and orientation, maximum quadrat size, line and column skip, and so on.

The header can also hold signs drawn by the user, used in the text as sign1, sign2... ("embedded signs"). See Adding a sign of your own to a document.

The form JSesh writes

JSesh always writes each construct in the same way. Texts generated by other tools should use the same spelling.

Construct Written as
Separator always -; : and * without spaces
Sign =, code, \ (mirror), \N (scale), \RN (rotation), other modifiers, {{x,y,s}}, _ or __
Rotation always \RN with 0 ≤ N < 360
Scale with a position in {{x,y,s}}, and only if x or y is not 0; otherwise \N
Absolute group **
Overwrite ##
Ligature with a group ^^^ and &&&
Complete enclosure <-...->, <S-...->, <H-...->, <F-...->, <G-...->
Partial enclosure <1-...-0>, <s1-...-s0>
Toggles $r, $b, #b, #e only, and never crossing each other
Philological marks as signs, separated with -
Text +l...+s, with \ and + escaped, one block per script
Superscript \|...-, with \ and - escaped
End of line, of page ! or !=N%, or !!, then [align=...] unless the line is aligned at the start, followed by a line break
Zone %zone[...](...), with only the options which are set
Running annotation %haplography, %lacuna, with size=fill for a filling one; the size is always written

Toggles are closed before each line break, page break and zone, and at the end of the text, then reopened if needed. This comes from HieroTeX compatibility. The closing toggle at the end of a text follows the last item directly, as in $r-A1$b-.