This package is made of two parts : The first deals with building a view for a manuel de codage text, and in particular, placing the different subviews.
Once these subviews are built, the view can be drawn on screen (or printer, or pdf file...) ; This is the task of the drawer classes. HieroglyphsDrawer is specialized in hieroglyphs, and is also used while building the view, because it knows about sign dimentions. ViewDrawer does make very few decision, and mecanically draws a view. A benefit from this approach is that things like view dimentions are easier to compute.
The actual drawing of the view is made, for individual elements, by an ElementDrawer. A default implementation is proposed, but it can be changed, if one wants, for instance, to change the drawing of cartouches.
A problem we need to handle now concerns the passing of data such as drawingSpecifications. It's quite clear that in most cases, the user will want all his hieroglyphic rendering to look the same, So we probably want to share the drawingSpecifications. On the other hand, it should be possible to change them on a widget by widget basis.
Rendering text with multiple orientations : Basically, we build regions of text with homogeneous orientation. In the same page, when a region is built, it's added to the page.
the problem is where ? To solve it, we use the metaphor of a current cursor. The cursor's place will depend on the global text orientation, and on the previous text orientation. Suppose a global orientation right-to-left ; let's consider a right-to-left sequence A,B, then a left-to-right sequence C,D, then a second right-to-left sequence E.
The rendering will be ECDBA. Thus, the cursor, after B would be placed at the left of B
Now, if the global orientation is left-to-right, the rendering would be BACDE ; the cursor after B would be placed to the right of B. In general, the cursor position in a homogeneous sequence is a function of the sequence orientation ; the cursor position when the orientation changes is a function of the global orientation.