4 # code as grid. only the grid saves!
5 # there may already be a little groff markup in this file
6 my $textForTypesetting = "7tmpslave9printfunction";
8 # this returns the text as an array of arrays, alllinesAllleters ;)
9 my @ohmyAoA = &parseText
("$textForTypesetting.txt");
10 # this subroutine's name is no good. it should be more like makegroff
13 # takes as an argument the file to be parsed, so &parseText("file.txt")
15 my @alllinesAllletters;
16 my @currentLineLetters;
17 my $TEXTlinesCounter = 0;
23 @currentLineLetters = split //, $_;
24 $alllinesAllletters[$TEXTlinesCounter] = [@currentLineLetters];
31 my @linesletters = @_;
38 # this is the file that we will build
39 my $newFile = $textForTypesetting . "Typeset.txt";
40 open TYPESET
, "> $newFile";
42 # originally, at this point a header was inserted
45 foreach $referLine (@linesletters) {
46 $thisLineSize = @
$referLine - 1;
47 # this decision structure allows there to already be somemarkup in the file
48 if (@
$referLine[0] eq "." || @
$referLine[0] eq "\\") {
49 foreach $aLetter (0..$thisLineSize) {
50 print TYPESET @
$referLine[$aLetter];
54 foreach $aLetter (0..$thisLineSize) {
55 $anAmount = int(rand(20));
56 $goodbye = "\\h'" . $anAmount . "M'@$referLine[$aLetter]\\h'-" . $anAmount . "M'";
57 print TYPESET
$goodbye;