Writing a continuous line inside a text model
Posted: Mon Jun 15, 2015 2:25 pm
To draw a continuous line I tried to use the char "─" (push the Alt key and then type the number 2500 or 196). This is the unicode character U+2500. See http://www.fileformat.info/info/unicode ... /index.htm.
This char is encoded in UTF-8 using 3 bytes "E2 94 80". When I type this char several times, the cursor of the editor is incorrectly positioned. See attached image.
Anyway I post it here just for curiosity.
To draw an horizontal line inside a text model I am doing:
It uses the Ctls subsystem from http://www.zinnamturm.eu/downloadsAC.htm#Ctls.
It took me some time to arrive at it, in particular how to specify the size of the line via hLine.context.SetSize(); I am not very fluent using views.
Regards
This char is encoded in UTF-8 using 3 bytes "E2 94 80". When I type this char several times, the cursor of the editor is incorrectly positioned. See attached image.
Anyway I post it here just for curiosity.
To draw an horizontal line inside a text model I am doing:
Code: Select all
VAR md: TextModels.Model; fm: TextMappers.Formatter;
hLine: CtlsFigures.Figure;
...
md := TextModels.dir.New(); fm.ConnectTo(md);
...
hLine := CtlsFigures.NewLine(Ports.black, SHORT(ENTIER(0.5 * Ports.mm)));
fm.WriteView(hLine);
hLine.context.SetSize(190 * Ports.mm, 1 * Ports.mm); (* Width DIN A4 = 210 mm. *)
fm.WriteLn;
It took me some time to arrive at it, in particular how to specify the size of the line via hLine.context.SetSize(); I am not very fluent using views.
Regards