Debian Codegraph @

progs/arm_rtf.adb

raw
1 with --ARM_Output,
2 --ARM_Contents,
3 --Ada.Text_IO,
4 Ada.Exceptions,
5 Ada.Streams.Stream_IO,
6 Ada.Strings.Maps,
7 Ada.Strings.Fixed,
8 Ada.Characters.Handling,
9 Ada.Calendar,
10 Ada.Unchecked_Conversion;
11 package body ARM_RTF is
12
13 --
14 -- Ada reference manual formatter (ARM_Form).
15 --
16 -- This package defines the RTF output object.
17 -- Output objects are responsible for implementing the details of
18 -- a particular format.
19 --
20 -- ---------------------------------------
21 -- Copyright 2000, 2002, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012,
22 -- 2013, 2016
23 -- AXE Consultants. All rights reserved.
24 -- P.O. Box 1512, Madison WI 53701
25 -- E-Mail: [email protected]
26 --
27 -- ARM_Form is free software: you can redistribute it and/or modify
28 -- it under the terms of the GNU General Public License version 3
29 -- as published by the Free Software Foundation.
30 --
31 -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
32 -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
33 -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
34 -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
35 -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
36 -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
37 -- DAMAGES.
38 --
39 -- A copy of the GNU General Public License is available in the file
40 -- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
41 -- Otherwise, see <http://www.gnu.org/licenses/>.
42 --
43 -- If the GPLv3 license is not satisfactory for your needs, a commercial
44 -- use license is available for this tool. Contact Randy at AXE Consultants
45 -- for more information.
46 --
47 -- ---------------------------------------
48 --
49 -- Edit History:
50 --
51 -- 5/18/00 - RLB - Created package.
52 -- 5/22/00 - RLB - Added Includes_Changes to Create.
53 -- 5/23/00 - RLB - Added Set_Column and New_Column.
54 -- - Added Tab_Info and Tab_Stops.
55 -- 5/24/00 - RLB - Added Location to Text_Format.
56 -- - RLB - Added No_Breaks and Keep_with_Next to Start_Paragraph.
57 -- 5/25/00 - RLB - Added Big_Files to Create. Added Justification.
58 -- - RLB - Added Separator_Lines and TOC routines.
59 -- 5/26/00 - RLB - Added table operations.
60 -- 5/27/00 - RLB - Implemented table operations.
61 -- 5/28/00 - RLB - Added index style.
62 -- 6/ 2/00 - RLB - Added Soft_Line_Break.
63 -- - RLB - Changed back to mostly "after" spacing, so paragraph
64 -- numbers format correctly on tops of pages.
65 -- 8/ 2/00 - RLB - Added Soft_Hyphen_Break and left and right quote
66 -- characters.
67 -- - RLB - Added additional styles.
68 -- - RLB - Fixed bulleted styles to have a right indent as well.
69 -- 8/ 4/00 - RLB - Added additional styles.
70 -- - RLB - Fixed table text size.
71 -- 8/ 7/00 - RLB - Added Leading flag to Start_Paragraph, removed "Leading"
72 -- styles.
73 -- 8/ 8/00 - RLB - Added "Hang_Width" in order to get more accurate
74 -- hang prefix determination.
75 -- 8/10/00 - RLB - Style corrections.
76 -- 8/11/00 - RLB - Fixed footers for clauses with very long titles.
77 -- - RLB - Added Hanging_in_Bulleted styles.
78 -- 8/16/00 - RLB - Adjusted so captial 'I' is not a large character.
79 -- - RLB - Added Code_Indented_Nested_Bulleted and Notes_Nested_Bulleted.
80 -- 8/17/00 - RLB - Replaced "Leading" by "Space_After".
81 -- - RLB - Added Nested_Enumerated.
82 -- 8/21/00 - RLB - Moved paragraph numbers in a bit for AARM.
83 -- 8/22/00 - RLB - Added Revised_Clause_Header.
84 -- 8/23/00 - RLB - Revised widths of AARM text to be more like RM.
85 -- 8/31/00 - RLB - Moved paragraphs in again.
86 -- 9/26/00 - RLB - Added Syntax_Summary style.
87 -- 9/27/00 - RLB - Cut the lower margin for the AARM pages.
88 -- 7/18/02 - RLB - Removed Document parameter, replaced by three
89 -- strings.
90 -- - RLB - Added AI_Reference.
91 -- - RLB - Added Change_Version_Type and uses.
92 -- 9/10/04 - RLB - Added "Both" to possible changes to handle
93 -- replacement of changed text.
94 -- 9/14/04 - RLB - Moved Change_Version_Type to contents.
95 -- 9/15/04 - RLB - Completely rewrote Text_Format to avoid problems
96 -- with ordering of calls.
97 -- 11/03/04 - RLB - Added Nested_X2_Bulleted.
98 -- 11/15/04 - RLB - Added Indented_Nested_Bulleted.
99 -- 11/16/04 - RLB - Experimented with changes to avoid the hot pink
100 -- revision markers.
101 -- 12/15/04 - RLB - Added Pascal's workaround to formatting bugs in
102 -- Word 2000/XP/2003.
103 -- 12/16/04 - RLB - Removed it after it proved not to help.
104 -- 1/24/05 - RLB - Added Inner_Indent.
105 -- 2/ 1/05 - RLB - Added Turkish chars to allow an AARM note.
106 -- 5/27/05 - RLB - Added arbitrary Unicode characters.
107 -- 1/11/06 - RLB - Eliminated dispatching Create in favor of tailored
108 -- versions.
109 -- 1/18/06 - RLB - Added additional styles.
110 -- 2/ 8/06 - RLB - Added additional parameters to the table command.
111 -- 2/10/06 - RLB - Added even more additional parameters to the
112 -- table command.
113 -- - RLB - Added picture command.
114 -- 9/21/06 - RLB - Added Body_Font; revised styles to handle that.
115 -- 9/22/06 - RLB - Added Subsubclause.
116 -- 9/25/06 - RLB - Handled optional renaming of TOC.
117 -- - RLB - Added Last_Column_Width to Start_Table.
118 -- 10/10/06 - RLB - Widened bulleted and enumerated hanging a bit to make
119 -- room for wider numbers for ISO 2004 format.
120 -- 10/13/06 - RLB - Added Local_Link_Start and Local_Link_End to allow
121 -- formatting in the linked text.
122 -- 12/22/06 - RLB - Fixed glitch in number of column units.
123 -- 2/ 9/07 - RLB - Changed comments on AI_Reference.
124 -- 2/14/07 - RLB - Revised to separate style and indent information
125 -- for paragraphs.
126 -- 2/16/07 - RLB - Added example styles for additional nesting levels.
127 -- 2/19/07 - RLB - Added Standard Title style.
128 -- 12/18/07 - RLB - Fixed silly table bug.
129 -- - RLB - Added Plain_Annex.
130 -- 12/19/07 - RLB - Added limited colors to Text_Format.
131 -- 12/21/07 - RLB - Removed extra "not" from "large" character counter
132 -- in Ordinary_Character.
133 -- 5/ 4/09 - RLB - Added the footer information.
134 -- 5/ 6/09 - RLB - Added ISO format footer and version names.
135 -- 10/28/09 - RLB - Added missing with.
136 -- 3/31/10 - RLB - Adjusted picture scaling to be closer to reality.
137 -- 10/18/11 - RLB - Changed to GPLv3 license.
138 -- 10/20/11 - RLB - Updated to handle extra-wide paragraph numbers
139 -- automatically (there are too many to hand-fix now).
140 -- 10/25/11 - RLB - Added old insertion version to Revised_Clause_Header.
141 -- 4/ 3/12 - RLB - Eliminated redundancy.
142 -- 8/31/12 - RLB - Added Output_Path.
143 -- 10/18/12 - RLB - Added additional hanging styles.
144 -- 11/05/12 - RLB - Added various additional styles.
145 -- 11/26/12 - RLB - Added subdivision names to Clause_Header and
146 -- Revised_Clause_Header.
147 -- 12/13/12 - RLB - Added style needed by AARM (only in deleted text).
148 -- 8/16/13 - RLB - Added missing style needed by recent RM change.
149 -- 6/28/16 - RLB - Added missing style needed by recent ACATS
150 -- documentation change.
151 -- 8/19/16 - RLB - Nasty bug in End_Hang_Item: it loses any open styles
152 -- if a line break has to be inserted.
153
154
155 -- Note: We assume a lot about the Section_Names passed into
156 -- Section in order to get the proper headers/footers/page numbers.
157 -- Someday, that ought to be changed somehow.
158
159 LINE_LENGTH : constant := 78;
160 -- Maximum intended line length.
161
162 LEADING_PERCENT : constant := 70;
163 -- Leading is 70% of normal height.
164 TRAILING_PERCENT : constant := 150;
165 -- Leading is 150% of normal height.
166
167 type Format_Info_Type is record
168 Defined : Boolean := False;
169 Size : Natural; -- In 1/2 pts.
170 Indent : Natural; -- In Twips (.1 pt = 1/120th pica = 1/1440th inch).
171 Hang_Width : Natural; -- In Twips (.1 pt = 1/120th pica = 1/1440th inch).
172 Before : Natural; -- Vertical space before in Twips. (\sb)
173 After : Natural; -- Vertical space after in Twips. (\sa)
174 Is_Justified : Boolean; -- True if the format is justified. (\qj vs. \qc or \ql)
175 Number : Natural; -- Style number.
176 Format_String : String(1 .. 200);
177 Format_Len : Natural := 0;
178 end record;
179
180 Paragraph_Info : array (ARM_Output.Paragraph_Style_Type,
181 ARM_Output.Paragraph_Indent_Type) of Format_Info_Type;
182 -- Set by Start_RTF_File.
183 Heading_1_Info : Format_Info_Type;
184 Heading_2_Info : Format_Info_Type;
185 Heading_3_Info : Format_Info_Type;
186 Heading_4_Info : Format_Info_Type;
187 Category_Header_Info : Format_Info_Type;
188 Normal_Paragraph_Number_Info : Format_Info_Type;
189 Wide_Paragraph_Number_Info : Format_Info_Type;
190 Header_Info : Format_Info_Type;
191 Footer_Info : Format_Info_Type;
192 TOC_1_Info : Format_Info_Type;
193 TOC_2_Info : Format_Info_Type;
194 TOC_3_Info : Format_Info_Type;
195 TOC_4_Info : Format_Info_Type;
196
197 Table_C_Text_Info : Format_Info_Type;
198 Table_L_Text_Info : Format_Info_Type;
199 Table_C_Sml_Text_Info : Format_Info_Type;
200 Table_L_Sml_Text_Info : Format_Info_Type;
201
202 procedure Set_Style (Into : in out Format_Info_Type;
203 Font : in ARM_Output.Font_Family_Type; -- Default means use Body_Font.
204 Body_Font : in ARM_Output.Font_Family_Type;
205 Font_Size : in Natural;
206 Style_Indent : in Natural;
207 Style_Hang_Width : in Natural := 0;
208 Style_Before : in Natural;
209 Style_After : in Natural;
210 Style_Justified : in Boolean;
211 Style_String_Prefix : in String;
212 Style_String_Suffix : in String) is
213 -- Internal routine.
214 -- Set the indicated style information.
215 -- The two part of the Style String includes all of the information
216 -- except Font (\fn), Font_Size (\fsnn), Indent (\linn), Hang (\fi-nn),
217 -- Before (\sbnn), and After (\sann) -- these are added appropriately
218 -- between the halves of the string.
219 Font_String : String(1..3) := "\f0";
220
221 function Make (Code : in String; Value : in Natural) return String is
222 Val : constant String := Natural'Image(Value);
223 begin
224 if Value /= 0 then
225 return '\' & Code & Val(2..Val'Last);
226 else
227 return ""; -- Make nothing.
228 end if;
229 end Make;
230
231 begin
232 Into.Defined := True;
233 Into.Size := Font_Size;
234 case Font is
235 when ARM_Output.Default =>
236 if ARM_Output."=" (Body_Font, ARM_Output.Swiss) then
237 Font_String(3) := '1';
238 Into.Size := Into.Size - 1;
239 else -- Roman.
240 Font_String(3) := '0';
241 end if;
242 when ARM_Output.Roman =>
243 Font_String(3) := '0';
244 when ARM_Output.Swiss =>
245 Font_String(3) := '1';
246 when ARM_Output.Fixed =>
247 Font_String(3) := '2';
248 end case;
249 Into.Indent := Style_Indent;
250 Into.Hang_Width := Style_Hang_Width;
251 Into.Before := Style_Before;
252 Into.After := Style_After;
253 Into.Is_Justified := Style_Justified;
254 declare
255 Style : constant String :=
256 Style_String_Prefix & " " &
257 Font_String &
258 Make ("fs", Into.Size) &
259 Make ("li", Into.Indent) &
260 Make ("fi-", Into.Hang_Width) &
261 Make ("sb", Into.Before) &
262 Make ("sa", Into.After) &
263 Style_String_Suffix;
264 begin
265 Ada.Strings.Fixed.Move (Source => Style,
266 Target => Into.Format_String);
267 Into.Format_Len := Style'Length;
268 end;
269 end Set_Style;
270
271
272 procedure Write_Style (Fyle : in Ada.Text_IO.File_Type;
273 Style : in Format_Info_Type) is
274 -- Internal routine.
275 -- Write a header to start a style definition for Style.
276 begin
277 if not Style.Defined then
278 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
279 "Undefined Style in style table");
280 end if;
281 Ada.Text_IO.Put (Fyle, "{" &
282 Style.Format_String(1 .. Style.Format_Len));
283 end Write_Style;
284
285
286 procedure Write_Style_for_Paragraph (Fyle : in Ada.Text_IO.File_Type;
287 Style : in Format_Info_Type;
288 Count : out Natural) is
289 -- Internal routine.
290 -- Write a header to start a paragraph in Style. Count is set to
291 -- the characters written.
292 begin
293 if not Style.Defined then
294 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
295 "Undefined Style in paragraph");
296 end if;
297 Ada.Text_IO.Put (Fyle, "{\pard\plain " &
298 Style.Format_String(1 .. Style.Format_Len));
299 Count := Style.Format_Len + 13;
300 end Write_Style_for_Paragraph;
301
302
303 procedure Write_Headers (Output_Object : in out RTF_Output_Type) is
304 -- Write the page headers for this object into the current file.
305 Junk : Natural;
306 begin
307 -- Default header/footer:
308 Ada.Text_IO.Put (Output_Object.Output_File, "{\headerl ");
309 Write_Style_for_Paragraph (Output_Object.Output_File, Header_Info, Junk);
310 if Ada.Strings.Unbounded.Length (Output_Object.Header_Prefix) = 0 then
311 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " &
312 Ada.Strings.Unbounded.To_String (Output_Object.Title) &
313 "\par}}}");
314 elsif Ada.Strings.Unbounded.Length (Output_Object.Title) = 0 then
315 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " &
316 Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
317 "\par}}}");
318 else
319 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b\f1 " &
320 Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
321 " \emdash " &
322 Ada.Strings.Unbounded.To_String (Output_Object.Title) &
323 "\par}}}");
324 end if;
325 Ada.Text_IO.Put (Output_Object.Output_File, "{\headerr ");
326 Write_Style_for_Paragraph (Output_Object.Output_File, Header_Info, Junk);
327 if Ada.Strings.Unbounded.Length (Output_Object.Header_Prefix) = 0 then
328 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " &
329 Ada.Strings.Unbounded.To_String (Output_Object.Title) &
330 "\par}}}");
331 elsif Ada.Strings.Unbounded.Length (Output_Object.Title) = 0 then
332 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " &
333 Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
334 "\par}}}");
335 else
336 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\qr\b\f1 " &
337 Ada.Strings.Unbounded.To_String (Output_Object.Header_Prefix) &
338 " \emdash " &
339 Ada.Strings.Unbounded.To_String (Output_Object.Title) &
340 "\par}}}");
341 end if;
342 -- Note: We don't need the default footers; none probably work better, anyway.
343 -- Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl ");
344 -- Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Junk);
345 -- if Name = "00" or else Name = "TOC" or else Name = "Ttl" then
346 -- -- No section number.
347 -- Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
348 -- else
349 -- Ada.Text_IO.Put (Output_Object.Output_File, "{\b\f1 ");
350 -- if Name(1) = '0' then -- Strip leading zero...
351 -- Ada.Text_IO.Put (Output_Object.Output_File, Name(2..Name'Last));
352 -- else
353 -- Ada.Text_IO.Put (Output_Object.Output_File, Name);
354 -- end if;
355 -- Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f0 ");
356 -- end if;
357 -- Ada.Text_IO.Put (Output_Object.Output_File, Title);
358 -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\tab \tab{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}");
359 -- Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr ");
360 -- Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Junk);
361 -- Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\tab \tab ");
362 -- Ada.Text_IO.Put (Output_Object.Output_File, Title);
363 -- if Name = "00" or else Name = "TOC" or else Name = "Ttl" then
364 -- null; -- No section number.
365 -- else
366 -- Ada.Text_IO.Put (Output_Object.Output_File, "\~\~\~\b\f1 ");
367 -- if Name(1) = '0' then -- Strip leading zero...
368 -- Ada.Text_IO.Put (Output_Object.Output_File, Name(2..Name'Last));
369 -- else
370 -- Ada.Text_IO.Put (Output_Object.Output_File, Name);
371 -- end if;
372 -- end if;
373 -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}}");
374 end Write_Headers;
375
376
377 procedure Start_RTF_File (Output_Object : in out RTF_Output_Type;
378 File_Name : in String;
379 Title : in String;
380 Name : in String) is
381 -- Internal routine.
382 -- Create an RTF file, and generate the needed text to start an RTF
383 -- file. The file name is just the name portion, not the path or
384 -- extension. "Name" is a short identifier, typically the clause
385 -- number or letter.
386
387 INDENT_UNIT : constant := 360;
388
389 subtype PWidth is String(1..4);
390 function Paper_Width return PWidth is
391 -- Return the paper width in twips:
392 begin
393 case Output_Object.Page_Size is
394 when ARM_RTF.A4 =>
395 return "9030";
396 when ARM_RTF.Letter =>
397 return "9360";
398 when ARM_RTF.Half_Letter =>
399 return "5760";
400 when ARM_RTF.Ada95 =>
401 return "7740";
402 end case;
403 end Paper_Width;
404
405 function Half_Paper_Width return PWidth is
406 -- Return the center of the paper width in twips:
407 begin
408 case Output_Object.Page_Size is
409 when ARM_RTF.A4 =>
410 return "4515";
411 when ARM_RTF.Letter =>
412 return "4680";
413 when ARM_RTF.Half_Letter =>
414 return "2880";
415 when ARM_RTF.Ada95 =>
416 return "3870";
417 end case;
418 end Half_Paper_Width;
419
420
421 begin
422 Ada.Text_IO.Create (Output_Object.Output_File, Ada.Text_IO.Out_File,
423 Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) &
424 File_Name & ".RTF");
425
426
427 -- Note: This header (simplified) is from a Word 97 created file.
428 -- File introduction:
429 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033");
430 -- rtf1=RTF file marker;
431 -- ansi=character set is ansi;
432 -- ansicpg=code page for ansi-Unicode conversion (1252);
433 -- uc1=One character replacement for Unicode characters;
434 -- deff0=Default font to use (Font 0);
435 -- deflang=default language (1033 - American English);
436 -- deflangfe=default language (asian text) (1033 - American English).
437
438 -- Font table:
439 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\fonttbl");
440 case Output_Object.Primary_Serif_Font is
441 when Times_New_Roman =>
442 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f0\froman\fcharset0 Times New Roman;}");
443 when Souvenir =>
444 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f0\froman\fcharset0 Souvenir{\*\falt Souvienne};}");
445 end case;
446 case Output_Object.Primary_Sans_Serif_Font is
447 when Helvetica =>
448 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f1\fswiss\fcharset0 Helvetica{\*\falt Arial};}"); -- Usually Arial on most Windows machines.
449 when Arial =>
450 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f1\fswiss\fcharset0 Arial{\*\falt Helvetica};}"); -- Give Arial preference, because otherwise it screwed up Jim Moore's machine.
451 end case;
452 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f2\fmodern\fcharset0\fprq1 Courier New;}");
453 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\f3\ftech\fcharset0 Symbol;}}");
454 -- f=Font number;
455 -- fswiss,froman,fmodern,gtech=font family;
456 -- fcharset=character set (0=Ansi);
457 -- fprq=pitch (0=anything (default); 1=fixed; 2=variable);
458 -- falt=alternative font name;
459 -- followed by the font name
460
461 -- File table: (None used.)
462
463 -- Color table:
464 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\colortbl;");
465 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue0;"); -- Color 1
466 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue255;"); -- Color 2
467 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green255\blue255;"); -- Color 3
468 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green255\blue0;"); -- Color 4
469 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green0\blue255;"); -- Color 5
470 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green0\blue0;"); -- Color 6
471 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green255\blue0;"); -- Color 7
472 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red255\green255\blue255;"); -- Color 8
473 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green0\blue128;"); -- Color 9
474 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green128\blue128;"); -- Color 10
475 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red0\green128\blue0;"); -- Color 11
476 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green0\blue128;"); -- Color 12
477 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green0\blue0;"); -- Color 13
478 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green128\blue0;"); -- Color 14
479 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red128\green128\blue128;"); -- Color 15
480 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\red192\green192\blue192;}"); -- Color 16
481
482 -- Style sheet:
483 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\stylesheet");
484
485 if Output_Object.Page_Size = ARM_RTF.Ada95 or else
486 Output_Object.Page_Size = ARM_RTF.Half_Letter then
487 -- These are smaller page sizes than the other sizes.
488 -- ** TBD: Consider putting this into a separate parameter (there is
489 -- ** little reason for the font size to depend on the page size).
490 Set_Style (Paragraph_Info(ARM_Output.Normal, 0),
491 Font => ARM_Output.Default,
492 Body_Font => Output_Object.Body_Font,
493 Font_Size => 18,
494 Style_Indent => 0,
495 Style_Before => 0,
496 Style_After => 120,
497 Style_Justified => TRUE,
498 Style_String_Prefix =>
499 "\s0\widctlpar\adjustright",
500 Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext0 ");
501 Set_Style (Heading_1_Info,
502 Font => ARM_Output.Swiss,
503 Body_Font => Output_Object.Body_Font,
504 Font_Size => 28,
505 Style_Indent => 0,
506 Style_Before => 0,
507 Style_After => 210,
508 Style_Justified => FALSE,
509 Style_String_Prefix =>
510 "\s1\keepn\widctlpar\outlinelevel0\adjustright",
511 Style_String_Suffix => "\b\kerning28\qc\cgrid \sbasedon0 \snext0 ");
512 Set_Style (Heading_2_Info,
513 Font => ARM_Output.Swiss,
514 Body_Font => Output_Object.Body_Font,
515 Font_Size => 24,
516 Style_Indent => 0,
517 Style_Before => 240,
518 Style_After => 120,
519 Style_Justified => FALSE,
520 Style_String_Prefix =>
521 "\s2\keepn\widctlpar\outlinelevel1\adjustright",
522 Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
523 Set_Style (Heading_3_Info,
524 Font => ARM_Output.Swiss,
525 Body_Font => Output_Object.Body_Font,
526 Font_Size => 23,
527 Style_Indent => 0,
528 Style_Before => 210,
529 Style_After => 90,
530 Style_Justified => FALSE,
531 Style_String_Prefix =>
532 "\s3\keepn\widctlpar\outlinelevel2\adjustright",
533 Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
534 Set_Style (Category_Header_Info,
535 Font => ARM_Output.Default,
536 Body_Font => Output_Object.Body_Font,
537 Font_Size => 14,
538 Style_Indent => 0,
539 Style_Before => 100,
540 Style_After => 60,
541 Style_Justified => FALSE,
542 Style_String_Prefix =>
543 "\s4\keepn\adjustright",
544 Style_String_Suffix => "\cgrid\qc\i \snext0 ");
545 Set_Style (Normal_Paragraph_Number_Info,
546 Font => ARM_Output.Swiss,
547 Body_Font => Output_Object.Body_Font,
548 Font_Size => 12,
549 Style_Indent => 0,
550 Style_Before => 0,
551 Style_After => 0,
552 Style_Justified => FALSE,
553 Style_String_Prefix =>
554 "\s5\keepn\widctlpar\adjustright " &
555 "\pvpara\phpg\posxo\posy0\absw450\dxfrtext100\dfrmtxtx120\dfrmtxty120"&
556 "\cgrid\qc",
557 Style_String_Suffix => "\snext0 "); -- Note: We adjust the space before on use.
558 Set_Style (Wide_Paragraph_Number_Info,
559 Font => ARM_Output.Swiss,
560 Body_Font => Output_Object.Body_Font,
561 Font_Size => 12,
562 Style_Indent => 0,
563 Style_Before => 0,
564 Style_After => 0,
565 Style_Justified => FALSE,
566 Style_String_Prefix =>
567 "\s5\keepn\widctlpar\adjustright " &
568 "\pvpara\phpg\posxo\posy0\absw490\dxfrtext100\dfrmtxtx120\dfrmtxty120"&
569 "\cgrid\qc",
570 Style_String_Suffix => "\snext0 "); -- Note: We adjust the space before on use.
571 Set_Style (Paragraph_Info(ARM_Output.Small, 1), -- Notes
572 Font => ARM_Output.Default,
573 Body_Font => Output_Object.Body_Font,
574 Font_Size => 15,
575 Style_Indent => INDENT_UNIT*1,
576 Style_Before => 0,
577 Style_After => 90,
578 Style_Justified => TRUE,
579 Style_String_Prefix =>
580 "\s6\widctlpar\adjustright",
581 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext6 ");
582 Set_Style (Paragraph_Info(ARM_Output.Small, 2), -- Annotations
583 Font => ARM_Output.Default,
584 Body_Font => Output_Object.Body_Font,
585 Font_Size => 15,
586 Style_Indent => INDENT_UNIT*2,
587 Style_Before => 0,
588 Style_After => 90,
589 Style_Justified => TRUE,
590 Style_String_Prefix =>
591 "\s7\widctlpar\adjustright",
592 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext7 ");
593 Set_Style (Paragraph_Info(ARM_Output.Examples, 1),
594 Font => ARM_Output.Fixed,
595 Body_Font => Output_Object.Body_Font,
596 Font_Size => 16,
597 Style_Indent => INDENT_UNIT*1,
598 Style_Before => 0,
599 Style_After => 80,
600 Style_Justified => FALSE,
601 Style_String_Prefix =>
602 "\s8\widctlpar\adjustright",
603 Style_String_Suffix => "\cgrid\sl-160\ql \snext8 ");
604 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 3),
605 Font => ARM_Output.Fixed,
606 Body_Font => Output_Object.Body_Font,
607 Font_Size => 14,
608 Style_Indent => INDENT_UNIT*3,
609 Style_Before => 0,
610 Style_After => 70,
611 Style_Justified => FALSE,
612 Style_String_Prefix =>
613 "\s9\widctlpar\adjustright",
614 Style_String_Suffix => "\cgrid\sl-140\ql \snext9 ");
615 Set_Style (Paragraph_Info(ARM_Output.Normal, 1), -- Syntax indent
616 Font => ARM_Output.Default,
617 Body_Font => Output_Object.Body_Font,
618 Font_Size => 18,
619 Style_Indent => INDENT_UNIT*1,
620 Style_Before => 0,
621 Style_After => 80,
622 Style_Justified => FALSE,
623 Style_String_Prefix =>
624 "\s10\widctlpar\adjustright",
625 Style_String_Suffix => "\cgrid\ql\sl-200 \snext10 ");
626 -- Note: Narrower space between and afterwards.
627 Set_Style (Paragraph_Info(ARM_Output.Normal, 3), -- Regular indent
628 Font => ARM_Output.Default,
629 Body_Font => Output_Object.Body_Font,
630 Font_Size => 18,
631 Style_Indent => INDENT_UNIT*3,
632 Style_Before => 0,
633 Style_After => 120,
634 Style_Justified => TRUE,
635 Style_String_Prefix =>
636 "\s11\widctlpar\adjustright",
637 Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext11 ");
638 Set_Style (Paragraph_Info(ARM_Output.Small, 5), -- Regular annotation indent
639 Font => ARM_Output.Default,
640 Body_Font => Output_Object.Body_Font,
641 Font_Size => 15,
642 Style_Indent => INDENT_UNIT*5,
643 Style_Before => 0,
644 Style_After => 90,
645 Style_Justified => TRUE,
646 Style_String_Prefix =>
647 "\s12\widctlpar\adjustright",
648 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext12 ");
649 Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 3),
650 Font => ARM_Output.Default,
651 Body_Font => Output_Object.Body_Font,
652 Font_Size => 18,
653 Style_Indent => INDENT_UNIT*3,
654 Style_Hang_Width => 1080,
655 Style_Before => 0,
656 Style_After => 100,
657 Style_Justified => TRUE,
658 Style_String_Prefix =>
659 "\s13\widctlpar\adjustright",
660 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext13 ");
661 -- Note: Narrower space between and afterwards.
662 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 1),
663 Font => ARM_Output.Default,
664 Body_Font => Output_Object.Body_Font,
665 Font_Size => 18,
666 Style_Indent => INDENT_UNIT*1,
667 Style_Hang_Width => 360,
668 Style_Before => 0,
669 Style_After => 100,
670 Style_Justified => TRUE,
671 Style_String_Prefix =>
672 "\s14\widctlpar\adjustright",
673 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext14 ");
674 -- Note: Narrower space between and afterwards.
675 Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5),
676 Font => ARM_Output.Default,
677 Body_Font => Output_Object.Body_Font,
678 Font_Size => 15,
679 Style_Indent => INDENT_UNIT*5,
680 Style_Hang_Width => 1080,
681 Style_Before => 0,
682 Style_After => 80,
683 Style_Justified => TRUE,
684 Style_String_Prefix =>
685 "\s15\widctlpar\adjustright",
686 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext15 ");
687 -- Note: Narrower space between and afterwards.
688 Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3),
689 Font => ARM_Output.Default,
690 Body_Font => Output_Object.Body_Font,
691 Font_Size => 15,
692 Style_Indent => INDENT_UNIT*3,
693 Style_Hang_Width => 360,
694 Style_Before => 0,
695 Style_After => 80,
696 Style_Justified => TRUE,
697 Style_String_Prefix =>
698 "\s16\widctlpar\adjustright",
699 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext16 ");
700 -- Note: Narrower space between and afterwards.
701 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 1),
702 Font => ARM_Output.Default,
703 Body_Font => Output_Object.Body_Font,
704 Font_Size => 18,
705 Style_Indent => INDENT_UNIT*1,
706 Style_Hang_Width => 240,
707 Style_Before => 0,
708 Style_After => 100,
709 Style_Justified => TRUE,
710 Style_String_Prefix =>
711 "\s17\widctlpar\adjustright",
712 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext17 ");
713 -- Note: Narrower space between and afterwards.
714 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 2),
715 Font => ARM_Output.Default,
716 Body_Font => Output_Object.Body_Font,
717 Font_Size => 18,
718 Style_Indent => INDENT_UNIT*2,
719 Style_Hang_Width => 220,
720 Style_Before => 0,
721 Style_After => 100,
722 Style_Justified => TRUE,
723 Style_String_Prefix =>
724 "\s18\widctlpar\adjustright",
725 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext18 ");
726 -- Note: Narrower space between and afterwards.
727 Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 3),
728 Font => ARM_Output.Default,
729 Body_Font => Output_Object.Body_Font,
730 Font_Size => 15,
731 Style_Indent => INDENT_UNIT*3,
732 Style_Hang_Width => 220,
733 Style_Before => 0,
734 Style_After => 80,
735 Style_Justified => TRUE,
736 Style_String_Prefix =>
737 "\s19\widctlpar\adjustright",
738 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext19 ");
739 -- Note: Narrower space between and afterwards.
740 Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4),
741 Font => ARM_Output.Default,
742 Body_Font => Output_Object.Body_Font,
743 Font_Size => 15,
744 Style_Indent => INDENT_UNIT*4,
745 Style_Hang_Width => 200,
746 Style_Before => 0,
747 Style_After => 80,
748 Style_Justified => TRUE,
749 Style_String_Prefix =>
750 "\s20\widctlpar\adjustright",
751 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1440 \snext20 ");
752 -- Note: Narrower space between and afterwards.
753 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 4), -- Indented bullets
754 Font => ARM_Output.Default,
755 Body_Font => Output_Object.Body_Font,
756 Font_Size => 18,
757 Style_Indent => INDENT_UNIT*4,
758 Style_Hang_Width => 240,
759 Style_Before => 0,
760 Style_After => 100,
761 Style_Justified => TRUE,
762 Style_String_Prefix =>
763 "\s21\widctlpar\adjustright",
764 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext21 ");
765 -- Note: Narrower space between and afterwards.
766 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 2), -- Syntax indent bullets
767 Font => ARM_Output.Default,
768 Body_Font => Output_Object.Body_Font,
769 Font_Size => 18,
770 Style_Indent => INDENT_UNIT*2,
771 Style_Hang_Width => 240,
772 Style_Before => 0,
773 Style_After => 80,
774 Style_Justified => TRUE,
775 Style_String_Prefix =>
776 "\s22\widctlpar\adjustright",
777 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext22 ");
778 -- Note: Narrower space between and afterwards.
779 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 3), -- Code indented bullets
780 Font => ARM_Output.Default,
781 Body_Font => Output_Object.Body_Font,
782 Font_Size => 18,
783 Style_Indent => INDENT_UNIT*3,
784 Style_Hang_Width => 240,
785 Style_Before => 0,
786 Style_After => 100,
787 Style_Justified => TRUE,
788 Style_String_Prefix =>
789 "\s23\widctlpar\adjustright",
790 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext23 ");
791 -- Note: Narrower space between and afterwards.
792 Set_Style (Paragraph_Info(ARM_Output.Normal, 2), -- Code indented
793 Font => ARM_Output.Default,
794 Body_Font => Output_Object.Body_Font,
795 Font_Size => 18,
796 Style_Indent => INDENT_UNIT*2,
797 Style_Before => 0,
798 Style_After => 120,
799 Style_Justified => TRUE,
800 Style_String_Prefix =>
801 "\s24\widctlpar\adjustright",
802 Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext24 ");
803 Set_Style (Paragraph_Info(ARM_Output.Small, 4), -- Code indented annotations.
804 Font => ARM_Output.Default,
805 Body_Font => Output_Object.Body_Font,
806 Font_Size => 15,
807 Style_Indent => INDENT_UNIT*4,
808 Style_Before => 0,
809 Style_After => 90,
810 Style_Justified => TRUE,
811 Style_String_Prefix =>
812 "\s25\widctlpar\adjustright",
813 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext25 ");
814 Set_Style (Paragraph_Info(ARM_Output.Examples, 4), -- Indented examples
815 Font => ARM_Output.Fixed,
816 Body_Font => Output_Object.Body_Font,
817 Font_Size => 16,
818 Style_Indent => INDENT_UNIT*4,
819 Style_Before => 0,
820 Style_After => 80,
821 Style_Justified => FALSE,
822 Style_String_Prefix =>
823 "\s26\widctlpar\adjustright",
824 Style_String_Suffix => "\cgrid\ql\sl-160 \snext26 ");
825 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 6), -- Indented annotation examples.
826 Font => ARM_Output.Fixed,
827 Body_Font => Output_Object.Body_Font,
828 Font_Size => 14,
829 Style_Indent => INDENT_UNIT*6,
830 Style_Before => 0,
831 Style_After => 70,
832 Style_Justified => FALSE,
833 Style_String_Prefix =>
834 "\s27\widctlpar\adjustright",
835 Style_String_Suffix => "\cgrid\ql\sl-140 \snext27 ");
836
837 Set_Style (Header_Info,
838 Font => ARM_Output.Default,
839 Body_Font => Output_Object.Body_Font,
840 Font_Size => 17,
841 Style_Indent => 0,
842 Style_Before => 0,
843 Style_After => 0,
844 Style_Justified => FALSE,
845 Style_String_Prefix =>
846 "\s28\widctlpar\tqc\tx" & Half_Paper_Width &
847 "\tqr\tx" & Paper_Width & "\adjustright",
848 Style_String_Suffix => "\cgrid \sbasedon0 \snext28 ");
849 Set_Style (Footer_Info,
850 Font => ARM_Output.Default,
851 Body_Font => Output_Object.Body_Font,
852 Font_Size => 17,
853 Style_Indent => 0,
854 Style_Before => 0,
855 Style_After => 0,
856 Style_Justified => FALSE,
857 Style_String_Prefix =>
858 "\s29\widctlpar" & -- "\tqc\tx" & Half_Paper_Width & -- We don't use or define the center tab; it causes problems with very long titles.
859 "\tqr\tx" & Paper_Width & "\adjustright",
860 Style_String_Suffix => "\cgrid \sbasedon0 \snext29 ");
861 Set_Style (Paragraph_Info(ARM_Output.Index, 0),
862 Font => ARM_Output.Default,
863 Body_Font => Output_Object.Body_Font,
864 Font_Size => 15,
865 Style_Indent => 225,
866 Style_Hang_Width => 225,
867 Style_Before => 0,
868 Style_After => 0,
869 Style_Justified => FALSE,
870 Style_String_Prefix =>
871 "\s31\widctlpar\adjustright",
872 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext31 ");
873 Set_Style (Paragraph_Info(ARM_Output.Wide_Above, 0),
874 Font => ARM_Output.Default,
875 Body_Font => Output_Object.Body_Font,
876 Font_Size => 18,
877 Style_Indent => 0,
878 Style_Before => 120,
879 Style_After => 120,
880 Style_Justified => TRUE,
881 Style_String_Prefix =>
882 "\s32\widctlpar\adjustright",
883 Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext0 ");
884 Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Above, 2), -- Wide above annotations.
885 Font => ARM_Output.Default,
886 Body_Font => Output_Object.Body_Font,
887 Font_Size => 15,
888 Style_Indent => INDENT_UNIT*2,
889 Style_Before => 90,
890 Style_After => 90,
891 Style_Justified => TRUE,
892 Style_String_Prefix =>
893 "\s33\widctlpar\adjustright",
894 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext7 ");
895 Set_Style (Paragraph_Info(ARM_Output.Small_Header, 1), -- Notes header
896 Font => ARM_Output.Default,
897 Body_Font => Output_Object.Body_Font,
898 Font_Size => 15,
899 Style_Indent => INDENT_UNIT*1,
900 Style_Before => 0,
901 Style_After => 0,
902 Style_Justified => TRUE,
903 Style_String_Prefix =>
904 "\s34\widctlpar\adjustright",
905 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext6 ");
906 -- Note: No extra space afterwards.
907 Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 2), -- Bullets in notes
908 Font => ARM_Output.Default,
909 Body_Font => Output_Object.Body_Font,
910 Font_Size => 15,
911 Style_Indent => INDENT_UNIT*2,
912 Style_Hang_Width => 240,
913 Style_Before => 0,
914 Style_After => 60,
915 Style_Justified => TRUE,
916 Style_String_Prefix =>
917 "\s35\widctlpar\adjustright",
918 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx720 \snext35 ");
919 -- Note: Narrower space between and afterwards.
920 Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3), -- Nested bullets in notes
921 Font => ARM_Output.Default,
922 Body_Font => Output_Object.Body_Font,
923 Font_Size => 15,
924 Style_Indent => INDENT_UNIT*3,
925 Style_Hang_Width => 230,
926 Style_Before => 0,
927 Style_After => 60,
928 Style_Justified => TRUE,
929 Style_String_Prefix =>
930 "\s36\widctlpar\adjustright",
931 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext36 ");
932 -- Note: Narrower space between and afterwards.
933 Set_Style (Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3),
934 Font => ARM_Output.Default,
935 Body_Font => Output_Object.Body_Font,
936 Font_Size => 18,
937 Style_Indent => INDENT_UNIT*3,
938 Style_Hang_Width => 720,
939 Style_Before => 0,
940 Style_After => 100,
941 Style_Justified => TRUE,
942 Style_String_Prefix =>
943 "\s37\widctlpar\adjustright",
944 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0 \snext14 ");
945 -- Note: Narrower space between and afterwards.
946 Set_Style (Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5),
947 Font => ARM_Output.Default,
948 Body_Font => Output_Object.Body_Font,
949 Font_Size => 15,
950 Style_Indent => INDENT_UNIT*5,
951 Style_Hang_Width => 720,
952 Style_Before => 0,
953 Style_After => 80,
954 Style_Justified => TRUE,
955 Style_String_Prefix =>
956 "\s38\widctlpar\adjustright",
957 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0 \snext16 ");
958 -- Note: Narrower space between and afterwards.
959 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 4), -- Code indent nested bullets
960 Font => ARM_Output.Default,
961 Body_Font => Output_Object.Body_Font,
962 Font_Size => 18,
963 Style_Indent => INDENT_UNIT*4,
964 Style_Hang_Width => 220,
965 Style_Before => 0,
966 Style_After => 100,
967 Style_Justified => TRUE,
968 Style_String_Prefix =>
969 "\s39\widctlpar\adjustright",
970 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1440 \snext39 ");
971 -- Note: Narrower space between and afterwards.
972 Set_Style (Paragraph_Info(ARM_Output.Syntax_Summary, 1),
973 Font => ARM_Output.Default,
974 Body_Font => Output_Object.Body_Font,
975 Font_Size => 15,
976 Style_Indent => INDENT_UNIT*1,
977 Style_Before => 0,
978 Style_After => 65,
979 Style_Justified => FALSE,
980 Style_String_Prefix =>
981 "\s40\widctlpar\adjustright",
982 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext40 ");
983 -- Note: Narrower space between and afterwards.
984 Set_Style (Paragraph_Info(ARM_Output.Enumerated, 1),
985 Font => ARM_Output.Default,
986 Body_Font => Output_Object.Body_Font,
987 Font_Size => 18,
988 Style_Indent => INDENT_UNIT*1,
989 Style_Hang_Width => 240,
990 Style_Before => 0,
991 Style_After => 100,
992 Style_Justified => TRUE,
993 Style_String_Prefix =>
994 "\s41\widctlpar\adjustright",
995 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext41 ");
996 -- Note: Narrower space between and afterwards.
997 Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 3),
998 Font => ARM_Output.Default,
999 Body_Font => Output_Object.Body_Font,
1000 Font_Size => 15,
1001 Style_Indent => INDENT_UNIT*3,
1002 Style_Hang_Width => 220,
1003 Style_Before => 0,
1004 Style_After => 80,
1005 Style_Justified => TRUE,
1006 Style_String_Prefix =>
1007 "\s42\widctlpar\adjustright",
1008 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext42 ");
1009 -- Note: Narrower space between and afterwards.
1010 Set_Style (Paragraph_Info(ARM_Output.Enumerated, 2),
1011 Font => ARM_Output.Default,
1012 Body_Font => Output_Object.Body_Font,
1013 Font_Size => 18,
1014 Style_Indent => INDENT_UNIT*2,
1015 Style_Hang_Width => 260,
1016 Style_Before => 0,
1017 Style_After => 100,
1018 Style_Justified => TRUE,
1019 Style_String_Prefix =>
1020 "\s43\widctlpar\adjustright",
1021 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext43 ");
1022 -- Note: Narrower space between and afterwards.
1023 Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 4),
1024 Font => ARM_Output.Default,
1025 Body_Font => Output_Object.Body_Font,
1026 Font_Size => 15,
1027 Style_Indent => INDENT_UNIT*4,
1028 Style_Hang_Width => 240,
1029 Style_Before => 0,
1030 Style_After => 80,
1031 Style_Justified => TRUE,
1032 Style_String_Prefix =>
1033 "\s44\widctlpar\adjustright",
1034 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext44 ");
1035 -- Note: Narrower space between and afterwards.
1036 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 3), -- Doubly nested bullets
1037 Font => ARM_Output.Default,
1038 Body_Font => Output_Object.Body_Font,
1039 Font_Size => 18,
1040 Style_Indent => INDENT_UNIT*3,
1041 Style_Hang_Width => 220,
1042 Style_Before => 0,
1043 Style_After => 100,
1044 Style_Justified => TRUE,
1045 Style_String_Prefix =>
1046 "\s45\widctlpar\adjustright",
1047 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx720 \snext45 ");
1048 -- Note: Narrower space between and afterwards.
1049 Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5), -- Doubly nested bullets
1050 Font => ARM_Output.Default,
1051 Body_Font => Output_Object.Body_Font,
1052 Font_Size => 15,
1053 Style_Indent => INDENT_UNIT*5,
1054 Style_Hang_Width => 200,
1055 Style_Before => 0,
1056 Style_After => 80,
1057 Style_Justified => TRUE,
1058 Style_String_Prefix =>
1059 "\s46\widctlpar\adjustright",
1060 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1440 \snext46 ");
1061 -- Note: Narrower space between and afterwards.
1062 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 5), -- Indented nested bullets.
1063 Font => ARM_Output.Default,
1064 Body_Font => Output_Object.Body_Font,
1065 Font_Size => 18,
1066 Style_Indent => INDENT_UNIT*5,
1067 Style_Hang_Width => 240,
1068 Style_Before => 0,
1069 Style_After => 100,
1070 Style_Justified => TRUE,
1071 Style_String_Prefix =>
1072 "\s47\widctlpar\adjustright",
1073 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx1080 \snext47 ");
1074 -- Note: Narrower space between and afterwards.
1075 Set_Style (Paragraph_Info(ARM_Output.Normal, 4), -- Inner indented
1076 Font => ARM_Output.Default,
1077 Body_Font => Output_Object.Body_Font,
1078 Font_Size => 18,
1079 Style_Indent => INDENT_UNIT*4,
1080 Style_Before => 0,
1081 Style_After => 120,
1082 Style_Justified => TRUE,
1083 Style_String_Prefix =>
1084 "\s48\widctlpar\adjustright",
1085 Style_String_Suffix => "\cgrid\qj\sl-220\slmult0 \snext48 ");
1086 Set_Style (Paragraph_Info(ARM_Output.Small, 6), -- Inner indented
1087 Font => ARM_Output.Default,
1088 Body_Font => Output_Object.Body_Font,
1089 Font_Size => 15,
1090 Style_Indent => INDENT_UNIT*6,
1091 Style_Before => 0,
1092 Style_After => 90,
1093 Style_Justified => TRUE,
1094 Style_String_Prefix =>
1095 "\s49\widctlpar\adjustright",
1096 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext49 ");
1097 Set_Style (Paragraph_Info(ARM_Output.Small, 3), -- Annotations in syntax indentation
1098 Font => ARM_Output.Default,
1099 Body_Font => Output_Object.Body_Font,
1100 Font_Size => 15,
1101 Style_Indent => INDENT_UNIT*3,
1102 Style_Before => 0,
1103 Style_After => 90,
1104 Style_Justified => TRUE,
1105 Style_String_Prefix =>
1106 "\s50\widctlpar\adjustright",
1107 Style_String_Suffix => "\cgrid\qj\sl-180\slmult0 \snext50 ");
1108 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 1),
1109 Font => ARM_Output.Swiss,
1110 Body_Font => Output_Object.Body_Font,
1111 Font_Size => 16,
1112 Style_Indent => INDENT_UNIT*1,
1113 Style_Before => 0,
1114 Style_After => 80,
1115 Style_Justified => FALSE,
1116 Style_String_Prefix =>
1117 "\s51\widctlpar\adjustright",
1118 Style_String_Suffix => "\cgrid\sl-180\ql \snext51 ");
1119 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3),
1120 Font => ARM_Output.Swiss,
1121 Body_Font => Output_Object.Body_Font,
1122 Font_Size => 14,
1123 Style_Indent => INDENT_UNIT*3,
1124 Style_Before => 0,
1125 Style_After => 70,
1126 Style_Justified => FALSE,
1127 Style_String_Prefix =>
1128 "\s52\widctlpar\adjustright",
1129 Style_String_Suffix => "\cgrid\sl-160\ql \snext52 ");
1130 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 4), -- Indented
1131 Font => ARM_Output.Swiss,
1132 Body_Font => Output_Object.Body_Font,
1133 Font_Size => 16,
1134 Style_Indent => INDENT_UNIT*4,
1135 Style_Before => 0,
1136 Style_After => 80,
1137 Style_Justified => FALSE,
1138 Style_String_Prefix =>
1139 "\s53\widctlpar\adjustright",
1140 Style_String_Suffix => "\cgrid\ql\sl-180 \snext53 ");
1141 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6), -- Indented
1142 Font => ARM_Output.Swiss,
1143 Body_Font => Output_Object.Body_Font,
1144 Font_Size => 14,
1145 Style_Indent => INDENT_UNIT*6,
1146 Style_Before => 0,
1147 Style_After => 70,
1148 Style_Justified => FALSE,
1149 Style_String_Prefix =>
1150 "\s54\widctlpar\adjustright",
1151 Style_String_Suffix => "\cgrid\ql\sl-160 \snext54 ");
1152 Set_Style (Paragraph_Info(ARM_Output.Enumerated, 3), -- Doubly nested enumerations
1153 Font => ARM_Output.Default,
1154 Body_Font => Output_Object.Body_Font,
1155 Font_Size => 18,
1156 Style_Indent => INDENT_UNIT*3,
1157 Style_Hang_Width => 260,
1158 Style_Before => 0,
1159 Style_After => 100,
1160 Style_Justified => TRUE,
1161 Style_String_Prefix =>
1162 "\s55\widctlpar\adjustright",
1163 Style_String_Suffix => "\ri360\cgrid\qj\sl-200\slmult0\tx360 \snext43 ");
1164 -- Note: Narrower space between and afterwards.
1165 Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 5), -- Doubly nested enumerations
1166 Font => ARM_Output.Default,
1167 Body_Font => Output_Object.Body_Font,
1168 Font_Size => 15,
1169 Style_Indent => INDENT_UNIT*5,
1170 Style_Hang_Width => 240,
1171 Style_Before => 0,
1172 Style_After => 80,
1173 Style_Justified => TRUE,
1174 Style_String_Prefix =>
1175 "\s56\widctlpar\adjustright",
1176 Style_String_Suffix => "\ri360\cgrid\qj\sl-170\slmult0\tx1080 \snext56 ");
1177 -- Note: Narrower space between and afterwards.
1178 Set_Style (Paragraph_Info(ARM_Output.Examples, 2), -- Syntax Indented examples
1179 Font => ARM_Output.Fixed,
1180 Body_Font => Output_Object.Body_Font,
1181 Font_Size => 16,
1182 Style_Indent => INDENT_UNIT*2,
1183 Style_Before => 0,
1184 Style_After => 80,
1185 Style_Justified => FALSE,
1186 Style_String_Prefix =>
1187 "\s57\widctlpar\adjustright",
1188 Style_String_Suffix => "\cgrid\ql\sl-160 \snext57 ");
1189 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 4), -- Syntax Indented annotation examples.
1190 Font => ARM_Output.Fixed,
1191 Body_Font => Output_Object.Body_Font,
1192 Font_Size => 14,
1193 Style_Indent => INDENT_UNIT*4,
1194 Style_Before => 0,
1195 Style_After => 70,
1196 Style_Justified => FALSE,
1197 Style_String_Prefix =>
1198 "\s58\widctlpar\adjustright",
1199 Style_String_Suffix => "\cgrid\ql\sl-140 \snext58 ");
1200 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 2), -- Syntax Indented
1201 Font => ARM_Output.Swiss,
1202 Body_Font => Output_Object.Body_Font,
1203 Font_Size => 16,
1204 Style_Indent => INDENT_UNIT*2,
1205 Style_Before => 0,
1206 Style_After => 80,
1207 Style_Justified => FALSE,
1208 Style_String_Prefix =>
1209 "\s59\widctlpar\adjustright",
1210 Style_String_Suffix => "\cgrid\ql\sl-180 \snext59 ");
1211 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4), -- Syntax Indented
1212 Font => ARM_Output.Swiss,
1213 Body_Font => Output_Object.Body_Font,
1214 Font_Size => 14,
1215 Style_Indent => INDENT_UNIT*4,
1216 Style_Before => 0,
1217 Style_After => 70,
1218 Style_Justified => FALSE,
1219 Style_String_Prefix =>
1220 "\s60\widctlpar\adjustright",
1221 Style_String_Suffix => "\cgrid\ql\sl-160 \snext60 ");
1222 Set_Style (Paragraph_Info(ARM_Output.Examples, 3), -- Code Indented examples
1223 Font => ARM_Output.Fixed,
1224 Body_Font => Output_Object.Body_Font,
1225 Font_Size => 16,
1226 Style_Indent => INDENT_UNIT*3,
1227 Style_Before => 0,
1228 Style_After => 80,
1229 Style_Justified => FALSE,
1230 Style_String_Prefix =>
1231 "\s61\widctlpar\adjustright",
1232 Style_String_Suffix => "\cgrid\ql\sl-160 \snext61 ");
1233 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 5), -- Code Indented annotation examples.
1234 Font => ARM_Output.Fixed,
1235 Body_Font => Output_Object.Body_Font,
1236 Font_Size => 14,
1237 Style_Indent => INDENT_UNIT*5,
1238 Style_Before => 0,
1239 Style_After => 70,
1240 Style_Justified => FALSE,
1241 Style_String_Prefix =>
1242 "\s62\widctlpar\adjustright",
1243 Style_String_Suffix => "\cgrid\ql\sl-140 \snext62 ");
1244 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 3), -- Code Indented
1245 Font => ARM_Output.Swiss,
1246 Body_Font => Output_Object.Body_Font,
1247 Font_Size => 16,
1248 Style_Indent => INDENT_UNIT*3,
1249 Style_Before => 0,
1250 Style_After => 80,
1251 Style_Justified => FALSE,
1252 Style_String_Prefix =>
1253 "\s63\widctlpar\adjustright",
1254 Style_String_Suffix => "\cgrid\ql\sl-180 \snext63 ");
1255 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5), -- Code Indented
1256 Font => ARM_Output.Swiss,
1257 Body_Font => Output_Object.Body_Font,
1258 Font_Size => 14,
1259 Style_Indent => INDENT_UNIT*5,
1260 Style_Before => 0,
1261 Style_After => 70,
1262 Style_Justified => FALSE,
1263 Style_String_Prefix =>
1264 "\s64\widctlpar\adjustright",
1265 Style_String_Suffix => "\cgrid\ql\sl-160 \snext64 ");
1266 Set_Style (Paragraph_Info(ARM_Output.Title, 0),
1267 Font => ARM_Output.Default,
1268 Body_Font => Output_Object.Body_Font,
1269 Font_Size => 34, -- Slightly less than double.
1270 Style_Indent => 0,
1271 Style_Before => 120,
1272 Style_After => 120,
1273 Style_Justified => TRUE,
1274 Style_String_Prefix =>
1275 "\s65\widctlpar\adjustright",
1276 Style_String_Suffix => "\cgrid\qj\sl-360\slmult0 \snext0 ");
1277 Set_Style (Paragraph_Info(ARM_Output.Giant_Hanging, 4),
1278 Font => ARM_Output.Default,
1279 Body_Font => Output_Object.Body_Font,
1280 Font_Size => 18,
1281 Style_Indent => INDENT_UNIT*4,
1282 Style_Hang_Width => 1440,
1283 Style_Before => 0,
1284 Style_After => 100,
1285 Style_Justified => TRUE,
1286 Style_String_Prefix =>
1287 "\s66\widctlpar\adjustright",
1288 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext66 ");
1289 -- Note: Narrower space between and afterwards.
1290 Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 2),
1291 Font => ARM_Output.Default,
1292 Body_Font => Output_Object.Body_Font,
1293 Font_Size => 18,
1294 Style_Indent => INDENT_UNIT*2,
1295 Style_Hang_Width => 720,
1296 Style_Before => 0,
1297 Style_After => 100,
1298 Style_Justified => TRUE,
1299 Style_String_Prefix =>
1300 "\s67\widctlpar\adjustright",
1301 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext67 ");
1302 -- Note: Narrower space between and afterwards.
1303 Set_Style (Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6),
1304 Font => ARM_Output.Default,
1305 Body_Font => Output_Object.Body_Font,
1306 Font_Size => 15,
1307 Style_Indent => INDENT_UNIT*6,
1308 Style_Hang_Width => 1440,
1309 Style_Before => 0,
1310 Style_After => 80,
1311 Style_Justified => TRUE,
1312 Style_String_Prefix =>
1313 "\s68\widctlpar\adjustright",
1314 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext68 ");
1315 -- Note: Narrower space between and afterwards.
1316 Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4),
1317 Font => ARM_Output.Default,
1318 Body_Font => Output_Object.Body_Font,
1319 Font_Size => 15,
1320 Style_Indent => INDENT_UNIT*4,
1321 Style_Hang_Width => 720,
1322 Style_Before => 0,
1323 Style_After => 80,
1324 Style_Justified => TRUE,
1325 Style_String_Prefix =>
1326 "\s69\widctlpar\adjustright",
1327 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext69 ");
1328 -- Note: Narrower space between and afterwards.
1329
1330 -- The following are indented one extra level:
1331 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 2),
1332 Font => ARM_Output.Default,
1333 Body_Font => Output_Object.Body_Font,
1334 Font_Size => 18,
1335 Style_Indent => INDENT_UNIT*2,
1336 Style_Hang_Width => 360,
1337 Style_Before => 0,
1338 Style_After => 100,
1339 Style_Justified => TRUE,
1340 Style_String_Prefix =>
1341 "\s70\widctlpar\adjustright",
1342 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext70 ");
1343 -- Note: Narrower space between and afterwards.
1344 Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 3),
1345 Font => ARM_Output.Default,
1346 Body_Font => Output_Object.Body_Font,
1347 Font_Size => 18,
1348 Style_Indent => INDENT_UNIT*3,
1349 Style_Hang_Width => 720,
1350 Style_Before => 0,
1351 Style_After => 100,
1352 Style_Justified => TRUE,
1353 Style_String_Prefix =>
1354 "\s71\widctlpar\adjustright",
1355 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext71 ");
1356 -- Note: Narrower space between and afterwards.
1357 Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 4),
1358 Font => ARM_Output.Default,
1359 Body_Font => Output_Object.Body_Font,
1360 Font_Size => 18,
1361 Style_Indent => INDENT_UNIT*4,
1362 Style_Hang_Width => 1080,
1363 Style_Before => 0,
1364 Style_After => 100,
1365 Style_Justified => TRUE,
1366 Style_String_Prefix =>
1367 "\s72\widctlpar\adjustright",
1368 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext72 ");
1369 -- Note: Narrower space between and afterwards.
1370 Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4),
1371 Font => ARM_Output.Default,
1372 Body_Font => Output_Object.Body_Font,
1373 Font_Size => 15,
1374 Style_Indent => INDENT_UNIT*4,
1375 Style_Hang_Width => 360,
1376 Style_Before => 0,
1377 Style_After => 80,
1378 Style_Justified => TRUE,
1379 Style_String_Prefix =>
1380 "\s73\widctlpar\adjustright",
1381 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext73 ");
1382 -- Note: Narrower space between and afterwards.
1383 Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5),
1384 Font => ARM_Output.Default,
1385 Body_Font => Output_Object.Body_Font,
1386 Font_Size => 15,
1387 Style_Indent => INDENT_UNIT*5,
1388 Style_Hang_Width => 720,
1389 Style_Before => 0,
1390 Style_After => 80,
1391 Style_Justified => TRUE,
1392 Style_String_Prefix =>
1393 "\s74\widctlpar\adjustright",
1394 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext74 ");
1395 -- Note: Narrower space between and afterwards.
1396 Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6),
1397 Font => ARM_Output.Default,
1398 Body_Font => Output_Object.Body_Font,
1399 Font_Size => 15,
1400 Style_Indent => INDENT_UNIT*6,
1401 Style_Hang_Width => 1080,
1402 Style_Before => 0,
1403 Style_After => 80,
1404 Style_Justified => TRUE,
1405 Style_String_Prefix =>
1406 "\s75\widctlpar\adjustright",
1407 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext75 ");
1408 -- Note: Narrower space between and afterwards.
1409
1410 -- The following are indented two extra levels:
1411 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 3),
1412 Font => ARM_Output.Default,
1413 Body_Font => Output_Object.Body_Font,
1414 Font_Size => 18,
1415 Style_Indent => INDENT_UNIT*3,
1416 Style_Hang_Width => 360,
1417 Style_Before => 0,
1418 Style_After => 100,
1419 Style_Justified => TRUE,
1420 Style_String_Prefix =>
1421 "\s76\widctlpar\adjustright",
1422 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext76 ");
1423 -- Note: Narrower space between and afterwards.
1424 Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 4),
1425 Font => ARM_Output.Default,
1426 Body_Font => Output_Object.Body_Font,
1427 Font_Size => 18,
1428 Style_Indent => INDENT_UNIT*4,
1429 Style_Hang_Width => 720,
1430 Style_Before => 0,
1431 Style_After => 100,
1432 Style_Justified => TRUE,
1433 Style_String_Prefix =>
1434 "\s77\widctlpar\adjustright",
1435 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext77 ");
1436 -- Note: Narrower space between and afterwards.
1437 Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5),
1438 Font => ARM_Output.Default,
1439 Body_Font => Output_Object.Body_Font,
1440 Font_Size => 15,
1441 Style_Indent => INDENT_UNIT*5,
1442 Style_Hang_Width => 360,
1443 Style_Before => 0,
1444 Style_After => 80,
1445 Style_Justified => TRUE,
1446 Style_String_Prefix =>
1447 "\s78\widctlpar\adjustright",
1448 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext78 ");
1449 -- Note: Narrower space between and afterwards.
1450 Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6),
1451 Font => ARM_Output.Default,
1452 Body_Font => Output_Object.Body_Font,
1453 Font_Size => 15,
1454 Style_Indent => INDENT_UNIT*6,
1455 Style_Hang_Width => 720,
1456 Style_Before => 0,
1457 Style_After => 80,
1458 Style_Justified => TRUE,
1459 Style_String_Prefix =>
1460 "\s79\widctlpar\adjustright",
1461 Style_String_Suffix => "\cgrid\qj\sl-170\slmult0 \snext79 ");
1462 -- Note: Narrower space between and afterwards.
1463
1464 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 2), -- Notes indent
1465 Font => ARM_Output.Fixed,
1466 Body_Font => Output_Object.Body_Font,
1467 Font_Size => 14,
1468 Style_Indent => INDENT_UNIT*2,
1469 Style_Before => 0,
1470 Style_After => 70,
1471 Style_Justified => FALSE,
1472 Style_String_Prefix =>
1473 "\s80\widctlpar\adjustright",
1474 Style_String_Suffix => "\cgrid\sl-140\ql \snext80 ");
1475 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1),
1476 Font => ARM_Output.Swiss,
1477 Body_Font => Output_Object.Body_Font,
1478 Font_Size => 14,
1479 Style_Indent => INDENT_UNIT*1,
1480 Style_Before => 0,
1481 Style_After => 70,
1482 Style_Justified => FALSE,
1483 Style_String_Prefix =>
1484 "\s81\widctlpar\adjustright",
1485 Style_String_Suffix => "\cgrid\sl-160\ql \snext81 ");
1486 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2),
1487 Font => ARM_Output.Swiss,
1488 Body_Font => Output_Object.Body_Font,
1489 Font_Size => 14,
1490 Style_Indent => INDENT_UNIT*1,
1491 Style_Before => 0,
1492 Style_After => 70,
1493 Style_Justified => FALSE,
1494 Style_String_Prefix =>
1495 "\s82\widctlpar\adjustright",
1496 Style_String_Suffix => "\cgrid\sl-160\ql \snext82 ");
1497 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 1),
1498 Font => ARM_Output.Fixed,
1499 Body_Font => Output_Object.Body_Font,
1500 Font_Size => 14,
1501 Style_Indent => INDENT_UNIT*1,
1502 Style_Before => 0,
1503 Style_After => 70,
1504 Style_Justified => FALSE,
1505 Style_String_Prefix =>
1506 "\s83\widctlpar\adjustright",
1507 Style_String_Suffix => "\cgrid\sl-140\ql \snext83 ");
1508 Set_Style (Paragraph_Info(ARM_Output.Examples, 5), -- Child Indented examples
1509 Font => ARM_Output.Fixed,
1510 Body_Font => Output_Object.Body_Font,
1511 Font_Size => 16,
1512 Style_Indent => INDENT_UNIT*5,
1513 Style_Before => 0,
1514 Style_After => 80,
1515 Style_Justified => FALSE,
1516 Style_String_Prefix =>
1517 "\s84\widctlpar\adjustright",
1518 Style_String_Suffix => "\cgrid\ql\sl-160 \snext84 ");
1519 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 7), -- Child Indented annotation examples.
1520 Font => ARM_Output.Fixed,
1521 Body_Font => Output_Object.Body_Font,
1522 Font_Size => 14,
1523 Style_Indent => INDENT_UNIT*7,
1524 Style_Before => 0,
1525 Style_After => 70,
1526 Style_Justified => FALSE,
1527 Style_String_Prefix =>
1528 "\s85\widctlpar\adjustright",
1529 Style_String_Suffix => "\cgrid\ql\sl-140 \snext85 ");
1530
1531 -- The following are indented three extra levels:
1532 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 4),
1533 Font => ARM_Output.Default,
1534 Body_Font => Output_Object.Body_Font,
1535 Font_Size => 18,
1536 Style_Indent => INDENT_UNIT*4,
1537 Style_Hang_Width => 360,
1538 Style_Before => 0,
1539 Style_After => 100,
1540 Style_Justified => TRUE,
1541 Style_String_Prefix =>
1542 "\s86\widctlpar\adjustright",
1543 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext86 ");
1544 -- Note: Narrower space between and afterwards.
1545
1546 -- New styles should be added here, following numbers will need adjustments.
1547 Set_Style (Heading_4_Info,
1548 Font => ARM_Output.Swiss,
1549 Body_Font => Output_Object.Body_Font,
1550 Font_Size => 22,
1551 Style_Indent => 0,
1552 Style_Before => 210,
1553 Style_After => 90,
1554 Style_Justified => FALSE,
1555 Style_String_Prefix =>
1556 "\s87\keepn\widctlpar\outlinelevel3\adjustright",
1557 Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
1558 if Output_Object.Big_Files then
1559 -- Define the TOC styles:
1560 Set_Style (TOC_1_Info,
1561 Font => ARM_Output.Swiss,
1562 Body_Font => Output_Object.Body_Font,
1563 Font_Size => 20,
1564 Style_Indent => 0,
1565 Style_Before => 45,
1566 Style_After => 45,
1567 Style_Justified => FALSE,
1568 Style_String_Prefix =>
1569 "\s88\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
1570 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
1571 Set_Style (TOC_2_Info,
1572 Font => ARM_Output.Swiss,
1573 Body_Font => Output_Object.Body_Font,
1574 Font_Size => 17,
1575 Style_Indent => 200,
1576 Style_Before => 0,
1577 Style_After => 0,
1578 Style_Justified => FALSE,
1579 Style_String_Prefix =>
1580 "\s89\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
1581 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
1582 Set_Style (TOC_3_Info,
1583 Font => ARM_Output.Swiss,
1584 Body_Font => Output_Object.Body_Font,
1585 Font_Size => 17,
1586 Style_Indent => 400,
1587 Style_Before => 0,
1588 Style_After => 0,
1589 Style_Justified => FALSE,
1590 Style_String_Prefix =>
1591 "\s90\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
1592 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
1593 Set_Style (TOC_4_Info,
1594 Font => ARM_Output.Swiss,
1595 Body_Font => Output_Object.Body_Font,
1596 Font_Size => 17,
1597 Style_Indent => 600,
1598 Style_Before => 0,
1599 Style_After => 0,
1600 Style_Justified => FALSE,
1601 Style_String_Prefix =>
1602 "\s91\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
1603 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
1604 end if;
1605 Set_Style (Table_C_Text_Info,
1606 Font => ARM_Output.Default,
1607 Body_Font => Output_Object.Body_Font,
1608 Font_Size => 18,
1609 Style_Indent => 0,
1610 Style_Before => 20,
1611 Style_After => 20,
1612 Style_Justified => FALSE,
1613 Style_String_Prefix => "",
1614 Style_String_Suffix => "\qc ");
1615 -- We use a bit of space above and below to avoid overrunning
1616 -- the borders of the cells.
1617 Set_Style (Table_L_Text_Info,
1618 Font => ARM_Output.Default,
1619 Body_Font => Output_Object.Body_Font,
1620 Font_Size => 18,
1621 Style_Indent => 0,
1622 Style_Before => 20,
1623 Style_After => 20,
1624 Style_Justified => FALSE,
1625 Style_String_Prefix => "",
1626 Style_String_Suffix => "\ql ");
1627 Set_Style (Table_C_Sml_Text_Info,
1628 Font => ARM_Output.Default,
1629 Body_Font => Output_Object.Body_Font,
1630 Font_Size => 15,
1631 Style_Indent => 0,
1632 Style_Before => 20,
1633 Style_After => 20,
1634 Style_Justified => FALSE,
1635 Style_String_Prefix => "",
1636 Style_String_Suffix => "\qc ");
1637 Set_Style (Table_L_Sml_Text_Info,
1638 Font => ARM_Output.Default,
1639 Body_Font => Output_Object.Body_Font,
1640 Font_Size => 15,
1641 Style_Indent => 0,
1642 Style_Before => 20,
1643 Style_After => 20,
1644 Style_Justified => FALSE,
1645 Style_String_Prefix => "",
1646 Style_String_Suffix => "\ql ");
1647 else
1648 Set_Style (Paragraph_Info(ARM_Output.Normal, 0),
1649 Font => ARM_Output.Default,
1650 Body_Font => Output_Object.Body_Font,
1651 Font_Size => 22,
1652 Style_Indent => 0,
1653 Style_Before => 0,
1654 Style_After => 120,
1655 Style_Justified => TRUE,
1656 Style_String_Prefix =>
1657 "\s0\widctlpar\adjustright",
1658 Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext0 ");
1659 Set_Style (Heading_1_Info,
1660 Font => ARM_Output.Swiss,
1661 Body_Font => Output_Object.Body_Font,
1662 Font_Size => 36,
1663 Style_Indent => 0,
1664 Style_Before => 0,
1665 Style_After => 210,
1666 Style_Justified => FALSE,
1667 Style_String_Prefix =>
1668 "\s1\keepn\widctlpar\outlinelevel0\adjustright",
1669 Style_String_Suffix => "\b\kerning36\qc\cgrid \sbasedon0 \snext0 ");
1670 Set_Style (Heading_2_Info,
1671 Font => ARM_Output.Swiss,
1672 Body_Font => Output_Object.Body_Font,
1673 Font_Size => 28,
1674 Style_Indent => 0,
1675 Style_Before => 240,
1676 Style_After => 120,
1677 Style_Justified => FALSE,
1678 Style_String_Prefix =>
1679 "\s2\keepn\widctlpar\outlinelevel1\adjustright",
1680 Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
1681 Set_Style (Heading_3_Info,
1682 Font => ARM_Output.Swiss,
1683 Body_Font => Output_Object.Body_Font,
1684 Font_Size => 28,
1685 Style_Indent => 0,
1686 Style_Before => 210,
1687 Style_After => 100,
1688 Style_Justified => FALSE,
1689 Style_String_Prefix =>
1690 "\s3\keepn\widctlpar\outlinelevel2\adjustright",
1691 Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
1692 Set_Style (Category_Header_Info,
1693 Font => ARM_Output.Default,
1694 Body_Font => Output_Object.Body_Font,
1695 Font_Size => 16,
1696 Style_Indent => 0,
1697 Style_Before => 120,
1698 Style_After => 120,
1699 Style_Justified => FALSE,
1700 Style_String_Prefix =>
1701 "\s4\keepn\adjustright",
1702 Style_String_Suffix => "\cgrid\qc\i \snext0 ");
1703 Set_Style (Normal_Paragraph_Number_Info,
1704 Font => ARM_Output.Swiss,
1705 Body_Font => Output_Object.Body_Font,
1706 Font_Size => 14,
1707 Style_Indent => 0,
1708 Style_Before => 0,
1709 Style_After => 0,
1710 Style_Justified => FALSE,
1711 Style_String_Prefix =>
1712 "\s5\keepn\widctlpar\adjustright " &
1713 "\pvpara\phpg\posxo\posy0\absw580\dxfrtext100\dfrmtxtx150\dfrmtxty150"&
1714 "\cgrid\qc",
1715 Style_String_Suffix => "\snext0 "); -- We adjust the space before for each number.
1716 -- Frame commands:
1717 -- \pvpara - positions the frame vertically with the next paragraph;
1718 -- \phpg - positions the frame horizonatally within the page;
1719 -- \posxo - positions the paragraph outside of the frame;
1720 -- \posy0 - positions the paragraph at the top of the frame;
1721 -- \absw - frame width in twips (640);
1722 -- \dxfrtext - distance of frame from text in all directions (twips);
1723 -- \dfrmtxtx - horizontal distance of text from frame (twips);
1724 -- \dfrmtxty - vertical distance of text from frame (twips).
1725
1726 Set_Style (Wide_Paragraph_Number_Info,
1727 Font => ARM_Output.Swiss,
1728 Body_Font => Output_Object.Body_Font,
1729 Font_Size => 14,
1730 Style_Indent => 0,
1731 Style_Before => 0,
1732 Style_After => 0,
1733 Style_Justified => FALSE,
1734 Style_String_Prefix =>
1735 "\s5\keepn\widctlpar\adjustright " &
1736 "\pvpara\phpg\posxo\posy0\absw640\dxfrtext100\dfrmtxtx150\dfrmtxty150"&
1737 "\cgrid\qc",
1738 Style_String_Suffix => "\snext0 "); -- We adjust the space before for each number.
1739
1740
1741 Set_Style (Paragraph_Info(ARM_Output.Small, 1), -- Notes
1742 Font => ARM_Output.Default,
1743 Body_Font => Output_Object.Body_Font,
1744 Font_Size => 18,
1745 Style_Indent => INDENT_UNIT*1,
1746 Style_Before => 0,
1747 Style_After => 90,
1748 Style_Justified => TRUE,
1749 Style_String_Prefix =>
1750 "\s6\widctlpar\adjustright",
1751 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext6 ");
1752 Set_Style (Paragraph_Info(ARM_Output.Small, 2), -- Annotations
1753 Font => ARM_Output.Default,
1754 Body_Font => Output_Object.Body_Font,
1755 Font_Size => 18,
1756 Style_Indent => INDENT_UNIT*2,
1757 Style_Before => 0,
1758 Style_After => 90,
1759 Style_Justified => TRUE,
1760 Style_String_Prefix =>
1761 "\s7\widctlpar\adjustright",
1762 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext7 ");
1763 Set_Style (Paragraph_Info(ARM_Output.Examples, 1),
1764 Font => ARM_Output.Fixed,
1765 Body_Font => Output_Object.Body_Font,
1766 Font_Size => 18,
1767 Style_Indent => INDENT_UNIT*1,
1768 Style_Before => 0,
1769 Style_After => 100,
1770 Style_Justified => FALSE,
1771 Style_String_Prefix =>
1772 "\s8\widctlpar\adjustright",
1773 Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext8 ");
1774 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 3),
1775 Font => ARM_Output.Fixed,
1776 Body_Font => Output_Object.Body_Font,
1777 Font_Size => 16,
1778 Style_Indent => INDENT_UNIT*3,
1779 Style_Before => 0,
1780 Style_After => 80,
1781 Style_Justified => FALSE,
1782 Style_String_Prefix =>
1783 "\s9\widctlpar\adjustright",
1784 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext9 ");
1785 Set_Style (Paragraph_Info(ARM_Output.Normal, 1), -- Syntax indented
1786 Font => ARM_Output.Default,
1787 Body_Font => Output_Object.Body_Font,
1788 Font_Size => 22,
1789 Style_Indent => INDENT_UNIT*1,
1790 Style_Before => 0,
1791 Style_After => 100,
1792 Style_Justified => FALSE,
1793 Style_String_Prefix =>
1794 "\s10\widctlpar\adjustright",
1795 Style_String_Suffix => "\cgrid\ql\sl-240 \snext10 ");
1796 -- Note: Narrower space between and afterwards.
1797 Set_Style (Paragraph_Info(ARM_Output.Normal, 3), -- Indented
1798 Font => ARM_Output.Default,
1799 Body_Font => Output_Object.Body_Font,
1800 Font_Size => 22,
1801 Style_Indent => INDENT_UNIT*3,
1802 Style_Before => 0,
1803 Style_After => 120,
1804 Style_Justified => TRUE,
1805 Style_String_Prefix =>
1806 "\s11\widctlpar\adjustright",
1807 Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext11 ");
1808 Set_Style (Paragraph_Info(ARM_Output.Small, 5), -- Indented annotations
1809 Font => ARM_Output.Default,
1810 Body_Font => Output_Object.Body_Font,
1811 Font_Size => 18,
1812 Style_Indent => INDENT_UNIT*5,
1813 Style_Before => 0,
1814 Style_After => 90,
1815 Style_Justified => TRUE,
1816 Style_String_Prefix =>
1817 "\s12\widctlpar\adjustright",
1818 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext12 ");
1819 Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 3),
1820 Font => ARM_Output.Default,
1821 Body_Font => Output_Object.Body_Font,
1822 Font_Size => 22,
1823 Style_Indent => INDENT_UNIT*3,
1824 Style_Hang_Width => 1080,
1825 Style_Before => 0,
1826 Style_After => 110,
1827 Style_Justified => TRUE,
1828 Style_String_Prefix =>
1829 "\s13\widctlpar\adjustright",
1830 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext13 ");
1831 -- Note: Narrower space between and afterwards.
1832 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 1),
1833 Font => ARM_Output.Default,
1834 Body_Font => Output_Object.Body_Font,
1835 Font_Size => 22,
1836 Style_Indent => INDENT_UNIT*1,
1837 Style_Hang_Width => 360,
1838 Style_Before => 0,
1839 Style_After => 120,
1840 Style_Justified => TRUE,
1841 Style_String_Prefix =>
1842 "\s14\widctlpar\adjustright",
1843 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext14 ");
1844 -- Note: Narrower space between and afterwards.
1845 Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5), -- Indented two levels for use in indented text.
1846 Font => ARM_Output.Default,
1847 Body_Font => Output_Object.Body_Font,
1848 Font_Size => 18,
1849 Style_Indent => INDENT_UNIT*5,
1850 Style_Hang_Width => 1080,
1851 Style_Before => 0,
1852 Style_After => 90,
1853 Style_Justified => TRUE,
1854 Style_String_Prefix =>
1855 "\s15\widctlpar\adjustright",
1856 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext15 ");
1857 -- Note: Narrower space between.
1858 Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3), -- Indented two levels for use in indented text.
1859 Font => ARM_Output.Default,
1860 Body_Font => Output_Object.Body_Font,
1861 Font_Size => 18,
1862 Style_Indent => INDENT_UNIT*3,
1863 Style_Hang_Width => 360,
1864 Style_Before => 0,
1865 Style_After => 90,
1866 Style_Justified => TRUE,
1867 Style_String_Prefix =>
1868 "\s16\widctlpar\adjustright",
1869 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext16 ");
1870 -- Note: Narrower space between.
1871 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 1),
1872 Font => ARM_Output.Default,
1873 Body_Font => Output_Object.Body_Font,
1874 Font_Size => 22,
1875 Style_Indent => INDENT_UNIT*1,
1876 Style_Hang_Width => 250,
1877 Style_Before => 0,
1878 Style_After => 110,
1879 Style_Justified => TRUE,
1880 Style_String_Prefix =>
1881 "\s17\widctlpar\adjustright",
1882 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext17 ");
1883 -- Note: Narrower space between and afterwards.
1884 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 2),
1885 Font => ARM_Output.Default,
1886 Body_Font => Output_Object.Body_Font,
1887 Font_Size => 22,
1888 Style_Indent => INDENT_UNIT*2,
1889 Style_Hang_Width => 220,
1890 Style_Before => 0,
1891 Style_After => 110,
1892 Style_Justified => TRUE,
1893 Style_String_Prefix =>
1894 "\s18\widctlpar\adjustright",
1895 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext18 ");
1896 -- Note: Narrower space between and afterwards.
1897 Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 3),
1898 Font => ARM_Output.Default,
1899 Body_Font => Output_Object.Body_Font,
1900 Font_Size => 18,
1901 Style_Indent => INDENT_UNIT*3,
1902 Style_Hang_Width => 220,
1903 Style_Before => 0,
1904 Style_After => 90,
1905 Style_Justified => TRUE,
1906 Style_String_Prefix =>
1907 "\s19\widctlpar\adjustright",
1908 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext19 ");
1909 -- Note: Narrower space between.
1910 Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4),
1911 Font => ARM_Output.Default,
1912 Body_Font => Output_Object.Body_Font,
1913 Font_Size => 18,
1914 Style_Indent => INDENT_UNIT*4,
1915 Style_Hang_Width => 200,
1916 Style_Before => 0,
1917 Style_After => 90,
1918 Style_Justified => TRUE,
1919 Style_String_Prefix =>
1920 "\s20\widctlpar\adjustright",
1921 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1440 \snext20 ");
1922 -- Note: Narrower space between.
1923 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 4), -- Indented bulleted
1924 Font => ARM_Output.Default,
1925 Body_Font => Output_Object.Body_Font,
1926 Font_Size => 22,
1927 Style_Indent => INDENT_UNIT*4,
1928 Style_Hang_Width => 250,
1929 Style_Before => 0,
1930 Style_After => 110,
1931 Style_Justified => TRUE,
1932 Style_String_Prefix =>
1933 "\s21\widctlpar\adjustright",
1934 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext21 ");
1935 -- Note: Narrower space between and afterwards.
1936 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 2), -- Bullets in syntax indenting
1937 Font => ARM_Output.Default,
1938 Body_Font => Output_Object.Body_Font,
1939 Font_Size => 22,
1940 Style_Indent => INDENT_UNIT*2,
1941 Style_Hang_Width => 250,
1942 Style_Before => 0,
1943 Style_After => 110,
1944 Style_Justified => TRUE,
1945 Style_String_Prefix =>
1946 "\s22\widctlpar\adjustright",
1947 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext22 ");
1948 -- Note: Narrower space between and afterwards.
1949 Set_Style (Paragraph_Info(ARM_Output.Bulleted, 3), -- Bullets in syntax indenting
1950 Font => ARM_Output.Default,
1951 Body_Font => Output_Object.Body_Font,
1952 Font_Size => 22,
1953 Style_Indent => INDENT_UNIT*3,
1954 Style_Hang_Width => 250,
1955 Style_Before => 0,
1956 Style_After => 110,
1957 Style_Justified => TRUE,
1958 Style_String_Prefix =>
1959 "\s23\widctlpar\adjustright",
1960 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext23 ");
1961 -- Note: Narrower space between and afterwards.
1962 Set_Style (Paragraph_Info(ARM_Output.Normal, 2), -- Code indenting
1963 Font => ARM_Output.Default,
1964 Body_Font => Output_Object.Body_Font,
1965 Font_Size => 22,
1966 Style_Indent => INDENT_UNIT*2,
1967 Style_Before => 0,
1968 Style_After => 120,
1969 Style_Justified => TRUE,
1970 Style_String_Prefix =>
1971 "\s24\widctlpar\adjustright",
1972 Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext24 ");
1973 Set_Style (Paragraph_Info(ARM_Output.Small, 4), -- Annotations in code indenting
1974 Font => ARM_Output.Default,
1975 Body_Font => Output_Object.Body_Font,
1976 Font_Size => 18,
1977 Style_Indent => INDENT_UNIT*4,
1978 Style_Before => 0,
1979 Style_After => 90,
1980 Style_Justified => TRUE,
1981 Style_String_Prefix =>
1982 "\s25\widctlpar\adjustright",
1983 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext25 ");
1984 Set_Style (Paragraph_Info(ARM_Output.Examples, 4), -- Indented examples
1985 Font => ARM_Output.Fixed,
1986 Body_Font => Output_Object.Body_Font,
1987 Font_Size => 18,
1988 Style_Indent => INDENT_UNIT*4,
1989 Style_Before => 0,
1990 Style_After => 100,
1991 Style_Justified => FALSE,
1992 Style_String_Prefix =>
1993 "\s26\widctlpar\adjustright",
1994 Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext26 ");
1995 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 6), -- Indented examples in annotations.
1996 Font => ARM_Output.Fixed,
1997 Body_Font => Output_Object.Body_Font,
1998 Font_Size => 16,
1999 Style_Indent => INDENT_UNIT*6,
2000 Style_Before => 0,
2001 Style_After => 80,
2002 Style_Justified => FALSE,
2003 Style_String_Prefix =>
2004 "\s27\widctlpar\adjustright",
2005 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext27 ");
2006
2007 Set_Style (Header_Info,
2008 Font => ARM_Output.Default,
2009 Body_Font => Output_Object.Body_Font,
2010 Font_Size => 20,
2011 Style_Indent => 0,
2012 Style_Before => 0,
2013 Style_After => 0,
2014 Style_Justified => FALSE,
2015 Style_String_Prefix =>
2016 "\s28\widctlpar\tqc\tx" & Half_Paper_Width &
2017 "\tqr\tx" & Paper_Width & "\adjustright",
2018 Style_String_Suffix => "\cgrid \sbasedon0 \snext28 ");
2019 Set_Style (Footer_Info,
2020 Font => ARM_Output.Default,
2021 Body_Font => Output_Object.Body_Font,
2022 Font_Size => 20,
2023 Style_Indent => 0,
2024 Style_Before => 0,
2025 Style_After => 0,
2026 Style_Justified => FALSE,
2027 Style_String_Prefix =>
2028 "\s29\widctlpar" & -- "\tqc\tx" & Half_Paper_Width & -- We don't use or define the center tab; it causes problems with very long titles.
2029 "\tqr\tx" & Paper_Width & "\adjustright",
2030 Style_String_Suffix => "\cgrid \sbasedon0 \snext29 ");
2031 Set_Style (Paragraph_Info(ARM_Output.Index, 0),
2032 Font => ARM_Output.Default,
2033 Body_Font => Output_Object.Body_Font,
2034 Font_Size => 18,
2035 Style_Indent => 270,
2036 Style_Hang_Width => 270,
2037 Style_Before => 0,
2038 Style_After => 0,
2039 Style_Justified => FALSE,
2040 Style_String_Prefix =>
2041 "\s31\widctlpar\adjustright",
2042 Style_String_Suffix => "\cgrid\ql\sl-200\slmult0 \snext31 ");
2043 Set_Style (Paragraph_Info(ARM_Output.Wide_Above, 0),
2044 Font => ARM_Output.Default,
2045 Body_Font => Output_Object.Body_Font,
2046 Font_Size => 22,
2047 Style_Indent => 0,
2048 Style_Before => 120,
2049 Style_After => 120,
2050 Style_Justified => TRUE,
2051 Style_String_Prefix =>
2052 "\s32\widctlpar\adjustright",
2053 Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext0 ");
2054 Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Above, 2), -- Wide above annotations.
2055 Font => ARM_Output.Default,
2056 Body_Font => Output_Object.Body_Font,
2057 Font_Size => 18,
2058 Style_Indent => INDENT_UNIT*2,
2059 Style_Before => 90,
2060 Style_After => 90,
2061 Style_Justified => TRUE,
2062 Style_String_Prefix =>
2063 "\s33\widctlpar\adjustright",
2064 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext7 ");
2065 Set_Style (Paragraph_Info(ARM_Output.Small_Header, 1), -- Notes header
2066 Font => ARM_Output.Default,
2067 Body_Font => Output_Object.Body_Font,
2068 Font_Size => 18,
2069 Style_Indent => INDENT_UNIT*1,
2070 Style_Before => 0,
2071 Style_After => 0,
2072 Style_Justified => TRUE,
2073 Style_String_Prefix =>
2074 "\s34\widctlpar\adjustright",
2075 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext6 ");
2076 -- Note: No space afterwards.
2077 Set_Style (Paragraph_Info(ARM_Output.Small_Bulleted, 2), -- Bullets in notes
2078 Font => ARM_Output.Default,
2079 Body_Font => Output_Object.Body_Font,
2080 Font_Size => 18,
2081 Style_Indent => INDENT_UNIT*2,
2082 Style_Hang_Width => 250,
2083 Style_Before => 0,
2084 Style_After => 90,
2085 Style_Justified => TRUE,
2086 Style_String_Prefix =>
2087 "\s35\widctlpar\adjustright",
2088 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx720 \snext35 ");
2089 -- Note: Narrower space between.
2090 Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3), -- Nested bullets in notes
2091 Font => ARM_Output.Default,
2092 Body_Font => Output_Object.Body_Font,
2093 Font_Size => 18,
2094 Style_Indent => INDENT_UNIT*3,
2095 Style_Hang_Width => 220,
2096 Style_Before => 0,
2097 Style_After => 90,
2098 Style_Justified => TRUE,
2099 Style_String_Prefix =>
2100 "\s36\widctlpar\adjustright",
2101 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext36 ");
2102 -- Note: Narrower space between.
2103 Set_Style (Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3),
2104 Font => ARM_Output.Default,
2105 Body_Font => Output_Object.Body_Font,
2106 Font_Size => 22,
2107 Style_Indent => INDENT_UNIT*3,
2108 Style_Hang_Width => 720,
2109 Style_Before => 0,
2110 Style_After => 110,
2111 Style_Justified => TRUE,
2112 Style_String_Prefix =>
2113 "\s37\widctlpar\adjustright",
2114 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0 \snext14 ");
2115 -- Note: Narrower space between and afterwards.
2116 Set_Style (Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5),
2117 Font => ARM_Output.Default,
2118 Body_Font => Output_Object.Body_Font,
2119 Font_Size => 18,
2120 Style_Indent => INDENT_UNIT*5,
2121 Style_Hang_Width => 720,
2122 Style_Before => 0,
2123 Style_After => 90,
2124 Style_Justified => TRUE,
2125 Style_String_Prefix =>
2126 "\s38\widctlpar\adjustright",
2127 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0 \snext16 ");
2128 -- Note: Narrower space between.
2129 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 4), -- Nested bullets in code indenting
2130 Font => ARM_Output.Default,
2131 Body_Font => Output_Object.Body_Font,
2132 Font_Size => 22,
2133 Style_Indent => INDENT_UNIT*4,
2134 Style_Hang_Width => 220,
2135 Style_Before => 0,
2136 Style_After => 110,
2137 Style_Justified => TRUE,
2138 Style_String_Prefix =>
2139 "\s39\widctlpar\adjustright",
2140 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1440 \snext39 ");
2141 -- Note: Narrower space between and afterwards.
2142 Set_Style (Paragraph_Info(ARM_Output.Syntax_Summary, 1),
2143 Font => ARM_Output.Default,
2144 Body_Font => Output_Object.Body_Font,
2145 Font_Size => 18,
2146 Style_Indent => INDENT_UNIT*1,
2147 Style_Before => 0,
2148 Style_After => 90,
2149 Style_Justified => FALSE,
2150 Style_String_Prefix =>
2151 "\s40\widctlpar\adjustright",
2152 Style_String_Suffix => "\cgrid\ql\sl-200\slmult0 \snext40 ");
2153 -- Note: Narrower space between and afterwards.
2154 Set_Style (Paragraph_Info(ARM_Output.Enumerated, 1),
2155 Font => ARM_Output.Default,
2156 Body_Font => Output_Object.Body_Font,
2157 Font_Size => 22,
2158 Style_Indent => INDENT_UNIT*1,
2159 Style_Hang_Width => 250,
2160 Style_Before => 0,
2161 Style_After => 110,
2162 Style_Justified => TRUE,
2163 Style_String_Prefix =>
2164 "\s41\widctlpar\adjustright",
2165 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext41 ");
2166 -- Note: Narrower space between and afterwards.
2167 Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 3),
2168 Font => ARM_Output.Default,
2169 Body_Font => Output_Object.Body_Font,
2170 Font_Size => 18,
2171 Style_Indent => INDENT_UNIT*3,
2172 Style_Hang_Width => 220,
2173 Style_Before => 0,
2174 Style_After => 90,
2175 Style_Justified => TRUE,
2176 Style_String_Prefix =>
2177 "\s42\widctlpar\adjustright",
2178 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext42 ");
2179 -- Note: Narrower space between.
2180 Set_Style (Paragraph_Info(ARM_Output.Enumerated, 2), -- Nested enumerations.
2181 Font => ARM_Output.Default,
2182 Body_Font => Output_Object.Body_Font,
2183 Font_Size => 22,
2184 Style_Indent => INDENT_UNIT*2,
2185 Style_Hang_Width => 270,
2186 Style_Before => 0,
2187 Style_After => 110,
2188 Style_Justified => TRUE,
2189 Style_String_Prefix =>
2190 "\s43\widctlpar\adjustright",
2191 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext43 ");
2192 -- Note: Narrower space between and afterwards.
2193 Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 4), -- Small nested enumerations.
2194 Font => ARM_Output.Default,
2195 Body_Font => Output_Object.Body_Font,
2196 Font_Size => 18,
2197 Style_Indent => INDENT_UNIT*4,
2198 Style_Hang_Width => 240,
2199 Style_Before => 0,
2200 Style_After => 90,
2201 Style_Justified => TRUE,
2202 Style_String_Prefix =>
2203 "\s44\widctlpar\adjustright",
2204 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext44 ");
2205 -- Note: Narrower space between.
2206 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 3), -- Doubly nested bullets
2207 Font => ARM_Output.Default,
2208 Body_Font => Output_Object.Body_Font,
2209 Font_Size => 22,
2210 Style_Indent => INDENT_UNIT*3,
2211 Style_Hang_Width => 220,
2212 Style_Before => 0,
2213 Style_After => 110,
2214 Style_Justified => TRUE,
2215 Style_String_Prefix =>
2216 "\s45\widctlpar\adjustright",
2217 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx720 \snext45 ");
2218 -- Note: Narrower space between and afterwards.
2219 Set_Style (Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5), -- Doubly nested bullets
2220 Font => ARM_Output.Default,
2221 Body_Font => Output_Object.Body_Font,
2222 Font_Size => 18,
2223 Style_Indent => INDENT_UNIT*5,
2224 Style_Hang_Width => 200,
2225 Style_Before => 0,
2226 Style_After => 90,
2227 Style_Justified => TRUE,
2228 Style_String_Prefix =>
2229 "\s46\widctlpar\adjustright",
2230 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1440 \snext46 ");
2231 -- Note: Narrower space between.
2232 Set_Style (Paragraph_Info(ARM_Output.Nested_Bulleted, 5), -- Indented nested bullets
2233 Font => ARM_Output.Default,
2234 Body_Font => Output_Object.Body_Font,
2235 Font_Size => 22,
2236 Style_Indent => INDENT_UNIT*5,
2237 Style_Hang_Width => 250,
2238 Style_Before => 0,
2239 Style_After => 110,
2240 Style_Justified => TRUE,
2241 Style_String_Prefix =>
2242 "\s47\widctlpar\adjustright",
2243 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx1080 \snext47 ");
2244 -- Note: Narrower space between and afterwards.
2245 Set_Style (Paragraph_Info(ARM_Output.Normal, 4), -- Inner indented
2246 Font => ARM_Output.Default,
2247 Body_Font => Output_Object.Body_Font,
2248 Font_Size => 22,
2249 Style_Indent => INDENT_UNIT*4,
2250 Style_Before => 0,
2251 Style_After => 120,
2252 Style_Justified => TRUE,
2253 Style_String_Prefix =>
2254 "\s48\widctlpar\adjustright",
2255 Style_String_Suffix => "\cgrid\qj\sl-260\slmult0 \snext48 ");
2256 Set_Style (Paragraph_Info(ARM_Output.Small, 6), -- Inner indented
2257 Font => ARM_Output.Default,
2258 Body_Font => Output_Object.Body_Font,
2259 Font_Size => 18,
2260 Style_Indent => INDENT_UNIT*6,
2261 Style_Before => 0,
2262 Style_After => 90,
2263 Style_Justified => TRUE,
2264 Style_String_Prefix =>
2265 "\s49\widctlpar\adjustright",
2266 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext49 ");
2267 Set_Style (Paragraph_Info(ARM_Output.Small, 3), -- Annotations in syntax indenting
2268 Font => ARM_Output.Default,
2269 Body_Font => Output_Object.Body_Font,
2270 Font_Size => 18,
2271 Style_Indent => INDENT_UNIT*4,
2272 Style_Before => 0,
2273 Style_After => 90,
2274 Style_Justified => TRUE,
2275 Style_String_Prefix =>
2276 "\s50\widctlpar\adjustright",
2277 Style_String_Suffix => "\cgrid\qj\sl-200\slmult0 \snext50 ");
2278 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 1),
2279 Font => ARM_Output.Swiss,
2280 Body_Font => Output_Object.Body_Font,
2281 Font_Size => 20,
2282 Style_Indent => INDENT_UNIT*1,
2283 Style_Before => 0,
2284 Style_After => 110,
2285 Style_Justified => FALSE,
2286 Style_String_Prefix =>
2287 "\s51\widctlpar\adjustright",
2288 Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext51 ");
2289 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3),
2290 Font => ARM_Output.Swiss,
2291 Body_Font => Output_Object.Body_Font,
2292 Font_Size => 16,
2293 Style_Indent => INDENT_UNIT*3,
2294 Style_Before => 0,
2295 Style_After => 80,
2296 Style_Justified => FALSE,
2297 Style_String_Prefix =>
2298 "\s52\widctlpar\adjustright",
2299 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext52 ");
2300 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 4), -- Indented examples
2301 Font => ARM_Output.Swiss,
2302 Body_Font => Output_Object.Body_Font,
2303 Font_Size => 20,
2304 Style_Indent => INDENT_UNIT*4,
2305 Style_Before => 0,
2306 Style_After => 110,
2307 Style_Justified => FALSE,
2308 Style_String_Prefix =>
2309 "\s53\widctlpar\adjustright",
2310 Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext53 ");
2311 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6), -- Indented examples
2312 Font => ARM_Output.Swiss,
2313 Body_Font => Output_Object.Body_Font,
2314 Font_Size => 16,
2315 Style_Indent => INDENT_UNIT*6,
2316 Style_Before => 0,
2317 Style_After => 80,
2318 Style_Justified => FALSE,
2319 Style_String_Prefix =>
2320 "\s54\widctlpar\adjustright",
2321 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext54 ");
2322 Set_Style (Paragraph_Info(ARM_Output.Enumerated, 3), -- Doubly nested enumerations.
2323 Font => ARM_Output.Default,
2324 Body_Font => Output_Object.Body_Font,
2325 Font_Size => 22,
2326 Style_Indent => INDENT_UNIT*3,
2327 Style_Hang_Width => 270,
2328 Style_Before => 0,
2329 Style_After => 110,
2330 Style_Justified => TRUE,
2331 Style_String_Prefix =>
2332 "\s55\widctlpar\adjustright",
2333 Style_String_Suffix => "\ri360\cgrid\qj\sl-240\slmult0\tx360 \snext55 ");
2334 -- Note: Narrower space between and afterwards.
2335 Set_Style (Paragraph_Info(ARM_Output.Small_Enumerated, 5), -- Small doubly nested enumerations.
2336 Font => ARM_Output.Default,
2337 Body_Font => Output_Object.Body_Font,
2338 Font_Size => 18,
2339 Style_Indent => INDENT_UNIT*5,
2340 Style_Hang_Width => 240,
2341 Style_Before => 0,
2342 Style_After => 90,
2343 Style_Justified => TRUE,
2344 Style_String_Prefix =>
2345 "\s56\widctlpar\adjustright",
2346 Style_String_Suffix => "\ri360\cgrid\qj\sl-190\slmult0\tx1080 \snext56 ");
2347 -- Note: Narrower space between.
2348 Set_Style (Paragraph_Info(ARM_Output.Examples, 2), -- Syntax Indented examples
2349 Font => ARM_Output.Fixed,
2350 Body_Font => Output_Object.Body_Font,
2351 Font_Size => 18,
2352 Style_Indent => INDENT_UNIT*2,
2353 Style_Before => 0,
2354 Style_After => 100,
2355 Style_Justified => FALSE,
2356 Style_String_Prefix =>
2357 "\s57\widctlpar\adjustright",
2358 Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext57 ");
2359 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 4), -- Syntax Indented examples in annotations.
2360 Font => ARM_Output.Fixed,
2361 Body_Font => Output_Object.Body_Font,
2362 Font_Size => 16,
2363 Style_Indent => INDENT_UNIT*4,
2364 Style_Before => 0,
2365 Style_After => 80,
2366 Style_Justified => FALSE,
2367 Style_String_Prefix =>
2368 "\s58\widctlpar\adjustright",
2369 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext58 ");
2370 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 2), -- Syntax Indented examples
2371 Font => ARM_Output.Swiss,
2372 Body_Font => Output_Object.Body_Font,
2373 Font_Size => 20,
2374 Style_Indent => INDENT_UNIT*2,
2375 Style_Before => 0,
2376 Style_After => 110,
2377 Style_Justified => FALSE,
2378 Style_String_Prefix =>
2379 "\s59\widctlpar\adjustright",
2380 Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext59 ");
2381 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4), -- Syntax Indented examples
2382 Font => ARM_Output.Swiss,
2383 Body_Font => Output_Object.Body_Font,
2384 Font_Size => 16,
2385 Style_Indent => INDENT_UNIT*4,
2386 Style_Before => 0,
2387 Style_After => 80,
2388 Style_Justified => FALSE,
2389 Style_String_Prefix =>
2390 "\s60\widctlpar\adjustright",
2391 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext60 ");
2392 Set_Style (Paragraph_Info(ARM_Output.Examples, 3), -- Code Indented examples
2393 Font => ARM_Output.Fixed,
2394 Body_Font => Output_Object.Body_Font,
2395 Font_Size => 18,
2396 Style_Indent => INDENT_UNIT*3,
2397 Style_Before => 0,
2398 Style_After => 100,
2399 Style_Justified => FALSE,
2400 Style_String_Prefix =>
2401 "\s61\widctlpar\adjustright",
2402 Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext61 ");
2403 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 5), -- Code Indented examples in annotations.
2404 Font => ARM_Output.Fixed,
2405 Body_Font => Output_Object.Body_Font,
2406 Font_Size => 16,
2407 Style_Indent => INDENT_UNIT*5,
2408 Style_Before => 0,
2409 Style_After => 80,
2410 Style_Justified => FALSE,
2411 Style_String_Prefix =>
2412 "\s62\widctlpar\adjustright",
2413 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext62 ");
2414 Set_Style (Paragraph_Info(ARM_Output.Swiss_Examples, 3), -- Code Indented examples
2415 Font => ARM_Output.Swiss,
2416 Body_Font => Output_Object.Body_Font,
2417 Font_Size => 20,
2418 Style_Indent => INDENT_UNIT*3,
2419 Style_Before => 0,
2420 Style_After => 110,
2421 Style_Justified => FALSE,
2422 Style_String_Prefix =>
2423 "\s63\widctlpar\adjustright",
2424 Style_String_Suffix => "\cgrid\ql\sl-240\slmult0 \snext63 ");
2425 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5), -- Code Indented examples
2426 Font => ARM_Output.Swiss,
2427 Body_Font => Output_Object.Body_Font,
2428 Font_Size => 16,
2429 Style_Indent => INDENT_UNIT*5,
2430 Style_Before => 0,
2431 Style_After => 80,
2432 Style_Justified => FALSE,
2433 Style_String_Prefix =>
2434 "\s64\widctlpar\adjustright",
2435 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext64 ");
2436 Set_Style (Paragraph_Info(ARM_Output.Title, 0),
2437 Font => ARM_Output.Default,
2438 Body_Font => Output_Object.Body_Font,
2439 Font_Size => 42, -- Slight less than double (3 pts larger than Heading_1).
2440 Style_Indent => 0,
2441 Style_Before => 120,
2442 Style_After => 120,
2443 Style_Justified => TRUE,
2444 Style_String_Prefix =>
2445 "\s65\widctlpar\adjustright",
2446 Style_String_Suffix => "\cgrid\qj\sl-440\slmult0 \snext0 ");
2447 Set_Style (Paragraph_Info(ARM_Output.Giant_Hanging, 4),
2448 Font => ARM_Output.Default,
2449 Body_Font => Output_Object.Body_Font,
2450 Font_Size => 22,
2451 Style_Indent => INDENT_UNIT*4,
2452 Style_Hang_Width => 1440,
2453 Style_Before => 0,
2454 Style_After => 110,
2455 Style_Justified => TRUE,
2456 Style_String_Prefix =>
2457 "\s66\widctlpar\adjustright",
2458 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext66 ");
2459 -- Note: Narrower space between and afterwards.
2460 Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 2),
2461 Font => ARM_Output.Default,
2462 Body_Font => Output_Object.Body_Font,
2463 Font_Size => 22,
2464 Style_Indent => INDENT_UNIT*2,
2465 Style_Hang_Width => 720,
2466 Style_Before => 0,
2467 Style_After => 120,
2468 Style_Justified => TRUE,
2469 Style_String_Prefix =>
2470 "\s67\widctlpar\adjustright",
2471 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext67 ");
2472 -- Note: Narrower space between and afterwards.
2473 Set_Style (Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6),
2474 Font => ARM_Output.Default,
2475 Body_Font => Output_Object.Body_Font,
2476 Font_Size => 18,
2477 Style_Indent => INDENT_UNIT*6,
2478 Style_Hang_Width => 1440,
2479 Style_Before => 0,
2480 Style_After => 90,
2481 Style_Justified => TRUE,
2482 Style_String_Prefix =>
2483 "\s68\widctlpar\adjustright",
2484 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext68 ");
2485 -- Note: Narrower space between.
2486 Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4),
2487 Font => ARM_Output.Default,
2488 Body_Font => Output_Object.Body_Font,
2489 Font_Size => 18,
2490 Style_Indent => INDENT_UNIT*4,
2491 Style_Hang_Width => 720,
2492 Style_Before => 0,
2493 Style_After => 90,
2494 Style_Justified => TRUE,
2495 Style_String_Prefix =>
2496 "\s69\widctlpar\adjustright",
2497 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext69 ");
2498 -- Note: Narrower space between.
2499
2500 -- The following are indented one extra level:
2501 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 2),
2502 Font => ARM_Output.Default,
2503 Body_Font => Output_Object.Body_Font,
2504 Font_Size => 22,
2505 Style_Indent => INDENT_UNIT*2,
2506 Style_Hang_Width => 360,
2507 Style_Before => 0,
2508 Style_After => 120,
2509 Style_Justified => TRUE,
2510 Style_String_Prefix =>
2511 "\s70\widctlpar\adjustright",
2512 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext70 ");
2513 -- Note: Narrower space between and afterwards.
2514 Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 3),
2515 Font => ARM_Output.Default,
2516 Body_Font => Output_Object.Body_Font,
2517 Font_Size => 22,
2518 Style_Indent => INDENT_UNIT*3,
2519 Style_Hang_Width => 720,
2520 Style_Before => 0,
2521 Style_After => 120,
2522 Style_Justified => TRUE,
2523 Style_String_Prefix =>
2524 "\s71\widctlpar\adjustright",
2525 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext71 ");
2526 -- Note: Narrower space between and afterwards.
2527 Set_Style (Paragraph_Info(ARM_Output.Wide_Hanging, 4),
2528 Font => ARM_Output.Default,
2529 Body_Font => Output_Object.Body_Font,
2530 Font_Size => 22,
2531 Style_Indent => INDENT_UNIT*4,
2532 Style_Hang_Width => 1080,
2533 Style_Before => 0,
2534 Style_After => 120,
2535 Style_Justified => TRUE,
2536 Style_String_Prefix =>
2537 "\s72\widctlpar\adjustright",
2538 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext72 ");
2539 -- Note: Narrower space between and afterwards.
2540 Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4),
2541 Font => ARM_Output.Default,
2542 Body_Font => Output_Object.Body_Font,
2543 Font_Size => 18,
2544 Style_Indent => INDENT_UNIT*4,
2545 Style_Hang_Width => 360,
2546 Style_Before => 0,
2547 Style_After => 90,
2548 Style_Justified => TRUE,
2549 Style_String_Prefix =>
2550 "\s73\widctlpar\adjustright",
2551 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext73 ");
2552 -- Note: Narrower space between.
2553 Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5),
2554 Font => ARM_Output.Default,
2555 Body_Font => Output_Object.Body_Font,
2556 Font_Size => 18,
2557 Style_Indent => INDENT_UNIT*5,
2558 Style_Hang_Width => 720,
2559 Style_Before => 0,
2560 Style_After => 90,
2561 Style_Justified => TRUE,
2562 Style_String_Prefix =>
2563 "\s74\widctlpar\adjustright",
2564 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext74 ");
2565 -- Note: Narrower space between.
2566 Set_Style (Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6),
2567 Font => ARM_Output.Default,
2568 Body_Font => Output_Object.Body_Font,
2569 Font_Size => 18,
2570 Style_Indent => INDENT_UNIT*6,
2571 Style_Hang_Width => 1080,
2572 Style_Before => 0,
2573 Style_After => 90,
2574 Style_Justified => TRUE,
2575 Style_String_Prefix =>
2576 "\s75\widctlpar\adjustright",
2577 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext75 ");
2578 -- Note: Narrower space between.
2579 -- The following are indented two extra levels:
2580 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 3),
2581 Font => ARM_Output.Default,
2582 Body_Font => Output_Object.Body_Font,
2583 Font_Size => 22,
2584 Style_Indent => INDENT_UNIT*3,
2585 Style_Hang_Width => 360,
2586 Style_Before => 0,
2587 Style_After => 120,
2588 Style_Justified => TRUE,
2589 Style_String_Prefix =>
2590 "\s76\widctlpar\adjustright",
2591 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext76 ");
2592 -- Note: Narrower space between and afterwards.
2593 Set_Style (Paragraph_Info(ARM_Output.Medium_Hanging, 4),
2594 Font => ARM_Output.Default,
2595 Body_Font => Output_Object.Body_Font,
2596 Font_Size => 22,
2597 Style_Indent => INDENT_UNIT*4,
2598 Style_Hang_Width => 720,
2599 Style_Before => 0,
2600 Style_After => 120,
2601 Style_Justified => TRUE,
2602 Style_String_Prefix =>
2603 "\s77\widctlpar\adjustright",
2604 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext77 ");
2605 -- Note: Narrower space between and afterwards.
2606 Set_Style (Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5),
2607 Font => ARM_Output.Default,
2608 Body_Font => Output_Object.Body_Font,
2609 Font_Size => 18,
2610 Style_Indent => INDENT_UNIT*5,
2611 Style_Hang_Width => 360,
2612 Style_Before => 0,
2613 Style_After => 90,
2614 Style_Justified => TRUE,
2615 Style_String_Prefix =>
2616 "\s78\widctlpar\adjustright",
2617 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext78 ");
2618 -- Note: Narrower space between.
2619 Set_Style (Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6),
2620 Font => ARM_Output.Default,
2621 Body_Font => Output_Object.Body_Font,
2622 Font_Size => 18,
2623 Style_Indent => INDENT_UNIT*6,
2624 Style_Hang_Width => 720,
2625 Style_Before => 0,
2626 Style_After => 90,
2627 Style_Justified => TRUE,
2628 Style_String_Prefix =>
2629 "\s79\widctlpar\adjustright",
2630 Style_String_Suffix => "\cgrid\qj\sl-190\slmult0 \snext79 ");
2631 -- Note: Narrower space between.
2632
2633 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 2), -- Indented for notes.
2634 Font => ARM_Output.Fixed,
2635 Body_Font => Output_Object.Body_Font,
2636 Font_Size => 16,
2637 Style_Indent => INDENT_UNIT*2,
2638 Style_Before => 0,
2639 Style_After => 80,
2640 Style_Justified => FALSE,
2641 Style_String_Prefix =>
2642 "\s80\widctlpar\adjustright",
2643 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext80 ");
2644 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1),
2645 Font => ARM_Output.Swiss,
2646 Body_Font => Output_Object.Body_Font,
2647 Font_Size => 16,
2648 Style_Indent => INDENT_UNIT*1,
2649 Style_Before => 0,
2650 Style_After => 80,
2651 Style_Justified => FALSE,
2652 Style_String_Prefix =>
2653 "\s81\widctlpar\adjustright",
2654 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext81 ");
2655 Set_Style (Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2),
2656 Font => ARM_Output.Swiss,
2657 Body_Font => Output_Object.Body_Font,
2658 Font_Size => 16,
2659 Style_Indent => INDENT_UNIT*2,
2660 Style_Before => 0,
2661 Style_After => 80,
2662 Style_Justified => FALSE,
2663 Style_String_Prefix =>
2664 "\s82\widctlpar\adjustright",
2665 Style_String_Suffix => "\cgrid\ql\sl-180\slmult0 \snext82 ");
2666 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 1),
2667 Font => ARM_Output.Fixed,
2668 Body_Font => Output_Object.Body_Font,
2669 Font_Size => 16,
2670 Style_Indent => INDENT_UNIT*1,
2671 Style_Before => 0,
2672 Style_After => 80,
2673 Style_Justified => FALSE,
2674 Style_String_Prefix =>
2675 "\s83\widctlpar\adjustright",
2676 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext83 ");
2677 Set_Style (Paragraph_Info(ARM_Output.Examples, 5), -- Child Indented examples
2678 Font => ARM_Output.Fixed,
2679 Body_Font => Output_Object.Body_Font,
2680 Font_Size => 18,
2681 Style_Indent => INDENT_UNIT*5,
2682 Style_Before => 0,
2683 Style_After => 100,
2684 Style_Justified => FALSE,
2685 Style_String_Prefix =>
2686 "\s84\widctlpar\adjustright",
2687 Style_String_Suffix => "\cgrid\ql\sl-190\slmult0 \snext84 ");
2688 Set_Style (Paragraph_Info(ARM_Output.Small_Examples, 7), -- Child Indented examples in annotations.
2689 Font => ARM_Output.Fixed,
2690 Body_Font => Output_Object.Body_Font,
2691 Font_Size => 16,
2692 Style_Indent => INDENT_UNIT*7,
2693 Style_Before => 0,
2694 Style_After => 80,
2695 Style_Justified => FALSE,
2696 Style_String_Prefix =>
2697 "\s85\widctlpar\adjustright",
2698 Style_String_Suffix => "\cgrid\ql\sl-170\slmult0 \snext85 ");
2699
2700 -- The following are indented three extra levels:
2701 Set_Style (Paragraph_Info(ARM_Output.Narrow_Hanging, 4),
2702 Font => ARM_Output.Default,
2703 Body_Font => Output_Object.Body_Font,
2704 Font_Size => 22,
2705 Style_Indent => INDENT_UNIT*4,
2706 Style_Hang_Width => 360,
2707 Style_Before => 0,
2708 Style_After => 120,
2709 Style_Justified => TRUE,
2710 Style_String_Prefix =>
2711 "\s86\widctlpar\adjustright",
2712 Style_String_Suffix => "\cgrid\qj\sl-240\slmult0 \snext86 ");
2713 -- Note: Narrower space between and afterwards.
2714
2715 -- New styles should be added here, following numbers will need adjustments.
2716 Set_Style (Heading_4_Info,
2717 Font => ARM_Output.Swiss,
2718 Body_Font => Output_Object.Body_Font,
2719 Font_Size => 27,
2720 Style_Indent => 0,
2721 Style_Before => 210,
2722 Style_After => 100,
2723 Style_Justified => FALSE,
2724 Style_String_Prefix =>
2725 "\s87\keepn\widctlpar\outlinelevel3\adjustright",
2726 Style_String_Suffix => "\b\ql\cgrid \sbasedon0 \snext0 ");
2727 if Output_Object.Big_Files then
2728 -- Define the TOC styles:
2729 Set_Style (TOC_1_Info,
2730 Font => ARM_Output.Swiss,
2731 Body_Font => Output_Object.Body_Font,
2732 Font_Size => 24,
2733 Style_Indent => 0,
2734 Style_Before => 60,
2735 Style_After => 60,
2736 Style_Justified => FALSE,
2737 Style_String_Prefix =>
2738 "\s88\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
2739 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
2740 Set_Style (TOC_2_Info,
2741 Font => ARM_Output.Swiss,
2742 Body_Font => Output_Object.Body_Font,
2743 Font_Size => 22,
2744 Style_Indent => 200,
2745 Style_Before => 0,
2746 Style_After => 0,
2747 Style_Justified => FALSE,
2748 Style_String_Prefix =>
2749 "\s89\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
2750 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
2751 Set_Style (TOC_3_Info,
2752 Font => ARM_Output.Swiss,
2753 Body_Font => Output_Object.Body_Font,
2754 Font_Size => 22,
2755 Style_Indent => 400,
2756 Style_Before => 0,
2757 Style_After => 0,
2758 Style_Justified => FALSE,
2759 Style_String_Prefix =>
2760 "\s90\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
2761 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
2762 Set_Style (TOC_4_Info,
2763 Font => ARM_Output.Swiss,
2764 Body_Font => Output_Object.Body_Font,
2765 Font_Size => 22,
2766 Style_Indent => 600,
2767 Style_Before => 0,
2768 Style_After => 0,
2769 Style_Justified => FALSE,
2770 Style_String_Prefix =>
2771 "\s91\widctlpar\tqr\tldot\tx" & Paper_Width & "\adjustright",
2772 Style_String_Suffix => "\b\cgrid \sbasedon0 \snext0 ");
2773 end if;
2774 Set_Style (Table_C_Text_Info,
2775 Font => ARM_Output.Default,
2776 Body_Font => Output_Object.Body_Font,
2777 Font_Size => 22,
2778 Style_Indent => 0,
2779 Style_Before => 10,
2780 Style_After => 10,
2781 Style_Justified => FALSE,
2782 Style_String_Prefix => "",
2783 Style_String_Suffix => "\qc ");
2784 -- We use a bit of space above and below to avoid overrunning
2785 -- the borders of the cells.
2786 Set_Style (Table_L_Text_Info,
2787 Font => ARM_Output.Default,
2788 Body_Font => Output_Object.Body_Font,
2789 Font_Size => 22,
2790 Style_Indent => 0,
2791 Style_Before => 20,
2792 Style_After => 20,
2793 Style_Justified => FALSE,
2794 Style_String_Prefix => "",
2795 Style_String_Suffix => "\ql ");
2796 Set_Style (Table_C_Sml_Text_Info,
2797 Font => ARM_Output.Default,
2798 Body_Font => Output_Object.Body_Font,
2799 Font_Size => 18,
2800 Style_Indent => 0,
2801 Style_Before => 20,
2802 Style_After => 20,
2803 Style_Justified => FALSE,
2804 Style_String_Prefix => "",
2805 Style_String_Suffix => "\qc ");
2806 Set_Style (Table_L_Sml_Text_Info,
2807 Font => ARM_Output.Default,
2808 Body_Font => Output_Object.Body_Font,
2809 Font_Size => 18,
2810 Style_Indent => 0,
2811 Style_Before => 20,
2812 Style_After => 20,
2813 Style_Justified => FALSE,
2814 Style_String_Prefix => "",
2815 Style_String_Suffix => "\ql ");
2816 end if;
2817
2818 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 0));
2819 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Normal;}");
2820 -- Normal style.
2821 Write_Style (Output_Object.Output_File, Heading_1_Info);
2822 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 1;}");
2823 Write_Style (Output_Object.Output_File, Heading_2_Info);
2824 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 2;}");
2825 Write_Style (Output_Object.Output_File, Heading_3_Info);
2826 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 3;}");
2827 Write_Style (Output_Object.Output_File, Category_Header_Info);
2828 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Category Header;}");
2829 Write_Style (Output_Object.Output_File, Normal_Paragraph_Number_Info);
2830 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Paragraph Number;}");
2831 Write_Style (Output_Object.Output_File, Wide_Paragraph_Number_Info);
2832 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Large Paragraph Number;}");
2833 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 1));
2834 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes;}");
2835 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 2));
2836 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Annotations;}");
2837 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 1));
2838 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Examples;}");
2839 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 3));
2840 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Examples;}");
2841 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 1));
2842 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented;}");
2843 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 3));
2844 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Normal Indented;}");
2845 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 5));
2846 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented;}");
2847 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Hanging, 3));
2848 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Hanging;}");
2849 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 1));
2850 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Narrow Hanging;}");
2851 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Hanging, 5));
2852 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Hanging;}");
2853 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 3));
2854 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Narrow Hanging;}");
2855 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 1));
2856 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Bulleted;}");
2857 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 2));
2858 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested Bulleted;}");
2859 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Bulleted, 3));
2860 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Bulleted;}");
2861 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 4));
2862 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested Bulleted;}");
2863 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 4));
2864 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Bulleted;}");
2865 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 2));
2866 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented Bulleted;}");
2867 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Bulleted, 3));
2868 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Bulleted;}");
2869 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 2));
2870 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented;}");
2871 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 4));
2872 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Code Indented;}");
2873 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 4));
2874 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Examples;}");
2875 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 6));
2876 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Examples;}");
2877 Write_Style (Output_Object.Output_File, Header_Info);
2878 Ada.Text_IO.Put_Line (Output_Object.Output_File, "header;}");
2879 Write_Style (Output_Object.Output_File, Footer_Info);
2880 Ada.Text_IO.Put_Line (Output_Object.Output_File, "footer;}");
2881 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\*\cs30 \additive \sbasedon30 page number;}");
2882 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Index, 0));
2883 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Index;}");
2884 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Above, 0));
2885 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Wide;}");
2886 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Above, 2));
2887 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Wide Annotations;}");
2888 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Header, 1));
2889 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Header;}");
2890 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Bulleted, 2));
2891 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Bulleted;}");
2892 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 3));
2893 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Notes Nested Bulleted;}");
2894 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Hanging_in_Bulleted, 3));
2895 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Hanging in Bulleted;}");
2896 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Hanging_in_Bulleted, 5));
2897 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Hanging in Bulleted;}");
2898 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 4));
2899 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Bulleted;}");
2900 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Syntax_Summary, 1));
2901 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Summary;}");
2902 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 1));
2903 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Enumerated;}");
2904 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 3));
2905 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Enumerated;}");
2906 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 2));
2907 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested Enumerated;}");
2908 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 4));
2909 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested Enumerated;}");
2910 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 3));
2911 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested X2 Bulleted;}");
2912 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Nested_Bulleted, 5));
2913 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested X2 Bulleted;}");
2914 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Nested_Bulleted, 5));
2915 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Nested Bulleted;}");
2916 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Normal, 4));
2917 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Inner Indented;}");
2918 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 6));
2919 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Inner Indented;}");
2920 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small, 3));
2921 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Syntax Indented;}");
2922 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 1));
2923 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Examples;}");
2924 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 3));
2925 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Examples;}");
2926 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 4));
2927 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Indented Examples;}");
2928 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 6));
2929 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Indented Examples;}");
2930 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Enumerated, 3));
2931 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Nested X2 Enumerated;}");
2932 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Enumerated, 5));
2933 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Nested X2 Enumerated;}");
2934 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 2));
2935 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Syntax Indented Examples;}");
2936 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 4));
2937 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Syntax Indented Examples;}");
2938 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 2));
2939 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Syntax Indented Examples;}");
2940 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 4));
2941 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Syntax Indented Examples;}");
2942 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 3));
2943 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Code Indented Examples;}");
2944 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 5));
2945 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Code Indented Examples;}");
2946 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Swiss_Examples, 3));
2947 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Swiss Code Indented Examples;}");
2948 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 5));
2949 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Code Indented Examples;}");
2950 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Title, 0));
2951 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Standard Title;}");
2952 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Giant_Hanging, 4));
2953 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Giant Hanging;}");
2954 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 2));
2955 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Medium Hanging;}");
2956 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Giant_Hanging, 6));
2957 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Giant Hanging;}");
2958 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 4));
2959 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Medium Hanging;}");
2960 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 2));
2961 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Narrow Hanging;}");
2962 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 3));
2963 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Narrow Hanging;}");
2964 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Wide_Hanging, 4));
2965 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Indented Hanging;}");
2966 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 4));
2967 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Narrow Hanging;}");
2968 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 5));
2969 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Medium Hanging;}");
2970 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Wide_Hanging, 6));
2971 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Indented Hanging;}");
2972 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Narrow_Hanging, 3));
2973 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Dbl Indented Narrow Hanging;}");
2974 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Medium_Hanging, 4));
2975 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Dbl Indented Narrow Hanging;}");
2976 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Narrow_Hanging, 5));
2977 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Dbl Indented Narrow Hanging;}");
2978 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Medium_Hanging, 6));
2979 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Dbl Indented Medium Hanging;}");
2980 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 2));
2981 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Notes Indented Examples;}");
2982 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 1));
2983 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Basic Examples;}");
2984 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Swiss_Examples, 2));
2985 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Swiss Indented Basic Examples;}");
2986 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 1));
2987 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Basic Examples;}");
2988 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Examples, 5));
2989 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Child Indented Examples;}");
2990 Write_Style (Output_Object.Output_File, Paragraph_Info(ARM_Output.Small_Examples, 6));
2991 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Small Child Indented Examples;}");
2992 if Output_Object.Big_Files then
2993 Write_Style (Output_Object.Output_File, Heading_4_Info);
2994 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 4;}");
2995 -- Define the TOC styles:
2996 Write_Style (Output_Object.Output_File, TOC_1_Info);
2997 Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 1;}");
2998 Write_Style (Output_Object.Output_File, TOC_2_Info);
2999 Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 2;}");
3000 Write_Style (Output_Object.Output_File, TOC_3_Info);
3001 Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 3;}");
3002 Write_Style (Output_Object.Output_File, TOC_4_Info);
3003 Ada.Text_IO.Put_Line (Output_Object.Output_File, "toc 4;}}");
3004 else
3005 Write_Style (Output_Object.Output_File, Heading_4_Info);
3006 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Heading 4;}}");
3007 end if;
3008 -- \additive means that the style inherits from the previous style.
3009 -- \basedon defines the style that the style was inherited from.
3010 -- \snext defines the next style to use (if omitted, use same style).
3011 -- \shidden - Don't show the style in the drop down menu.
3012
3013 -- Formatting properties:
3014 -- \widctlpar - Widow/orphan control in this paragraph;
3015 -- \adjustright - adjust right indent for document properties;
3016 -- \fs - font size in halfpoints (.5 pt);
3017 -- \f - font number;
3018 -- \q - text alignment (j - justified, c - centered, l - left, r -right);
3019 -- \cgrid - set the character grid(?) to the default;
3020 -- \li - left indent, in twips (.1 pt);
3021 -- \fi - first line indent, in twips (.1 pt);
3022 -- \sa - space after paragraph, in twips (.1 pt);
3023 -- \sb - space before paragraph, in twips (.1 pt);
3024 -- \sl - space between lines, in twips. "Exactly" if negative, "At least" if positive.
3025 -- \slmult0 - line space multiple - 0 - Exactly or "At least"/.
3026 -- \pard - reset to default paragraph properties;
3027 -- \plain - reset to default font/character properties;
3028 -- \tx - set tab at location, in twips (.1 pt);
3029 -- \tqc - set following tab as a centered tab;
3030 -- \tqr - set following tab as a right tab.
3031
3032 -- Revision table:
3033 Ada.Text_IO.Put (Output_Object.Output_File, "{\*\revtbl ");
3034 if Ada.Strings.Unbounded.Length (Output_Object.Version_Names('0')) = 0 then
3035 Ada.Text_IO.Put (Output_Object.Output_File, "{Original Text;}");
3036 else
3037 Ada.Text_IO.Put (Output_Object.Output_File, "{" &
3038 Ada.Strings.Unbounded.To_String(Output_Object.Version_Names('0')) &
3039 ";}");
3040 end if;
3041 for Version in Character range '1' .. '9' loop
3042 if Ada.Strings.Unbounded.Length (Output_Object.Version_Names(Version)) /= 0 then
3043 Ada.Text_IO.Put (Output_Object.Output_File, "{" &
3044 Ada.Strings.Unbounded.To_String(Output_Object.Version_Names(Version)) &
3045 ";}");
3046 else exit; -- No more after the first empty one.
3047 end if;
3048 end loop;
3049 Ada.Text_IO.Put_Line (Output_Object.Output_File, "}");
3050
3051 -- Information (truncated):
3052 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\info{\title " &
3053 Ada.Strings.Unbounded.To_String (Output_Object.Title) & "}");
3054
3055 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\version2");
3056
3057 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\author AXE Consultants}"); -- Working.
3058 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\operator Randall Brukardt, Principle Technician}}");
3059 --Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\author JTC1/SC22/WG9/ARG}"); -- Final.
3060 --Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\operator Randall Brukardt, ARG Editor}}");
3061
3062 -- Initial setup (document properties):
3063 -- Paper size:
3064 -- Note: If changing the page size or margins, be sure to change the
3065 -- header and footer tab settings as well.
3066 case Output_Object.Page_Size is
3067 when ARM_RTF.A4 =>
3068 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw11909\paperh16834"); -- Set paper to A4.
3069 when ARM_RTF.Letter =>
3070 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw12240\paperh15840"); -- Set paper to US Letter.
3071 when ARM_RTF.Half_Letter =>
3072 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw7920\paperh12240"); -- Set paper to 5.5x8.5.
3073 when ARM_RTF.Ada95 =>
3074 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\paperw10080\paperh12960"); -- Set paper to 7x9.
3075 end case;
3076
3077 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\facingp\margmirror"); -- Set to facing pages and mirrored margins.
3078 -- Margins.
3079 case Output_Object.Page_Size is
3080 when ARM_RTF.Ada95 | ARM_RTF.Half_Letter =>
3081 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\margl1440\margr900\margt1080\margb1080");
3082 when ARM_RTF.Letter | ARM_RTF.A4 =>
3083 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\margl1800\margr1080\margt1440\margb1440");
3084 end case;
3085 -- Revisions:
3086 if Output_Object.Includes_Changes then
3087 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\revisions\revprop3 \revbar0 ");
3088 -- \revisions - Revisions marking is on;
3089 -- \revprop3 - Show revisions as underlined.
3090 -- \revbar0 - No revision bars.
3091 -- Alternatively, use \revprop0\revbar3, using the infamous
3092 -- vertical bar on the outside, and no other highlighting.
3093 -- else not changes, thus no revisions.
3094 end if;
3095 -- Other properties:
3096 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\widowctrl\ftnbj\aenddoc\lytprtmet\formshade\viewkind1\viewscale100");
3097 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgbrdrhead\pgbrdrfoot\fet0");
3098 -- \widowctrl - Enable widow and orphan control;
3099 -- \ftnbj - Footnotes at bottom of page;
3100 -- \aenddoc - Endnotes at end of document;
3101 -- \lytprtmet - Layout using printer metrics;
3102 -- \formshade - Form field shading is on;
3103 -- \viewkind - Default view of the document (1-Page Layout; 4-Normal);
3104 -- \viewscale100 - Percentage zoom of the document (100%);
3105 -- \pgbrdrhead - Page border surrounds header;
3106 -- \pgbrdrfoot - Page border surrounds footer;
3107 -- \fet0 - Footnote/endnote control: 0 - Footnotes only (or none);
3108 -- Section properties:
3109 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sectd\linex0\endnhere\sectdefaultcl\sbkodd\headery540\footery540");
3110 -- \sectd - Default section properties;
3111 -- \linex0 - Line number spacing (0 - none);
3112 -- \endnhere- Endnotes included;
3113 -- \sectdefaultcl - Default character layout for section.
3114 -- \sbkodd - Start at top of odd page.
3115 -- \headery - Distance (in twips) of header from top of page.
3116 -- \footery - Distance (in twips) of footerr from bottom of page.
3117 if Name = "Ttl" or else -- Title page
3118 Name = "All" then -- Single giant file
3119 -- No page numbers, headers, or footers here.
3120 null;
3121 else
3122 if Name = "00" or else Name = "TOC" then
3123 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgnlcrm\pgncont "); -- Lower-case roman numeral, numbers continue.
3124 elsif Name = "01" then
3125 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgndec\pgnstart1\pgnrestart "); -- Decimal page number; starts at 1 here.
3126 else
3127 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\pgndec\pgncont "); -- Decimal page number, numbers continue.
3128 end if;
3129 -- Write the page headers:
3130 Write_Headers (Output_Object);
3131 end if;
3132 Output_Object.Wrote_into_Section := False;
3133 end Start_RTF_File;
3134
3135
3136 procedure End_RTF_File (Output_Object : in out RTF_Output_Type) is
3137 -- Internal routine.
3138 -- Generate the needed text to end an RTF file. Also closes the file.
3139 begin
3140 Ada.Text_IO.Put_Line (Output_Object.Output_File, "}");
3141 Ada.Text_IO.Close (Output_Object.Output_File);
3142 end End_RTF_File;
3143
3144
3145 procedure Create (Output_Object : in out RTF_Output_Type;
3146 Page_Size : in ARM_RTF.Page_Size;
3147 Includes_Changes : in Boolean;
3148 Big_Files : in Boolean;
3149 File_Prefix : in String;
3150 Output_Path : in String;
3151 Primary_Sans_Serif_Font : in Sans_Serif_Fonts := Arial;
3152 Primary_Serif_Font : in Serif_Fonts := Times_New_Roman;
3153 Body_Font : in ARM_Output.Font_Family_Type := ARM_Output.Roman;
3154 Header_Prefix : in String := "";
3155 Footer_Use_Date : in Boolean;
3156 Footer_Use_Clause_Name : in Boolean;
3157 Footer_Use_ISO_Format : in Boolean;
3158 Footer_Text : in String := "";
3159 Version_Names : in ARM_Contents.Versioned_String;
3160 Title : in String := "") is
3161 -- Create an Output_Object for a document with the specified page
3162 -- size. Changes from the base document are included if
3163 -- Includes_Changes is True (otherwise no revisions are generated).
3164 -- Generate a few large output files if
3165 -- Big_Files is True; otherwise generate smaller output files.
3166 -- The prefix of the output file names is File_Prefix - this
3167 -- should be no more then 4 characters allowed in file names.
3168 -- The files will be written into Output_Path.
3169 -- The title of the document is Title.
3170 -- The header prefix appears in the header (if any) before the title,
3171 -- separated by a dash.
3172 -- The footer consists of the page number, the date if Footer_Use_Date
3173 -- is true, and the clause name if Footer_Use_Clase_Name is True, and
3174 -- the Footer_Text otherwise. The font and size of the footer is as
3175 -- an ISO standard if Footer_Use_ISO_Format is True, and as the
3176 -- Ada Reference Manual otherwise.
3177 -- The primary font used for the Sans_Serif text, and for the Serif
3178 -- text, is as specified.
3179 -- Which font is used for the body is specified by Body_Font.
3180 -- The author names of the various versions is specified by the
3181 -- Version_Names.
3182 begin
3183 if Output_Object.Is_Valid then
3184 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3185 "Already valid object");
3186 end if;
3187 Output_Object.Is_Valid := True;
3188 Output_Object.Page_Size := Page_Size;
3189 Output_Object.Includes_Changes := Includes_Changes;
3190 Output_Object.Big_Files := Big_Files;
3191 Ada.Strings.Fixed.Move (Target => Output_Object.File_Prefix,
3192 Source => File_Prefix);
3193 Output_Object.Output_Path :=
3194 Ada.Strings.Unbounded.To_Unbounded_String (Output_Path);
3195 Output_Object.Primary_Sans_Serif_Font := Primary_Sans_Serif_Font;
3196 Output_Object.Primary_Serif_Font := Primary_Serif_Font;
3197 Output_Object.Body_Font := Body_Font;
3198 Output_Object.Title := Ada.Strings.Unbounded.To_Unbounded_String (Title);
3199 Output_Object.Header_Prefix :=
3200 Ada.Strings.Unbounded.To_Unbounded_String (Header_Prefix);
3201 Output_Object.Footer_Text :=
3202 Ada.Strings.Unbounded.To_Unbounded_String (Footer_Text);
3203 Output_Object.Footer_Use_Date := Footer_Use_Date;
3204 Output_Object.Footer_Use_Clause_Name := Footer_Use_Clause_Name;
3205 Output_Object.Footer_Use_ISO_Format := Footer_Use_ISO_Format;
3206 Output_Object.Version_Names := Version_Names;
3207 if Big_Files then
3208 -- We're going to generate a single giant file. Open it now.
3209 Start_RTF_File (Output_Object,
3210 Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right),
3211 Ada.Strings.Unbounded.To_String (Output_Object.Title),
3212 "All");
3213 Ada.Text_IO.New_Line (Output_Object.Output_File);
3214 end if;
3215 end Create;
3216
3217
3218 procedure Close (Output_Object : in out RTF_Output_Type) is
3219 -- Close an Output_Object. No further output to the object is
3220 -- allowed after this call.
3221 begin
3222 if not Output_Object.Is_Valid then
3223 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3224 "Not valid object");
3225 end if;
3226 if Ada.Text_IO.Is_Open (Output_Object.Output_File) then
3227 End_RTF_File (Output_Object);
3228 end if;
3229 Output_Object.Is_Valid := False;
3230 end Close;
3231
3232
3233 procedure Section (Output_Object : in out RTF_Output_Type;
3234 Section_Title : in String;
3235 Section_Name : in String) is
3236 -- Start a new section. The title is Section_Title (this is
3237 -- intended for humans). The name is Section_Name (this is
3238 -- intended to be suitable to be a portion of a file name).
3239 begin
3240 if not Output_Object.Is_Valid then
3241 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3242 "Not valid object");
3243 end if;
3244 if Output_Object.Is_In_Paragraph then
3245 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3246 "Section in paragraph");
3247 end if;
3248 if not Output_Object.Big_Files then
3249 if Ada.Text_IO.Is_Open (Output_Object.Output_File) then
3250 End_RTF_File (Output_Object);
3251 end if;
3252
3253 -- Create a new file for this section:
3254 Start_RTF_File (Output_Object,
3255 Ada.Strings.Fixed.Trim (Output_Object.File_Prefix, Ada.Strings.Right) &
3256 "-" & Section_Name,
3257 Section_Title,
3258 Section_Name);
3259 Ada.Text_IO.New_Line (Output_Object.Output_File);
3260 else
3261 if Output_Object.Wrote_into_Section then
3262 -- Just a new section header (odd page break) and page number setup:
3263 if Section_Name = "TOC" then
3264 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgnlcrm\pgnstart1\pgnrestart ");
3265 -- Lower-case roman number page number; reset to 1.
3266 elsif Section_Name = "00" then
3267 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgnlcrm\pgncont ");
3268 -- Lower-case roman numeral, numbers continue.
3269 elsif Section_Name = "01" then
3270 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgndec\pgnstart1\pgnrestart ");
3271 -- Decimal page number; starts at 1 here.
3272 else
3273 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgndec\pgncont ");
3274 -- Decimal page number, numbers continue.
3275 end if;
3276 -- Write the page headers:
3277 Write_Headers (Output_Object);
3278 -- else Probably the title page: no headers or footers.
3279 end if;
3280 Output_Object.Wrote_into_Section := False;
3281 end if;
3282 end Section;
3283
3284
3285 procedure Set_Columns (Output_Object : in out RTF_Output_Type;
3286 Number_of_Columns : in ARM_Output.Column_Count) is
3287 -- Set the number of columns.
3288 -- Raises Not_Valid_Error if in a paragraph.
3289 begin
3290 if not Output_Object.Is_Valid then
3291 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3292 "Not valid object");
3293 end if;
3294 if Output_Object.Is_In_Paragraph then
3295 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3296 "In paragraph");
3297 end if;
3298 if Number_of_Columns = Output_Object.Column_Count then
3299 return;
3300 end if;
3301 if Output_Object.Wrote_into_Section then
3302 Ada.Text_IO.Put (Output_Object.Output_File, "\sect\sbknone");
3303 end if;
3304 case Number_of_Columns is
3305 when 1 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols1 ");
3306 when 2 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols2\colsx0 ");
3307 -- Two columns, no space between. (Paragraph formatting
3308 -- will take care of that.)
3309 when 3 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols3\colsx0 ");
3310 when 4 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols4\colsx0 ");
3311 when 5 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols5\colsx0 ");
3312 when 6 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols6\colsx0 ");
3313 when 7 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols7\colsx0 ");
3314 when 8 => Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cols8\colsx0 ");
3315 end case;
3316 Output_Object.Column_Count := Number_of_Columns;
3317 end Set_Columns;
3318
3319
3320 procedure Set_Tabs (Output_Object : in out RTF_Output_Type;
3321 Style : in ARM_Output.Paragraph_Style_Type;
3322 Indent : in ARM_Output.Paragraph_Indent_Type) is
3323 -- Set tabs in the current (just started) paragraph.
3324 begin
3325 case Style is
3326 when ARM_Output.Normal | ARM_Output.Wide_Above |
3327 ARM_Output.Small | ARM_Output.Small_Wide_Above |
3328 ARM_Output.Header | ARM_Output.Small_Header |
3329 ARM_Output.Index | ARM_Output.Syntax_Summary |
3330 ARM_Output.Title |
3331 ARM_Output.Examples | ARM_Output.Small_Examples |
3332 ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples =>
3333 if Output_Object.Tab_Stops.Number /= 0 then
3334 if (Output_Object.Tab_Stops.Number * 8) + Output_Object.Char_Count >
3335 LINE_LENGTH then
3336 Ada.Text_IO.New_Line (Output_Object.Output_File);
3337 Output_Object.Char_Count := 0;
3338 end if;
3339 declare
3340 function Stop_in_Twips (Stop : ARM_Output.Tab_Stop_Type) return Natural is
3341 -- Return the value of a tab stop in Twips:
3342 begin
3343 if ARM_Output."="(Stop.Kind, ARM_Output.Left_Fixed) then
3344 return Stop.Stop*120 +
3345 Paragraph_Info(Style, Indent).Indent;
3346 -- *120 is to convert picas to Twips.
3347 else
3348 -- Scale with font size. (Stop assumes 12 pt
3349 -- type).
3350 -- Raw formula:
3351 -- (Stop.Stop * 120) -- Stop in twips.
3352 -- * (Paragraph_Info(Format).Size / 24) -- Font scale.
3353 -- After rearranging, we get:
3354 return
3355 Stop.Stop * Paragraph_Info(Style, Indent).Size * 5 +
3356 Paragraph_Info(Style, Indent).Indent;
3357 end if;
3358 end Stop_in_Twips;
3359
3360 begin
3361 for I in 1 .. Output_Object.Tab_Stops.Number loop
3362 -- Define tab stops.
3363 declare
3364 Num : String := Integer'Image (Stop_in_Twips (
3365 Output_Object.Tab_Stops.Stops(I)));
3366 begin
3367 Ada.Text_IO.Put (Output_Object.Output_File, "\tx");
3368 Ada.Text_IO.Put (Output_Object.Output_File, Num(2..Num'Length));
3369 Ada.Text_IO.Put (Output_Object.Output_File, " ");
3370 Output_Object.Char_Count := Output_Object.Char_Count + 4 + Num'Length-1;
3371 end;
3372 end loop;
3373 end;
3374 -- else no tabs defined.
3375 end if;
3376
3377 when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
3378 ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted |
3379 ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging |
3380 ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging |
3381 ARM_Output.Hanging_in_Bulleted |
3382 ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging |
3383 ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging |
3384 ARM_Output.Small_Hanging_in_Bulleted |
3385 ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
3386 if Output_Object.Tab_Stops.Number /= 0 then
3387 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3388 "Tabs in hanging/bulleted paragraph");
3389 end if;
3390 end case;
3391 end Set_Tabs;
3392
3393
3394 procedure Start_Paragraph (Output_Object : in out RTF_Output_Type;
3395 Style : in ARM_Output.Paragraph_Style_Type;
3396 Indent : in ARM_Output.Paragraph_Indent_Type;
3397 Number : in String;
3398 No_Prefix : in Boolean := False;
3399 Tab_Stops : in ARM_Output.Tab_Info := ARM_Output.NO_TABS;
3400 No_Breaks : in Boolean := False;
3401 Keep_with_Next : in Boolean := False;
3402 Space_After : in ARM_Output.Space_After_Type
3403 := ARM_Output.Normal;
3404 Justification : in ARM_Output.Justification_Type
3405 := ARM_Output.Default) is
3406 -- Start a new paragraph. The style and indent of the paragraph is as
3407 -- specified. The (AA)RM paragraph number (which might include update
3408 -- and version numbers as well: [12.1/1]) is Number. If the format is
3409 -- a type with a prefix (bullets, hangining items), the prefix is
3410 -- omitted if No_Prefix is true. Tab_Stops defines the tab stops for
3411 -- the paragraph. If No_Breaks is True, we will try to avoid page breaks
3412 -- in the paragraph. If Keep_with_Next is true, we will try to avoid
3413 -- separating this paragraph and the next one. (These may have no
3414 -- effect in formats that don't have page breaks). Space_After
3415 -- specifies the amount of space following the paragraph. Justification
3416 -- specifies the text justification for the paragraph. Not_Valid_Error
3417 -- is raised if Tab_Stops /= NO_TABS for a hanging or bulleted format.
3418 begin
3419 if not Output_Object.Is_Valid then
3420 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3421 "Not valid object");
3422 end if;
3423 if Output_Object.Is_In_Paragraph then
3424 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3425 "Already in paragraph");
3426 end if;
3427 if not Paragraph_Info(Style, Indent).Defined then
3428 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3429 "Undefined Style " & ARM_Output.Paragraph_Style_Type'Image(Style) &
3430 " and Indent:" & ARM_Output.Paragraph_Indent_Type'Image(Indent));
3431 end if;
3432 Output_Object.Is_In_Paragraph := True;
3433 Output_Object.Had_Prefix := not No_Prefix;
3434 Output_Object.Char_Count := 0;
3435 Output_Object.Saw_Hang_End := False;
3436 Output_Object.Wrote_into_Section := True;
3437
3438 -- First, write the paragraph number, if any. This has its own style.
3439 if Number /= "" then -- We have a paragraph number.
3440 -- Most paragraph numbers are 7 or fewer characters. The box is
3441 -- sized for 7 characters. If we have 8 characters (as in 277.10/2),
3442 -- we need a wider box.
3443 if Number'Length > 7 then
3444 Write_Style_for_Paragraph (Output_Object.Output_File,
3445 Wide_Paragraph_Number_Info, Output_Object.Char_Count);
3446 else
3447 Write_Style_for_Paragraph (Output_Object.Output_File,
3448 Normal_Paragraph_Number_Info, Output_Object.Char_Count);
3449 end if;
3450 -- Figure the space above: (We use a variable space above so the
3451 -- numbers align with the bottom of the text, not the top).
3452 declare
3453 Diff : Natural := (Paragraph_Info(Style, Indent).Size -
3454 Normal_Paragraph_Number_Info.Size) +
3455 (Paragraph_Info(Style, Indent).Before/10);
3456 -- This would seem to be double the required adjustment for the
3457 -- size, but it works. So why question it?
3458 begin
3459 if Diff >= 30 then
3460 Ada.Text_IO.Put (Output_Object.Output_File, "\sb3" &
3461 Character'Val(Diff mod 10 + Character'Pos('0')) & "0 ");
3462 elsif Diff >= 20 then
3463 Ada.Text_IO.Put (Output_Object.Output_File, "\sb2" &
3464 Character'Val(Diff mod 10 + Character'Pos('0')) & "0 ");
3465 elsif Diff >= 10 then
3466 Ada.Text_IO.Put (Output_Object.Output_File, "\sb1" &
3467 Character'Val(Diff mod 10 + Character'Pos('0')) & "0 ");
3468 else
3469 Ada.Text_IO.Put (Output_Object.Output_File, "\sb" &
3470 Character'Val(Diff + Character'Pos('0')) & "0 ");
3471 end if;
3472 end;
3473 --*** Box width??
3474
3475 Ada.Text_IO.Put (Output_Object.Output_File, Number);
3476 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
3477 Output_Object.Char_Count := 0;
3478 -- else no paragraph number.
3479 end if;
3480 -- Now, write the paragraph header:
3481 case Style is
3482 when ARM_Output.Normal | ARM_Output.Wide_Above |
3483 ARM_Output.Small | ARM_Output.Small_Wide_Above |
3484 ARM_Output.Header | ARM_Output.Small_Header |
3485 ARM_Output.Index | ARM_Output.Syntax_Summary |
3486 ARM_Output.Title |
3487 ARM_Output.Examples | ARM_Output.Small_Examples |
3488 ARM_Output.Swiss_Examples | ARM_Output.Small_Swiss_Examples =>
3489 Write_Style_for_Paragraph (Output_Object.Output_File,
3490 Paragraph_Info(Style, Indent),
3491 Output_Object.Char_Count);
3492 --Ada.Text_IO.Put_Line ("Start paragraph - full style");
3493 when ARM_Output.Bulleted | ARM_Output.Nested_Bulleted |
3494 ARM_Output.Small_Bulleted | ARM_Output.Small_Nested_Bulleted =>
3495 Write_Style_for_Paragraph (Output_Object.Output_File,
3496 Paragraph_Info(Style, Indent),
3497 Output_Object.Char_Count);
3498 --Ada.Text_IO.Put_Line ("Start paragraph - full style (bullet)");
3499 if No_Prefix then
3500 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
3501 Output_Object.Char_Count := Output_Object.Char_Count + 5;
3502 else
3503 if ARM_Output."=" (Style, ARM_Output.Nested_Bulleted) or else
3504 ARM_Output."=" (Style, ARM_Output.Small_Nested_Bulleted) then
3505 -- Make a smaller bullet.
3506 if Paragraph_Info(Style, Indent).Size = 15 then
3507 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs12\'b7}\tab ");
3508 elsif Paragraph_Info(Style, Indent).Size = 16 then
3509 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs12\'b7}\tab ");
3510 elsif Paragraph_Info(Style, Indent).Size = 18 then
3511 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs14\'b7}\tab ");
3512 elsif Paragraph_Info(Style, Indent).Size = 20 then
3513 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs16\'b7}\tab ");
3514 else --if Paragraph_Info(Style, Indent).Size = 22 then
3515 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\fs18\'b7}\tab ");
3516 end if;
3517 Output_Object.Char_Count := Output_Object.Char_Count + 19;
3518 else -- Normal bullet.
3519 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'b7}\tab ");
3520 Output_Object.Char_Count := Output_Object.Char_Count + 14;
3521 end if;
3522 end if;
3523
3524 when ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging |
3525 ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging |
3526 ARM_Output.Hanging_in_Bulleted |
3527 ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging |
3528 ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging |
3529 ARM_Output.Small_Hanging_in_Bulleted |
3530 ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
3531 Write_Style_for_Paragraph (Output_Object.Output_File,
3532 Paragraph_Info(Style, Indent),
3533 Output_Object.Char_Count);
3534 --Ada.Text_IO.Put_Line ("Start paragraph - full style (hang)");
3535 if No_Prefix then
3536 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
3537 Output_Object.Char_Count := Output_Object.Char_Count + 5;
3538 Output_Object.Saw_Hang_End := True;
3539 else -- Has prefix.
3540 Output_Object.Saw_Hang_End := False;
3541 Output_Object.Prefix_Large_Char_Count := 0;
3542 end if;
3543 end case;
3544
3545 Output_Object.Paragraph_Style := Style;
3546 Output_Object.Paragraph_Indent := Indent;
3547 Output_Object.Font := ARM_Output.Default;
3548 Output_Object.Is_Bold := False;
3549 Output_Object.Is_Italic := False;
3550 Output_Object.Size := 0;
3551 Output_Object.Color := ARM_Output.Default;
3552 Output_Object.Real_Size := Paragraph_Info(Style,Indent).Size;
3553 Output_Object.Tab_Stops := Tab_Stops;
3554 Output_Object.Current_Space_After := Space_After;
3555
3556 Set_Tabs (Output_Object, Style, Indent);
3557
3558 if No_Breaks or Keep_with_Next then
3559 if Output_Object.Char_Count + 13 >
3560 LINE_LENGTH then
3561 Ada.Text_IO.New_Line (Output_Object.Output_File);
3562 Output_Object.Char_Count := 0;
3563 end if;
3564 if No_Breaks then
3565 Ada.Text_IO.Put (Output_Object.Output_File, "\keep ");
3566 Output_Object.Char_Count := Output_Object.Char_Count + 6;
3567 end if;
3568 if Keep_with_Next then
3569 Ada.Text_IO.Put (Output_Object.Output_File, "\keepn ");
3570 Output_Object.Char_Count := Output_Object.Char_Count + 7;
3571 end if;
3572 end if;
3573 if ARM_Output."=" (Space_After, ARM_Output.Narrow) then
3574 -- Reduce the following space by 30%:
3575 declare
3576 SA : constant String := Natural'Image((Paragraph_Info(Style, Indent).After*(LEADING_PERCENT/10))/10);
3577 begin
3578 if Output_Object.Char_Count + 4 + SA'Length - 1 >
3579 LINE_LENGTH then
3580 Ada.Text_IO.New_Line (Output_Object.Output_File);
3581 Output_Object.Char_Count := 0;
3582 end if;
3583 Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
3584 Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
3585 Ada.Text_IO.Put (Output_Object.Output_File, " ");
3586 Output_Object.Char_Count := 4 + SA'Length - 1;
3587 end;
3588 elsif ARM_Output."=" (Space_After, ARM_Output.Wide) then
3589 -- Increase the following space by 50%:
3590 declare
3591 SA : constant String := Natural'Image((Paragraph_Info(Style, Indent).After*(TRAILING_PERCENT/10))/10);
3592 begin
3593 if Output_Object.Char_Count + 4 + SA'Length - 1 >
3594 LINE_LENGTH then
3595 Ada.Text_IO.New_Line (Output_Object.Output_File);
3596 Output_Object.Char_Count := 0;
3597 end if;
3598 Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
3599 Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
3600 Ada.Text_IO.Put (Output_Object.Output_File, " ");
3601 Output_Object.Char_Count := 4 + SA'Length - 1;
3602 end;
3603 end if;
3604 if ARM_Output."/=" (Justification, ARM_Output.Default) then
3605 if Output_Object.Char_Count + 4 >
3606 LINE_LENGTH then
3607 Ada.Text_IO.New_Line (Output_Object.Output_File);
3608 Output_Object.Char_Count := 0;
3609 end if;
3610 case Justification is
3611 when ARM_Output.Default => null; -- Can't get here.
3612 when ARM_Output.Left =>
3613 Ada.Text_IO.Put (Output_Object.Output_File, "\ql ");
3614 Output_Object.Char_Count := Output_Object.Char_Count + 4;
3615 when ARM_Output.Center =>
3616 Ada.Text_IO.Put (Output_Object.Output_File, "\qc ");
3617 Output_Object.Char_Count := Output_Object.Char_Count + 4;
3618 when ARM_Output.Right =>
3619 Ada.Text_IO.Put (Output_Object.Output_File, "\qr ");
3620 Output_Object.Char_Count := Output_Object.Char_Count + 4;
3621 when ARM_Output.Justified =>
3622 Ada.Text_IO.Put (Output_Object.Output_File, "\qj ");
3623 Output_Object.Char_Count := Output_Object.Char_Count + 4;
3624 end case;
3625 end if;
3626 -- Start hang (last), so we get a clean count of prefix characters:
3627 case Style is
3628 when ARM_Output.Giant_Hanging | ARM_Output.Wide_Hanging |
3629 ARM_Output.Medium_Hanging | ARM_Output.Narrow_Hanging |
3630 ARM_Output.Small_Giant_Hanging | ARM_Output.Small_Wide_Hanging |
3631 ARM_Output.Small_Medium_Hanging | ARM_Output.Small_Narrow_Hanging |
3632 ARM_Output.Hanging_in_Bulleted | ARM_Output.Small_Hanging_in_Bulleted |
3633 ARM_Output.Enumerated | ARM_Output.Small_Enumerated =>
3634 if not No_Prefix then
3635 Ada.Text_IO.New_Line (Output_Object.Output_File);
3636 Output_Object.Char_Count := 0;
3637 --Ada.Text_Io.Put ("Start Hang:");
3638 -- else no prefix, no need to count.
3639 end if;
3640 when others => null;
3641 end case;
3642 end Start_Paragraph;
3643
3644
3645 procedure End_Paragraph (Output_Object : in out RTF_Output_Type) is
3646 -- End a paragraph.
3647 begin
3648 if not Output_Object.Is_Valid then
3649 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3650 "Not valid object");
3651 end if;
3652 if not Output_Object.Is_In_Paragraph then
3653 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3654 "Not in paragraph");
3655 end if;
3656 Output_Object.Is_In_Paragraph := False;
3657 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
3658 Output_Object.Char_Count := 0;
3659 --Ada.Text_IO.Put_Line ("End paragraph '}'");
3660 end End_Paragraph;
3661
3662
3663 procedure Category_Header (Output_Object : in out RTF_Output_Type;
3664 Header_Text : String) is
3665 -- Output a Category header (that is, "Legality Rules",
3666 -- "Dynamic Semantics", etc.)
3667 -- (Note: We did not use a enumeration here to insure that these
3668 -- headers are spelled the same in all output versions).
3669 -- Raises Not_Valid_Error if in a paragraph.
3670 Count : Natural; -- Not used after being set.
3671 begin
3672 if not Output_Object.Is_Valid then
3673 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3674 "Not valid object");
3675 end if;
3676 if Output_Object.Is_In_Paragraph then
3677 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3678 "Header in paragraph");
3679 end if;
3680 Ada.Text_IO.New_Line (Output_Object.Output_File);
3681 Write_Style_for_Paragraph (Output_Object.Output_File,
3682 Category_Header_Info, Count);
3683 Ada.Text_IO.Put_Line (Output_Object.Output_File,
3684 Header_Text & "\par}");
3685 Output_Object.Char_Count := 0;
3686 Output_Object.Wrote_into_Section := True;
3687 end Category_Header;
3688
3689
3690 function Current_Date return String is
3691 -- Local routine:
3692 Date : Ada.Calendar.Time := Ada.Calendar.Clock;
3693 Day : constant String := Ada.Calendar.Day_Number'Image(Ada.Calendar.Day(Date));
3694 Year : constant String := Ada.Calendar.Year_Number'Image(Ada.Calendar.Year(Date));
3695 Month : constant Ada.Calendar.Month_Number := Ada.Calendar.Month(Date);
3696 begin
3697 case Month is
3698 when 1 => return Day(2..Day'Last) & " January" & Year;
3699 when 2 => return Day(2..Day'Last) & " February" & Year;
3700 when 3 => return Day(2..Day'Last) & " March" & Year;
3701 when 4 => return Day(2..Day'Last) & " April" & Year;
3702 when 5 => return Day(2..Day'Last) & " May" & Year;
3703 when 6 => return Day(2..Day'Last) & " June" & Year;
3704 when 7 => return Day(2..Day'Last) & " July" & Year;
3705 when 8 => return Day(2..Day'Last) & " August" & Year;
3706 when 9 => return Day(2..Day'Last) & " September" & Year;
3707 when 10 => return Day(2..Day'Last) & " October" & Year;
3708 when 11 => return Day(2..Day'Last) & " November" & Year;
3709 when 12 => return Day(2..Day'Last) & " December" & Year;
3710 end case;
3711 end Current_Date;
3712
3713
3714 procedure Clause_Footer (Output_Object : in out RTF_Output_Type;
3715 Header_Text : in String;
3716 Level : in ARM_Contents.Level_Type;
3717 Clause_Number : in String;
3718 No_Page_Break : in Boolean := False) is
3719 -- Local routine: Set up the footer for the header.
3720 Count : Natural; -- Not used after being set.
3721 begin
3722 -- Adjust footer.
3723 if Output_Object.Wrote_into_Section then
3724 -- Start a new section:
3725 if No_Page_Break or else
3726 ARM_Contents."="(Level, ARM_Contents.Clause) or else
3727 ARM_Contents."="(Level, ARM_Contents.Subclause) or else
3728 ARM_Contents."="(Level, ARM_Contents.Subsubclause) then
3729 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbknone\pgncont ");
3730 else
3731 -- Start sections on a new page. (Should only happen in the
3732 -- introduction).
3733 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkpage\pgncont ");
3734 end if;
3735 -- else just use the existing section.
3736 end if;
3737 if Clause_Number = "" or else
3738 ARM_Contents."="(Level, ARM_Contents.Unnumbered_Section) then
3739 Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl ");
3740 Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
3741 if Output_Object.Footer_Use_ISO_Format then
3742 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
3743 elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
3744 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 ");
3745 else
3746 Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
3747 end if;
3748 if Output_Object.Footer_Use_Clause_Name then
3749 Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
3750 else
3751 Ada.Text_IO.Put (Output_Object.Output_File,
3752 Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
3753 end if;
3754 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
3755 if Output_Object.Footer_Use_Date then
3756 Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
3757 -- else no date.
3758 end if;
3759 if Output_Object.Footer_Use_ISO_Format then
3760 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\par}}}");
3761 else
3762 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}");
3763 end if;
3764 Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr ");
3765 Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
3766 if Output_Object.Footer_Use_ISO_Format then
3767 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
3768 elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
3769 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
3770 else
3771 Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
3772 end if;
3773 if Output_Object.Footer_Use_Date then
3774 Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
3775 -- else no date.
3776 end if;
3777 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
3778 if Output_Object.Footer_Use_ISO_Format then
3779 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
3780 end if;
3781 if Output_Object.Footer_Use_Clause_Name then
3782 Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
3783 else
3784 Ada.Text_IO.Put (Output_Object.Output_File,
3785 Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
3786 end if;
3787 if Output_Object.Footer_Use_ISO_Format then
3788 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}}");
3789 else
3790 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}");
3791 end if;
3792 else
3793 Ada.Text_IO.Put (Output_Object.Output_File, "{\footerl ");
3794 Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
3795 if Output_Object.Footer_Use_Clause_Name then
3796 Ada.Text_IO.Put (Output_Object.Output_File, "{\b\f1 ");
3797 if Level in ARM_Contents.Plain_Annex .. ARM_Contents.Normative_Annex then
3798 -- Clause Number includes "Annex". Just use the letter.
3799 Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number(Clause_Number'Last));
3800 else
3801 Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number);
3802 end if;
3803 if Output_Object.Footer_Use_ISO_Format then
3804 Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f1\fs16 ");
3805 elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
3806 Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f1 ");
3807 else
3808 Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~{\f0 ");
3809 end if;
3810 Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
3811 else
3812 if Output_Object.Footer_Use_ISO_Format then
3813 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
3814 elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
3815 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 ");
3816 else
3817 Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
3818 end if;
3819 Ada.Text_IO.Put (Output_Object.Output_File,
3820 Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
3821 end if;
3822 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
3823 if Output_Object.Footer_Use_Date then
3824 Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
3825 -- else no date.
3826 end if;
3827 if Output_Object.Footer_Use_ISO_Format then
3828 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\par}}}");
3829 else
3830 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\~\~\~\~\~\~{\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}\par}}}");
3831 end if;
3832 Ada.Text_IO.Put (Output_Object.Output_File, "{\footerr ");
3833 Write_Style_for_Paragraph (Output_Object.Output_File, Footer_Info, Count);
3834 if Output_Object.Footer_Use_ISO_Format then
3835 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs22\b {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
3836 elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
3837 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
3838 else
3839 Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 {\field{\*\fldinst { PAGE }}{\fldrslt {\lang1024 x}}}}\~\~\~\~\~\~");
3840 end if;
3841 if Output_Object.Footer_Use_Date then
3842 Ada.Text_IO.Put (Output_Object.Output_File, Current_Date);
3843 -- else no date.
3844 end if;
3845 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
3846 if Output_Object.Footer_Use_ISO_Format then
3847 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1\fs16 ");
3848 elsif ARM_Output."="(Output_Object.Body_Font, ARM_Output.Swiss) then
3849 Ada.Text_IO.Put (Output_Object.Output_File, "{\f1 ");
3850 else
3851 Ada.Text_IO.Put (Output_Object.Output_File, "{\f0 ");
3852 end if;
3853 if Output_Object.Footer_Use_Clause_Name then
3854 Ada.Text_IO.Put (Output_Object.Output_File, Header_Text);
3855 Ada.Text_IO.Put (Output_Object.Output_File, "}\~\~\~\b\f1 ");
3856 if Level in ARM_Contents.Plain_Annex .. ARM_Contents.Normative_Annex then
3857 -- Clause Number includes "Annex". Just use the letter.
3858 Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number(Clause_Number'Last));
3859 else
3860 Ada.Text_IO.Put (Output_Object.Output_File, Clause_Number);
3861 end if;
3862 else
3863 Ada.Text_IO.Put (Output_Object.Output_File,
3864 Ada.Strings.Unbounded.To_String (Output_Object.Footer_Text));
3865 Ada.Text_IO.Put (Output_Object.Output_File, "}");
3866 end if;
3867 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}}");
3868 end if;
3869 Output_Object.Wrote_into_Section := True;
3870 end Clause_Footer;
3871
3872
3873 procedure Clause_Header (Output_Object : in out RTF_Output_Type;
3874 Header_Text : in String;
3875 Level : in ARM_Contents.Level_Type;
3876 Clause_Number : in String;
3877 Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
3878 No_Page_Break : in Boolean := False) is
3879 -- Output a Clause header. The level of the header is specified
3880 -- in Level. The Clause Number is as specified; the top-level (and
3881 -- other) subdivision names are as specified. These should appear in
3882 -- the table of contents.
3883 -- For hyperlinked formats, this should generate a link target.
3884 -- If No_Page_Break is True, suppress any page breaks.
3885 -- Raises Not_Valid_Error if in a paragraph.
3886 Count : Natural; -- Not used after being set.
3887 begin
3888 if not Output_Object.Is_Valid then
3889 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3890 "Not valid object");
3891 end if;
3892 if Output_Object.Is_In_Paragraph then
3893 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
3894 "Header in paragraph");
3895 end if;
3896 Ada.Text_IO.New_Line (Output_Object.Output_File);
3897
3898 -- Adjust footer.
3899 Clause_Footer (Output_Object, Header_Text, Level, Clause_Number, No_Page_Break);
3900
3901 -- Special for table of contents:
3902 if Clause_Number = "" and then
3903 (Header_Text = "Table of Contents" or else -- Ada 95 format
3904 Header_Text = "Contents") then -- ISO 2004 format.
3905 if Header_Text = "Table of Contents" then
3906 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs36\kerning36\qc\cgrid Table of Contents\par}");
3907 else
3908 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs36\kerning36\qc\cgrid Contents\par}");
3909 end if;
3910 Output_Object.Char_Count := 0;
3911 return;
3912 end if;
3913
3914 case Level is
3915 when ARM_Contents.Plain_Annex =>
3916 Write_Style_for_Paragraph (Output_Object.Output_File,
3917 Heading_1_Info, Count);
3918 Ada.Text_IO.Put_Line (Output_Object.Output_File,
3919 Clause_Number & ": " & Header_Text & "\par}");
3920 -- Note: Clause_Number includes "Annex"
3921 when ARM_Contents.Normative_Annex =>
3922 Write_Style_for_Paragraph (Output_Object.Output_File,
3923 Heading_1_Info, Count);
3924 Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
3925 -- Note: Clause_Number includes "Annex"
3926 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (normative)}\line ");
3927 Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
3928 when ARM_Contents.Informative_Annex =>
3929 Write_Style_for_Paragraph (Output_Object.Output_File,
3930 Heading_1_Info, Count);
3931 Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
3932 -- Note: Clause_Number includes "Annex"
3933 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (informative)}\line ");
3934 Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
3935 when ARM_Contents.Unnumbered_Section =>
3936 if Header_Text /= "" then
3937 Write_Style_for_Paragraph (Output_Object.Output_File,
3938 Heading_1_Info, Count);
3939 Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
3940 end if;
3941 when ARM_Contents.Section =>
3942 case Top_Level_Subdivision_Name is
3943 when ARM_Output.Chapter =>
3944 Write_Style_for_Paragraph (Output_Object.Output_File,
3945 Heading_1_Info, Count);
3946 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Chapter " &
3947 Clause_Number & ": " & Header_Text & "\par}");
3948 when ARM_Output.Section =>
3949 Write_Style_for_Paragraph (Output_Object.Output_File,
3950 Heading_1_Info, Count);
3951 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Section " &
3952 Clause_Number & ": " & Header_Text & "\par}");
3953 when ARM_Output.Clause =>
3954 Write_Style_for_Paragraph (Output_Object.Output_File,
3955 Heading_1_Info, Count);
3956 Ada.Text_IO.Put_Line (Output_Object.Output_File,
3957 Clause_Number & "\~\~\~" & Header_Text & "\par}");
3958 end case;
3959 when ARM_Contents.Clause =>
3960 Write_Style_for_Paragraph (Output_Object.Output_File,
3961 Heading_2_Info, Count);
3962 Ada.Text_IO.Put_Line (Output_Object.Output_File,
3963 Clause_Number & " " & Header_Text & "\par}");
3964 when ARM_Contents.Subclause =>
3965 Write_Style_for_Paragraph (Output_Object.Output_File,
3966 Heading_3_Info, Count);
3967 Ada.Text_IO.Put_Line (Output_Object.Output_File,
3968 Clause_Number & " " & Header_Text & "\par}");
3969 when ARM_Contents.Subsubclause =>
3970 Write_Style_for_Paragraph (Output_Object.Output_File,
3971 Heading_4_Info, Count);
3972 Ada.Text_IO.Put_Line (Output_Object.Output_File,
3973 Clause_Number & " " & Header_Text & "\par}");
3974 when ARM_Contents.Dead_Clause =>
3975 raise Program_Error; -- No headers for dead clauses.
3976 end case;
3977 Output_Object.Char_Count := 0;
3978 end Clause_Header;
3979
3980
3981 procedure Revised_Clause_Header
3982 (Output_Object : in out RTF_Output_Type;
3983 New_Header_Text : in String;
3984 Old_Header_Text : in String;
3985 Level : in ARM_Contents.Level_Type;
3986 Clause_Number : in String;
3987 Version : in ARM_Contents.Change_Version_Type;
3988 Old_Version : in ARM_Contents.Change_Version_Type;
3989 Top_Level_Subdivision_Name : in ARM_Output.Top_Level_Subdivision_Name_Kind;
3990 No_Page_Break : in Boolean := False) is
3991 -- Output a revised clause header. Both the original and new text will
3992 -- be output. The level of the header is specified in Level. The Clause
3993 -- Number is as specified; the top-level (and other) subdivision names
3994 -- are as specified. These should appear in the table of contents.
3995 -- For hyperlinked formats, this should generate a link target.
3996 -- Version is the insertion version of the new text; Old_Version is
3997 -- the insertion version of the old text.
3998 -- If No_Page_Break is True, suppress any page breaks.
3999 -- Raises Not_Valid_Error if in a paragraph.
4000 Count : Natural; -- Not used after being set.
4001 function Header_Text return String is
4002 begin
4003 if Old_Version = '0' then -- Old is original text
4004 return "{\revised\revauth" & Version & " " & New_Header_Text & "}{\deleted\revauthdel" & Version & " " & Old_Header_Text & "}";
4005 else
4006 return "{\revised\revauth" & Version & " " & New_Header_Text &
4007 "}{\deleted\revauthdel" & Version &
4008 "\revised\revauth" & Old_Version & " " &
4009 Old_Header_Text & "}";
4010 end if;
4011 end Header_Text;
4012 begin
4013 if not Output_Object.Is_Valid then
4014 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4015 "Not valid object");
4016 end if;
4017 if Output_Object.Is_In_Paragraph then
4018 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4019 "Header in paragraph");
4020 end if;
4021 Ada.Text_IO.New_Line (Output_Object.Output_File);
4022
4023 -- Adjust footer.
4024 Clause_Footer (Output_Object, New_Header_Text, Level,
4025 Clause_Number, No_Page_Break);
4026
4027 case Level is
4028 when ARM_Contents.Plain_Annex =>
4029 Write_Style_for_Paragraph (Output_Object.Output_File,
4030 Heading_1_Info, Count);
4031 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4032 Clause_Number & ": " & Header_Text & "\par}");
4033 -- Note: Clause_Number includes "Annex"
4034 when ARM_Contents.Normative_Annex =>
4035 Write_Style_for_Paragraph (Output_Object.Output_File,
4036 Heading_1_Info, Count);
4037 Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
4038 -- Note: Clause_Number includes "Annex"
4039 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (normative)}\line ");
4040 Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
4041 when ARM_Contents.Informative_Annex =>
4042 Write_Style_for_Paragraph (Output_Object.Output_File,
4043 Heading_1_Info, Count);
4044 Ada.Text_IO.Put_Line (Output_Object.Output_File, Clause_Number & "\line ");
4045 -- Note: Clause_Number includes "Annex"
4046 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\b0 (informative)}\line ");
4047 Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
4048 when ARM_Contents.Unnumbered_Section =>
4049 if Header_Text /= "" then
4050 Write_Style_for_Paragraph (Output_Object.Output_File,
4051 Heading_1_Info, Count);
4052 Ada.Text_IO.Put_Line (Output_Object.Output_File, Header_Text & "\par}");
4053 end if;
4054 when ARM_Contents.Section =>
4055 case Top_Level_Subdivision_Name is
4056 when ARM_Output.Chapter =>
4057 Write_Style_for_Paragraph (Output_Object.Output_File,
4058 Heading_1_Info, Count);
4059 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Chapter " &
4060 Clause_Number & ": " & Header_Text & "\par}");
4061 when ARM_Output.Section =>
4062 Write_Style_for_Paragraph (Output_Object.Output_File,
4063 Heading_1_Info, Count);
4064 Ada.Text_IO.Put_Line (Output_Object.Output_File, "Section " &
4065 Clause_Number & ": " & Header_Text & "\par}");
4066 when ARM_Output.Clause =>
4067 Write_Style_for_Paragraph (Output_Object.Output_File,
4068 Heading_1_Info, Count);
4069 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4070 Clause_Number & "\~\~\~" & Header_Text & "\par}");
4071 end case;
4072 when ARM_Contents.Clause =>
4073 Write_Style_for_Paragraph (Output_Object.Output_File,
4074 Heading_2_Info, Count);
4075 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4076 Clause_Number & " " & Header_Text & "\par}");
4077 when ARM_Contents.Subclause =>
4078 Write_Style_for_Paragraph (Output_Object.Output_File,
4079 Heading_3_Info, Count);
4080 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4081 Clause_Number & " " & Header_Text & "\par}");
4082 when ARM_Contents.Subsubclause =>
4083 Write_Style_for_Paragraph (Output_Object.Output_File,
4084 Heading_4_Info, Count);
4085 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4086 Clause_Number & " " & Header_Text & "\par}");
4087 when ARM_Contents.Dead_Clause =>
4088 raise Program_Error; -- No headers for dead clauses.
4089 end case;
4090 Output_Object.Char_Count := 0;
4091 end Revised_Clause_Header;
4092
4093
4094 procedure TOC_Marker (Output_Object : in out RTF_Output_Type;
4095 For_Start : in Boolean) is
4096 -- Mark the start (if For_Start is True) or end (if For_Start is
4097 -- False) of the table of contents data. Output objects that
4098 -- auto-generate the table of contents can use this to do needed
4099 -- actions.
4100 begin
4101 if not Output_Object.Is_Valid then
4102 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4103 "Not valid object");
4104 end if;
4105 if Output_Object.Is_In_Paragraph then
4106 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4107 "TOC in paragraph");
4108 end if;
4109 if Output_Object.Big_Files then
4110 if For_Start then
4111 -- Create a Table of contents field:
4112 Write_Style_for_Paragraph (Output_Object.Output_File,
4113 Paragraph_Info(ARM_Output.Normal, 0),
4114 Output_Object.Char_Count);
4115 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4116 "{\field\fldedit{\*\fldinst TOC \\o ""1-3"" }{\fldrslt ");
4117 Output_Object.Char_Count := 0;
4118 else -- End.
4119 -- Close the field:
4120 Ada.Text_IO.Put_Line (Output_Object.Output_File, "}}\par}");
4121 end if;
4122 else -- Small files:
4123 null; -- We're not generating a table of contents.
4124 end if;
4125 end TOC_Marker;
4126
4127
4128 procedure New_Page (Output_Object : in out RTF_Output_Type;
4129 Kind : ARM_Output.Page_Kind_Type := ARM_Output.Any_Page) is
4130 -- Output a page break.
4131 -- Note that this has no effect on non-printing formats.
4132 -- Any_Page breaks to the top of the next page (whatever it is);
4133 -- Odd_Page_Only breaks to the top of the odd-numbered page;
4134 -- Soft_Page allows a page break but does not force one (use in
4135 -- "No_Breaks" paragraphs.)
4136 -- Raises Not_Valid_Error if in a paragraph if Kind = Any_Page or
4137 -- Odd_Page, and if not in a paragraph if Kind = Soft_Page.
4138 begin
4139 if not Output_Object.Is_Valid then
4140 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4141 "Not valid object");
4142 end if;
4143 case Kind is
4144 when ARM_Output.Any_Page =>
4145 if Output_Object.Is_In_Paragraph then
4146 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4147 "Page in paragraph");
4148 end if;
4149 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkpage\pgncont ");
4150 -- A section break and start on a new page, with page numbers continuing.
4151 -- All other section properties are inherited.
4152 -- We use a section break here, and not
4153 -- "\page", because that gives the wrong footers if the next
4154 -- item is a clause header (as it usually is).
4155 Output_Object.Wrote_into_Section := False;
4156 when ARM_Output.Odd_Page_Only =>
4157 if Output_Object.Is_In_Paragraph then
4158 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4159 "Page in paragraph");
4160 end if;
4161 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sect\sbkodd\pgncont ");
4162 -- A section break and start on an odd page, with page numbers continuing.
4163 -- All other section properties are inherited.
4164 Output_Object.Wrote_into_Section := False;
4165 when ARM_Output.Soft_Page =>
4166 if not Output_Object.Is_In_Paragraph then
4167 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4168 "Soft page not in paragraph");
4169 end if;
4170 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\softpage ");
4171 end case;
4172 end New_Page;
4173
4174
4175 procedure New_Column (Output_Object : in out RTF_Output_Type) is
4176 -- Output a column break.
4177 -- Raises Not_Valid_Error if in a paragraph, or if the number of
4178 -- columns is 1.
4179 begin
4180 if not Output_Object.Is_Valid then
4181 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4182 "Not valid object");
4183 end if;
4184 if Output_Object.Is_In_Paragraph then
4185 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4186 "New Column in paragraph");
4187 end if;
4188 if Output_Object.Column_Count <= 1 then
4189 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4190 "Column break, but no columns");
4191 end if;
4192 -- Set the font size to the most recently used one, because
4193 -- otherwise this takes a 12 pt. space, much too large in some cases:
4194 declare
4195 FS : constant String := Natural'Image(
4196 Paragraph_Info(Output_Object.Paragraph_Style,
4197 Output_Object.Paragraph_Indent).Size);
4198 begin
4199 Ada.Text_IO.Put (Output_Object.Output_File, "\fs");
4200 Ada.Text_IO.Put (Output_Object.Output_File, FS(2..FS'Last));
4201 end;
4202 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\column ");
4203 end New_Column;
4204
4205
4206 procedure Separator_Line (Output_Object : in out RTF_Output_Type;
4207 Is_Thin : Boolean := True) is
4208 -- Output a separator line. It is thin if "Is_Thin" is true.
4209 -- Raises Not_Valid_Error if in a paragraph.
4210 begin
4211 if not Output_Object.Is_Valid then
4212 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4213 "Not valid object");
4214 end if;
4215 if Output_Object.Is_In_Paragraph then
4216 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4217 "Separator in paragraph");
4218 end if;
4219 Ada.Text_IO.New_Line (Output_Object.Output_File);
4220 if Is_Thin then
4221 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard \widctlpar\brdrb\brdrs\brdrw15\brsp20 \adjustright \fs4\par }");
4222 -- \brdrb - Bottom border; \brdrs - Single thickness;
4223 -- \brdrw15 - thickness of 15 twips (max 75);
4224 -- \brsp20 - spacing between border and text.
4225 else
4226 Ada.Text_IO.Put_Line (Output_Object.Output_File, "{\pard \widctlpar\brdrb\brdrs\brdrw30\brsp20 \adjustright \fs4\par }");
4227 end if;
4228 Ada.Text_IO.New_Line (Output_Object.Output_File);
4229 end Separator_Line;
4230
4231
4232 function Format_Value (Value : in Integer) return String is
4233 Str : constant String := Natural'Image(Value);
4234 begin
4235 if Value < 0 then
4236 return Str;
4237 else
4238 return Str(2..Str'Last);
4239 end if;
4240 end Format_Value;
4241
4242
4243 type Table_Info_Kind is (Caption, Header, Header_no_Caption, First_Row, Row, Last_Row);
4244
4245 procedure RTF_Table_Info (Output_Object : in out RTF_Output_Type;
4246 Kind : in Table_Info_Kind) is
4247 -- Output the current table definition (Word needs this on every row):
4248 use type ARM_Output.Column_Text_Alignment;
4249 begin
4250 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trowd \trgaph108 ");
4251
4252 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trrh" &
4253 Format_Value(Paragraph_Info(ARM_Output.Normal,0).Size * 16) &
4254 "\trleft" & Format_Value(Output_Object.Table_Indent) & " ");
4255
4256 if Output_Object.Table_Has_Border then
4257 -- Set all of the borders to the normal:
4258 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trbrdrt\brdrs\brdrw10 " &
4259 "\trbrdrl\brdrs\brdrw10 " & "\trbrdrb\brdrs\brdrw10 " &
4260 "\trbrdrr\brdrs\brdrw10 " & "\trbrdrh\brdrs\brdrw10 " &
4261 "\trbrdrv\brdrs\brdrw10 ");
4262 -- else nothing.
4263 end if;
4264
4265 if Output_Object.Table_No_Page_Break then
4266 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trkeep\trkeepfollow ");
4267 elsif Kind = Header_no_Caption then
4268 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trhdr\trkeep ");
4269 else
4270 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\trkeep ");
4271 end if;
4272
4273 case Kind is
4274 when Caption =>
4275 -- Now, define the cell borders:
4276 if Output_Object.Table_Has_Border then
4277 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4278 "\clvertalc \clbrdrt\brdrs\brdrw10 " &
4279 "\clbrdrl\brdrs\brdrw10 " &
4280 "\clbrdrb\brdrs\brdrw10 " &
4281 "\clbrdrr\brdrs\brdrw10 ");
4282 else
4283 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4284 "\clvertalc ");
4285 end if;
4286
4287 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
4288 Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " ");
4289 -- Caption cell crosses entire line.
4290
4291 -- Now, set up text (normal, centered):
4292 if Output_Object.Table_Has_Small_Text then
4293 Write_Style_for_Paragraph (Output_Object.Output_File,
4294 Table_C_Sml_Text_Info,
4295 Output_Object.Char_Count);
4296 Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
4297 Output_Object.Size := 0;
4298 else
4299 Write_Style_for_Paragraph (Output_Object.Output_File,
4300 Table_C_Text_Info,
4301 Output_Object.Char_Count);
4302 Output_Object.Real_Size := Table_C_Text_Info.Size;
4303 Output_Object.Size := 0;
4304 end if;
4305 Ada.Text_IO.Put (Output_Object.Output_File, "\intbl ");
4306 Output_Object.Char_Count := Output_Object.Char_Count + 6;
4307
4308 when Header | Header_No_Caption =>
4309 -- Now, define the cell borders for each cell:
4310 for I in 1 .. Output_Object.Column_Count loop
4311 if Output_Object.Table_Has_Border then
4312 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4313 "\clvertalc \clbrdrt\brdrs\brdrw10 " &
4314 "\clbrdrl\brdrs\brdrw10 " &
4315 "\clbrdrb\brdrs\brdrw10 " &
4316 "\clbrdrr\brdrs\brdrw10 ");
4317 else
4318 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4319 "\clvertalc ");
4320 end if;
4321 --Ada.Text_IO.Put_Line("Header:");
4322 --Ada.Text_IO.Put_Line("Indent:" & Natural'Image(Output_Object.Table_Indent) &
4323 -- " Count:" & Natural'Image(I+Output_Object.Table_First_Column_Mult-1));
4324 if I /= Output_Object.Column_Count then
4325 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
4326 Format_Value(Output_Object.Table_Indent +
4327 Output_Object.Table_Column_Width*(Integer(I+Output_Object.Table_First_Column_Mult-1))) & " ");
4328 else -- Last cell, full width.
4329 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
4330 Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " ");
4331 end if;
4332 end loop;
4333
4334 -- Now, define text format:
4335 if Output_Object.Table_Alignment = ARM_Output.Center_All then
4336 if Output_Object.Table_Has_Small_Text then
4337 Write_Style_for_Paragraph (Output_Object.Output_File,
4338 Table_C_Sml_Text_Info,
4339 Output_Object.Char_Count);
4340 Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
4341 Output_Object.Size := 0;
4342 else
4343 Write_Style_for_Paragraph (Output_Object.Output_File,
4344 Table_C_Text_Info,
4345 Output_Object.Char_Count);
4346 Output_Object.Real_Size := Table_C_Text_Info.Size;
4347 Output_Object.Size := 0;
4348 end if;
4349 else
4350 if Output_Object.Table_Has_Small_Text then
4351 Write_Style_for_Paragraph (Output_Object.Output_File,
4352 Table_L_Sml_Text_Info,
4353 Output_Object.Char_Count);
4354 Output_Object.Real_Size := Table_L_Sml_Text_Info.Size;
4355 Output_Object.Size := 0;
4356 else
4357 Write_Style_for_Paragraph (Output_Object.Output_File,
4358 Table_L_Text_Info,
4359 Output_Object.Char_Count);
4360 Output_Object.Real_Size := Table_L_Text_Info.Size;
4361 Output_Object.Size := 0;
4362 end if;
4363 end if;
4364 Ada.Text_IO.Put (Output_Object.Output_File, "\intbl ");
4365 Output_Object.Char_Count := Output_Object.Char_Count + 6;
4366
4367 when First_Row | Row | Last_Row =>
4368 -- Now, define the cell borders for each cell:
4369 for I in 1 .. Output_Object.Column_Count loop
4370 if Output_Object.Table_Has_Border then
4371 if Kind = First_Row then
4372 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4373 "\clvertalc \clbrdrt\brdrs\brdrw10 " &
4374 "\clbrdrl\brdrs\brdrw10 " &
4375 "\clbrdrb\brdrs\brdrw10 " &
4376 "\clbrdrr\brdrs\brdrw10 ");
4377 elsif Kind = Row then
4378 --Ada.Text_IO.Put_Line (Output_Object.Output_File,
4379 -- "\clvertalc \clbrdrl\brdrs\brdrw10 " &
4380 -- "\clbrdrr\brdrs\brdrw10 ");
4381 -- Why no bottom border??
4382
4383 -- No top border!
4384 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4385 "\clvertalc \clbrdrl\brdrs\brdrw10 " &
4386 "\clbrdrb\brdrs\brdrw10 " &
4387 "\clbrdrr\brdrs\brdrw10 ");
4388 else -- Kind = Last_Row then
4389 -- No top border!
4390 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4391 "\clvertalc \clbrdrl\brdrs\brdrw10 " &
4392 "\clbrdrb\brdrs\brdrw10 " &
4393 "\clbrdrr\brdrs\brdrw10 ");
4394 end if;
4395 else
4396 Ada.Text_IO.Put_Line (Output_Object.Output_File,
4397 "\clvertalc ");
4398 end if;
4399
4400 if I /= Output_Object.Column_Count then
4401 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
4402 Format_Value(Output_Object.Table_Indent +
4403 Output_Object.Table_Column_Width*(Integer(I+Output_Object.Table_First_Column_Mult-1))) & " ");
4404 else -- Last cell, full width.
4405 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cltxlrtb\cellx" &
4406 Format_Value(Output_Object.Table_Indent + Output_Object.Table_Width) & " ");
4407 end if;
4408 end loop;
4409
4410 -- Now, define text format:
4411 if Output_Object.Table_Alignment = ARM_Output.Center_All then
4412 if Output_Object.Table_Has_Small_Text then
4413 Write_Style_for_Paragraph (Output_Object.Output_File,
4414 Table_C_Sml_Text_Info,
4415 Output_Object.Char_Count);
4416 Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
4417 Output_Object.Size := 0;
4418 else
4419 Write_Style_for_Paragraph (Output_Object.Output_File,
4420 Table_C_Text_Info,
4421 Output_Object.Char_Count);
4422 Output_Object.Real_Size := Table_C_Text_Info.Size;
4423 Output_Object.Size := 0;
4424 end if;
4425 else
4426 if Output_Object.Table_Has_Small_Text then
4427 Write_Style_for_Paragraph (Output_Object.Output_File,
4428 Table_L_Sml_Text_Info,
4429 Output_Object.Char_Count);
4430 Output_Object.Real_Size := Table_L_Sml_Text_Info.Size;
4431 Output_Object.Size := 0;
4432 else
4433 Write_Style_for_Paragraph (Output_Object.Output_File,
4434 Table_L_Text_Info,
4435 Output_Object.Char_Count);
4436 Output_Object.Real_Size := Table_L_Text_Info.Size;
4437 Output_Object.Size := 0;
4438 end if;
4439 end if;
4440 Ada.Text_IO.Put (Output_Object.Output_File, "\intbl ");
4441 Output_Object.Char_Count := Output_Object.Char_Count + 6;
4442
4443 end case;
4444
4445 -- \trowd - Start a table row.
4446 -- \row - End a table row.
4447 -- \trgaph - Half of of the gap between cells, in twips.
4448 -- \trhdr - Repeat line as header on following pages.
4449 -- \trkeep - Keep the row together (no page break).
4450 -- \trkeepfollow - Keep the row with the following (no page break).
4451 -- \trleft - Left edge of table row (in twips).
4452 -- \trrh - Row height (minimum if positive, absolute if negative).
4453
4454 -- \clveralc - Text is centered vertically in cell.
4455 -- \cltxlrtb - Text flows top to bottom and left to right.
4456 -- \cellx - Right edge of cell, in Twips. (This is an absolute position).
4457
4458 -- \intbl - Required marker for each cell.
4459 -- \cell - Ends cell (use instead of \par).
4460
4461 -- \trbrdrt - Row Top border
4462 -- \trbrdrl - Row Left border
4463 -- \trbrdrb - Row Bottom border
4464 -- \trbrdrr - Row Right border
4465 -- \trbrdrh - Row Horizontal border
4466 -- \trbrdrv - Row Vertical border
4467 -- \clbrdrt - Cell Top border
4468 -- \clbrdrl - Cell Left border
4469 -- \clbrdrb - Cell Bottom border
4470 -- \clbrdrr - Cell Right border
4471 -- \brdrs - Single width border
4472 -- \brdrw - Width of the pen (can't be more than 75).
4473
4474 end RTF_Table_Info;
4475
4476
4477 procedure Start_Table (Output_Object : in out RTF_Output_Type;
4478 Columns : in ARM_Output.Column_Count;
4479 First_Column_Width : in ARM_Output.Column_Count;
4480 Last_Column_Width : in ARM_Output.Column_Count;
4481 Alignment : in ARM_Output.Column_Text_Alignment;
4482 No_Page_Break : in Boolean;
4483 Has_Border : in Boolean;
4484 Small_Text_Size : in Boolean;
4485 Header_Kind : in ARM_Output.Header_Kind_Type) is
4486 -- Starts a table. The number of columns is Columns; the first
4487 -- column has First_Column_Width times the normal column width, and
4488 -- the last column has Last_Column_Width times the normal column width.
4489 -- Alignment is the horizontal text alignment within the columns.
4490 -- No_Page_Break should be True to keep the table intact on a single
4491 -- page; False to allow it to be split across pages.
4492 -- Has_Border should be true if a border is desired, false otherwise.
4493 -- Small_Text_Size means that the contents will have the AARM size;
4494 -- otherwise it will have the normal size.
4495 -- Header_Kind determines whether the table has headers.
4496 -- This command starts a paragraph; the entire table is a single
4497 -- paragraph. Text will be considered part of the caption until the
4498 -- next table marker call.
4499 -- Raises Not_Valid_Error if in a paragraph.
4500 Page_Width : Natural;
4501 Column_Units : constant Natural :=
4502 Natural(Columns+First_Column_Width+Last_Column_Width-2);
4503 -- The number of column units (a unit being a regular width column).
4504 begin
4505 if not Output_Object.Is_Valid then
4506 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4507 "Not valid object");
4508 end if;
4509 if Output_Object.Is_In_Paragraph then
4510 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4511 "Table in paragraph");
4512 end if;
4513
4514 Output_Object.Is_In_Paragraph := True;
4515 Output_Object.Is_In_Table := True;
4516 Output_Object.Table_No_Page_Break := No_Page_Break;
4517 Output_Object.Table_Alignment := Alignment;
4518 Output_Object.Table_First_Column_Mult := First_Column_Width;
4519 Output_Object.Table_Last_Column_Mult := Last_Column_Width;
4520 Output_Object.Table_Has_Border := Has_Border;
4521 Output_Object.Table_Has_Small_Text := Small_Text_Size;
4522
4523 case Output_Object.Page_Size is
4524 when ARM_RTF.A4 =>
4525 Page_Width := 9030;
4526 when ARM_RTF.Letter =>
4527 Page_Width := 9360;
4528 when ARM_RTF.Half_Letter =>
4529 Page_Width := 5040;
4530 when ARM_RTF.Ada95 =>
4531 Page_Width := 7740;
4532 end case;
4533 if Column_Units <= 3 then
4534 Output_Object.Table_Indent := Page_Width / 6;
4535 elsif Column_Units <= 8 then
4536 Output_Object.Table_Indent := Page_Width / 16;
4537 else
4538 Output_Object.Table_Indent := 0;
4539 end if;
4540 Output_Object.Table_Width := Page_Width - Output_Object.Table_Indent*2;
4541 Output_Object.Table_Column_Width := Output_Object.Table_Width / (Column_Units);
4542 Output_Object.Column_Count := Columns;
4543 --Ada.Text_IO.Put_Line("Table information");
4544 --Ada.Text_IO.Put_Line("Columns:" & Natural'Image(Columns) &
4545 -- " 1st column mult:" & Natural'Image(First_Column_Width) &
4546 -- " last column mult:" & Natural'Image(Last_Column_Width));
4547 --Ada.Text_IO.Put_Line("Width (twips):" & Natural'Image(Output_Object.Table_Width) &
4548 -- " Column width:" & Natural'Image(Output_Object.Table_Column_Width));
4549
4550 -- Make a blank line before, of the right size:
4551 Write_Style_for_Paragraph (Output_Object.Output_File,
4552 Table_L_Text_Info,
4553 Output_Object.Char_Count);
4554 Ada.Text_IO.Put (Output_Object.Output_File, "\par }");
4555 Output_Object.Char_Count := 0;
4556
4557 case Header_Kind is
4558 when ARM_Output.Both_Caption_and_Header =>
4559 RTF_Table_Info (Output_Object, Kind => Caption);
4560 when ARM_Output.Header_Only =>
4561 RTF_Table_Info (Output_Object, Kind => Header_no_Caption);
4562 when ARM_Output.No_Headers =>
4563 RTF_Table_Info (Output_Object, Kind => Row);
4564 end case;
4565
4566 end Start_Table;
4567
4568
4569 procedure Table_Marker (Output_Object : in out RTF_Output_Type;
4570 Marker : in ARM_Output.Table_Marker_Type) is
4571 -- Marks the end of an entity in a table.
4572 -- If Marker is End_Caption, the table caption ends and the
4573 -- future text is part of the table header.
4574 -- If Marker is End_Header, the table header ends and the
4575 -- future text is part of the table body.
4576 -- If Marker is End_Row, a row in the table is completed, and another
4577 -- row started.
4578 -- If Marker is End_Row_Next_Is_Last, a row in the table is completed,
4579 -- and another row started. That row is the last row in the table.
4580 -- If Marker is End_Item, an item in the table header or body is ended,
4581 -- and another started.
4582 -- If Marker is End_Table, the entire table is finished.
4583 -- Raises Not_Valid_Error if not in a table.
4584 use type ARM_Output.Column_Text_Alignment;
4585 begin
4586 if not Output_Object.Is_Valid then
4587 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4588 "Not valid object");
4589 end if;
4590 if (not Output_Object.Is_In_Paragraph) or (not Output_Object.Is_In_Table) then
4591 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4592 "Table marker not in table");
4593 end if;
4594 case Marker is
4595 when ARM_Output.End_Item =>
4596 if Output_Object.Table_Alignment = ARM_Output.Center_except_First then
4597 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
4598 Output_Object.Char_Count := 0;
4599 -- Now, define text format:
4600 if Output_Object.Table_Has_Small_Text then
4601 Write_Style_for_Paragraph (Output_Object.Output_File,
4602 Table_C_Sml_Text_Info,
4603 Output_Object.Char_Count);
4604 Output_Object.Real_Size := Table_C_Sml_Text_Info.Size;
4605 Output_Object.Size := 0;
4606 else
4607 Write_Style_for_Paragraph (Output_Object.Output_File,
4608 Table_C_Text_Info,
4609 Output_Object.Char_Count);
4610 Output_Object.Real_Size := Table_C_Text_Info.Size;
4611 Output_Object.Size := 0;
4612 end if;
4613 else -- Text format stays the same.
4614 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell ");
4615 Output_Object.Char_Count := 0;
4616 end if;
4617
4618 when ARM_Output.End_Caption =>
4619 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
4620 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
4621
4622 -- Start header row:
4623 RTF_Table_Info (Output_Object, Kind => Header); -- Repeat table definition.
4624
4625 when ARM_Output.End_Header =>
4626 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
4627 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
4628
4629 -- Start 1st body row:
4630 RTF_Table_Info (Output_Object, Kind => First_Row); -- Repeat table definition.
4631
4632 when ARM_Output.End_Row =>
4633 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
4634 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
4635
4636 -- Start other body rows (no top border!):
4637 RTF_Table_Info (Output_Object, Kind => Row); -- Repeat table definition.
4638
4639 when ARM_Output.End_Row_Next_Is_Last =>
4640 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
4641 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End row.
4642
4643 -- Start other body rows (no top border!):
4644 RTF_Table_Info (Output_Object, Kind => Last_Row); -- Repeat table definition.
4645
4646 when ARM_Output.End_Table =>
4647 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\cell }");
4648 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\row "); -- End last row of table.
4649
4650 Output_Object.Is_In_Paragraph := False;
4651 Output_Object.Is_In_Table := False;
4652 Output_Object.Column_Count := 1;
4653
4654 -- Make a blank line after, of the right size:
4655 Write_Style_for_Paragraph (Output_Object.Output_File,
4656 Table_L_Text_Info,
4657 Output_Object.Char_Count);
4658 Ada.Text_IO.Put (Output_Object.Output_File, "\par }");
4659 Output_Object.Char_Count := 0;
4660 Ada.Text_IO.New_Line (Output_Object.Output_File);
4661 end case;
4662 end Table_Marker;
4663
4664
4665 -- Text output: These are only allowed after a Start_Paragraph and
4666 -- before any End_Paragraph. Raises Not_Valid_Error if not allowed.
4667
4668 Special_Set : constant Ada.Strings.Maps.Character_Set :=
4669 Ada.Strings.Maps."or" (Ada.Strings.Maps.To_Set ('\'),
4670 Ada.Strings.Maps."or" (Ada.Strings.Maps.To_Set ('{'),
4671 Ada.Strings.Maps.To_Set ('}')));
4672
4673 procedure Ordinary_Text (Output_Object : in out RTF_Output_Type;
4674 Text : in String) is
4675 -- Output ordinary text.
4676 -- The text must end at a word break, never in the middle of a word.
4677 begin
4678 if not Output_Object.Is_Valid then
4679 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4680 "Not valid object");
4681 end if;
4682 if not Output_Object.Is_In_Paragraph then
4683 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4684 "Not in paragraph");
4685 end if;
4686 if Ada.Strings.Fixed.Count (Text, Special_Set) = 0 and then
4687 (Output_Object.Paragraph_Style not in
4688 ARM_Output.Text_Prefixed_Style_Subtype or else
4689 Output_Object.Saw_Hang_End) then
4690 -- The second condition so that prefixes have their
4691 -- characters counted properly...
4692 if Output_Object.Char_Count + Text'Length > LINE_LENGTH then
4693 Ada.Text_IO.New_Line (Output_Object.Output_File);
4694 Ada.Text_IO.Put (Output_Object.Output_File, Text);
4695 Output_Object.Char_Count := Text'Length;
4696 elsif Output_Object.Char_Count + Text'Length >= LINE_LENGTH - 10 then
4697 Ada.Text_IO.Put_Line (Output_Object.Output_File, Text);
4698 Output_Object.Char_Count := 0;
4699 else
4700 Ada.Text_IO.Put (Output_Object.Output_File, Text);
4701 Output_Object.Char_Count := Output_Object.Char_Count + Text'Length;
4702 end if;
4703 else
4704 for I in Text'range loop
4705 Ordinary_Character (Output_Object, Text(I));
4706 end loop;
4707 end if;
4708 end Ordinary_Text;
4709
4710
4711 procedure Ordinary_Character (Output_Object : in out RTF_Output_Type;
4712 Char : in Character) is
4713 -- Output an ordinary character.
4714 -- Spaces will be used to break lines as needed.
4715 begin
4716 if not Output_Object.Is_Valid then
4717 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4718 "Not valid object");
4719 end if;
4720 if not Output_Object.Is_In_Paragraph then
4721 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4722 "Not in paragraph");
4723 end if;
4724 if Char = ' ' and then Output_Object.Char_Count >= LINE_LENGTH - 5 then
4725 Ada.Text_IO.Put_Line (Output_Object.Output_File, " ");
4726 Output_Object.Char_Count := 0;
4727 else
4728 if Char = '\' then
4729 Ada.Text_IO.Put (Output_Object.Output_File, "\\");
4730 Output_Object.Char_Count := Output_Object.Char_Count + 2;
4731 elsif Char = '{' then
4732 Ada.Text_IO.Put (Output_Object.Output_File, "\{");
4733 Output_Object.Char_Count := Output_Object.Char_Count + 2;
4734 elsif Char = '}' then
4735 Ada.Text_IO.Put (Output_Object.Output_File, "\}");
4736 Output_Object.Char_Count := Output_Object.Char_Count + 2;
4737 elsif Char >= Character'Val(126) then -- All higher Latin-1 characters.
4738 declare
4739 Code : constant Natural := Character'Pos(Char);
4740 begin
4741 if Code mod 16 >= 10 then
4742 if Code / 16 >= 10 then
4743 Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
4744 Character'Val((Code / 16 - 10) + Character'Pos('a')) &
4745 Character'Val((Code mod 16 - 10) + Character'Pos('a')));
4746 else
4747 Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
4748 Character'Val((Code / 16) + Character'Pos('0')) &
4749 Character'Val((Code mod 16 - 10) + Character'Pos('a')));
4750 end if;
4751 else
4752 if Code / 16 >= 10 then
4753 Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
4754 Character'Val((Code / 16 - 10) + Character'Pos('a')) &
4755 Character'Val((Code mod 16) + Character'Pos('0')));
4756 else
4757 Ada.Text_IO.Put (Output_Object.Output_File, "\'" &
4758 Character'Val((Code / 16) + Character'Pos('0')) &
4759 Character'Val((Code mod 16) + Character'Pos('0')));
4760 end if;
4761 end if;
4762 Output_Object.Char_Count := Output_Object.Char_Count + 5;
4763 end;
4764 if Output_Object.Paragraph_Style in
4765 ARM_Output.Text_Prefixed_Style_Subtype and then
4766 (not Output_Object.Saw_Hang_End) then
4767 if not Ada.Characters.Handling.Is_Lower (Char) then
4768 Output_Object.Prefix_Large_Char_Count :=
4769 Output_Object.Prefix_Large_Char_Count + 1;
4770 -- else small character. (This isn't perfectly accurate, but
4771 -- these aren't used much in prefixes.)
4772 end if;
4773 end if;
4774 else
4775 Ada.Text_IO.Put (Output_Object.Output_File, Char);
4776 Output_Object.Char_Count := Output_Object.Char_Count + 1;
4777 if Output_Object.Paragraph_Style in
4778 ARM_Output.Text_Prefixed_Style_Subtype and then
4779 (not Output_Object.Saw_Hang_End) then
4780 --Ada.Text_Io.Put (Char);
4781 if Char in 'A' .. 'H' or else Char in 'J' .. 'Z' or else -- Capital 'I' is narrow.
4782 Char in '0' .. '9' or else
4783 Char = '+' or else Char = '_' or else Char = '@' or else
4784 Char = '#' or else Char = '$' or else Char = '%' or else
4785 Char = '&' or else Char = '*' or else Char = '<' or else
4786 Char = '>' then
4787 Output_Object.Prefix_Large_Char_Count :=
4788 Output_Object.Prefix_Large_Char_Count + 1;
4789 elsif Char = '.' then
4790 -- '.' is extra narrow; treat it as canceling out a
4791 -- a large character.
4792 if Output_Object.Prefix_Large_Char_Count > 0 then
4793 Output_Object.Prefix_Large_Char_Count :=
4794 Output_Object.Prefix_Large_Char_Count - 1;
4795 end if;
4796 -- else small character.
4797 end if;
4798 end if;
4799 end if;
4800 end if;
4801 end Ordinary_Character;
4802
4803
4804 procedure Hard_Space (Output_Object : in out RTF_Output_Type) is
4805 -- Output a hard space. No line break should happen at a hard space.
4806 begin
4807 if not Output_Object.Is_Valid then
4808 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4809 "Not valid object");
4810 end if;
4811 if not Output_Object.Is_In_Paragraph then
4812 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4813 "Not in paragraph");
4814 end if;
4815 if Output_Object.Paragraph_Style in ARM_Output.Examples ..
4816 ARM_Output.Small_Examples then
4817 -- Fixed width fonts; hard spaces seem to be a different width
4818 -- than regular ones. So use regular spaces.
4819 Ada.Text_IO.Put (Output_Object.Output_File, " ");
4820 Output_Object.Char_Count := Output_Object.Char_Count + 1;
4821 else
4822 Ada.Text_IO.Put (Output_Object.Output_File, "\~");
4823 Output_Object.Char_Count := Output_Object.Char_Count + 2;
4824 end if;
4825 end Hard_Space;
4826
4827
4828 procedure Line_Break (Output_Object : in out RTF_Output_Type) is
4829 -- Output a line break. This does not start a new paragraph.
4830 -- This corresponds to a "<BR>" in HTML.
4831 begin
4832 if not Output_Object.Is_Valid then
4833 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4834 "Not valid object");
4835 end if;
4836 if not Output_Object.Is_In_Paragraph then
4837 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4838 "Not in paragraph");
4839 end if;
4840 if Output_Object.Is_In_Table then
4841 -- We can't use \Par in a table, or Word deadlocks.
4842 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line ");
4843 Output_Object.Char_Count := 0;
4844 elsif not Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Is_Justified then
4845 -- We can't use \Par, as that inserts paragraph spacing.
4846 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line ");
4847 Output_Object.Char_Count := 0;
4848 else
4849 -- We can't use \Line, as that will cause the line to be justified.
4850 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sa0\par ");
4851 -- We have to turn off the inter-paragraph spacing.
4852 -- Now, reset the \sa setting.
4853 declare
4854 SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After;
4855 begin
4856 if ARM_Output."="(Output_Object.Current_Space_After,
4857 ARM_Output.Narrow) then
4858 SA_Width := SA_Width*(LEADING_PERCENT/10)/10;
4859 elsif ARM_Output."="(Output_Object.Current_Space_After,
4860 ARM_Output.Wide) then
4861 SA_Width := SA_Width*(TRAILING_PERCENT/10)/10;
4862 end if;
4863 declare
4864 SA : constant String := Natural'Image(SA_Width);
4865 begin
4866 Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
4867 Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
4868 Ada.Text_IO.Put (Output_Object.Output_File, " ");
4869 Output_Object.Char_Count := 4 + SA'Length - 1;
4870 end;
4871 end;
4872 if (Output_Object.Paragraph_Style in ARM_Output.Bulleted ..
4873 ARM_Output.Small_Hanging_in_Bulleted) then -- Always "NoPrefix" here.
4874 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
4875 Output_Object.Char_Count := Output_Object.Char_Count + 5;
4876 end if;
4877 end if;
4878 end Line_Break;
4879
4880
4881 procedure Index_Line_Break (Output_Object : in out RTF_Output_Type;
4882 Clear_Keep_with_Next : in Boolean) is
4883 -- Output a line break for the index. This does not start a new
4884 -- paragraph in terms of spacing. This corresponds to a "<BR>"
4885 -- in HTML. If Clear_Keep_with_Next is true, insure that the next
4886 -- line does not require the following line to stay with it.
4887 -- Raises Not_Valid_Error if the paragraph is not in the index format.
4888 begin
4889 if not Output_Object.Is_Valid then
4890 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4891 "Not valid object");
4892 end if;
4893 if not Output_Object.Is_In_Paragraph then
4894 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4895 "Not in paragraph");
4896 end if;
4897 if ARM_Output."/=" (Output_Object.Paragraph_Style, ARM_Output.Index) or else
4898 ARM_Output."/=" (Output_Object.Paragraph_Indent, 0) then
4899 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4900 "Not in index paragraph");
4901 end if;
4902 -- We have to use /par here, because otherwise we don't get the "undent"
4903 -- at the start of the paragraph.
4904
4905 if Clear_Keep_with_Next then
4906 -- Note: We need this special routine, because ending the paragraph
4907 -- would add blank lines to the HTML.
4908 End_Paragraph (Output_Object);
4909 Start_Paragraph (Output_Object, ARM_Output.Index, Indent => 0,
4910 Number => "", No_Breaks => True, Keep_with_Next => False,
4911 Tab_Stops => Output_Object.Tab_Stops);
4912 else
4913 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par ");
4914 -- Inherits the paragraph properties.
4915 end if;
4916 Output_Object.Char_Count := 0;
4917 end Index_Line_Break;
4918
4919
4920 procedure Soft_Line_Break (Output_Object : in out RTF_Output_Type) is
4921 -- Output a soft line break. This is a place (in the middle of a
4922 -- "word") that we allow a line break. It is usually used after
4923 -- underscores in long non-terminals.
4924 begin
4925 if not Output_Object.Is_Valid then
4926 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4927 "Not valid object");
4928 end if;
4929 if not Output_Object.Is_In_Paragraph then
4930 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4931 "Not in paragraph");
4932 end if;
4933 Ada.Text_IO.Put (Output_Object.Output_File, "\softline ");
4934 --Ada.Text_IO.Put (Output_Object.Output_File, "\zwbo ");
4935 -- -- Zero-width break opportunity. (Word 7.0 [Word 95] or later).
4936 -- (Doesn't work).
4937 Output_Object.Char_Count := Output_Object.Char_Count + 10;
4938 end Soft_Line_Break;
4939
4940
4941 procedure Soft_Hyphen_Break (Output_Object : in out RTF_Output_Type) is
4942 -- Output a soft line break, with a hyphen. This is a place (in the middle of
4943 -- a "word") that we allow a line break. If the line break is used,
4944 -- a hyphen will be added to the text.
4945 begin
4946 if not Output_Object.Is_Valid then
4947 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4948 "Not valid object");
4949 end if;
4950 if not Output_Object.Is_In_Paragraph then
4951 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4952 "Not in paragraph");
4953 end if;
4954 Ada.Text_IO.Put (Output_Object.Output_File, "\-");
4955 Output_Object.Char_Count := Output_Object.Char_Count + 2;
4956 end Soft_Hyphen_Break;
4957
4958
4959 procedure Tab (Output_Object : in out RTF_Output_Type) is
4960 -- Output a tab, inserting space up to the next tab stop.
4961 -- Raises Not_Valid_Error if the paragraph was created with
4962 -- Tab_Stops = ARM_Output.NO_TABS.
4963 begin
4964 if not Output_Object.Is_Valid then
4965 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4966 "Not valid object");
4967 end if;
4968 if not Output_Object.Is_In_Paragraph then
4969 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4970 "Not in paragraph");
4971 end if;
4972 if ARM_Output."="(Output_Object.Tab_Stops, ARM_Output.NO_TABS) then
4973 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4974 "Tab, but none set");
4975 end if;
4976 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
4977 Output_Object.Char_Count := Output_Object.Char_Count + 5;
4978 end Tab;
4979
4980
4981 procedure Special_Character (Output_Object : in out RTF_Output_Type;
4982 Char : in ARM_Output.Special_Character_Type) is
4983 -- Output an special character.
4984 begin
4985 if not Output_Object.Is_Valid then
4986 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4987 "Not valid object");
4988 end if;
4989 if not Output_Object.Is_In_Paragraph then
4990 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
4991 "Not in paragraph");
4992 end if;
4993 case Char is
4994 when ARM_Output.EM_Dash =>
4995 Ada.Text_IO.Put (Output_Object.Output_File, "\emdash ");
4996 Output_Object.Char_Count := Output_Object.Char_Count + 8;
4997 when ARM_Output.EN_Dash =>
4998 Ada.Text_IO.Put (Output_Object.Output_File, "\endash ");
4999 Output_Object.Char_Count := Output_Object.Char_Count + 8;
5000 when ARM_Output.GEQ =>
5001 --Unicode: Doesn't work on Windows 98:
5002 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8805 >=");
5003 --Output_Object.Char_Count := Output_Object.Char_Count + 13;
5004 -- Character 179, Symbol font.
5005 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'B3}");
5006 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5007 when ARM_Output.LEQ =>
5008 --Unicode: Doesn't work on Windows 98:
5009 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8804 <=");
5010 --Output_Object.Char_Count := Output_Object.Char_Count + 13;
5011 -- Character 163, Symbol font.
5012 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'A3}");
5013 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5014 when ARM_Output.NEQ =>
5015 --Unicode: Doesn't work on Windows 98:
5016 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u8800 /=");
5017 --Output_Object.Char_Count := Output_Object.Char_Count + 13;
5018 -- Character 185, Symbol font.
5019 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'B9}");
5020 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5021 when ARM_Output.PI =>
5022 --Unicode: Doesn't work on Windows 98:
5023 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc2\u960 PI");
5024 --Output_Object.Char_Count := Output_Object.Char_Count + 12;
5025 -- Character 112, Symbol font.
5026 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'70}");
5027 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5028 when ARM_Output.Left_Ceiling =>
5029 --Unicode: Doesn't work on Windows 98:
5030 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc8\u8968 Ceiling(");
5031 --Output_Object.Char_Count := Output_Object.Char_Count + 19;
5032 -- Character 233, Symbol font.
5033 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'E9}");
5034 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5035 when ARM_Output.Right_Ceiling =>
5036 --Unicode: Doesn't work on Windows 98:
5037 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u8969 )");
5038 --Output_Object.Char_Count := Output_Object.Char_Count + 11;
5039 -- Character 249, Symbol font.
5040 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'F9}");
5041 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5042 when ARM_Output.Left_Floor =>
5043 --Unicode: Doesn't work on Windows 98:
5044 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc6\u8970 Floor(");
5045 --Output_Object.Char_Count := Output_Object.Char_Count + 17;
5046 -- Character 235, Symbol font.
5047 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'EB}");
5048 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5049 when ARM_Output.Right_Floor =>
5050 --Unicode: Doesn't work on Windows 98:
5051 --Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u8971 )");
5052 --Output_Object.Char_Count := Output_Object.Char_Count + 11;
5053 -- Character 251, Symbol font.
5054 Ada.Text_IO.Put (Output_Object.Output_File, "{\f3\'FB}");
5055 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5056 when ARM_Output.Thin_Space =>
5057 Ada.Text_IO.Put (Output_Object.Output_File, "\qmspace ");
5058 Output_Object.Char_Count := Output_Object.Char_Count + 9;
5059 when ARM_Output.Left_Quote =>
5060 Ada.Text_IO.Put (Output_Object.Output_File, "\lquote ");
5061 Output_Object.Char_Count := Output_Object.Char_Count + 8;
5062 when ARM_Output.Right_Quote =>
5063 Ada.Text_IO.Put (Output_Object.Output_File, "\rquote ");
5064 Output_Object.Char_Count := Output_Object.Char_Count + 8;
5065 when ARM_Output.Left_Double_Quote =>
5066 Ada.Text_IO.Put (Output_Object.Output_File, "\ldblquote ");
5067 Output_Object.Char_Count := Output_Object.Char_Count + 11;
5068 when ARM_Output.Right_Double_Quote =>
5069 Ada.Text_IO.Put (Output_Object.Output_File, "\rdblquote ");
5070 Output_Object.Char_Count := Output_Object.Char_Count + 11;
5071 when ARM_Output.Small_Dotless_I =>
5072 --Unicode: Doesn't work on Windows 98: but we have no choice here:
5073 Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u305 i");
5074 -- Note: \uc1 means ASCII version has one character;
5075 -- \u305 means use Unicode character 305.
5076 Output_Object.Char_Count := Output_Object.Char_Count + 11;
5077 when ARM_Output.Capital_Dotted_I =>
5078 --Unicode: Doesn't work on Windows 98: but we have no choice here:
5079 Ada.Text_IO.Put (Output_Object.Output_File, "\uc1\u304 I");
5080 Output_Object.Char_Count := Output_Object.Char_Count + 11;
5081 end case;
5082 if Output_Object.Paragraph_Style in
5083 ARM_Output.Text_Prefixed_Style_Subtype and then
5084 (not Output_Object.Saw_Hang_End) then
5085 Output_Object.Prefix_Large_Char_Count :=
5086 Output_Object.Prefix_Large_Char_Count + 1;
5087 end if;
5088 end Special_Character;
5089
5090
5091 procedure Unicode_Character (Output_Object : in out RTF_Output_Type;
5092 Char : in ARM_Output.Unicode_Type) is
5093 -- Output a Unicode character, with code position Char.
5094 Char_Code : constant String := ARM_Output.Unicode_Type'Image(Char);
5095 Len : constant String := Natural'Image(Char_Code'Length+2);
5096 begin
5097 -- We don't check this, we just output it.
5098 if not Output_Object.Is_Valid then
5099 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5100 "Not valid object");
5101 end if;
5102 if not Output_Object.Is_In_Paragraph then
5103 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5104 "Not in paragraph");
5105 end if;
5106 Ada.Text_IO.Put (Output_Object.Output_File, "\uc" & Len(2..Len'Last) &
5107 "\u" & Char_Code(2..Char_Code'Last) & " <U" &
5108 Char_Code(2..Char_Code'Last) & ">");
5109 Output_Object.Char_Count := Output_Object.Char_Count + 9 + Len'Last-1 +
5110 (Char_Code'Last-1)*2;
5111 if Output_Object.Paragraph_Style in
5112 ARM_Output.Text_Prefixed_Style_Subtype and then
5113 (not Output_Object.Saw_Hang_End) then
5114 Output_Object.Prefix_Large_Char_Count :=
5115 Output_Object.Prefix_Large_Char_Count + 1;
5116 end if;
5117 end Unicode_Character;
5118
5119
5120 procedure End_Hang_Item (Output_Object : in out RTF_Output_Type) is
5121 -- Marks the end of a hanging item. Call only once per paragraph.
5122 -- Raises Not_Valid_Error if the paragraph style is not in
5123 -- Text_Prefixed_Style_Subtype, or if this has already been
5124 -- called for the current paragraph, or if the paragraph was started
5125 -- with No_Prefix = True.
5126 Current_Format : ARM_Output.Format_Type;
5127 begin
5128 if not Output_Object.Is_Valid then
5129 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5130 "Not valid object");
5131 end if;
5132 if not Output_Object.Is_In_Paragraph then
5133 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5134 "Not in paragraph");
5135 end if;
5136 if Output_Object.Paragraph_Style not in ARM_Output.Text_Prefixed_Style_Subtype then
5137 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5138 "Not a hanging paragraph");
5139 end if;
5140 if Output_Object.Saw_Hang_End then
5141 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5142 "Already saw the end of the hanging part");
5143 end if;
5144 Output_Object.Saw_Hang_End := True;
5145
5146 --Ada.Text_Io.Put (": Cnt=" & Natural'Image(Output_Object.Char_Count) & " Lrg=" &
5147 -- Natural'Image(Output_Object.Prefix_Large_Char_Count));
5148 --Ada.Text_Io.Put (" Style=" & ARM_Output.Paragraph_Style_Type'Image(Output_Object.Paragraph_Style));
5149 --Ada.Text_Io.Put (" Indent=" & ARM_Output.Paragraph_Indent_Type'Image(Output_Object.Paragraph_Indent));
5150 --Ada.Text_Io.Put (" Count=" & Natural'Image(
5151 -- ((Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width * 6 * 2) /
5152 -- (Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size * 5 * 5)) - 1));
5153 --Ada.Text_Io.Put (" Hang_Width=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width));
5154 --Ada.Text_Io.Put (" Size=" & Natural'Image(Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size));
5155
5156 if Output_Object.Char_Count*2 + Output_Object.Prefix_Large_Char_Count
5157 <= ((Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Hang_Width * 6 * 2) /
5158 (Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).Size * 5 * 5)) - 1 then
5159 -- No line break needed. (I can't find a way to get Word to do
5160 -- this properly, so we have to do it. We assume large characters
5161 -- are about 1 1/2 times normal characters, and that normal
5162 -- characters are about 5/6 the pt. size in width. Note that "Size"
5163 -- is in 1/2 pts., while "Hang_Width" is in .1 pts., so we need
5164 -- the "5" to correct the units.) The "- 1" is to allow space
5165 -- for the trailing space/tab. (Running into the text looks bad!).
5166 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
5167 Output_Object.Char_Count := Output_Object.Char_Count + 5;
5168 --Ada.Text_Io.Put_Line (" No_Break");
5169 else -- Line break needed.
5170 -- Just writing a line break clobbers any open styles.
5171 -- We have to save the current style, close it properly,
5172 -- do the line break stuff, and then reopen it. This showed as
5173 -- a bug only in RM-All, 3.3.1(19) [which should be shown as
5174 -- deleted, but was not.]
5175 -- Note that the HTML version does this save and restore dance,
5176 -- why we didn't do it here I'm not sure - RLB - 8/19/16.
5177 Current_Format := (Bold => Output_Object.Is_Bold,
5178 Italic => Output_Object.Is_Italic,
5179 Font => Output_Object.Font,
5180 Size => Output_Object.Size,
5181 Color => Output_Object.Color,
5182 Change => Output_Object.Change,
5183 Version => Output_Object.Version,
5184 Added_Version => Output_Object.Added_Version,
5185 Location=> Output_Object.Location);
5186 Text_Format (Output_Object, ARM_Output.NORMAL_FORMAT);
5187 -- Clear the existing format.
5188 --Ada.Text_IO.Put_Line (Output_Object.Output_File, "\line ");
5189 --Output_Object.Char_Count := 0;
5190 --This idiot program JUSTIFIES the text fragment, so a line
5191 --break cannot be used if the text is justified.
5192 Ada.Text_IO.Put_Line (Output_Object.Output_File, "\sa0\keepn\par }");
5193 Write_Style_for_Paragraph (Output_Object.Output_File,
5194 Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent),
5195 Output_Object.Char_Count);
5196 Set_Tabs (Output_Object, Output_Object.Paragraph_Style,
5197 Output_Object.Paragraph_Indent);
5198
5199 -- Reset after spacing:
5200 if ARM_Output."="(Output_Object.Current_Space_After,
5201 ARM_Output.Narrow) then
5202 declare
5203 SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After*(LEADING_PERCENT/10)/10;
5204 SA : constant String := Natural'Image(SA_Width);
5205 begin
5206 Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
5207 Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
5208 Ada.Text_IO.Put (Output_Object.Output_File, " ");
5209 Output_Object.Char_Count := 4 + SA'Length - 1;
5210 end;
5211 elsif ARM_Output."="(Output_Object.Current_Space_After,
5212 ARM_Output.Wide) then
5213 declare
5214 SA_Width : Natural := Paragraph_Info(Output_Object.Paragraph_Style, Output_Object.Paragraph_Indent).After*(TRAILING_PERCENT/10)/10;
5215 SA : constant String := Natural'Image(SA_Width);
5216 begin
5217 Ada.Text_IO.Put (Output_Object.Output_File, "\sa");
5218 Ada.Text_IO.Put (Output_Object.Output_File, SA(2..SA'Last));
5219 Ada.Text_IO.Put (Output_Object.Output_File, " ");
5220 Output_Object.Char_Count := 4 + SA'Length - 1;
5221 end;
5222 end if;
5223 Ada.Text_IO.Put (Output_Object.Output_File, "\tab ");
5224 Output_Object.Char_Count := Output_Object.Char_Count + 5;
5225 --Ada.Text_Io.Put_Line (" Break");
5226 -- Reset the format:
5227 Text_Format (Output_Object, Current_Format);
5228 end if;
5229 end End_Hang_Item;
5230
5231
5232 procedure Text_Format (Output_Object : in out RTF_Output_Type;
5233 Format : in ARM_Output.Format_Type) is
5234 -- Change the text format so that all of the properties are as specified.
5235 -- Note: Changes to these properties ought be stack-like; that is,
5236 -- Bold on, Italic on, Italic off, Bold off is OK; Bold on, Italic on,
5237 -- Bold off, Italic off should be avoided (as separate commands).
5238 TRACE_TF : constant Boolean := FALSE;
5239 use type ARM_Output.Change_Type;
5240 -- use type ARM_Contents.Change_Version_Type;
5241 use type ARM_Output.Location_Type;
5242 use type ARM_Output.Size_Type;
5243 use type ARM_Output.Color_Type;
5244
5245 procedure Make_Size_Command (Size : in Natural) is
5246 -- Write a \fs command to the file for Size.
5247 -- Max 29.5 pt, min 5 pt.
5248 begin
5249 if Output_Object.Real_Size >= 50 then
5250 Ada.Text_IO.Put (Output_Object.Output_File, "\fs5" &
5251 Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
5252 elsif Output_Object.Real_Size >= 40 then
5253 Ada.Text_IO.Put (Output_Object.Output_File, "\fs4" &
5254 Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
5255 elsif Output_Object.Real_Size >= 30 then
5256 Ada.Text_IO.Put (Output_Object.Output_File, "\fs3" &
5257 Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
5258 elsif Output_Object.Real_Size >= 20 then
5259 Ada.Text_IO.Put (Output_Object.Output_File, "\fs2" &
5260 Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
5261 elsif Output_Object.Real_Size >= 10 then
5262 Ada.Text_IO.Put (Output_Object.Output_File, "\fs1" &
5263 Character'Val(Output_Object.Real_Size mod 10 + Character'Pos('0')));
5264 else
5265 Ada.Text_IO.Put (Output_Object.Output_File, "\fs10");
5266 end if;
5267 Output_Object.Char_Count := Output_Object.Char_Count + 6;
5268 end Make_Size_Command;
5269
5270
5271 procedure Close_Basic_Format is
5272 -- Close any open basic format (Bold/Italic/Size/Font) command.
5273 begin
5274 if (not Output_Object.Is_Bold) and (not Output_Object.Is_Italic) and
5275 ARM_Output."=" (Output_Object.Font, ARM_Output.Default) and
5276 Output_Object.Color = ARM_Output.Default and
5277 Output_Object.Size = 0 then
5278 -- No format previously set, so none to close (default).
5279 return;
5280 end if;
5281 if TRACE_TF then
5282 Ada.Text_Io.Put (" Close basic format [");
5283 if Output_Object.Is_Bold then
5284 Ada.Text_Io.Put ('B');
5285 end if;
5286 if Output_Object.Is_Italic then
5287 Ada.Text_Io.Put ('I');
5288 end if;
5289 if Output_Object.Size /= 0 then
5290 Ada.Text_Io.Put ('S');
5291 end if;
5292 if Output_Object.Color /= ARM_Output.Default then
5293 Ada.Text_Io.Put ('C');
5294 end if;
5295 if ARM_Output."/=" (Output_Object.Font, ARM_Output.Default) then
5296 Ada.Text_Io.Put ('F');
5297 end if;
5298 Ada.Text_Io.Put (']');
5299 end if;
5300 Ada.Text_IO.Put (Output_Object.Output_File, "}");
5301 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5302 Output_Object.Real_Size := Output_Object.Real_Size -
5303 (Integer(Output_Object.Size)*2);
5304 Output_Object.Size := 0;
5305 Output_Object.Is_Bold := False;
5306 Output_Object.Is_Italic := False;
5307 Output_Object.Color := ARM_Output.Default;
5308 case Output_Object.Font is
5309 when ARM_Output.Default => null;
5310 when ARM_Output.Fixed => null;
5311 when ARM_Output.Roman => null;
5312 when ARM_Output.Swiss =>
5313 -- Undo the size adjustment, if any.
5314 if ARM_Output."/=" (Output_Object.Body_Font, ARM_Output.Swiss) then
5315 Output_Object.Real_Size := Output_Object.Real_Size + 1;
5316 -- else no adjustment.
5317 end if;
5318 end case;
5319 Output_Object.Font := ARM_Output.Default;
5320 end Close_Basic_Format;
5321
5322
5323 procedure Make_Basic_Format is
5324 -- Make any needed Bold/Italic/Size/Font command.
5325 begin
5326 if (not Format.Bold) and (not Format.Italic) and
5327 ARM_Output."=" (Format.Font, ARM_Output.Default) and
5328 Format.Color = ARM_Output.Default and
5329 Format.Size = 0 then
5330 -- No format needed (default).
5331 return;
5332 end if;
5333 Ada.Text_IO.Put (Output_Object.Output_File, "{");
5334 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5335 if TRACE_TF then
5336 Ada.Text_Io.Put (" Make basic {");
5337 end if;
5338
5339 -- Bold:
5340 if Format.Bold then
5341 if TRACE_TF then
5342 Ada.Text_Io.Put (" Change bold");
5343 end if;
5344 Ada.Text_IO.Put (Output_Object.Output_File, "\b");
5345 Output_Object.Char_Count := Output_Object.Char_Count + 2;
5346 Output_Object.Is_Bold := True;
5347 end if;
5348 -- Italic:
5349 if Format.Italic then
5350 if TRACE_TF then
5351 Ada.Text_Io.Put (" Change italics");
5352 end if;
5353 Ada.Text_IO.Put (Output_Object.Output_File, "\i");
5354 Output_Object.Char_Count := Output_Object.Char_Count + 2;
5355 Output_Object.Is_Italic := True;
5356 end if;
5357 -- Size:
5358 if Format.Size /= 0 then
5359 if TRACE_TF then
5360 Ada.Text_Io.Put (" Change size " & ARM_Output.Size_Type'Image(Format.Size));
5361 end if;
5362 Output_Object.Real_Size := Output_Object.Real_Size +
5363 Integer(Format.Size)*2;
5364 if ARM_Output."/=" (Format.Font, ARM_Output.Swiss)
5365 or else ARM_Output."=" (Output_Object.Body_Font, ARM_Output.Swiss) then
5366 Make_Size_Command (Output_Object.Real_Size);
5367 -- else it will be done by the Font, below.
5368 end if;
5369 end if;
5370 Output_Object.Size := Format.Size;
5371 -- Color:
5372 if Format.Color /= ARM_Output.Default then
5373 if TRACE_TF then
5374 Ada.Text_Io.Put (" Change color " & ARM_Output.Color_Type'Image(Format.Color));
5375 end if;
5376 case Format.Color is
5377 when ARM_Output.Default => null;
5378 when ARM_Output.Black => -- Color 1
5379 Ada.Text_IO.Put (Output_Object.Output_File, "\cf1");
5380 Output_Object.Char_Count := Output_Object.Char_Count + 4;
5381 when ARM_Output.Red => -- Color 13
5382 Ada.Text_IO.Put (Output_Object.Output_File, "\cf13");
5383 Output_Object.Char_Count := Output_Object.Char_Count + 5;
5384 when ARM_Output.Green => -- Color 11
5385 Ada.Text_IO.Put (Output_Object.Output_File, "\cf11");
5386 Output_Object.Char_Count := Output_Object.Char_Count + 5;
5387 when ARM_Output.Blue => -- Color 9
5388 Ada.Text_IO.Put (Output_Object.Output_File, "\cf9");
5389 Output_Object.Char_Count := Output_Object.Char_Count + 4;
5390 end case;
5391 end if;
5392 Output_Object.Color := Format.Color;
5393
5394 -- Font:
5395 case Format.Font is
5396 when ARM_Output.Default => null;
5397 when ARM_Output.Fixed =>
5398 if TRACE_TF then
5399 Ada.Text_Io.Put (" Change font fixed");
5400 end if;
5401 Ada.Text_IO.Put (Output_Object.Output_File, "\f2");
5402 Output_Object.Char_Count := Output_Object.Char_Count + 4;
5403 when ARM_Output.Roman =>
5404 if TRACE_TF then
5405 Ada.Text_Io.Put (" Change font roman");
5406 end if;
5407 Ada.Text_IO.Put (Output_Object.Output_File, "\f0");
5408 Output_Object.Char_Count := Output_Object.Char_Count + 4;
5409 when ARM_Output.Swiss =>
5410 if TRACE_TF then
5411 Ada.Text_Io.Put (" Change font swiss");
5412 end if;
5413 Ada.Text_IO.Put (Output_Object.Output_File, "\f1");
5414 Output_Object.Char_Count := Output_Object.Char_Count + 3;
5415 -- Swiss fonts always appear too large, so shrink it a bit,
5416 -- but not if the main body is a Swiss font.
5417 if ARM_Output."/=" (Output_Object.Body_Font, ARM_Output.Swiss) then
5418 Output_Object.Real_Size := Output_Object.Real_Size - 1;
5419 Make_Size_Command (Output_Object.Real_Size);
5420 end if;
5421 end case;
5422 Ada.Text_IO.Put (Output_Object.Output_File, " ");
5423 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5424 Output_Object.Font := Format.Font;
5425 end Make_Basic_Format;
5426
5427
5428 procedure Make_Revision is
5429 -- Make any needed revision:
5430 begin
5431 -- We could "improve" this by keeping similar changes together,
5432 -- especially for changes to/from Both, but its a lot more work
5433 -- and unnecessary.
5434 case Format.Change is
5435 when ARM_Output.Insertion =>
5436 if TRACE_TF then
5437 Ada.Text_Io.Put (" Change insertion");
5438 end if;
5439 Ada.Text_IO.Put (Output_Object.Output_File, "{\revised\revauth" & Format.Version & ' ');
5440 Output_Object.Char_Count := Output_Object.Char_Count + 18;
5441 -- Note: \revauthN indicates the author. Each version
5442 -- that we'll use needs an entry in the \revtbl.
5443 -- We could include a date with \revddtm??, but that's messy.
5444 when ARM_Output.Deletion =>
5445 if TRACE_TF then
5446 Ada.Text_Io.Put (" Change deletion");
5447 end if;
5448 Ada.Text_IO.Put (Output_Object.Output_File, "{\deleted\revauthdel" & Format.Version & ' ');
5449 Output_Object.Char_Count := Output_Object.Char_Count + 21;
5450 -- Note: \revauthdelN indicates the author. Each version
5451 -- that we'll use needs an entry in the \revtbl.
5452 -- We could include a date with \revddtmdel??, but that's messy.
5453 when ARM_Output.Both =>
5454 if TRACE_TF then
5455 Ada.Text_Io.Put (" Change both");
5456 end if;
5457 Ada.Text_IO.Put (Output_Object.Output_File, "{\revised\revauth" & Format.Added_Version & ' ');
5458 Output_Object.Char_Count := Output_Object.Char_Count + 18;
5459 Ada.Text_IO.Put (Output_Object.Output_File, "{\deleted\revauthdel" & Format.Version & ' ');
5460 Output_Object.Char_Count := Output_Object.Char_Count + 21;
5461 -- Note: \revauthdelN indicates the author. Each version
5462 -- that we'll use needs an entry in the \revtbl.
5463 -- We could include a date with \revddtmdel??, but that's messy.
5464 when ARM_Output.None =>
5465 null;
5466 end case;
5467 Output_Object.Change := Format.Change;
5468 Output_Object.Version := Format.Version;
5469 Output_Object.Added_Version := Format.Added_Version;
5470 end Make_Revision;
5471
5472
5473 procedure Close_Revision is
5474 -- Close any open revision:
5475 begin
5476 -- We could "improve" this by keeping similar changes together,
5477 -- especially for changes to/from Both, but its a lot more work
5478 -- and unnecessary.
5479 case Output_Object.Change is
5480 when ARM_Output.Insertion =>
5481 if TRACE_TF then
5482 Ada.Text_Io.Put (" Unchange insertion");
5483 end if;
5484 Ada.Text_IO.Put (Output_Object.Output_File, "}");
5485 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5486 when ARM_Output.Deletion =>
5487 if TRACE_TF then
5488 Ada.Text_Io.Put (" Unchange deletion");
5489 end if;
5490 Ada.Text_IO.Put (Output_Object.Output_File, "}");
5491 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5492 when ARM_Output.None =>
5493 null;
5494 when ARM_Output.Both =>
5495 if TRACE_TF then
5496 Ada.Text_Io.Put (" Unchange both");
5497 end if;
5498 Ada.Text_IO.Put (Output_Object.Output_File, "}}");
5499 Output_Object.Char_Count := Output_Object.Char_Count + 2;
5500 end case;
5501 end Close_Revision;
5502
5503
5504 procedure Make_Location is
5505 -- Make any needed location:
5506 begin
5507 case Format.Location is
5508 when ARM_Output.Subscript =>
5509 if TRACE_TF then
5510 Ada.Text_Io.Put (" Change sub");
5511 end if;
5512 Ada.Text_IO.Put (Output_Object.Output_File, "{\sub ");
5513 Output_Object.Char_Count := Output_Object.Char_Count + 6;
5514 when ARM_Output.Superscript =>
5515 if TRACE_TF then
5516 Ada.Text_Io.Put (" Change sup");
5517 end if;
5518 Ada.Text_IO.Put (Output_Object.Output_File, "{\super ");
5519 Output_Object.Char_Count := Output_Object.Char_Count + 8;
5520 when ARM_Output.Normal =>
5521 null;
5522 end case;
5523 Output_Object.Location := Format.Location;
5524 end Make_Location;
5525
5526
5527 procedure Close_Location is
5528 -- Close any open location:
5529 begin
5530 case Output_Object.Location is
5531 when ARM_Output.Subscript =>
5532 if TRACE_TF then
5533 Ada.Text_Io.Put (" Unchange sub");
5534 end if;
5535 Ada.Text_IO.Put (Output_Object.Output_File, "}");
5536 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5537 when ARM_Output.Superscript =>
5538 if TRACE_TF then
5539 Ada.Text_Io.Put (" Unchange sup");
5540 end if;
5541 Ada.Text_IO.Put (Output_Object.Output_File, "}");
5542 Output_Object.Char_Count := Output_Object.Char_Count + 1;
5543 when ARM_Output.Normal =>
5544 null;
5545 end case;
5546 end Close_Location;
5547
5548 begin
5549 if not Output_Object.Is_Valid then
5550 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5551 "Not valid object");
5552 end if;
5553 if not Output_Object.Is_In_Paragraph then
5554 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5555 "Not in paragraph");
5556 end if;
5557
5558 if TRACE_TF then
5559 Ada.Text_Io.Put ("Text format");
5560 end if;
5561 -- We always make changes in the order:
5562 -- Revision;
5563 -- Location;
5564 -- Basic_Format (Bold, Italic, Font, Size, Color).
5565 -- Thus, we have to unstack them in the reverse order. And, if we want
5566 -- to change an outer one, we have to close and redo any inner
5567 -- ones.
5568
5569 -- We do these in this order so that the changes are stacked properly.
5570 if Format.Change /= Output_Object.Change or else
5571 Format.Version /= Output_Object.Version or else
5572 Format.Added_Version /= Output_Object.Added_Version then
5573 Close_Basic_Format;
5574 Close_Location;
5575 Close_Revision;
5576 Make_Revision;
5577 Make_Location;
5578 Make_Basic_Format;
5579 elsif Format.Location /= Output_Object.Location then
5580 -- We don't need to change the revision, leave it alone.
5581 Close_Basic_Format;
5582 Close_Location;
5583 Make_Location;
5584 Make_Basic_Format;
5585 elsif Format.Color /= Output_Object.Color or else
5586 Format.Size /= Output_Object.Size or else
5587 ARM_Output."/=" (Format.Font, Output_Object.Font) or else
5588 Format.Bold /= Output_Object.Is_Bold or else
5589 Format.Italic /= Output_Object.Is_Italic then
5590 Close_Basic_Format;
5591 Make_Basic_Format;
5592 -- else no change at all.
5593 end if;
5594 if TRACE_TF then
5595 Ada.Text_Io.New_Line;
5596 end if;
5597 end Text_Format;
5598
5599
5600 procedure Clause_Reference (Output_Object : in out RTF_Output_Type;
5601 Text : in String;
5602 Clause_Number : in String) is
5603 -- Generate a reference to a clause in the standard. The text of
5604 -- the reference is "Text", and the number of the clause is
5605 -- Clause_Number. For hyperlinked formats, this should generate
5606 -- a link; for other formats, the text alone is generated.
5607 begin
5608 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5609 -- Note: We could generate genuine clause references for Word,
5610 -- but that wouldn't buy us anything for the RM.
5611 end Clause_Reference;
5612
5613
5614 procedure Index_Target (Output_Object : in out RTF_Output_Type;
5615 Index_Key : in Natural) is
5616 -- Generate a index target. This marks the location where an index
5617 -- reference occurs. Index_Key names the index item involved.
5618 -- For hyperlinked formats, this should generate a link target;
5619 -- for other formats, nothing is generated.
5620 begin
5621 if not Output_Object.Is_Valid then
5622 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5623 "Not valid object");
5624 end if;
5625 if not Output_Object.Is_In_Paragraph then
5626 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5627 "Not in paragraph");
5628 end if;
5629 null; -- Nothing to do for RTF. We could have let Word make the
5630 -- index, but then we'd still have to build it for HTML, and
5631 -- we couldn't get paragraph numbers in the index.
5632 end Index_Target;
5633
5634
5635 procedure Index_Reference (Output_Object : in out RTF_Output_Type;
5636 Text : in String;
5637 Index_Key : in Natural;
5638 Clause_Number : in String) is
5639 -- Generate a reference to an index target in the standard. The text
5640 -- of the reference is "Text", and Index_Key and Clause_Number denotes
5641 -- the target. For hyperlinked formats, this should generate
5642 -- a link; for other formats, the text alone is generated.
5643 begin
5644 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5645 end Index_Reference;
5646
5647
5648 procedure DR_Reference (Output_Object : in out RTF_Output_Type;
5649 Text : in String;
5650 DR_Number : in String) is
5651 -- Generate a reference to an DR from the standard. The text
5652 -- of the reference is "Text", and DR_Number denotes
5653 -- the target. For hyperlinked formats, this should generate
5654 -- a link; for other formats, the text alone is generated.
5655 begin
5656 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5657 end DR_Reference;
5658
5659
5660 procedure AI_Reference (Output_Object : in out RTF_Output_Type;
5661 Text : in String;
5662 AI_Number : in String) is
5663 -- Generate a reference to an AI from the standard. The text
5664 -- of the reference is "Text", and AI_Number denotes
5665 -- the target (in unfolded format). For hyperlinked formats, this should
5666 -- generate a link; for other formats, the text alone is generated.
5667 begin
5668 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5669 end AI_Reference;
5670
5671
5672 procedure Local_Target (Output_Object : in out RTF_Output_Type;
5673 Text : in String;
5674 Target : in String) is
5675 -- Generate a local target. This marks the potential target of local
5676 -- links identified by "Target". Text is the text of the target.
5677 -- For hyperlinked formats, this should generate a link target;
5678 -- for other formats, only the text is generated.
5679 begin
5680 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5681 end Local_Target;
5682
5683
5684 procedure Local_Link (Output_Object : in out RTF_Output_Type;
5685 Text : in String;
5686 Target : in String;
5687 Clause_Number : in String) is
5688 -- Generate a local link to the target and clause given.
5689 -- Text is the text of the link.
5690 -- For hyperlinked formats, this should generate a link;
5691 -- for other formats, only the text is generated.
5692 begin
5693 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5694 end Local_Link;
5695
5696
5697 procedure Local_Link_Start (Output_Object : in out RTF_Output_Type;
5698 Target : in String;
5699 Clause_Number : in String) is
5700 -- Generate a local link to the target and clause given.
5701 -- The link will surround text until Local_Link_End is called.
5702 -- Local_Link_End must be called before this routine can be used again.
5703 -- For hyperlinked formats, this should generate a link;
5704 -- for other formats, only the text is generated.
5705 begin
5706 null; -- No link, nothing to do.
5707 end Local_Link_Start;
5708
5709
5710 procedure Local_Link_End (Output_Object : in out RTF_Output_Type;
5711 Target : in String;
5712 Clause_Number : in String) is
5713 -- End a local link for the target and clause given.
5714 -- This must be in the same paragraph as the Local_Link_Start.
5715 -- For hyperlinked formats, this should generate a link;
5716 -- for other formats, only the text is generated.
5717 begin
5718 null; -- No link, nothing to do.
5719 end Local_Link_End;
5720
5721
5722 procedure URL_Link (Output_Object : in out RTF_Output_Type;
5723 Text : in String;
5724 URL : in String) is
5725 -- Generate a link to the URL given.
5726 -- Text is the text of the link.
5727 -- For hyperlinked formats, this should generate a link;
5728 -- for other formats, only the text is generated.
5729 begin
5730 Ordinary_Text (Output_Object, Text); -- Nothing special in this format.
5731 end URL_Link;
5732
5733
5734 procedure Picture (Output_Object : in out RTF_Output_Type;
5735 Name : in String;
5736 Descr : in String;
5737 Alignment : in ARM_Output.Picture_Alignment;
5738 Height, Width : in Natural;
5739 Border : in ARM_Output.Border_Kind) is
5740 -- Generate a picture.
5741 -- Name is the (simple) file name of the picture; Descr is a
5742 -- descriptive name for the picture (it will appear in some web
5743 -- browsers).
5744 -- We assume that it is a .PNG or .JPG and that it will be present
5745 -- in the same directory as the output files.
5746 -- Alignment specifies the picture alignment.
5747 -- Height and Width specify the picture size in pixels.
5748 -- Border specifies the kind of border.
5749 use type ARM_Output.Picture_Alignment;
5750 use type ARM_Output.Border_Kind;
5751
5752 HORIZONTAL_TWIPS_PER_PIXEL : constant := 16; -- By experiment.
5753 VERTICAL_TWIPS_PER_PIXEL : constant := 16; -- By experiment.
5754 -- These values give us Pixels/90 = box size in inches.
5755
5756 -- For reasons that I don't understand, the supposed "raw" picture
5757 -- size is Pixels/120. So a scaling of 75% gives exact pixels.
5758
5759
5760 type Kind is (PNG, JPEG, Unknown);
5761 type DWord is mod 2**32;
5762 Picture_Width : DWord;
5763 Picture_Height : DWord;
5764 Picture_Kind : Kind := Unknown;
5765 Picture_Scaling : Natural;
5766
5767 procedure Get_Picture_Dimensions is
5768 -- Get the picture dimensions from the graphic file.
5769 use type Ada.Streams.Stream_Element_Offset;
5770 Fyle : Ada.Streams.Stream_IO.File_Type;
5771 type PNG_Header is record
5772 Signature_1 : DWord; -- Fixed value
5773 Signature_2 : DWord; -- Fixed value
5774 Header_Len : DWord; -- Fixed value (13)
5775 Header_Type : DWord; -- Fixed value ("IHDR")
5776 Width : DWord; -- In pixels.
5777 Height : DWord; -- In pixels.
5778 -- Other stuff is not important here.
5779 end record;
5780 subtype PNG_Stream is Ada.Streams.Stream_Element_Array(1..6*4);
5781 function Convert is new Ada.Unchecked_Conversion (Source => PNG_Stream,
5782 Target => PNG_Header);
5783 Buffer : PNG_Stream;
5784 Last : Ada.Streams.Stream_Element_Offset;
5785 Temp : Ada.Streams.Stream_Element;
5786 begin
5787 begin
5788 Ada.Streams.Stream_IO.Open (Fyle,
5789 Mode => Ada.Streams.Stream_IO.In_File,
5790 Name => Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) &
5791 Name);
5792 exception
5793 when Oops:others =>
5794 Ada.Text_IO.Put_Line ("** Unable to open picture file: " &
5795 Ada.Exceptions.Exception_Message(Oops));
5796 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5797 "Unable to open picture file");
5798 end;
5799 -- Read a PNG header, to see if it is a PNG:
5800 Ada.Streams.Stream_IO.Read (Fyle, Buffer, Last);
5801 if Last /= 24 then
5802 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5803 "Picture file too short");
5804 end if;
5805 if Convert(Buffer).Signature_1 = 16#89_50_4e_47# and then
5806 Convert(Buffer).Signature_2 = 16#0d_0a_1a_0a# then
5807 -- This is a PNG file:
5808 Picture_Kind := PNG;
5809 Picture_Width := Convert(Buffer).Width;
5810 Picture_Height := Convert(Buffer).Height;
5811 Ada.Text_IO.Put_Line ("Forward PNG: Width=" &
5812 DWord'Image(Picture_Width) & " Height=" &
5813 DWord'Image(Picture_Height));
5814 elsif Convert(Buffer).Signature_1 = 16#47_4e_50_89# and then
5815 Convert(Buffer).Signature_2 = 16#0a_1a_0a_0d# then
5816 -- This is a byte-swapped PNG file.
5817 -- Swap the bytes in the buffer, then get the width and height:
5818 Temp := Buffer(17);
5819 Buffer(17) := Buffer(20);
5820 Buffer(20) := Temp;
5821 Temp := Buffer(18);
5822 Buffer(18) := Buffer(19);
5823 Buffer(19) := Temp;
5824 Temp := Buffer(21);
5825 Buffer(21) := Buffer(24);
5826 Buffer(24) := Temp;
5827 Temp := Buffer(22);
5828 Buffer(22) := Buffer(23);
5829 Buffer(23) := Temp;
5830 Picture_Kind := PNG;
5831 Picture_Width := Convert(Buffer).Width;
5832 Picture_Height := Convert(Buffer).Height;
5833 Ada.Text_IO.Put_Line ("Reversed PNG: Width=" &
5834 DWord'Image(Picture_Width) & " Height=" &
5835 DWord'Image(Picture_Height));
5836
5837
5838 -- elsif Name'Length > 5 and then
5839 -- (Name(Name'Last-3..Name'Last) = ".JPG" or else
5840 -- Name(Name'Last-3..Name'Last) = ".jpg" or else
5841 -- Name(Name'Last-4..Name'Last) = ".JPEG" or else
5842 -- Name(Name'Last-4..Name'Last) = ".Jpeg" or else
5843 -- Name(Name'Last-4..Name'Last) = ".jpeg") then
5844 -- Picture_Kind := JPEG;
5845
5846
5847 else
5848 Ada.Text_IO.Put_Line ("** Unimplemented picture formatting: File type");
5849 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5850 "Do not recognize picture file");
5851 end if;
5852 end Get_Picture_Dimensions;
5853
5854
5855 function Format_Twips (Twips : in Natural) return String is
5856 Flab : constant String := Natural'Image(Twips);
5857 begin
5858 return Flab(2..Flab'Last);
5859 end Format_Twips;
5860
5861
5862 procedure Dump_File_in_Hex is
5863 -- Read and output the graphics file to the output file
5864 -- in Hexadecimal.
5865 Fyle : Ada.Streams.Stream_IO.File_Type;
5866 Buffer : Ada.Streams.Stream_Element_Array(1..32);
5867 Last : Ada.Streams.Stream_Element_Offset;
5868 use type Ada.Streams.Stream_Element;
5869 use type Ada.Streams.Stream_Element_Offset;
5870 Temp : Ada.Streams.Stream_Element;
5871 begin
5872 begin
5873 Ada.Streams.Stream_IO.Open (Fyle,
5874 Mode => Ada.Streams.Stream_IO.In_File,
5875 Name => Ada.Strings.Unbounded.To_String (Output_Object.Output_Path) &
5876 Name);
5877 exception
5878 when Oops:others =>
5879 Ada.Text_IO.Put_Line ("** Unable to open picture file: " &
5880 Ada.Exceptions.Exception_Message(Oops));
5881 Ada.Exceptions.Raise_Exception (ARM_Output.Not_Valid_Error'Identity,
5882 "Unable to open picture file");
5883 end;
5884 loop
5885 Ada.Streams.Stream_IO.Read (Fyle, Buffer, Last);
5886 exit when Last = 0; -- Nothing read equals end of file.
5887 for I in 1 .. Last loop
5888 Temp := Buffer(I) / 16;
5889 if Temp > 9 then
5890 Ada.Text_IO.Put (Output_Object.Output_File,
5891 Character'Val(Character'Pos('A') + (Temp - 10)));
5892 else
5893 Ada.Text_IO.Put (Output_Object.Output_File,
5894 Character'Val(Character'Pos('0') + Temp));
5895 end if;
5896 Temp := Buffer(I) mod 16;
5897 if Temp > 9 then
5898 Ada.Text_IO.Put (Output_Object.Output_File,
5899 Character'Val(Character'Pos('A') + (Temp - 10)));
5900 else
5901 Ada.Text_IO.Put (Output_Object.Output_File,
5902 Character'Val(Character'Pos('0') + Temp));
5903 end if;
5904 end loop;
5905 Ada.Text_IO.New_Line (Output_Object.Output_File);
5906 end loop;
5907 Ada.Streams.Stream_IO.Close (Fyle);
5908 end Dump_File_in_Hex;
5909
5910 begin
5911 Get_Picture_Dimensions;
5912
5913 -- Calculate scaling needed:
5914 declare
5915 Width_Scale, Height_Scale : Float;
5916 Word_Scaling : constant Float := 6.0;
5917 -- Scaling so that the HTML pixel and Word pixel
5918 -- have the same approximate size. Word's pixels
5919 -- seem to be about 6 times smaller than HTML's.
5920
5921 -- Word's box size is
5922 begin
5923 Width_Scale := Float(Width) / Float(Picture_Width) * 100.0 * Word_Scaling;
5924 Height_Scale := Float(Height) / Float(Picture_Height) * 100.0 * Word_Scaling;
5925
5926 -- Then, use the smaller scale:
5927 if Width_Scale < Height_Scale then
5928 Picture_Scaling := Natural(Width_Scale);
5929 else
5930 Picture_Scaling := Natural(Height_Scale);
5931 end if;
5932 Ada.Text_IO.Put_Line ("Picture scaling (%):" & Natural'Image(Picture_Scaling));
5933 Ada.Text_IO.Put_Line ("Box width=" &
5934 Natural'Image(Width) & " Height=" &
5935 Natural'Image(Height));
5936 -- Note: Word 2000/2003 seems to ignore this scaling; it seems to
5937 -- use the "picwgoal" and "pichgoal" exclusively.
5938 -- As noted above, that naturally gives a 75% scaling when the
5939 -- picture size and box size are the same. We remove that for this
5940 -- information. (Note: The smaller the scaling the better.)
5941 Ada.Text_IO.Put_Line ("Word 2003 scaling: Width=" &
5942 Natural'Image(Natural(Float(Width) / Float(Picture_Width) * 100.0 / 0.75)) & " Height=" &
5943 Natural'Image(Natural(Float(Height) / Float(Picture_Height) * 100.0 / 0.75)));
5944
5945 end;
5946
5947 -- Wrap the picture in a shape, so we can set the properties:
5948
5949 Ada.Text_IO.Put (Output_Object.Output_File,
5950 "{\shp{\*\shpinst"); -- Start a shape.
5951 Ada.Text_IO.Put (Output_Object.Output_File,
5952 "\shpleft0\shptop0"); -- Left and top are the origin.
5953 Ada.Text_IO.Put (Output_Object.Output_File,
5954 "\shpright" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Right edge in twips.
5955 Ada.Text_IO.Put_Line (Output_Object.Output_File,
5956 "\shpbottom" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Bottom edge in twips.
5957 Ada.Text_IO.Put (Output_Object.Output_File,
5958 "\shpfhdr0"); -- Shape is in the main document.
5959
5960 Ada.Text_IO.Put (Output_Object.Output_File,
5961 "\shpbxcolumn"); -- Shape is positioned relative to the column.
5962 Ada.Text_IO.Put (Output_Object.Output_File,
5963 "\shpbxignore"); -- But use posrelh instead (column is the default).
5964 Ada.Text_IO.Put (Output_Object.Output_File,
5965 "\shpbypara"); -- Shape is positioned relative to the paragraph.
5966 Ada.Text_IO.Put (Output_Object.Output_File,
5967 "\shpbyignore"); -- But use posrelv instead (paragraph is the default).
5968 case Alignment is
5969 when ARM_Output.Inline =>
5970 Ada.Text_IO.Put (Output_Object.Output_File,
5971 "\shpwr2\shpwrk0"); -- Wrap text around shape (rectangle), on both sides.
5972 when ARM_Output.Float_Left =>
5973 Ada.Text_IO.Put (Output_Object.Output_File,
5974 "\shpwr2\shpwrk2"); -- Wrap text around shape (rectangle), on right only.
5975 when ARM_Output.Float_Right =>
5976 Ada.Text_IO.Put (Output_Object.Output_File,
5977 "\shpwr2\shpwrk1"); -- Wrap text around shape (rectangle), on left only.
5978 when ARM_Output.Alone_Left | ARM_Output.Alone_Center |
5979 ARM_Output.Alone_Right =>
5980 Ada.Text_IO.Put (Output_Object.Output_File,
5981 "\shpwr1"); -- Don't allow text alongside shape.
5982 end case;
5983 Ada.Text_IO.Put (Output_Object.Output_File,
5984 "\shpfblwtxt0"); -- Text is below shape.
5985 Ada.Text_IO.Put (Output_Object.Output_File,
5986 "\shpz0"); -- Z-order for shape (these don't overlap, I hope).
5987
5988 Output_Object.Last_Shape_Id := Output_Object.Last_Shape_Id + 1;
5989 -- These need to be unique, but the value doesn't matter much.
5990 Ada.Text_IO.Put (Output_Object.Output_File,
5991 "\shplid" & Format_Twips(Output_Object.Last_Shape_Id));
5992 Ada.Text_IO.Put (Output_Object.Output_File,
5993 "{\sp{\sn shapeType}{\sv 75}}"); -- "Picture frame" type.
5994 Ada.Text_IO.Put_Line (Output_Object.Output_File,
5995 "{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}"); -- No flipping.
5996
5997 Ada.Text_IO.Put_Line (Output_Object.Output_File,
5998 "{\sp{\sn pib}{\sv {\pict"); -- Start the picture data
5999
6000 Ada.Text_IO.Put (Output_Object.Output_File,
6001 "\picscalex" & Format_Twips(Picture_Scaling)); -- X scaling (%).
6002 Ada.Text_IO.Put (Output_Object.Output_File,
6003 "\picscaley" & Format_Twips(Picture_Scaling)); -- Y scaling (%).
6004 Ada.Text_IO.Put (Output_Object.Output_File,
6005 "\piccropl0"); -- Left crop (twips) [Should be zero].
6006 Ada.Text_IO.Put (Output_Object.Output_File,
6007 "\piccropr0"); -- Right crop (twips) [Should be zero].
6008 Ada.Text_IO.Put (Output_Object.Output_File,
6009 "\piccropt0"); -- Top crop (twips) [Should be zero].
6010 Ada.Text_IO.Put_Line (Output_Object.Output_File,
6011 "\piccropb0"); -- Bottom crop (twips) [Should be zero].
6012 Ada.Text_IO.Put (Output_Object.Output_File,
6013 "\picw" & Format_Twips(Natural(Picture_Width) * 5)); -- Raw picture width in ??? (doesn't seem to be used).
6014 Ada.Text_IO.Put (Output_Object.Output_File,
6015 "\pich" & Format_Twips(Natural(Picture_Height) * 5)); -- Raw picture height in ??? (doesn't seem to be used).
6016 Ada.Text_IO.Put (Output_Object.Output_File,
6017 "\picwgoal" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Picture width goal in twips.
6018 Ada.Text_IO.Put_Line (Output_Object.Output_File,
6019 "\pichgoal" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Picture height goal in twips.
6020
6021 -- Figure out file type, using the correct type here:
6022 if Picture_Kind = PNG then
6023 Ada.Text_IO.Put_Line (Output_Object.Output_File,
6024 "\pngblip"); -- Specifies that the file is a PNG.
6025 elsif Picture_Kind = JPEG then
6026 Ada.Text_IO.Put_Line (Output_Object.Output_File,
6027 "\jpegblip"); -- Specifies that the file is a JPEG.
6028 else
6029 null; -- We should have already bombed.
6030 end if;
6031
6032 -- Should use:
6033 -- \bliptagnnn - Picture ID.
6034 -- \blipuid XXXX - Picture Unique ID.
6035 -- How these are calculated is unclear (it appears to be a hash of
6036 -- some kind). So I left these out.
6037
6038 Dump_File_in_Hex;
6039
6040 Ada.Text_IO.Put (Output_Object.Output_File,
6041 "}}}"); -- End the picture data.
6042
6043 Ada.Text_IO.Put (Output_Object.Output_File,
6044 "{\sp{\sn pibName}{\sv " & Name & "}}"); -- Picture file name
6045 Ada.Text_IO.Put (Output_Object.Output_File,
6046 "{\sp{\sn pibFlags}{\sv 2}}"); -- No idea, a flag of "2" is not documented.
6047 case Border is
6048 when ARM_Output.None =>
6049 Ada.Text_IO.Put (Output_Object.Output_File,
6050 "{\sp{\sn fLine}{\sv 0}}"); -- No line here.
6051 when ARM_Output.Thin =>
6052 -- Default lineType of 0, solid.
6053 Ada.Text_IO.Put (Output_Object.Output_File,
6054 "{\sp{\sn lineWidth}{\sv 9525}}"); -- Line size (single - 0.75pt).
6055 Ada.Text_IO.Put (Output_Object.Output_File,
6056 "{\sp{\sn fLine}{\sv 1}}"); -- Show line here.
6057 when ARM_Output.Thick =>
6058 Ada.Text_IO.Put (Output_Object.Output_File,
6059 "{\sp{\sn lineWidth}{\sv 19050}}"); -- Line size (double - 1.5pt).
6060 Ada.Text_IO.Put (Output_Object.Output_File,
6061 "{\sp{\sn fLine}{\sv 1}}"); -- Show line here.
6062 end case;
6063 case Alignment is
6064 when ARM_Output.Inline =>
6065 Ada.Text_IO.Put (Output_Object.Output_File,
6066 "{\sp{\sn posh}{\sv 1}}"); -- Position to the left.
6067 Ada.Text_IO.Put (Output_Object.Output_File,
6068 "{\sp{\sn posrelh}{\sv 3}}"); -- Position to the character.
6069 Ada.Text_IO.Put (Output_Object.Output_File,
6070 "{\sp{\sn posh}{\sv 2}}"); -- Position to the top.
6071 Ada.Text_IO.Put (Output_Object.Output_File,
6072 "{\sp{\sn posrelh}{\sv 3}}"); -- Position to the line.
6073 when ARM_Output.Float_Left =>
6074 Ada.Text_IO.Put (Output_Object.Output_File,
6075 "{\sp{\sn posh}{\sv 1}}"); -- Position to the left.
6076 Ada.Text_IO.Put (Output_Object.Output_File,
6077 "{\sp{\sn posrelh}{\sv 2}}"); -- Position to the column.
6078 when ARM_Output.Float_Right =>
6079 Ada.Text_IO.Put (Output_Object.Output_File,
6080 "{\sp{\sn posh}{\sv 3}}"); -- Position to the right.
6081 Ada.Text_IO.Put (Output_Object.Output_File,
6082 "{\sp{\sn posrelh}{\sv 2}}"); -- Position to the column.
6083 when ARM_Output.Alone_Left =>
6084 Ada.Text_IO.Put (Output_Object.Output_File,
6085 "{\sp{\sn posh}{\sv 1}}"); -- Position to the left.
6086 when ARM_Output.Alone_Center =>
6087 Ada.Text_IO.Put (Output_Object.Output_File,
6088 "{\sp{\sn posh}{\sv 2}}"); -- Position to the center.
6089 when ARM_Output.Alone_Right =>
6090 Ada.Text_IO.Put (Output_Object.Output_File,
6091 "{\sp{\sn posh}{\sv 3}}"); -- Position to the right.
6092 end case;
6093 Ada.Text_IO.Put_Line (Output_Object.Output_File,
6094 "{\sp{\sn fLayoutInCell}{\sv 0}}"); -- No nested use.
6095
6096 -- Here we find {\shprslt followed by metafile junk. Not doing that.
6097 ---- Fake Word 95 output (it shouldn't be used, but...):
6098 --Ada.Text_IO.Put_Line (Output_Object.Output_File,
6099 -- "{\shprslt\par\pard \ql \pvpara\posxr\dxfrtext180\dfrmtxtx180\dfrmtxty0\nowrap\adjustright\ \par}");
6100
6101 Ada.Text_IO.Put_Line (Output_Object.Output_File,
6102 "}}"); -- End the shape.
6103 Output_Object.Char_Count := 0;
6104
6105 -- Original code:
6106 --
6107 -- case Alignment is
6108 -- when ARM_Output.Inline =>
6109 -- null;
6110 -- when ARM_Output.Float_Left =>
6111 -- null; --***??
6112 -- when ARM_Output.Float_Right =>
6113 -- Ada.Text_IO.Put_Line ("** Unimplemented picture formatting: Float Right");
6114 -- when ARM_Output.Alone_Left =>
6115 -- Ada.Text_IO.Put (Output_Object.Output_File,
6116 -- "{\pard\plain\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " ");
6117 -- -- Set up a normal left-justified paragraph that is high enough for this picture.
6118 -- when ARM_Output.Alone_Center =>
6119 -- Ada.Text_IO.Put (Output_Object.Output_File,
6120 -- "{\pard\plain\qc\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " ");
6121 -- -- Set up a normal centered paragraph that is high enough for this picture.
6122 -- when ARM_Output.Alone_Right =>
6123 -- Ada.Text_IO.Put (Output_Object.Output_File,
6124 -- "{\pard\plain\qr\sb" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL) & " ");
6125 -- -- Set up a normal right-justified paragraph that is high enough for this picture.
6126 -- end case;
6127 --
6128 -- -- Picture setup:
6129 -- Ada.Text_IO.Put_Line (Output_Object.Output_File,
6130 -- "{\*\shppict {\pict "); -- Defines a picture (Word 97 and newer).
6131 --
6132 -- -- Shape Properties:
6133 -- Output_Object.Last_Shape_Id := Output_Object.Last_Shape_Id + 1;
6134 -- -- These need to be unique, but what they are doesn't matter much.
6135 -- Ada.Text_IO.Put (Output_Object.Output_File,
6136 -- "{\*\picprop\shplid" & Format_Twips(Output_Object.Last_Shape_Id));
6137 -- Ada.Text_IO.Put (Output_Object.Output_File,
6138 -- "{\sp{\sn shapeType}{\sv 75}}"); -- "Picture frame" type.
6139 -- Ada.Text_IO.Put_Line (Output_Object.Output_File,
6140 -- "{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}"); -- No flipping.
6141 -- Ada.Text_IO.Put (Output_Object.Output_File,
6142 -- "{\sp{\sn pibName}{\sv " & Name & "}}"); -- Picture file name
6143 -- Ada.Text_IO.Put (Output_Object.Output_File,
6144 -- "{\sp{\sn pibFlags}{\sv 2}}"); -- No idea, a flag of "2" is not documented.
6145 -- Ada.Text_IO.Put (Output_Object.Output_File,
6146 -- "{\sp{\sn fLine}{\sv 0}}"); -- No line here.
6147 -- Ada.Text_IO.Put_Line (Output_Object.Output_File,
6148 -- "{\sp{\sn fLayoutInCell}{\sv 1}}}"); -- Allow nested use..
6149 --
6150 --
6151 -- Ada.Text_IO.Put (Output_Object.Output_File,
6152 -- "\picscalex" & Format_Twips(Picture_Scaling)); -- X scaling (%).
6153 -- Ada.Text_IO.Put (Output_Object.Output_File,
6154 -- "\picscaley" & Format_Twips(Picture_Scaling)); -- Y scaling (%).
6155 -- Ada.Text_IO.Put (Output_Object.Output_File,
6156 -- "\piccropl0"); -- Left crop (twips) [Should be zero].
6157 -- Ada.Text_IO.Put (Output_Object.Output_File,
6158 -- "\piccropr0"); -- Right crop (twips) [Should be zero].
6159 -- Ada.Text_IO.Put (Output_Object.Output_File,
6160 -- "\piccropt0"); -- Top crop (twips) [Should be zero].
6161 -- Ada.Text_IO.Put_Line (Output_Object.Output_File,
6162 -- "\piccropb0"); -- Bottom crop (twips) [Should be zero].
6163 -- Ada.Text_IO.Put (Output_Object.Output_File,
6164 -- "\picw" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Raw picture width in twips.
6165 -- Ada.Text_IO.Put (Output_Object.Output_File,
6166 -- "\pich" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Raw picture height in twips.
6167 -- Ada.Text_IO.Put (Output_Object.Output_File,
6168 -- "\picwgoal" & Format_Twips(Width * HORIZONTAL_TWIPS_PER_PIXEL)); -- Picture width goal in twips.
6169 -- Ada.Text_IO.Put_Line (Output_Object.Output_File,
6170 -- "\pichgoal" & Format_Twips(Height * VERTICAL_TWIPS_PER_PIXEL)); -- Picture height goal in twips.
6171 --
6172 -- case Border is
6173 -- when ARM_Output.None =>
6174 -- null;
6175 -- when ARM_Output.Thin =>
6176 -- Ada.Text_IO.Put (Output_Object.Output_File,
6177 -- "\brdrs\brdrw15 "); -- Single thickness border (value is in twips).
6178 -- when ARM_Output.Thick =>
6179 -- Ada.Text_IO.Put (Output_Object.Output_File,
6180 -- "\brdrs\brdrw30 "); -- Double thickness border (value is in twips).
6181 -- end case;
6182 --
6183 -- -- Figure out file type, using the correct type here:
6184 -- if Picture_Kind = PNG then
6185 -- Ada.Text_IO.Put (Output_Object.Output_File,
6186 -- "\pngblip "); -- Specifies that the file is a PNG.
6187 -- elsif Picture_Kind = JPEG then
6188 -- Ada.Text_IO.Put (Output_Object.Output_File,
6189 -- "\jpegblip "); -- Specifies that the file is a JPEG.
6190 -- else
6191 -- null; -- We should have already bombed.
6192 -- end if;
6193 --
6194 -- -- Should use:
6195 -- -- \bliptagnnn - Picture ID.
6196 -- -- \blipuid XXXX - Picture Unique ID.
6197 -- -- How these are calculated is unclear (it appears to be a hash of
6198 -- -- some kind). So I left these out.
6199 --
6200 -- Dump_File_in_Hex;
6201 --
6202 -- Ada.Text_IO.Put_Line (Output_Object.Output_File,
6203 -- "}}"); -- End the picture.
6204 -- Output_Object.Char_Count := 0;
6205 --
6206 -- -- This should be followed by:
6207 -- -- {\*\nonshppict {\pict - Defines an old format picture. This has
6208 -- -- the graphic in metafile format. I have no idea how to convert that;
6209 -- -- forget it.
6210 --
6211 -- -- An easy but incredibly crappy implementation follows. But this
6212 -- -- needs height information in a dedicated paragraph to work at all
6213 -- -- (without it, it ends up one line high). If we have the height
6214 -- -- information, why bother with this; just generate it correctly.
6215 -- -- Then we can be sure that the height and width are specified.
6216 -- --Ada.Text_IO.Put_Line (Output_Object.Output_File,
6217 -- -- "{\field\fldedit{\*\fldinst { INCLUDEPICTURE "".\" & Name & """ \\* MERGEFORMAT \\d }}{\fldrslt {}}}");
6218 -- --Output_Object.Char_Count := 0;
6219 --
6220 -- -- Close anything opened for alignment:
6221 -- case Alignment is
6222 -- when ARM_Output.Inline =>
6223 -- null;
6224 -- when ARM_Output.Float_Left =>
6225 -- null;
6226 -- when ARM_Output.Float_Right =>
6227 -- null;
6228 -- when ARM_Output.Alone_Left =>
6229 -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
6230 -- when ARM_Output.Alone_Center =>
6231 -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
6232 -- when ARM_Output.Alone_Right =>
6233 -- Ada.Text_IO.Put_Line (Output_Object.Output_File, "\par}");
6234 -- end case;
6235
6236 end Picture;
6237
6238
6239 -- Notes:
6240 -- "\_" is a non-breaking hyphen.
6241
6242 end ARM_RTF;