diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:41:07 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:41:07 +0000 |
commit | 3af6d22bb3850ab2bac67287e3a3d3b0e32868e5 (patch) | |
tree | 3ee7a3ec64525911fa865bb984c86d997d855527 /scripts | |
parent | Adding debian version 6.05.01-1. (diff) | |
download | manpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.tar.xz manpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.zip |
Merging upstream version 6.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts')
24 files changed, 664 insertions, 10597 deletions
diff --git a/scripts/FIXME_list.sh b/scripts/FIXME_list.sh index 59ba3c0..cdaef76 100755 --- a/scripts/FIXME_list.sh +++ b/scripts/FIXME_list.sh @@ -9,7 +9,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -23,7 +23,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -40,10 +40,10 @@ while getopts "a" optname; do # Even show FIXMEs that aren't generally interesting. (Typically # these FIXMEs are notes to the maintainer to reverify something # at a future date.) - - show_all="y" + + show_all="y" ;; - + *) echo "Unknown option: $OPTARG" exit 1 ;; @@ -64,15 +64,15 @@ for dir in "$@"; do do cat "$page" | awk -v SHOW_ALL=$show_all -v PAGE_NAME="$page" \ ' - BEGIN { - page_FIXME_cnt = 0; + BEGIN { + page_FIXME_cnt = 0; } - - /FIXME/ { - + + /FIXME/ { + # /.\" FIXME . / ==> do not display this FIXME, unless # -a command-line option was supplied - + if ($0 ~ /^\.\\" FIXME \./ ) FIXME_type = "hidden" else if ($0 ~ /^\.\\" FIXME *\?/ ) @@ -85,26 +85,26 @@ for dir in "$@"; do print PAGE_NAME; } page_FIXME_cnt++; - - finished = 0; - do { - print $0; - - # Implicit end of FIXME is end-of-file or a line + + finished = 0; + do { + print $0; + + # Implicit end of FIXME is end-of-file or a line # that is not a comment - + if (getline == 0) finished = 1; - - if (!($0 ~ /^.\\"/)) + + if (!($0 ~ /^.\\"/)) finished = 1; - + # /.\" .$/ ==> Explicit end of FIXME - - if ($0 ~ /^.\\" \.$/) + + if ($0 ~ /^.\\" \.$/) finished = 1; } while (!finished); - + print ""; } } diff --git a/scripts/LinuxManBook/BuildLinuxMan.pl b/scripts/LinuxManBook/BuildLinuxMan.pl deleted file mode 100755 index 7d96057..0000000 --- a/scripts/LinuxManBook/BuildLinuxMan.pl +++ /dev/null @@ -1,249 +0,0 @@ -#!/usr/bin/perl -w -# -# BuildLinuxMan.pl : Build Linux manpages book -# Deri James : 15 Dec 2022 -# -# Params:- -# -# $1 = Directory holding the man pages -# -# (C) Copyright 2022, Deri James -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details -# (http://www.gnu.org/licenses/gpl-2.0.html). -# - -use strict; - -my $dir=shift || '.'; -my @aliases=`egrep -l '^\\.so' $dir/man*/*`; -my %alias; -my %target; -my $inTS=0; -my $inBlock=0; - -my %Sections= -( - "1" => "General Commands Manual", - "2" => "System Calls Manual", - "2type" => "System Calls Manual (types)", - "3" => "Library Functions Manual", - "3const" => "Library Functions Manual (constants)", - "3head" => "Library Functions Manual (headers)", - "3type" => "Library Functions Manual (types)", - "4" => "Kernel Interfaces Manual", - "5" => "File Formats Manual", - "6" => "Games Manual", - "7" => "Miscellaneous Information Manual", - "8" => "System Manager's Manual", - "9" => "Kernel Developer's Manual", -); - -my $Section=''; - -LoadAlias(); -BuildBook(); - -my $cmdstring="-Tpdf -k -pet -M. -F. -mandoc -manmark -dpaper=a4 -P-pa4 -rC1 -rCHECKSTYLE=3"; - -system("groff -Tpdf -ms LMBfront.t -Z > LMBfront.Z"); -system("groff -z -dPDF.EXPORT=1 -dLABEL.REFS=1 T $cmdstring 2>&1 | LC_ALL=C grep '^\\. *ds' | groff -Tpdf $cmdstring - T -Z > LinuxManBook.Z"); -system("./gropdf -F. LMBfront.Z LinuxManBook.Z > LinuxManBook.pdf"); -unlink "LinuxManBook.Z","LMBfront.Z"; # If you want to clean up - -# Aliases are the man pages which .so another man page, so build a hash of them so -# that when we are processing referenced man page we can add the target for the -# bookmark. - -sub LoadAlias -{ - foreach my $fn (@aliases) - { - chomp($fn); - my (@pth)=split('/',$fn); - my $nm=pop(@pth); - my $bkmark="$1_$2" if $nm=~m/(.*)\.(\w+)/; - - if (open(F,"<$fn")) - { - while (<F>) - { - next if m/^\.\\"/; - - if (m/^.so\s+(man\w+\/(.+)\.(.+?))$/) - { - $alias{$bkmark}=["$2_$3",$2,$3]; - push(@{$target{"$2_$3"}},$bkmark); - last; - } - else - { - print STDERR "Alias fail: $fn\n"; - } - } - - close(F); - } - else - { - print STDERR "Open fail: $fn\n"; - } - } -} - -sub BuildBook -{ - open(BK,">T"); - - foreach my $fn (sort sortman glob("$dir/man*/*")) - { - my ($nm,$sec,$srt)=GetNmSec($fn); - - my $bkmark="$1_$2" if $nm=~m/(.*)\.(\w+)/; - my $title= "$1\\($2\\)"; - -# If this is an alias, just add it to the outline panel. - - if (exists($alias{$bkmark})) - { - print BK ".eo\n.device ps:exec [/Dest /$alias{$bkmark}->[0] /Title ($title) /Level 2 /OUT pdfmark\n.ec\n"; - print BK ".if dPDF.EXPORT .tm .ds pdf:look($bkmark) $alias{$bkmark}->[1]($alias{$bkmark}->[2])\n"; - next; - } - - print BK ".\\\" >>>>>> $1($2) <<<<<<\n"; - - if (open(F,'<',$fn)) - { - while (<F>) - { - if (m/^\.\\"/) - { - print BK $_; - next; - } - - chomp; - -# This code is to determine whether we are within a tbl block and in a text block -# T{ and T}. This is fudge code particularly for the syscalls(7) page. - - $inTS=1 if m/\.TS/; - $inTS=0,$inBlock=0 if m/\.TE/; - - s/\r$//; # In case edited under windows i.e. CR/LF - s/\s+$//; - next if !$_; -# s/^\s+//; - - if (m/^\.BR\s+([-\w\\.]+)\s+\((.+?)\)(.*)/) - { - my $bkmark="$1"; - my $sec=$2; - my $after=$3; - my $dest=$bkmark; - $dest=~s/\\-/-/g; - $_=".MR \"$bkmark\" \"$sec\" \"$after\" \"$dest\""; - } - - s/^\.BI \\fB/.BI /; - s/^\.BR\s+(\S+)\s*$/.B $1/; - s/^\.BI\s+(\S+)\s*$/.B $1/; - s/^\.IR\s+(\S+)\s*$/.I $1/; - -# Fiddling for syscalls(7) :-( - - if ($inTS) - { - my @cols=split(/\t/,$_); - - foreach my $c (@cols) - { - $inBlock+=()=$c=~m/T\{/g; - $inBlock-=()=$c=~m/T\}/g; - - my $mtch=$c=~s/\s*\\fB([-\w.]+)\\fP\((\w+)\)/\n.MR $1 $2 \\c\n/g; - $c="T{\n${c}\nT}" if $mtch and !$inBlock; - } - - $_=join("\t",@cols); - s/\n\n/\n/g; - } - - if (m/^\.TH\s+([-\w\\.]+)\s+(\w+)/) - { - - # if new section add top level bookmark - - if ($sec ne $Section) - { - print BK ".nr PDFOUTLINE.FOLDLEVEL 1\n.fl\n"; - print BK ".pdfbookmark 1 $Sections{$sec}\n"; - print BK ".nr PDFOUTLINE.FOLDLEVEL 2\n"; - $Section=$sec; - } - - print BK "$_\n"; - -# Add a level two bookmark. We don't set it in the TH macro since the name passed -# may be different from the filename, i.e. file = unimplemented.2, TH = UNIMPLEMENTED 2 - - print BK ".pdfbookmark -T $bkmark 2 $1($2)\n"; - -# If this page is referenced by an alias plant a destination label for the alias. - - if (exists($target{$bkmark})) - { - foreach my $targ (@{$target{$bkmark}}) - { - print BK ".pdf*href.set $targ\n"; - } - } - - next; - } - - print BK "$_\n"; - - } - - close(F); - - } - } - - close(BK); -} - -sub GetNmSec -{ - my (@pth)=split('/',shift); - my $nm=pop(@pth); - my $sec=substr(pop(@pth),3); - my $srt=$nm; - $srt=~s/^_+//; - $srt="$sec/$srt"; - return($nm,$sec,$srt); -} - -sub sortman -{ -# Sort - ignore case but frig it so that intro is the first entry. - - my (undef,$s1,$c)=GetNmSec($a); - my (undef,$s2,$d)=GetNmSec($b); - - my $cmp=$s1 cmp $s2; - return $cmp if $cmp; - return -1 if ($c=~m/\/intro/ and $d!~m/\/intro/); - return 1 if ($d=~m/\/intro/ and $c!~m/\/intro/); - return (lc($c) cmp lc($d)); -} diff --git a/scripts/LinuxManBook/LMBfront.t b/scripts/LinuxManBook/LMBfront.roff index c034dd5..fdf1a98 100644 --- a/scripts/LinuxManBook/LMBfront.t +++ b/scripts/LinuxManBook/LMBfront.roff @@ -1,6 +1,3 @@ -.ig - front.t -.. .de Hl .br \l'\\n[.l]u-\\n[.i]u\&\\$1' @@ -8,31 +5,29 @@ .. .ps 10 .vs 12 -.nr PS 10 -.nr VS 12 -.nr SS_prefix 1v -.nr do-page 0 -.Nh 0 0 -.\" .so utp.mac -.\" .utp +.po 2c +.ll 17c +.sp 2.5c \Z@\D't 8p'@ .Hl \D't 0' .sp .6i -.DS R +.ad r .ps 52 \m[maroon]GNU/Linux\m[] .sp 18p .ps 16 \f[BMB]THE MAN-PAGES BOOK\fP -.sp 30p -.sp 1.4i +.sp 6i .ps 12 \f[HB]Maintainers:\fP .sp 2p .ps 10 \f[HB]Alejandro Colomar <alx@kernel.org> 2020 - present (5.09 - HEAD) +.brp Michael Kerrisk <mtk.manpages@gmail.com> 2004 - 2021 (2.00 - 5.13) +.brp Andries Brouwer <aeb@cwi.nl> 1995 - 2004 (1.6 - 1.70) +.brp Rik Faith 1993 - 1995 \0(1.0 - 1.5)\fP -.DE +.bp diff --git a/scripts/LinuxManBook/an-ext.tmac b/scripts/LinuxManBook/an-ext.tmac deleted file mode 100644 index e2f5c48..0000000 --- a/scripts/LinuxManBook/an-ext.tmac +++ /dev/null @@ -1,282 +0,0 @@ -.\" groff extension macros for man(7) package -.\" -.\" Copyright (C) 2007-2022 Free Software Foundation, Inc. -.\" -.\" Written by Eric S. Raymond <esr@thyrsus.com> -.\" Werner Lemberg <wl@gnu.org> -.\" G. Branden Robinson <g.branden.robinson@gmail.com> -.\" -.\" You may freely use, modify and/or distribute this file. -.\" -.\" The code below provides extension macros for the 'man' macro -.\" package. Care has been taken to make the code portable; groff -.\" extensions are properly hidden so that all troff implementations can -.\" use it without changes. -.\" -.\" With groff, this file is sourced by the 'man' macro package itself. -.\" Man page authors who are concerned about portability might add the -.\" used macros directly to the prologue of the man page(s). -. -. -.\" Convention: Auxiliary macros and registers start with 'm' followed -.\" by an uppercase letter or digit. -. -. -.\" Protect against being sourced twice. -.nr mZ +1 -.if \n(mZ>1 \ -. nx -. -.\" Define this to your implementation's constant-width typeface. -.ds mC CW -. -.\" In AT&T troff, there was no register exposing the hyphenation mode, -.\" and no way to save and restore it. Set this to a reasonable value -.\" for your implementation and preference. -.ie !\n(.g \ -. nr mJ 1 -.el \ -. do nr mJ \n[.hy] -. -.\" Check if we're using grohtml or grotty, and therefore support URIs. -.nr mH 0 -.nr mY 0 -.nr mU 0 -.if \n(.g \{\ -. if '\*(.T'html' \ -. nr mH 1 -. if '\*(.T'ascii' \ -. nr mY 1 -. if '\*(.T'cp1047' \ -. nr mY 1 -. if '\*(.T'latin1' \ -. nr mY 1 -. if '\*(.T'utf8' \ -. nr mY 1 -. nr mU \n(mH+\n(mY -.\} -. -. -.\" groff has glyph entities for angle brackets. -.ie \n(.g \{\ -. ds mL \(la\" -. ds mR \(ra\" -.\} -.el \{\ -. ds mL <\" -. ds mR >\" -.\} -. -.nr mS 0 -. -. -.\" Declare start of command synopsis. Sets up hanging indentation. -.de SY -. ie !\\n(mS \{\ -. nh -. nr mS 1 -. nr mA \\n(.j -. ad l -. nr mI \\n(.i -. \} -. el \{\ -. br -. ns -. \} -. -. nr mT \w'\fB\\$1\fP\ ' -. HP \\n(mTu -. B "\\$1" -.. -. -. -.\" End of command synopsis. Restores adjustment. -.de YS -. in \\n(mIu -. ad \\n(mA -. hy \\n(mJ -. nr mS 0 -.. -. -.\" Prepare link text for mail/web hyperlinks. `MT` and `UR` call this. -.de mV -. ds m1 \\$1\" -. \" Save the indentation and line length. We want the diversion to -. \" format as if it has an indentation of zero (that comes for free -. \" when we switch environments), but we want the line length reduced -. \" by the amount of indentation that obtains when we output it. -. nr mK \\n(.l -. nr mI \\n(.i -. \" We can only hyperlink if we're not in a diversion. -. nr mD 0 -. if '\\n(.z'' .nr mD 1 -. if \\n(mD&\\nU&\\n(mU \{\ -. \" Start diversion in a new environment. -. do ev link-text-env -. do di link-text-div -. ll (\\n(mKu-\\n(mIu) -. \} -. rr mK -.. -. -.\" Start URL. -.de UR -. mV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 -.. -. -. -.\" End URL. -.de UE -. ie \\n(mD&\\nU&\\n(mU \{\ -. br -. di -. ev -. -. \" Has there been at least one input line of hyperlinked text? -. ie \\n(dn \{\ -. if \\n(mH \ -\X^html:<a href="\\*(m1">^\c -. if \\n(mY \ -\X^tty: link \\*(m1^\c -. \" Strip off the final newline of the diversion and emit it. -. do chop link-text-div -. do link-text-div -\c -. if \\n(mH \ -\X^html:</a>^\c -. if \\n(mY \ -\X^tty: link^\c -. \} -. el \{\ -. if \\n(mH \ -\X^html:<a href="\\*(m1">\\*(m1</a>^\c -. if \\n(mY \ -\X^tty: link \\*(m1^\\*(m1\X^tty: link^\c -. \} -\&\\$*\" -. \} -. el \{\ -. nh -\\*(mL\\*(m1\\*(mR\\$1 -. do shift -. ie \n(.g .if \\n(.$ \&\\$*\" -. el .if \\n(.$>1 \&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\" -. hy \\n(mJ -. \} -. rr mD -.. -. -. -.\" Start email address. -.de MT -. mV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 -.. -. -. -.\" End email address. -.de ME -. ie \\n(mD&\\nU&\\n(mU \{\ -. br -. di -. ev -. -. \" Has there been at least one input line of hyperlinked text? -. ie \\n(dn \{\ -. if \\n(mH \ -\X^html:<a href="mailto:\\*(m1">^\c -. if \\n(mY \ -\X^tty: link mailto:\\*(m1^\c -. \" Strip off the final newline of the diversion and emit it. -. do chop link-text-div -. do link-text-div -\c -. if \\n(mH \ -\X^html:</a>^\c -. if \\n(mY \ -\X^tty: link^\c -. \} -. el \{\ -. if \\n(mH \ -\X^html:<a href="mailto:\\*(m1">\\*(m1</a>^\c -. if \\n(mY \ -\X^tty: link mailto:\\*(m1^\\*(m1\X^tty: link^\c -. \} -\&\\$*\" -. \} -. el \{\ -. nh -\\*(mL\\*(m1\\*(mR\\$1 -. do shift -. ie \n(.g .if \\n(.$ \&\\$*\" -. el .if \\n(.$>1 \&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9\" -. hy \\n(mJ -. \} -. rr mD -.. -. -. -.\" Set a man page cross reference. -.\" .MR page-topic page-section [trailing-text] -.if \n(.g .ig -.de MR -. nh -. ie \\n(.$=1 \ -. I \\$1 -. el \ -. IR \\$1 (\\$2)\\$3 -. hy \\n(mJ -.. -. -. -.\" Continuation line for .TP header. -.de TQ -. br -. ns -. TP \\$1\" no doublequotes around argument! -.. -. -. -.\" Start example. -.if \n(.g .ig -.de EX -. br -. if !\\n(mX \{\ -. nr mF \\n(.f -. nr mP \\n(PD -. nr PD 1v -. nf -. ft \\*(mC -. nr mX 1 -. \} -.. -. -. -.\" End example. -.if \n(.g .ig -.de EE -. br -. if \\n(mX \{\ -. ft \\n(mF -. nr PD \\n(mP -. fi -. nr mX 0 -. \} -.. -. -. -.\" Start display. -.de DS -. \" XXX to be written -.. -. -. -.\" End display. -.de DE -. \" XXX to be written -.. -. -.\" Local Variables: -.\" mode: nroff -.\" fill-column: 72 -.\" End: -.\" vim: set filetype=groff textwidth=72: diff --git a/scripts/LinuxManBook/an.tmac b/scripts/LinuxManBook/an.tmac index 298fd8a..26fbef6 100644 --- a/scripts/LinuxManBook/an.tmac +++ b/scripts/LinuxManBook/an.tmac @@ -1,6 +1,6 @@ .\" groff implementation of man(7) package .\" -.\" Copyright (C) 1989-2022 Free Software Foundation, Inc. +.\" Copyright (C) 1989-2023 Free Software Foundation, Inc. .\" Written by James Clark (jjc@jclark.com) .\" Enhanced by: Werner Lemberg <wl@gnu.org> .\" Larry Kollar <kollar@alltel.net> @@ -89,7 +89,7 @@ .\" Define alternate requests to handle continuous rendering. .\" .\" This .ne replacement avoids page breaks; instead, the page length is -.\" increased to the necessary amount (this is needed for tables). +.\" increased to the necessary amount. .de an-ne . ie \\n[.$] .nr an-amount (v;\\$*) . el .nr an-amount 1v @@ -128,13 +128,13 @@ . pl +1v . nf . ti 0 -\D'l \\n[LL]u 0' +. nop \D'l \\n[LL]u 0' . fi . \} . \} . rr an-TH-was-called . ch an-header -. bp +. an*break-page-with-new-number .. . .\" Move macros into place for continuous rendering. @@ -176,13 +176,18 @@ . nr an-saved-prevailing-indent1 \\n[IN] .. . -.\" Cause a page transition to a new man(7) document. Clear the page -.\" header trap so it is not sprung with stale information. Update the -.\" page number depending on the C (consecutive numbering) register. -.de an-start-new-document -. ch an-header +.\" Break the page and update its number depending on the C (consecutive +.\" numbering) register. +.\" +.\" Corner case: if formatting multiple documents and P (starting page +.\" number) is defined but C is not set, start numbering each document +.\" at \n[P]. Not strictly necessary if not switching macro packages. +.de an*break-page-with-new-number . ie \\n[C] .bp (\\n[%] + 1) \" argument NOT redundant before page 1 -. el .bp 1 +. el \{\ +. ie r P .bp \\n[P] +. el .bp 1 +. \} .. . .\" Localize manual section titles for English. @@ -197,7 +202,7 @@ . ds an*section8 System Manager's Manual\" . ds an*section9 Kernel Developer's Manual\" .. -.\" Remove '\%' from string used as bookmark destination +. .de an*cln . ds \\$1 . als an*cln:res \\$1 @@ -212,8 +217,9 @@ . .\" Write a bookmark/anchor/link target $2 at hierarchical depth $1. .de an*bookmark -. if '\\*[.T]'pdf' \{\ -. ie (\\$1=2) .pdfbookmark -T "\\*[an*page-ref-bm-nm]" \\$1 \\$2 +. if \\n[an*is-output-pdf] \{\ +. if (\\n[.$]>2) .an*cln an*page-ref-nm \\$3\" +. ie (\\$1=1) .pdfbookmark -T "\\*[an*page-ref-nm]" \\$1 \\$2 . el .pdfbookmark \\$1 \\$2 . \} .. @@ -229,11 +235,15 @@ . . \" If batch processing (rendering multiple) man page documents, we . \" must handle the end of a previous document. -. if !\\n[an-is-first-page-of-document] \{\ -. ie \\n[cR] .an-end -. el .an-start-new-document -. nr an-is-first-page-of-document 1 +. if \\n[an*need-titles-reset] \{\ +. if \\n[cR] .an-end +. +. \" Clear the page header trap so it is not sprung with stale +. \" information. +. ch an-header +. an*break-page-with-new-number . \} +. if \\n[C] .rr P . . nr an-TH-was-called 1 \" an-end can make certain assumptions. . @@ -244,7 +254,7 @@ . fam \\*[an*body-family] . ft R . -. nr PS 10z \" default point size +. nr PS 10z \" default type size . nr PS-SS 10z . nr PS-SH 10.95z . nr VS 12p @@ -351,7 +361,7 @@ . ev . . \" HTML gets the topic without any abbreviation, since it's metadata. -. if \\n[an-is-output-html] \{\ +. if \\n[an*is-output-html] \{\ . DEVTAG-TL . nop \\*[an*topic] . DEVTAG-EO-TL @@ -364,14 +374,15 @@ . . if !\\n[cR] \{\ . wh 0 an-header -. ie r FT .nr an-footer-location \\n[FT] -. el .nr an-footer-location (-.5i) -. wh (2u * \\n[an-footer-location]u) an-break-body-text -. wh \\n[an-footer-location]u an-footer +. ie r FT .nr an*footer-location \\n[FT] +. el .nr an*footer-location (-.5i) +. wh \\n[an*footer-location]u an-footer +. wh (\\n[an*footer-location]u - .5i) an-break-body-text +. rr an*footer-location . \} . \} . -. nr an-is-first-page-of-document 0 +. nr an*need-titles-reset 1 .. . .\" Support legacy AT&T and BSD Unix man pages. @@ -379,7 +390,7 @@ .\" Designate an AT&T Unix man page. .\" .AT [system-id[ release-id]] .de1 AT -\\*[an-deprecation-warn]\\ +. nop \\*[an-deprecation-warn]\\ . ds an-extra2 "7th Edition\" . if "\\$1"3" .ds an-extra2 "7th Edition\" . if "\\$1"4" .ds an-extra2 "System III\" @@ -395,7 +406,7 @@ .\" Designate a BSD Unix man page. .\" .UC [system-id] .de1 UC -\\*[an-deprecation-warn]\\ +. nop \\*[an-deprecation-warn]\\ . ds an-extra2 "3rd Berkeley Distribution\" . if "\\$1"3" .ds an-extra2 "3rd Berkeley Distribution\" . if "\\$1"4" .ds an-extra2 "4th Berkeley Distribution\" @@ -409,15 +420,15 @@ . .\" Restore tab stops to defaults. .de1 DT -\\*[an-deprecation-warn]\\ +. nop \\*[an-deprecation-warn]\\ . an-reset-tab-stops .. . .\" Restore inter-paragraph spacing to default (or set it to argument). .\" .PD [distance] .de1 PD -\\*[an-deprecation-warn]\\ -\\*[an-reset-paragraph-spacing]\\ +. nop \\*[an-deprecation-warn]\\ +. nop \\*[an-reset-paragraph-spacing]\\ .. . .\" Write the page header; can be redefined by man.local. @@ -473,9 +484,9 @@ . while (\\n[an-header-width] >= \\n[.lt]) \{\ . \" The page topic is too long; trim some bits out of the middle. . length an*topic-length \\*[an*topic-string] -. \" roff division rounds integers toward zero. Remove an additional -. \" character on each side of the midpoint to account for the -. \" ellipsis we add later. +. \" roff uses truncating division. Remove an additional character +. \" on each side of the midpoint to account for the ellipsis we add +. \" later. . nr an-mark1 (\\n[an*topic-length] / 2 - 2) . nr an-mark2 (\\n[an*topic-length] / 2 + 2) . ds an-prefix \\*[an*topic-string]\" @@ -706,7 +717,7 @@ contains unsupported escape sequence . if \\n[.$] \{\ . ds an-section-heading \\$*\" . if \\n[CS] .stringup an-section-heading -. an*bookmark 3 \E*[an-section-heading] +. an*bookmark 3 "\\*[an-section-heading]" \&\\*[an-section-heading] . \} . if \\n[an-remap-I-style-in-headings] .ftr I I @@ -732,7 +743,7 @@ contains unsupported escape sequence . if \\n[an-remap-I-style-in-headings] .ftr I \\*[an-heading-family]BI . if \\n[.$] \{\ . ds an*subsection-heading \\$*\" -. an*bookmark 4 \E*[an*subsection-heading] +. an*bookmark 4 "\\*[an*subsection-heading]" . nop \&\\$* . \} . if \\n[an-remap-I-style-in-headings] .ftr I I @@ -763,8 +774,7 @@ contains unsupported escape sequence .. . .\" Set arguments (or next input line producing written or drawn output -.\" if none) in bold style at smaller -.\" type size. +.\" if none) in bold style at smaller type size. .de1 SB . it 1 an-input-trap . ps -1 @@ -810,7 +820,7 @@ contains unsupported escape sequence . el \{\ . ie (\\n[.$] > 1) .TP "\\$2" . el .TP -\&\\$1 +. nop \&\\$1 . \} .. . @@ -831,11 +841,11 @@ contains unsupported escape sequence .\" .\" Implementation notes: .\" -.\" We always emit a non-printing input break \& before the first -.\" argument. This is necessary only when the calling man page is in -.\" compatibility mode; it works around the surprising AT&T semantics of -.\" \f escapes at the beginning of an input line. See "Implementation -.\" differences" in groff_diff(7) or the groff Texinfo manual. +.\" We always emit a dummy character \& before the first argument. This +.\" is necessary only when the calling man page is in compatibility +.\" mode; it works around the surprising AT&T semantics of \f escapes at +.\" the beginning of an input line. See "Implementation differences" in +.\" groff_diff(7) or the groff Texinfo manual. .\" .\" The italic correction escapes can be visually confusing. We apply .\" the following rules, always on the same input line. @@ -868,7 +878,7 @@ contains unsupported escape sequence . shift 2 . \} . if \\n[.$] .as an-result \f[B]\\$1\" -\\*[an-result] +. nop \\*[an-result] . rm an-result . ft R . \} @@ -885,7 +895,7 @@ contains unsupported escape sequence . shift 2 . \} . if \\n[.$] .as an-result \f[B]\\$1\" -\\*[an-result] +. nop \\*[an-result] . rm an-result . ft R . \} @@ -902,7 +912,7 @@ contains unsupported escape sequence . shift 2 . \} . if \\n[.$] .as an-result \,\f[I]\\$1\/\" -\\*[an-result] +. nop \\*[an-result] . rm an-result . ft R . \} @@ -919,7 +929,7 @@ contains unsupported escape sequence . shift 2 . \} . if \\n[.$] .as an-result \,\f[I]\\$1\/\" -\\*[an-result] +. nop \\*[an-result] . rm an-result . ft R . \} @@ -936,7 +946,7 @@ contains unsupported escape sequence . shift 2 . \} . if \\n[.$] .as an-result \f[R]\\$1\" -\\*[an-result] +. nop \\*[an-result] . rm an-result . ft R . \} @@ -953,14 +963,14 @@ contains unsupported escape sequence . shift 2 . \} . if \\n[.$] .as an-result \f[R]\\$1\" -\\*[an-result] +. nop \\*[an-result] . rm an-result . ft R . \} .. . .\" Start a relative inset level (by the amount given in the argument). -.\" .RS [indent] +.\" .RS [inset-amount] .de1 RS . nr an-saved-margin\\n[an-inset-level] \\n[an-margin] . nr an-saved-prevailing-indent\\n[an-inset-level] \ @@ -1004,7 +1014,7 @@ contains unsupported escape sequence .\" specified) for a command synopsis. .\" .OP flag [option-parameter] .de1 OP -\\*[an-deprecation-warn]\\ +. nop \\*[an-deprecation-warn]\\ . if ((\\n[.$] < 1) : (\\n[.$] > 2)) \ . an-style-warn .\\$0 expects 1 or 2 arguments, got \\n[.$] . ie (\\n[.$] > 1) \ @@ -1063,26 +1073,163 @@ contains unsupported escape sequence . nr an*is-in-example 0 .. . +.\" Store the argument and begin a diversion for link text. +.de an*begin-hyperlink +. ds an*hyperlink \\$1\" +. \" We want the diversion to format as if it has an indentation of +. \" zero (that comes for free when we switch environments), and we +. \" want the line length reduced by the amount of indentation that +. \" obtains when we output it. +. nr an*saved-line-length \\n[.l] +. nr an*saved-indentation \\n[.i] +. \" We can only hyperlink if we're not in a diversion. +. \" XXX: There's no fundamental reason for that, just a simple matter +. \" of macro programming. +. nr an*is-in-link-text-diversion 0 +. if '\\n(.z'' .nr an*is-in-link-text-diversion 1 +. if (\\n[an*is-in-link-text-diversion] & \\n[an*do-hyperlink]) \{\ +. \" Start diversion in a new environment. +. ev an*link-text-env +. di an*link-text-div +. ll (\\n[an*saved-line-length]u - \\n[an*saved-indentation]u) +. \} +. rr an*saved-indentation +. rr an*saved-line-length +.. +. +.\" Emit hyperlinked text with optional trailing text. +.\" +.\" The caller should set the `an*prefix` string if the hyperlink should +.\" be prefixed with a scheme; for example, email addresses get +.\" "mailto:", but this need not be visible when rendering an email +.\" address on a device incapable of hyperlinking. +.de an*end-hyperlink +. ie (\\n[an*is-in-link-text-diversion] & \\n[an*do-hyperlink]) \{\ +. br +. di +. ev +. +. \" Was any link text present? +. ie \\n[dn] \{\ +. if \\n[an*is-output-html] \ +. nop \X^html:<a href="\\*[an*prefix]\\*[an*hyperlink]">^\c +. if \\n[an*is-output-terminal] \ +. nop \X^tty: link \\*[an*prefix]\\*[an*hyperlink]^\c +. \" Strip off the final newline of the diversion and emit it. +. chop an*link-text-div +. an*link-text-div +\c\" XXX: If we .nop this, HTML output is corrupted (Savannah #63470). +. if \\n[an*is-output-html] \ +. nop \X^html:</a>^\c +. if \\n[an*is-output-terminal] \ +. nop \X^tty: link^\c +. \} +. \" If there was no link text, format URI as its own link text. We +. \" don't add angle brackets here. +. el \{\ +. if \\n[an*is-output-html] \ +. nop \X^html:<a href="\\*[an*prefix]\\*[an*hyperlink]">\ +\\*[an*hyperlink]</a>^\c +. if \\n[an*is-output-terminal] \ +. nop \X^tty: link \\*[an*prefix]\\*[an*hyperlink]^\ +\\*[an*hyperlink]\X^tty: link^\c +. \} +. nop \&\\$1\" +. \} +. \" If not hyperlinking, format URI in angle brackets. There was no +. \" diversion, so the link text has already been formatted normally. +. el \{\ +. nh +. nop \\[la]\\*[an*hyperlink]\\[ra]\\$1 +. hy \\n[an*hyphenation-mode] +. \} +. +. rr an*is-in-link-text-diversion +.. +. +.\" Begin email hyperlink. Input until the next `ME` call is stored in +.\" a diversion; it becomes the link text for the hyperlinked address. +.\" .MT nobody@example.com +.de1 MT +. if !(\\n[.$] = 1) \ +. an-style-warn .\\$0 expects 1 argument, got \\n[.$] +. ds an*prefix mailto: +. an*begin-hyperlink \\$1 +.. +. +.\" End email hyperlink. The optional argument supplies trailing +.\" punctuation (or, rarely, other text) after link text. +.\" .ME [trailing-text] +.de1 ME +. an*end-hyperlink \\$1 +. rm an*prefix +.. +. +.\" Begin web hyperlink. Input until the next `UE` call is stored in +.\" a diversion; it becomes the link text for the hyperlinked address. +.\" .UR nobody@example.com +.de1 UR +. if !(\\n[.$] = 1) \ +. an-style-warn .\\$0 expects 1 argument, got \\n[.$] +. ds an*prefix \" empty +. an*begin-hyperlink \\$1 +.. +. +.\" End web hyperlink. The optional argument supplies trailing +.\" punctuation (or, rarely, other text) after link text. +.\" .UE [trailing-text] +.de1 UE +. an*end-hyperlink \\$1 +. rm an*prefix +.. +. +.\" There is no standardized format for man page URLs, but the default +.\" is expected to work (or be harmlessly ignored) everywhere except +.\" macOS. Override in man.local if desired. +.nr an*MR-URL-format 1 +. .\" Set a man page cross reference. .\" .MR page-topic page-section [trailing-text] .de1 MR -. if ((\\n[.$] < 2) : (\\n[.$] > 3)) \ -. an-style-warn .\\$0 expects 2 or 3 arguments, got \\n[.$] -. nh -. if (\\n[U] & \\n[mU]) \{\ -. if \\n(mH \ -\X^html:<a href="man:\\$1(\\$2)">^\c -. if \\n(mY \ -\X^tty: link man:\\$1(\\$2)^\c +. if ((\\n[.$] < 2) : (\\n[.$] > 4)) \ +. an-style-warn .\\$0 expects 2 to 4 arguments, got \\n[.$] +. ie \\n[an*is-output-pdf] \{\ +. nh +. ds an*title \\\\$4 +. if '\\\\*[an*title]'' .ds an*title \\\\$1 +. ie \\n(.$=1 \ +. I \\$1 +. el \{\ +. an*cln an*page-ref-nm \\*[an*title]_\\$2 +. ie d pdf:look(\\*[an*page-ref-nm]) .pdfhref L -D \\*[an*page-ref-nm] -A "\\$3" -- \fI\\$1\fP(\\$2) +. el .IR \\$1 (\\$2)\\$3 +. \} +. hy \\n(mJ . \} -\&\\*[an-lic]\f[\\*[MF]]\\$1\\*[an-ic]\f[R](\\$2)\c -. if (\\n[U] & \\n[mU]) \{\ -. if \\n(mH \ -\X^html:</a>^\c -. if \\n(mY \ -\X^tty: link^\c +. el \{\ +. ds an*url man:\\$1(\\$2)\" used everywhere but macOS +. if (\\n[an*MR-URL-format] = 2) \ +. ds an*url x-man-page://\\$2/\\$1\" macOS/Mac OS X since 10.3 +. if (\\n[an*MR-URL-format] = 3) \ +. ds an*url man:\\$1.\\$2\" Bwana (Mac OS X) +. if (\\n[an*MR-URL-format] = 4) \ +. ds an*url x-man-doc://\\$2/\\$1\" ManOpen (Mac OS X pre-2005) +. nh +. if \\n[an*do-hyperlink] \{\ +. if \\n[an*is-output-html] \ +. nop \X^html:<a href="\\*[an*url]">^\c +. if \\n[an*is-output-terminal] \ +. nop \X^tty: link \\*[an*url]^\c +. \} +. nop \&\\*[an-lic]\f[\\*[MF]]\\$1\\*[an-ic]\f[R](\\$2)\c +. if \\n[an*do-hyperlink] \{\ +. if \\n[an*is-output-html] \ +. nop \X^html:</a>^\c +. if \\n[an*is-output-terminal] \ +. nop \X^tty: link^\c +. \} +. nop \&\\$3 . \} -\&\\$3 . hy \\n[an*hyphenation-mode] .. . @@ -1093,7 +1240,7 @@ contains unsupported escape sequence . \" If continuous rendering, tell tbl not to use keeps. . ie \\n[cR] .nr 3usekeeps 0 . el .nr 3usekeeps 1 -. if \\n[an-is-output-html] \{\ +. if \\n[an*is-output-html] \{\ . nr an-TS-ll \\n[.l] . ll 1000n . \} @@ -1107,7 +1254,7 @@ contains unsupported escape sequence .\" End table. .de1 TE . HTML-IMAGE-END -. if \\n[an-is-output-html] .ll \\n[an-TS-ll]u +. if \\n[an*is-output-html] .ll \\n[an-TS-ll]u . if !r TW .if !\\n[an-was-tbl-failure-reported] \{\ . ds an-msg tbl preprocessor failed, or it or soelim was not run;\" . as an-msg " table(s) likely not rendered\" @@ -1122,7 +1269,7 @@ contains unsupported escape sequence . .\" Start equation. .de1 EQ -. if \\n[an-is-output-html] \{\ +. if \\n[an*is-output-html] \{\ . nr an-EQ-ll \\n[.l] . ll 1000n . \} @@ -1132,32 +1279,17 @@ contains unsupported escape sequence .\" End equation. .de1 EN . HTML-IMAGE-END -. if \\n[an-is-output-html] .ll \\n[an-EQ-ll]u +. if \\n[an*is-output-html] .ll \\n[an-EQ-ll]u .. . -.\" Define R "string". Some ms(7) veterans confusedly use '.R' in man -.\" pages to try to switch to the roman font style. Attempt to catch -.\" this misuse by checking for arguments and warning about it. -.de1 R -\c -. ie \\n[.$] \{\ -. ds an-msg 'R' is a string (producing the registered sign),\" -. as an-msg " not a macro\" -. an-warn \\*[an-msg] -. rm an-msg -. nop \\$* -. \} -. el \{\ -. ie c\[rg] .nop \[rg]\c -. el .nop (Reg.)\c -. \} -.. . .\" === Define strings. === .\" .\" These strings must work in compatibility mode also. . .ds S \s'\\n(PSu'\" +.ie c\[rg] .ds R \(rg\" +.el .ds R (Reg.)\" .ie c\[tm] .ds Tm \(tm\" .el .ds Tm (TM)\" .ie c\[lq] .ds lq \(lq\" @@ -1178,12 +1310,28 @@ contains unsupported escape sequence .nr an-devtag-needs-end-of-heading 0 .nr an-devtag-needs-second-column 0 . -.nr an-is-first-page-of-document 1 -. -.nr an-is-output-html 0 -.if '\*[.T]'html' .nr an-is-output-html 1 -. -.ds an*body-family T \" Times +.\" Track whether the strings that set header and footer text need to be +.\" reconfigured. This happens when batch-rendering and starting a new +.\" page. +.nr an*need-titles-reset 0 +. +.nr an*is-output-html 0 +.if '\*[.T]'html' .nr an*is-output-html 1 +.nr an*is-output-pdf 0 +.if '\*[.T]'pdf' .nr an*is-output-pdf 1 +.nr an*is-output-terminal 0 +.if '\*(.T'ascii' .nr an*is-output-terminal 1 +.if '\*(.T'cp1047' .nr an*is-output-terminal 1 +.if '\*(.T'latin1' .nr an*is-output-terminal 1 +.if '\*(.T'utf8' .nr an*is-output-terminal 1 +. +.nr an*can-hyperlink 0 +.if ( \n[an*is-output-html] \ + : \n[an*is-output-pdf] \ + : \n[an*is-output-terminal]) \ +. nr an*can-hyperlink 1 +. +.ds an*body-family \n[.fam] \" Times .ds an*example-family C \" Courier . .\" Map monospaced fonts to standard styles for groff's nroff devices. @@ -1194,6 +1342,10 @@ contains unsupported escape sequence . ftr CBI BI .\} . +.\" undocumented register; unset to test an-ext.tmac extension macros +.if !r mG \ +. nr mG 1 +. .\" Load man macro extensions. .mso an-ext.tmac . @@ -1203,7 +1355,7 @@ contains unsupported escape sequence .\" Set each rendering parameter only if its -[dr] option or man.local .\" did not. . -.if '\*[.T]'pdf' \{\ +.if \n[an*is-output-pdf] \{\ . \" FIXME: The following registers are documented only in pdf.tmac. . if !r PDFOUTLINE.FOLDLEVEL .nr PDFOUTLINE.FOLDLEVEL 1 . if !r PDFHREF.VIEW.LEADING .nr PDFHREF.VIEW.LEADING 10p @@ -1225,11 +1377,11 @@ contains unsupported escape sequence . nr C 0 .el \ . if !\n[C] \ -. if \n[an-is-output-html] \{\ +. if \n[an*is-output-html] \{\ . tm \*[an]: consecutive page numbering required for HTML output . nr C 1 . \} -.if \n[an-is-output-html] \ +.if \n[an*is-output-html] \ . nr C 1 .if r ps4html \ . nr C 1 @@ -1251,7 +1403,7 @@ contains unsupported escape sequence . nr D 0 .el \ . if \n[D] \ -. if \n[an-is-output-html] \{\ +. if \n[an*is-output-html] \{\ . tm \*[an]: ignoring double-sided layout in HTML output . nr D 0 . \} @@ -1269,14 +1421,22 @@ contains unsupported escape sequence . ie \n[cR] \ . ds an-msg footer distance when continuously rendering\" . el \{\ +. nr an*tmp 1v +. ds an*help " (1v=\n[an*tmp]u)\" . ie (\n[FT] : (\n[FT] = 0)) \ -. ds an-msg non-negative footer distance: \n[FT]u\" +. ds an-msg non-negative footer distance: \n[FT]u\*[an*help]\" . el \{\ -. ie (-(\n[FT]) > (\n[.p] / 2)) \ -. ds an-msg implausibly large footer distance: \n[FT]u\" +. ie (-(\n[FT]) > (\n[.p] / 2)) \{\ +. ds an-msg implausibly large footer distance:\" +. as an-msg " \n[FT]u\*[an*help]\" +. \} . el \ -. if ((v;\n[FT]) < 1v) \ -. ds an-msg implausibly small footer distance: \n[FT]u\" +. if (-(\n[FT]) < 1v) \{\ +. ds an-msg implausibly small footer distance:\" +. as an-msg " \n[FT]u\*[an*help]\" +. \} +. rm an*help +. rr an*tmp . \} . \} . if d an-msg \{\ @@ -1319,7 +1479,7 @@ contains unsupported escape sequence .\" internal purposes like image embedding. Page numbers are not .\" rendered at all in continuous rendering mode. .if r P \{\ -. if \n[an-is-output-html] \ +. if \n[an*is-output-html] \ . if !(\n[P] = 1) \ . ds an-msg in HTML output\" . if \n[cR] \ @@ -1331,11 +1491,32 @@ contains unsupported escape sequence . rm an-msg .\} . -.if !r ps4html \ -. if r P \ -. pn 0\n[P] +.\" Setting the page number turns out to be tricky when batch rendering +.\" and switching macro packages. We must use different techniques +.\" depending on whether the transition to the first output page has +.\" happened yet. If it has not, `nl` will be `-1` and we use `pn`. If +.\" it has, we set `%`. Technically this is fragile since in theory a +.\" page could assign a negative value to `nl`. We might then be +.\" justified in saying they've broken the macro package and they get to +.\" keep both pieces. But if not, consider using a nonce register, +.\" initially set but then permanently cleared adjacent to this logic, +.\" and whose state is shared with mdoc (and andoc.tmac, if necessary). +.\" +.\" Also, we can't use the `P` register with grohtml at all. +.ie r ps4html \{\ +. if r P \{\ +. tm \*[an]: ignoring starting page number in HTML output +. rr P +. \} +.\} +.el \{\ +. if r P \{\ +. ie (\n[nl] = -1) .pn 0\n[P] +. el .nr % 0\n[P] +. \} +.\} . -.\" point size +.\" type size .if !r S \{\ . nr S 10 . if '\*[.T]'X75-12' \ @@ -1348,10 +1529,13 @@ contains unsupported escape sequence .if !r SN \ . nr SN 3n . -.\" URI enablement +.\" URI enablement desired .if !r U \ . nr U 1 . +.nr an*do-hyperlink 0 +.if (\n[U] & \n[an*can-hyperlink]) .nr an*do-hyperlink 1 +. .\" page number after which to apply letter suffixes .\" .\" Unlike most of these parameters, we do not set a default for X; only @@ -1359,7 +1543,7 @@ contains unsupported escape sequence .\" in continuous rendering mode. .if r X \{\ . af an-page-letter a -. if \n[an-is-output-html] \ +. if \n[an*is-output-html] \ . ds an-msg in HTML output\" . if \n[cR] \ . ds an-msg when continuously rendering @@ -1414,7 +1598,7 @@ contains unsupported escape sequence . .\" If rendering HTML, suppress headers and footers. .nr an-suppress-header-and-footer 0 -.if \n[an-is-output-html] .nr an-suppress-header-and-footer 1 +.if \n[an*is-output-html] .nr an-suppress-header-and-footer 1 .if r ps4html .nr an-suppress-header-and-footer 1 . .cp \n[*groff_an_tmac_C] diff --git a/scripts/LinuxManBook/andoc.tmac b/scripts/LinuxManBook/andoc.tmac deleted file mode 100644 index 8a3d61d..0000000 --- a/scripts/LinuxManBook/andoc.tmac +++ /dev/null @@ -1,114 +0,0 @@ -.\" andoc.tmac -.\" -.\" Load either an.tmac or doc.tmac. Multiple man pages can be handled. -.\" -.\" -.\" Copyright (C) 1991-2020 Free Software Foundation, Inc. -.\" Written by Werner Lemberg (wl@gnu.org), -.\" based on a patch from Tadziu Hoffmann. -.\" -.\" This file is part of groff. -.\" -.\" groff is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License as published by -.\" the Free Software Foundation, either version 3 of the License, or -.\" (at your option) any later version. -.\" -.\" groff is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -.\" License for more details. -.\" -.\" You should have received a copy of the GNU General Public License -.\" along with this program. If not, see -.\" <http://www.gnu.org/licenses/>. -.\" -. -.if !\n(.g \ -. ab andoc.tmac: macros require groff extensions; aborting -. -.do nr *groff_andoc_tmac_C \n[.cp] -.cp 0 -. -.als andoc-em em -.als andoc-bp bp -.als andoc-ne ne -. -. -.\" We must not use '.de1' for 'reload-doc' or 'reload-man'! 'doc.tmac' -.\" unconditionally switches compatibility mode off, but '.de1' would -.\" ignore this, restoring the mode that was active before. Similarly, -.\" we have to switch back to the original compatibility mode for man -.\" documents in case there is a mix of mdoc and man input files. -.\" -.\" Due to a bug in GNU troff it necessary to have a no-op line between -.\" '.do' and '\*'. -. -. -.de reload-doc -. \" Flush any partially collected output line and write page footer in -. \" continuous rendering mode. -. do if d an-end \ -. do an-end -. -. \" Remove traps planted by an.tmac. -. do ch an-header -. do ch an-break-body-text -. do ch an-footer -. -. do als em andoc-em -. do als bp andoc-bp -. do als ne andoc-ne -. do blm \" no blank line trap -. do lsm \" no leading space trap -. em \" no end-of-input trap -. -. do rm Dd \" force reinitialization of doc.tmac -. do mso doc.tmac -. -. do als TH reload-man -. -\\*(Dd\\ -.. -. -.de reload-man -. \" Flush any partially collected output line and write page footer in -. \" continuous rendering mode. -. do if d doc-end-macro \ -. do doc-end-macro -. -. \" Remove traps planted by mdoc/doc-{n,dit}roff. -. do ch doc-header -. do ch doc-footer -. -. do als em andoc-em -. do als bp andoc-bp -. do als ne andoc-ne -. do blm \" no blank line trap -. em \" no end-of-input trap -. -. do rm TH \" force reinitialization of an.tmac -. do mso an.tmac -. -. do als Dd reload-doc -. -\\*(TH\\ -.. -. -.als TH reload-man -.als Dd reload-doc -. -.\" dummy equation macros -- eqnrc is read before .TH or .Dd is parsed -.de EQ -.. -.de EN -.. -. -.cp \n[*groff_andoc_tmac_C] -.do rr *groff_andoc_tmac_C -. -.\" Local Variables: -.\" mode: nroff -.\" fill-column: 72 -.\" End: -.\" vim: set filetype=groff textwidth=72: diff --git a/scripts/LinuxManBook/anmark.tmac b/scripts/LinuxManBook/anmark.tmac deleted file mode 100644 index 95e9459..0000000 --- a/scripts/LinuxManBook/anmark.tmac +++ /dev/null @@ -1,22 +0,0 @@ -.nr PDFOUTLINE.FOLDLEVEL 1 -.defcolor pdf:href.colour rgb 0.00 0.25 0.75 -.pdfinfo /Title "The Linux man-pages Book" -.special S TINOR -.de EnD -.. -.am reload-man -.de MR EnD -. nh -. ds an*title \\\\$4 -. if '\\\\*[an*title]'' .ds an*title \\\\$1 -. an*cln an*par "\\\\*[an*title]_\\\\$2\" -. ie \\\\n(.$=1 \ -. I \\\\$1 -. el \{\ -. ie d pdf:look(\\\\*[an*par]) .pdfhref L -D \\\\*[an*par] -A "\\\\$3" -- \fI\\\\$1\fP(\\\\$2) -. el .IR \\\\$1 (\\\\$2)\\\\$3 -. \} -. hy \\\\n(mJ -.EnD -.. -. diff --git a/scripts/LinuxManBook/build.sh b/scripts/LinuxManBook/build.sh new file mode 100755 index 0000000..fcb8b83 --- /dev/null +++ b/scripts/LinuxManBook/build.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env -Sbash +# Copyright 2023-2024, Alejandro Colomar <alx@kernel.org> +# SPDX-License-Identifier: GPL-3.0-or-later + + +test -v CAT || CAT=cat; +test -v PRECONV || PRECONV=preconv; +test -v PIC || PIC=pic; +test -v TBL || TBL=tbl; +test -v EQN || EQN=eqn; +test -v TROFF || TROFF=troff; +test -v GROPDF || GROPDF=gropdf; + + +( + $CAT "$(dirname "$0")"/LMBfront.roff; + $CAT "$(dirname "$0")"/an.tmac; + "$(dirname "$0")"/prepare.pl "$1"; +) \ +| $PRECONV \ +| $PIC \ +| $TBL \ +| $EQN -Tpdf \ +| $TROFF -Tpdf -F"$(dirname "$0")" -dpaper=a4 \ +| $GROPDF -F"$(dirname "$0")" -pa4; diff --git a/scripts/LinuxManBook/en.tmac b/scripts/LinuxManBook/en.tmac deleted file mode 100644 index 441ca29..0000000 --- a/scripts/LinuxManBook/en.tmac +++ /dev/null @@ -1,77 +0,0 @@ -.\" English localization for groff -.\" -.\" Copyright (C) 2021-2022 Free Software Foundation, Inc. -.\" Written by G. Branden Robinson <g.branden.robinson.@gmail.com> -.\" -.\" This file is part of groff. -.\" -.\" groff is free software; you can redistribute it and/or modify it -.\" under the terms of the GNU General Public License as published by -.\" the Free Software Foundation, either version 3 of the License, or -.\" (at your option) any later version. -.\" -.\" groff is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -.\" License for more details. -.\" -.\" You should have received a copy of the GNU General Public License -.\" along with this program. If not, see -.\" <http://www.gnu.org/licenses/>. -.\" -.\" Please send comments to groff@gnu.org. -. -.do nr *groff_en_tmac_C \n[.cp] -.cp 0 -. -. -.\" If changing from an existing locale, we need to preserve the state -.\" of the "suppress hyphenation before a page location trap" bit. -.nr locale*use-trap-hyphenation-mode 0 -.if d locale \ -. if \n[.hy]=\n[\*[locale]*hyphenation-mode-trap] \ -. nr locale*use-trap-hyphenation-mode 1 -. -. -.ds locale english\" -. -.ss 12 -. -.\" Set up hyphenation. -. -.\" English hyphenation (\lefthyphenmin=2, \righthyphenmin=3) -.nr \*[locale]*hyphenation-mode-base 4 -.nr \*[locale]*hyphenation-mode-trap 6 -. -.ie \n[locale*use-trap-hyphenation-mode] \ -. hy \n[\*[locale]*hyphenation-mode-trap] -.el \ -. hy \n[\*[locale]*hyphenation-mode-base] -. -.rr locale*use-trap-hyphenation-mode -. -.hla en -.hpf hyphen.en -.hpfa hyphenex.en -. -. -.\" man package -.if d an \ -. an*reset-hyphenation-mode -. -. -.\" me package -.if d @R \{\ -. ds _td_format \\*(mo \\n(dy, \\n(y4\" -. ld -.\} -. -. -.cp \n[*groff_en_tmac_C] -.do rr *groff_en_tmac_C -. -.\" Local Variables: -.\" mode: nroff -.\" fill-column: 72 -.\" End: -.\" vim: set filetype=groff textwidth=72: diff --git a/scripts/LinuxManBook/gropdf b/scripts/LinuxManBook/gropdf deleted file mode 100755 index 8474e58..0000000 --- a/scripts/LinuxManBook/gropdf +++ /dev/null @@ -1,3710 +0,0 @@ -#!/bin/perl -w -# -# gropdf : PDF post processor for groff -# -# Copyright (C) 2011-2018 Free Software Foundation, Inc. -# Written by Deri James <deri@chuzzlewit.myzen.co.uk> (and KUBO Koichi) -# - -# This file is part of groff. -# -# groff is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# groff is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -use strict; -use Getopt::Long qw(:config bundling); -use Encode; - -my $use_suppl_font = 1; -my $use_unicode_bookmark = 1; - -use constant -{ - WIDTH => 0, - CHRCODE => 1, - PSNAME => 2, - ASSIGNED => 3, - USED => 4, - SUPPL => 5, -}; - -my $gotzlib=0; - -my $rc = eval -{ - require Compress::Zlib; - Compress::Zlib->import(); - 1; -}; - -if($rc) -{ - $gotzlib=1; -} -else -{ - Msg(0,"Perl module Compress::Zlib not available - cannot compress this pdf"); -} - -my %cfg; - -$cfg{GROFF_VERSION}='1.22.4'; -$cfg{GROFF_FONT_PATH}='/usr/share/groff/site-font:/usr/share/groff/1.22.4/font:/usr/lib/font'; -$cfg{RT_SEP}=':'; -binmode(STDOUT); - -my @obj; # Array of PDF objects -my $objct=0; # Count of Objects -my $fct=0; # Output count -my %fnt; # Used fonts -my $lct=0; # Input Line Count -my $src_name=''; -my %env; # Current environment -my %fontlst; # Fonts Loaded -my $rot=0; # Portrait -my %desc; # Contents of DESC -my %download; # Contents of downlopad file -my $pages; # Pointer to /Pages object -my $devnm='devpdf'; -my $cpage; # Pointer to current pages -my $cpageno=0; # Object no of current page -my $cat; # Pointer to catalogue -my $dests; # Pointer to Dests -my @mediabox=(0,0,595,842); -my @defaultmb=(0,0,595,842); -my $stream=''; # Current Text/Graphics stream -my $cftsz=10; # Current font sz -my $cft; # Current Font -my $cftsup=0; # Current Font (supplemental) -my $lwidth=1; # current linewidth -my $linecap=1; -my $linejoin=1; -my $textcol=''; # Current groff text -my $fillcol=''; # Current groff fill -my $curfill=''; # Current PDF fill -my $strkcol=''; -my $curstrk=''; -my @lin=(); # Array holding current line of text -my @ahead=(); # Buffer used to hol the next line -my $mode='g'; # Graphic (g) or Text (t) mode; -my $xpos=0; # Current X position -my $ypos=0; # Current Y position -my $tmxpos=0; -my $kernadjust=0; -my $curkern=0; -my $widtbl; # Pointer to width table for current font size -my $origwidtbl; # Pointer to width table -my $krntbl; # Pointer to kern table -my $matrix="1 0 0 1"; -my $whtsz; # Current width of a space -my $poschg=0; # V/H pending -my $fontchg=0; # font change pending -my $tnum=2; # flatness of B-Spline curve -my $tden=3; # flatness of B-Spline curve -my $linewidth=40; -my $w_flg=0; -my $nomove=0; -my $pendmv=0; -my $gotT=0; -my $suppress=0; # Suppress processing? -my %incfil; # Included Files -my @outlev=([0,undef,0,0]); # Structure pdfmark /OUT entries -my $curoutlev=\@outlev; -my $curoutlevno=0; # Growth point for @curoutlev -my $Foundry=''; -my $xrev=0; # Reverse x direction of font -my $matrixchg=0; -my $wt=-1; -my $thislev=1; -my $mark=undef; -my $suspendmark=undef; - - - -my $n_flg=1; -my $pginsert=-1; # Growth point for kids array -my %pgnames; # 'names' of pages for switchtopage -my @outlines=(); # State of Bookmark Outlines at end of each page -my $custompaper=0; # Has there been an X papersize -my $textenccmap=''; # CMap for groff text.enc encoding -my @XOstream=(); -my @PageAnnots={}; -my $noslide=0; -my $transition={PAGE => {Type => '/Trans', S => '', D => 1, Dm => '/H', M => '/I', Di => 0, SS => 1.0, B => 0}, - BLOCK => {Type => '/Trans', S => '', D => 1, Dm => '/H', M => '/I', Di => 0, SS => 1.0, B => 0}}; -my $firstpause=0; -my $present=0; - -$noslide=1 if exists($ENV{GROPDF_NOSLIDE}) and $ENV{GROPDF_NOSLIDE}; - -my %ppsz=( 'ledger'=>[1224,792], - 'legal'=>[612,1008], - 'letter'=>[612,792], - 'a0'=>[2384,3370], - 'a1'=>[1684,2384], - 'a2'=>[1191,1684], - 'a3'=>[842,1191], - 'a4'=>[595,842], - 'a5'=>[420,595], - 'a6'=>[297,420], - 'a7'=>[210,297], - 'a8'=>[148,210], - 'a9'=>[105,148], - 'a10'=>[73,105], - 'isob0'=>[2835,4008], - 'isob1'=>[2004,2835], - 'isob2'=>[1417,2004], - 'isob3'=>[1001,1417], - 'isob4'=>[709,1001], - 'isob5'=>[499,709], - 'isob6'=>[354,499], - 'c0'=>[2599,3677], - 'c1'=>[1837,2599], - 'c2'=>[1298,1837], - 'c3'=>[918,1298], - 'c4'=>[649,918], - 'c5'=>[459,649], - 'c6'=>[323,459] ); - -my $ucmap=<<'EOF'; -/CIDInit /ProcSet findresource begin -12 dict begin -begincmap -/CIDSystemInfo -<< /Registry (Adobe) -/Ordering (UCS) -/Supplement 0 ->> def -/CMapName /Adobe-Identity-UCS def -/CMapType 2 def -1 begincodespacerange -<0000> <FFFF> -endcodespacerange -2 beginbfrange -<008b> <008f> [<00660066> <00660069> <0066006c> <006600660069> <00660066006C>] -<00ad> <00ad> <002d> -endbfrange -endcmap -CMapName currentdict /CMap defineresource pop -end -end -EOF - -my $fd; -my $frot; -my $fpsz; -my $embedall=0; -my $debug=0; -my $version=0; -my $stats=0; -my $unicodemap; -my @idirs; - -#Load_Config(); - -GetOptions("F=s" => \$fd, 'I=s' => \@idirs, 'l' => \$frot, 'p=s' => \$fpsz, 'd!' => \$debug, 'v' => \$version, 'version' => \$version, 'e' => \$embedall, 'y=s' => \$Foundry, 's' => \$stats, 'u:s' => \$unicodemap); - -unshift(@idirs,'.'); - -if ($version) -{ - print "GNU gropdf (groff) version $cfg{GROFF_VERSION}\n"; - exit; -} - -if (defined($unicodemap)) -{ - if ($unicodemap eq '') - { - $ucmap=''; - } - elsif (-r $unicodemap) - { - local $/; - open(F,"<$unicodemap") or die "gropdf: Failed to open '$unicodemap'"; - ($ucmap)=(<F>); - close(F); - } - else - { - Msg(0,"Failed to find '$unicodemap' - ignoring"); - } -} - -# Search for 'font directory': paths in -f opt, shell var GROFF_FONT_PATH, default paths - -my $fontdir=$cfg{GROFF_FONT_PATH}; -$fontdir=$ENV{GROFF_FONT_PATH}.$cfg{RT_SEP}.$fontdir if exists($ENV{GROFF_FONT_PATH}); -$fontdir=$fd.$cfg{RT_SEP}.$fontdir if defined($fd); - -$rot=90 if $frot; -$matrix="0 1 -1 0" if $frot; - -LoadDownload(); -LoadDesc(); - -my $unitwidth=$desc{unitwidth}; -my $papersz=$desc{papersize}; -$papersz=lc($fpsz) if $fpsz; - -$env{FontHT}=0; -$env{FontSlant}=0; -MakeMatrix(); - -if (substr($papersz,0,1) eq '/' and -r $papersz) -{ - if (open(P,"<$papersz")) - { - while (<P>) - { - chomp; - s/# .*//; - next if $_ eq ''; - $papersz=$_; - last - } - - close(P); - } -} - -if ($papersz=~m/([\d.]+)([cipP]),([\d.]+)([cipP])/) -{ - @defaultmb=@mediabox=(0,0,ToPoints($3,$4),ToPoints($1,$2)); -} -elsif (exists($ppsz{$papersz})) -{ - @defaultmb=@mediabox=(0,0,$ppsz{$papersz}->[0],$ppsz{$papersz}->[1]); -} - -my (@dt)=localtime($ENV{SOURCE_DATE_EPOCH} || time); -my $dt=PDFDate(\@dt); - -my %info=('Creator' => "(groff version $cfg{GROFF_VERSION})", - 'Producer' => "(gropdf version $cfg{GROFF_VERSION})", - 'ModDate' => "($dt)", - 'CreationDate' => "($dt)"); - -while (<>) -{ - chomp; - s/\r$//; - $lct++; - - do # The ahead buffer behaves like 'ungetc' - {{ - if (scalar(@ahead)) - { - $_=shift(@ahead); - } - - - my $cmd=substr($_,0,1); - next if $cmd eq '#'; # just a comment - my $lin=substr($_,1); - - while ($cmd eq 'w') - { - $cmd=substr($lin,0,1); - $lin=substr($lin,1); - $w_flg=1 if $gotT; - } - - $lin=~s/^\s+//; -# $lin=~s/\s#.*?$//; # remove comment - $stream.="\% $_\n" if $debug; - - do_x($lin),next if ($cmd eq 'x'); - next if $suppress; - do_p($lin),next if ($cmd eq 'p'); - do_f($lin),next if ($cmd eq 'f'); - do_s($lin),next if ($cmd eq 's'); - do_m($lin),next if ($cmd eq 'm'); - do_D($lin),next if ($cmd eq 'D'); - do_V($lin),next if ($cmd eq 'V'); - do_v($lin),next if ($cmd eq 'v'); - do_t($lin),next if ($cmd eq 't'); - do_u($lin),next if ($cmd eq 'u'); - do_C($lin),next if ($cmd eq 'C'); - do_c($lin),next if ($cmd eq 'c'); - do_N($lin),next if ($cmd eq 'N'); - do_h($lin),next if ($cmd eq 'h'); - do_H($lin),next if ($cmd eq 'H'); - do_n($lin),next if ($cmd eq 'n'); - - my $tmp=scalar(@ahead); - }} until scalar(@ahead) == 0; - -} - -exit 0 if $lct==0; - -if ($cpageno > 0) -{ - my $trans='BLOCK'; - - $trans='PAGE' if $firstpause; - - if (scalar(@XOstream)) - { - MakeXO() if $stream; - $stream=join("\n",@XOstream)."\n"; - } - - my %t=%{$transition->{$trans}}; - $cpage->{MediaBox}=\@mediabox if $custompaper; - $cpage->{Trans}=FixTrans(\%t) if $t{S}; - - if ($#PageAnnots >= 0) - { - @{$cpage->{Annots}}=@PageAnnots; - } - - PutObj($cpageno); - OutStream($cpageno+1); -} - -$cat->{PageMode}='/FullScreen' if $present; - -PutOutlines(\@outlev); - -PutObj(1); - -my $info=BuildObj(++$objct,\%info); - -PutObj($objct); - -foreach my $fontno (keys %fontlst) -{ - my $o=$fontlst{$fontno}->{FNT}; - - foreach my $ch (@{$o->{NO}}) - { - my $psname=$o->{NAM}->{$ch->[1]}->[PSNAME] || '/.notdef'; - my $wid=$o->{NAM}->{$ch->[1]}->[WIDTH] || 0; - - push(@{$o->{DIFF}},$psname); - push(@{$o->{WIDTH}},$wid); - last if $#{$o->{DIFF}} >= 255; - } - unshift(@{$o->{DIFF}},0) if !$use_suppl_font; - my $p=GetObj($fontlst{$fontno}->{OBJ}); - - if (exists($p->{LastChar}) and $p->{LastChar} > 255) - { - $p->{LastChar} = 255; - splice(@{$o->{DIFF}},256); - splice(@{$o->{WIDTH}},256); - } - - if ($use_suppl_font) { - my $fnt = $o; - while ($fnt = $fnt->{NEXT}) { - my (@d, @w); - - foreach my $cn (0..255) { - my $ch = $fnt->{NO}->[$cn + $fnt->{SUPPL} * 256]; - if ($ch && $ch->[1] && $fnt->{NAM}->{$ch->[1]}->[USED]) { - push @d, $fnt->{NAM}->{$ch->[1]}->[PSNAME] || '/.notdef'; - push @w, $fnt->{NAM}->{$ch->[1]}->[WIDTH] || 0; - } else { - push @d, '/.notdef'; - push @w, 0; - } - } - - my $obj = BuildObj($objct + 1, { - %{$p}{qw/Type Subtype BaseFont FontDescriptor/}, - Widths => \@w, - FirstChar => 0, - LastChar => 255, - Encoding => BuildObj($objct + 2, { - Type => '/Encoding', - Differences => \@d, - }), - }); - $objct += 2; - - my $q = GetObj(2); - $q->{Resources}->{Font}->{$fnt->{NM}.'.'.$fnt->{SUPPL}} = $obj; - } - } -} - -foreach my $o (3..$objct) -{ - PutObj($o) if (!exists($obj[$o]->{XREF})); -} - -#my $encrypt=BuildObj(++$objct,{'Filter' => '/Standard', 'V' => 1, 'R' => 2, 'P' => 252}); -#PutObj($objct); -PutObj(2); - -my $xrefct=$fct; - -$objct+=1; -print "xref\n0 $objct\n0000000000 65535 f \n"; - -foreach my $xr (@obj) -{ - next if !defined($xr); - printf("%010d 00000 n \n",$xr->{XREF}); -} - -print "trailer\n<<\n/Info $info\n/Root 1 0 R\n/Size $objct\n>>\nstartxref\n$fct\n\%\%EOF\n"; -print "\% Pages=$pages->{Count}\n" if $stats; - - -sub MakeMatrix -{ - my $fontxrev=shift||0; - my @mat=($frot)?(0,1,-1,0):(1,0,0,1); - - if (!$frot) - { - if ($env{FontHT} != 0) - { - $mat[3]=sprintf('%.3f',$env{FontHT}/$cftsz); - } - - if ($env{FontSlant} != 0) - { - my $slant=$env{FontSlant}; - $slant*=$env{FontHT}/$cftsz if $env{FontHT} != 0; - my $ang=rad($slant); - - $mat[2]=sprintf('%.3f',sin($ang)/cos($ang)); - } - - if ($fontxrev) - { - $mat[0]=-$mat[0]; - } - } - - $matrix=join(' ',@mat); - $matrixchg=1; -} - -sub PutOutlines -{ - my $o=shift; - my $outlines; - - if ($#{$o} > 0) - { - # We've got Outlines to deal with - my $openct=$curoutlev->[0]->[2]; - - while ($thislev-- > 1) - { - my $nxtoutlev=$curoutlev->[0]->[1]; - $nxtoutlev->[0]->[2]+=$openct if $curoutlev->[0]->[3]==1; - $openct=0 if $nxtoutlev->[0]->[3]==-1; - $curoutlev=$nxtoutlev; - } - - $cat->{Outlines}=BuildObj(++$objct,{'Count' => abs($o->[0]->[0])+$o->[0]->[2]}); - $outlines=$obj[$objct]->{DATA}; - } - else - { - return; - } - - SetOutObj($o); - - $outlines->{First}=$o->[1]->[2]; - $outlines->{Last}=$o->[$#{$o}]->[2]; - - LinkOutObj($o,$cat->{Outlines}); -} - -sub SetOutObj -{ - my $o=shift; - - for my $j (1..$#{$o}) - { - my $ono=BuildObj(++$objct,$o->[$j]->[0]); - $o->[$j]->[2]=$ono; - - SetOutObj($o->[$j]->[1]) if $#{$o->[$j]->[1]} > -1; - } -} - -sub LinkOutObj -{ - my $o=shift; - my $parent=shift; - - for my $j (1..$#{$o}) - { - my $op=GetObj($o->[$j]->[2]); - - $op->{Next}=$o->[$j+1]->[2] if ($j < $#{$o}); - $op->{Prev}=$o->[$j-1]->[2] if ($j > 1); - $op->{Parent}=$parent; - - if ($#{$o->[$j]->[1]} > -1) - { - $op->{Count}=$o->[$j]->[1]->[0]->[2]*$o->[$j]->[1]->[0]->[3];# if exists($op->{Count}) and $op->{Count} > 0; - $op->{First}=$o->[$j]->[1]->[1]->[2]; - $op->{Last}=$o->[$j]->[1]->[$#{$o->[$j]->[1]}]->[2]; - LinkOutObj($o->[$j]->[1],$o->[$j]->[2]); - } - } -} - -sub GetObj -{ - my $ono=shift; - ($ono)=split(' ',$ono); - return($obj[$ono]->{DATA}); -} - - - -sub PDFDate -{ - my $dt=shift; - return(sprintf("D:%04d%02d%02d%02d%02d%02d%+03d'00'",$dt->[5]+1900,$dt->[4]+1,$dt->[3],$dt->[2],$dt->[1],$dt->[0],( localtime time() + 3600*( 12 - (gmtime)[2] ) )[2] - 12)); -} - -sub ToPoints -{ - my $num=shift; - my $unit=shift; - - if ($unit eq 'i') - { - return($num*72); - } - elsif ($unit eq 'c') - { - return int($num*72/2.54); - } - elsif ($unit eq 'm') # millimetres - { - return int($num*72/25.4); - } - elsif ($unit eq 'p') - { - return($num); - } - elsif ($unit eq 'P') - { - return($num*6); - } - elsif ($unit eq 'z') - { - return($num/$unitwidth); - } - else - { - Msg(1,"Unknown scaling factor '$unit'"); - } -} - -sub Load_Config -{ - open(CFG,"<gropdf_config") or die "Can't open config file: $!"; - - while (<CFG>) - { - chomp; - my ($key,$val)=split(/ ?= ?/); - - $cfg{$key}=$val; - } - - close(CFG); -} - -sub LoadDownload -{ - my $f; - my $found=0; - - my (@dirs)=split($cfg{RT_SEP},$fontdir); - - foreach my $dir (@dirs) - { - $f=undef; - OpenFile(\$f,$dir,"download"); - next if !defined($f); - $found++; - - while (<$f>) - { - chomp; - s/#.*$//; - next if $_ eq ''; - my ($foundry,$name,$file)=split(/\t+/); - if (substr($file,0,1) eq '*') - { - next if !$embedall; - $file=substr($file,1); - } - - $download{"$foundry $name"}=$file; - } - - close($f); - } - - Msg(1,"Failed to open 'download'") if !$found; -} - -sub OpenFile -{ - my $f=shift; - my $dirs=shift; - my $fnm=shift; - - if (substr($fnm,0,1) eq '/' or substr($fnm,1,1) eq ':') # dos - { - return if -r "$fnm" and open($$f,"<$fnm"); - } - - my (@dirs)=split($cfg{RT_SEP},$dirs); - - foreach my $dir (@dirs) - { - last if -r "$dir/$devnm/$fnm" and open($$f,"<$dir/$devnm/$fnm"); - } -} - -sub LoadDesc -{ - my $f; - - OpenFile(\$f,$fontdir,"DESC"); - Msg(1,"Failed to open 'DESC'") if !defined($f); - - while (<$f>) - { - chomp; - s/#.*$//; - next if $_ eq ''; - my ($name,$prms)=split(' ',$_,2); - $desc{lc($name)}=$prms; - } - - close($f); -} - -sub rad { $_[0]*3.14159/180 } - -my $InPicRotate=0; - -sub do_x -{ - my $l=shift; - my ($xcmd,@xprm)=split(' ',$l); - $xcmd=substr($xcmd,0,1); - - if ($xcmd eq 'T') - { - Msg(0,"Expecting a pdf pipe (got $xprm[0])") if $xprm[0] ne substr($devnm,3); - } - elsif ($xcmd eq 'f') # Register Font - { - $xprm[1]="${Foundry}-$xprm[1]" if $Foundry ne ''; - LoadFont($xprm[0],$xprm[1]); - } - elsif ($xcmd eq 'F') # Source File (for errors) - { - $env{SourceFile}=$xprm[0]; - } - elsif ($xcmd eq 'H') # FontHT - { - $xprm[0]/=$unitwidth; - $xprm[0]=0 if $xprm[0] == $cftsz; - $env{FontHT}=$xprm[0]; - MakeMatrix(); - } - elsif ($xcmd eq 'S') # FontSlant - { - $env{FontSlant}=$xprm[0]; - MakeMatrix(); - } - elsif ($xcmd eq 'i') # Initialise - { - if ($objct == 0) - { - $objct++; - @defaultmb=@mediabox; - BuildObj($objct,{'Pages' => BuildObj($objct+1, - {'Kids' => [], - 'Count' => 0, - 'Type' => '/Pages', - 'Rotate' => $rot, - 'MediaBox' => \@defaultmb, - 'Resources' => - {'Font' => {}, - 'ProcSet' => ['/PDF', '/Text', '/ImageB', '/ImageC', '/ImageI']} - } - ), - 'Type' => '/Catalog'}); - - $cat=$obj[$objct]->{DATA}; - $objct++; - $pages=$obj[2]->{DATA}; - Put("%PDF-1.4\n\x25\xe2\xe3\xcf\xd3\n"); - } - } - elsif ($xcmd eq 'X') - { - # There could be extended args - do - {{ - LoadAhead(1); - if (substr($ahead[0],0,1) eq '+') - { - $l.="\n".substr($ahead[0],1); - shift(@ahead); - } - }} until $#ahead==0; - - ($xcmd,@xprm)=split(' ',$l); - $xcmd=substr($xcmd,0,1); - - if ($xprm[0]=~m/^(.+:)(.+)/) - { - splice(@xprm,1,0,$2); - $xprm[0]=$1; - } - - my $par=join(' ',@xprm[1..$#xprm]); - - if ($xprm[0] eq 'ps:') - { - if ($xprm[1] eq 'invis') - { - $suppress=1; - } - elsif ($xprm[1] eq 'endinvis') - { - $suppress=0; - } - elsif ($par=~m/exec gsave currentpoint 2 copy translate (.+) rotate neg exch neg exch translate/) - { - # This is added by gpic to rotate a single object - - my $theta=-rad($1); - - IsGraphic(); - my ($curangle,$hyp)=RtoP($xpos,GraphY($ypos)); - my ($x,$y)=PtoR($theta+$curangle,$hyp); - $stream.="q\n".sprintf("%.3f %.3f %.3f %.3f %.3f %.3f cm",cos($theta),sin($theta),-sin($theta),cos($theta),$xpos-$x,GraphY($ypos)-$y)."\n"; - $InPicRotate=1; - } - elsif ($par=~m/exec grestore/ and $InPicRotate) - { - IsGraphic(); - $stream.="Q\n"; - $InPicRotate=0; - } - elsif ($par=~m/exec (\d) setlinejoin/) - { - IsGraphic(); - $linejoin=$1; - $stream.="$linejoin j\n"; - } - elsif ($par=~m/exec (\d) setlinecap/) - { - IsGraphic(); - $linecap=$1; - $stream.="$linecap J\n"; - } - elsif ($par=~m/exec %%%%PAUSE/i and !$noslide) - { - my $trans='BLOCK'; - - if ($firstpause) - { - $trans='PAGE'; - $firstpause=0; - } - MakeXO(); - NewPage($trans); - $present=1; - } - elsif ($par=~m/exec %%%%BEGINONCE/) - { - if ($noslide) - { - $suppress=1; - } - else - { - my $trans='BLOCK'; - - if ($firstpause) - { - $trans='PAGE'; - $firstpause=0; - } - MakeXO(); - NewPage($trans); - $present=1; - } - } - elsif ($par=~m/exec %%%%ENDONCE/) - { - if ($noslide) - { - $suppress=0; - } - else - { - MakeXO(); - NewPage('BLOCK'); - $cat->{PageMode}='/FullScreen'; - pop(@XOstream); - } - } - elsif ($par=~m/\[(.+) pdfmark/) - { - my $pdfmark=$1; - $pdfmark=~s((\d{4,6}) u)(sprintf("%.1f",$1/$desc{sizescale}))eg; - $pdfmark=~s(\\\[u00(..)\])(chr(hex($1)))eg; - - if ($pdfmark=~m/(.+) \/DOCINFO/) - { - my @xwds=split(' ',"<< $1 >>"); - my $docinfo=ParsePDFValue(\@xwds); - - foreach my $k (keys %{$docinfo}) - { - $info{$k}=$docinfo->{$k} if $k ne 'Producer'; - } - } - elsif ($pdfmark=~m/(.+) \/DOCVIEW/) - { - my @xwds=split(' ',"<< $1 >>"); - my $docview=ParsePDFValue(\@xwds); - - foreach my $k (keys %{$docview}) - { - $cat->{$k}=$docview->{$k} if !exists($cat->{$k}); - } - } - elsif ($pdfmark=~m/(.+) \/DEST/) - { - my @xwds=split(' ',"<< $1 >>"); - my $dest=ParsePDFValue(\@xwds); - foreach my $v (@{$dest->{View}}) - { - $v=GraphY(abs($v)) if substr($v,0,1) eq '-'; - } - unshift(@{$dest->{View}},"$cpageno 0 R"); - - if (!defined($dests)) - { - $cat->{Dests}=BuildObj(++$objct,{}); - $dests=$obj[$objct]->{DATA}; - } - - my $k=substr($dest->{Dest},1); - $dests->{$k}=$dest->{View}; - } - elsif ($pdfmark=~m/(.+) \/ANN/) - { - my $l=$1; - $l=~s/Color/C/; - $l=~s/Action/A/; - $l=~s/Title/T/; - $l=~s'/Subtype /URI'/S /URI'; - my @xwds=split(' ',"<< $l >>"); - my $annotno=BuildObj(++$objct,ParsePDFValue(\@xwds)); - my $annot=$obj[$objct]; - $annot->{DATA}->{Type}='/Annot'; - FixRect($annot->{DATA}->{Rect}); # Y origin to ll - FixPDFColour($annot->{DATA}); - push(@PageAnnots,$annotno); - } - elsif ($pdfmark=~m/(.+) \/OUT/) - { - my $t=$1; - $t=~s/\\\) /\\\\\) /g; - $t=~s/\\e/\\\\/g; - $t=~m/(^.*\/Title \()(.*)(\).*)/; - my ($pre,$title,$post)=($1,$2,$3); - if ($use_unicode_bookmark && - $title =~ s/\\\[u([0-9A-F_]+)\]/join( - '', map { pack "U", hex } split '_', $1 - )/eg) { - $title = join '', map sprintf("\\%o", $_), - unpack "C*", encode("utf16", $title); - } - $title=~s/(?<!\\)\(/\\\(/g; - $title=~s/(?<!\\)\)/\\\)/g; - my @xwds=split(' ',"<< $pre$title$post >>"); - my $out=ParsePDFValue(\@xwds); - - my $this=[$out,[]]; - - if (exists($out->{Level})) - { - my $lev=abs($out->{Level}); - my $levsgn=sgn($out->{Level}); - delete($out->{Level}); - - if ($lev > $thislev) - { - my $thisoutlev=$curoutlev->[$#{$curoutlev}]->[1]; - $thisoutlev->[0]=[0,$curoutlev,0,$levsgn]; - $curoutlev=$thisoutlev; - $curoutlevno=$#{$curoutlev}; - $thislev++; - } - elsif ($lev < $thislev) - { - my $openct=$curoutlev->[0]->[2]; - - while ($thislev > $lev) - { - my $nxtoutlev=$curoutlev->[0]->[1]; - $nxtoutlev->[0]->[2]+=$openct if $curoutlev->[0]->[3]==1; - $openct=0 if $nxtoutlev->[0]->[3]==-1; - $curoutlev=$nxtoutlev; - $thislev--; - } - - $curoutlevno=$#{$curoutlev}; - } - -# push(@{$curoutlev},$this); - splice(@{$curoutlev},++$curoutlevno,0,$this); - $curoutlev->[0]->[2]++; - } - else - { - # This code supports old pdfmark.tmac, unused by pdf.tmac - while ($curoutlev->[0]->[0] == 0 and defined($curoutlev->[0]->[1])) - { - $curoutlev=$curoutlev->[0]->[1]; - } - - $curoutlev->[0]->[0]--; - $curoutlev->[0]->[2]++; - push(@{$curoutlev},$this); - - - if (exists($out->{Count}) and $out->{Count} != 0) - { - push(@{$this->[1]},[abs($out->{Count}),$curoutlev,0,sgn($out->{Count})]); - $curoutlev=$this->[1]; - - if ($out->{Count} > 0) - { - my $p=$curoutlev; - - while (defined($p)) - { - $p->[0]->[2]+=$out->{Count}; - $p=$p->[0]->[1]; - } - } - } - } - } - } - } - elsif (lc($xprm[0]) eq 'pdf:') - { - if (lc($xprm[1]) eq 'import') - { - my $fil=$xprm[2]; - my $llx=$xprm[3]; - my $lly=$xprm[4]; - my $urx=$xprm[5]; - my $ury=$xprm[6]; - my $wid=$xprm[7]; - my $hgt=$xprm[8]||-1; - my $mat=[1,0,0,1,0,0]; - - if (!exists($incfil{$fil})) - { - if ($fil=~m/\.pdf$/) - { - $incfil{$fil}=LoadPDF($fil,$mat,$wid,$hgt,"import"); - } - elsif ($fil=~m/\.swf$/) - { - my $xscale=$wid/($urx-$llx+1); - my $yscale=($hgt<=0)?$xscale:($hgt/($ury-$lly+1)); - $hgt=($ury-$lly+1)*$yscale; - - if ($rot) - { - $mat->[3]=$xscale; - $mat->[0]=$yscale; - } - else - { - $mat->[0]=$xscale; - $mat->[3]=$yscale; - } - - $incfil{$fil}=LoadSWF($fil,[$llx,$lly,$urx,$ury],$mat); - } - else - { - Msg(0,"Unknown filetype '$fil'"); - return undef; - } - } - - if (defined($incfil{$fil})) - { - IsGraphic(); - if ($fil=~m/\.pdf$/) - { - my $bbox=$incfil{$fil}->[1]; - my $xscale=d3($wid/($bbox->[2]-$bbox->[0]+1)); - my $yscale=d3(($hgt<=0)?$xscale:($hgt/($bbox->[3]-$bbox->[1]+1))); - $wid=($bbox->[2]-$bbox->[0])*$xscale; - $hgt=($bbox->[3]-$bbox->[1])*$yscale; - $ypos+=$hgt; - $stream.="q $xscale 0 0 $yscale ".PutXY($xpos,$ypos)." cm"; - $stream.=" 0 1 -1 0 0 0 cm" if $rot; - $stream.=" /$incfil{$fil}->[0] Do Q\n"; - } - elsif ($fil=~m/\.swf$/) - { - $stream.=PutXY($xpos,$ypos)." m /$incfil{$fil} Do\n"; - } - } - } - elsif (lc($xprm[1]) eq 'pdfpic') - { - my $fil=$xprm[2]; - my $flag=uc($xprm[3]||'-L'); - my $wid=GetPoints($xprm[4])||-1; - my $hgt=GetPoints($xprm[5]||-1); - my $ll=GetPoints($xprm[6]||0); - my $mat=[1,0,0,1,0,0]; - - if (!exists($incfil{$fil})) - { - $incfil{$fil}=LoadPDF($fil,$mat,$wid,$hgt,"pdfpic"); - } - - if (defined($incfil{$fil})) - { - IsGraphic(); - my $bbox=$incfil{$fil}->[1]; - $wid=($bbox->[2]-$bbox->[0]) if $wid <= 0; - my $xscale=d3($wid/($bbox->[2]-$bbox->[0])); - my $yscale=d3(($hgt<=0)?$xscale:($hgt/($bbox->[3]-$bbox->[1]))); - $xscale=($wid<=0)?$yscale:$xscale; - $xscale=$yscale if $yscale < $xscale; - $yscale=$xscale if $xscale < $yscale; - $wid=($bbox->[2]-$bbox->[0])*$xscale; - $hgt=($bbox->[3]-$bbox->[1])*$yscale; - - if ($flag eq '-C' and $ll > $wid) - { - $xpos=int(($ll-$wid)/2); - } - elsif ($flag eq '-R' and $ll > $wid) - { - $xpos=$ll-$wid; - } - - $ypos+=$hgt; - $stream.="q $xscale 0 0 $yscale ".PutXY($xpos,$ypos)." cm"; - $stream.=" 0 1 -1 0 0 0 cm" if $rot; - $stream.=" /$incfil{$fil}->[0] Do Q\n"; - } - } - elsif (lc($xprm[1]) eq 'xrev') - { - $xrev=!$xrev; - } - elsif (lc($xprm[1]) eq 'markstart') - { - $mark={'rst' => ($xprm[2]+$xprm[4])/$unitwidth, 'rsb' => ($xprm[3]-$xprm[4])/$unitwidth, 'xpos' => $xpos-($xprm[4]/$unitwidth), - 'ypos' => $ypos, 'lead' => $xprm[4]/$unitwidth, 'pdfmark' => join(' ',@xprm[5..$#xprm])}; - } - elsif (lc($xprm[1]) eq 'markend') - { - PutHotSpot($xpos) if defined($mark); - $mark=undef; - } - elsif (lc($xprm[1]) eq 'marksuspend') - { - $suspendmark=$mark; - $mark=undef; - } - elsif (lc($xprm[1]) eq 'markrestart') - { - $mark=$suspendmark; - $suspendmark=undef; - } - elsif (lc($xprm[1]) eq 'pagename') - { - if ($pginsert > -1) - { - $pgnames{$xprm[2]}=$pages->{Kids}->[$pginsert]; - } - else - { - $pgnames{$xprm[2]}='top'; - } - } - elsif (lc($xprm[1]) eq 'switchtopage') - { - my $ba=$xprm[2]; - my $want=$xprm[3]; - - if ($pginsert > -1) - { - if (!defined($want) or $want eq '') - { - # no before/after - $want=$ba; - $ba='before'; - } - - if (!defined($ba) or $ba eq '' or $want eq 'bottom') - { - $pginsert=$#{$pages->{Kids}}; - } - elsif ($want eq 'top') - { - $pginsert=-1; - } - else - { - if (exists($pgnames{$want})) - { - my $ref=$pgnames{$want}; - - if ($ref eq 'top') - { - $pginsert=-1; - } - else - { - FIND: while (1) - { - foreach my $j (0..$#{$pages->{Kids}}) - { - if ($ref eq $pages->{Kids}->[$j]) - { - if ($ba eq 'before') - { - $pginsert=$j-1; - last FIND; - } - elsif ($ba eq 'after') - { - $pginsert=$j; - last FIND; - } - else - { - Msg(0,"Parameter must be top|bottom|before|after not '$ba'"); - last FIND; - } - } - - } - - Msg(0,"Can't find page ref '$ref'"); - last FIND - - } - } - } - else - { - Msg(0,"Can't find page named '$want'"); - } - } - - if ($pginsert < 0) - { - ($curoutlev,$curoutlevno,$thislev)=(\@outlev,0,1); - } - else - { - ($curoutlev,$curoutlevno,$thislev)=(@{$outlines[$pginsert]}); - } - } - } - elsif (lc($xprm[1]) eq 'transition' and !$noslide) - { - if (uc($xprm[2]) eq 'PAGE' or uc($xprm[2] eq 'SLIDE')) - { - $transition->{PAGE}->{S}='/'.ucfirst($xprm[3]) if $xprm[3] and $xprm[3] ne '.'; - $transition->{PAGE}->{D}=$xprm[4] if $xprm[4] and $xprm[4] ne '.'; - $transition->{PAGE}->{Dm}='/'.$xprm[5] if $xprm[5] and $xprm[5] ne '.'; - $transition->{PAGE}->{M}='/'.$xprm[6] if $xprm[6] and $xprm[6] ne '.'; - $xprm[7]='/None' if $xprm[7] and uc($xprm[7]) eq 'NONE'; - $transition->{PAGE}->{Di}=$xprm[7] if $xprm[7] and $xprm[7] ne '.'; - $transition->{PAGE}->{SS}=$xprm[8] if $xprm[8] and $xprm[8] ne '.'; - $transition->{PAGE}->{B}=$xprm[9] if $xprm[9] and $xprm[9] ne '.'; - } - elsif (uc($xprm[2]) eq 'BLOCK') - { - $transition->{BLOCK}->{S}='/'.ucfirst($xprm[3]) if $xprm[3] and $xprm[3] ne '.'; - $transition->{BLOCK}->{D}=$xprm[4] if $xprm[4] and $xprm[4] ne '.'; - $transition->{BLOCK}->{Dm}='/'.$xprm[5] if $xprm[5] and $xprm[5] ne '.'; - $transition->{BLOCK}->{M}='/'.$xprm[6] if $xprm[6] and $xprm[6] ne '.'; - $xprm[7]='/None' if $xprm[7] and uc($xprm[7]) eq 'NONE'; - $transition->{BLOCK}->{Di}=$xprm[7] if $xprm[7] and $xprm[7] ne '.'; - $transition->{BLOCK}->{SS}=$xprm[8] if $xprm[8] and $xprm[8] ne '.'; - $transition->{BLOCK}->{B}=$xprm[9] if $xprm[9] and $xprm[9] ne '.'; - } - - $present=1; - } - } - elsif (lc(substr($xprm[0],0,9)) eq 'papersize') - { - my ($px,$py)=split(',',substr($xprm[0],10)); - $px=GetPoints($px); - $py=GetPoints($py); - @mediabox=(0,0,$px,$py); - my @mb=@mediabox; - $matrixchg=1; - $custompaper=1; - $cpage->{MediaBox}=\@mb; - } - } -} - -sub FixPDFColour -{ - my $o=shift; - my $a=$o->{C}; - my @r=(); - my $c=$a->[0]; - - if ($#{$a}==3) - { - if ($c > 1) - { - foreach my $j (0..2) - { - push(@r,sprintf("%1.3f",$a->[$j]/0xffff)); - } - - $o->{C}=\@r; - } - } - elsif (substr($c,0,1) eq '#') - { - if (length($c) == 7) - { - foreach my $j (0..2) - { - push(@r,sprintf("%1.3f",hex(substr($c,$j*2+1,2))/0xff)); - } - - $o->{C}=\@r; - } - elsif (length($c) == 14) - { - foreach my $j (0..2) - { - push(@r,sprintf("%1.3f",hex(substr($c,$j*4+2,4))/0xffff)); - } - - $o->{C}=\@r; - } - } -} - -sub PutHotSpot -{ - my $endx=shift; - my $l=$mark->{pdfmark}; - $l=~s/Color/C/; - $l=~s/Action/A/; - $l=~s'/Subtype /URI'/S /URI'; - $l=~s(\\\[u00(..)\])(chr(hex($1)))eg; - my @xwds=split(' ',"<< $l >>"); - my $annotno=BuildObj(++$objct,ParsePDFValue(\@xwds)); - my $annot=$obj[$objct]; - $annot->{DATA}->{Type}='/Annot'; - $annot->{DATA}->{Rect}=[$mark->{xpos},$mark->{ypos}-$mark->{rsb},$endx+$mark->{lead},$mark->{ypos}-$mark->{rst}]; - FixPDFColour($annot->{DATA}); - FixRect($annot->{DATA}->{Rect}); # Y origin to ll - push(@PageAnnots,$annotno); -} - -sub sgn -{ - return(1) if $_[0] > 0; - return(-1) if $_[0] < 0; - return(0); -} - -sub FixRect -{ - my $rect=shift; - - return if !defined($rect); - $rect->[1]=GraphY($rect->[1]); - $rect->[3]=GraphY($rect->[3]); -} - -sub GetPoints -{ - my $val=shift; - - $val=ToPoints($1,$2) if ($val and $val=~m/(-?[\d.]+)([cipnz])/); - - return $val; -} - -# Although the PDF reference mentions XObject/Form as a way of incorporating an external PDF page into -# the current PDF, it seems not to work with any current PDF reader (although I am told (by Leonard Rosenthol, -# who helped author the PDF ISO standard) that Acroread 9 does support it, empiorical observation shows otherwise!!). -# So... do it the hard way - full PDF parser and merge required objects!!! - -# sub BuildRef -# { -# my $fil=shift; -# my $bbox=shift; -# my $mat=shift; -# my $wid=($bbox->[2]-$bbox->[0])*$mat->[0]; -# my $hgt=($bbox->[3]-$bbox->[1])*$mat->[3]; -# -# if (!open(PDF,"<$fil")) -# { -# Msg(0,"Failed to open '$fil'"); -# return(undef); -# } -# -# my (@f)=(<PDF>); -# -# close(PDF); -# -# $objct++; -# my $xonm="XO$objct"; -# -# $pages->{'Resources'}->{'XObject'}->{$xonm}=BuildObj($objct,{'Type' => '/XObject', -# 'Subtype' => '/Form', -# 'BBox' => $bbox, -# 'Matrix' => $mat, -# 'Resources' => $pages->{'Resources'}, -# 'Ref' => {'Page' => '1', -# 'F' => BuildObj($objct+1,{'Type' => '/Filespec', -# 'F' => "($fil)", -# 'EF' => {'F' => BuildObj($objct+2,{'Type' => '/EmbeddedFile'})} -# }) -# } -# }); -# -# $obj[$objct]->{STREAM}="q 1 0 0 1 0 0 cm -# q BT -# 1 0 0 1 0 0 Tm -# .5 g .5 G -# /F5 20 Tf -# (Proxy) Tj -# ET Q -# 0 0 m 72 0 l s -# Q\n"; -# -# # $obj[$objct]->{STREAM}=PutXY($xpos,$ypos)." m ".PutXY($xpos+$wid,$ypos)." l ".PutXY($xpos+$wid,$ypos+$hgt)." l ".PutXY($xpos,$ypos+$hgt)." l f\n"; -# $obj[$objct+2]->{STREAM}=join('',@f); -# PutObj($objct); -# PutObj($objct+1); -# PutObj($objct+2); -# $objct+=2; -# return($xonm); -# } - -sub LoadSWF -{ - my $fil=shift; - my $bbox=shift; - my $mat=shift; - my $wid=($bbox->[2]-$bbox->[0])*$mat->[0]; - my $hgt=($bbox->[3]-$bbox->[1])*$mat->[3]; - my (@path)=split('/',$fil); - my $node=pop(@path); - - if (!open(PDF,"<$fil")) - { - Msg(0,"Failed to open '$fil'"); - return(undef); - } - - my (@f)=(<PDF>); - - close(PDF); - - $objct++; - my $xonm="XO$objct"; - - $pages->{'Resources'}->{'XObject'}->{$xonm}=BuildObj($objct,{'Type' => '/XObject', 'BBox' => $bbox, 'Matrix' => $mat, 'FormType' => 1, 'Subtype' => '/Form', 'Length' => 0, 'Type' => "/XObject"}); - $obj[$objct]->{STREAM}=''; - PutObj($objct); - $objct++; - my $asset=BuildObj($objct,{'EF' => {'F' => BuildObj($objct+1,{})}, - 'F' => "($node)", - 'Type' => '/Filespec', - 'UF' => "($node)"}); - - PutObj($objct); - $objct++; - $obj[$objct]->{STREAM}=join('',@f); - PutObj($objct); - $objct++; - my $config=BuildObj($objct,{'Instances' => [BuildObj($objct+1,{'Params' => { 'Binding' => '/Background'}, 'Asset' => $asset})], - 'Subtype' => '/Flash'}); - - PutObj($objct); - $objct++; - PutObj($objct); - $objct++; - - my ($x,$y)=split(' ',PutXY($xpos,$ypos)); - - push(@{$cpage->{Annots}},BuildObj($objct,{'RichMediaContent' => {'Subtype' => '/Flash', 'Configurations' => [$config], 'Assets' => {'Names' => [ "($node)", $asset ] }}, - 'P' => "$cpageno 0 R", - 'RichMediaSettings' => { 'Deactivation' => { 'Condition' => '/PI', - 'Type' => '/RichMediaDeactivation'}, - 'Activation' => { 'Condition' => '/PV', - 'Type' => '/RichMediaActivation'}}, - 'F' => 68, - 'Subtype' => '/RichMedia', - 'Type' => '/Annot', - 'Rect' => "[ $x $y ".($x+$wid)." ".($y+$hgt)." ]", - 'Border' => [0,0,0]})); - - PutObj($objct); - - return $xonm; -} - -sub OpenInc -{ - my $fn=shift; - my $fnm=$fn; - my $F; - - if (substr($fnm,0,1) eq '/' or substr($fnm,1,1) eq ':') # dos - { - if (-r $fnm and open($F,"<$fnm")) - { - return($F,$fnm); - } - } - else - { - foreach my $dir (@idirs) - { - $fnm="$dir/$fn"; - - if (-r "$fnm" and open($F,"<$fnm")) - { - return($F,$fnm); - } - } - } - - return(undef,$fn); -} - -sub LoadPDF -{ - my $pdfnm=shift; - my $mat=shift; - my $wid=shift; - my $hgt=shift; - my $type=shift; - my $pdf; - my $pdftxt=''; - my $strmlen=0; - my $curobj=-1; - my $instream=0; - my $cont; - my $adj=0; - my $keepsep=$/; - - my ($PD,$PDnm)=OpenInc($pdfnm); - - if (!defined($PD)) - { - Msg(0,"Failed to open PDF '$pdfnm'"); - return undef; - } - - my $hdr=<$PD>; - - $/="\r",$adj=1 if (length($hdr) > 10); - - while (<$PD>) - { - chomp; - - s/\n//; - - if (m/endstream(\s+.*)?$/) - { - $instream=0; - $_="endstream"; - $_.=$1 if defined($1) - } - - next if $instream; - - if (m'/Length\s+(\d+)(\s+\d+\s+R)?') - { - if (!defined($2)) - { - $strmlen=$1; - } - else - { - $strmlen=0; - } - } - - if (m'^(\d+) \d+ obj') - { - $curobj=$1; - $pdf->[$curobj]->{OBJ}=undef; - } - - if (m'stream\s*$' and ! m/^endstream/) - { - if ($curobj > -1) - { - $pdf->[$curobj]->{STREAMPOS}=[tell($PD)+$adj,$strmlen]; - seek($PD,$strmlen,1); - $instream=1; - } - else - { - Msg(0,"Parsing PDF '$pdfnm' failed"); - return undef; - } - } - - $pdftxt.=$_.' '; - } - - close($PD); - - open(PD,"<$PDnm"); -# $pdftxt=~s/\]/ \]/g; - my (@pdfwds)=split(' ',$pdftxt); - my $wd; - - while ($wd=nextwd(\@pdfwds),length($wd)) - { - if ($wd=~m/\d+/ and defined($pdfwds[1]) and $pdfwds[1]=~m/^obj(.*)/) - { - $curobj=$wd; - shift(@pdfwds); shift(@pdfwds); - unshift(@pdfwds,$1) if defined($1) and length($1); - $pdf->[$curobj]->{OBJ}=ParsePDFObj(\@pdfwds); - } - elsif ($wd eq 'trailer' and !exists($pdf->[0]->{OBJ})) - { - $pdf->[0]->{OBJ}=ParsePDFObj(\@pdfwds); - } - else - { -# print "Skip '$wd'\n"; - } - } - - my $catalog=${$pdf->[0]->{OBJ}->{Root}}; - my $page=FindPage(1,$pdf); - my $xobj=++$objct; - - # Load the streamas - - foreach my $o (@{$pdf}) - { - if (exists($o->{STREAMPOS})) - { - my $l; - - $l=$o->{OBJ}->{Length} if exists($o->{OBJ}->{Length}); - - $l=$pdf->[$$l]->{OBJ} if (defined($l) && ref($l) eq 'OBJREF'); - - Msg(1,"Unable to determine length of stream \@$o->{STREAMPOS}->[0]") if !defined($l); - - sysseek(PD,$o->{STREAMPOS}->[0],0); - Msg(0,'Failed to read all the stream') if $l != sysread(PD,$o->{STREAM},$l); - - if ($gotzlib and exists($o->{OBJ}->{'Filter'}) and $o->{OBJ}->{'Filter'} eq '/FlateDecode') - { - $o->{STREAM}=Compress::Zlib::uncompress($o->{STREAM}); - delete($o->{OBJ }->{'Filter'}); - } - } - } - - close(PD); - - # Find BBox - my $BBox; - my $insmap={}; - - foreach my $k (qw( MediaBox ArtBox TrimBox BleedBox CropBox )) - { - $BBox=FindKey($pdf,$page,$k); - last if $BBox; - } - - $BBox=[0,0,595,842] if !defined($BBox); - - $wid=($BBox->[2]-$BBox->[0]+1) if $wid==0; - my $xscale=d3(abs($wid)/($BBox->[2]-$BBox->[0]+1)); - my $yscale=d3(($hgt<=0)?$xscale:(abs($hgt)/($BBox->[3]-$BBox->[1]+1))); - $hgt=($BBox->[3]-$BBox->[1]+1)*$yscale; - - if ($type eq "import") - { - $mat->[0]=$xscale; - $mat->[3]=$yscale; - } - - # Find Resource - - my $res=FindKey($pdf,$page,'Resources'); - my $xonm="XO$xobj"; - - # Map inserted objects to current PDF - - MapInsValue($pdf,$page,'',$insmap,$xobj,$pdf->[$page]->{OBJ}); -# -# Many PDFs include 'Resources' at the 'Page' level but if 'Resources' is held at a higher level (i.e 'Pages') -# then we need to include its objects as well. -# - MapInsValue($pdf,$page,'',$insmap,$xobj,$res) if !exists($pdf->[$page]->{OBJ}->{Resources}); - - # Copy Resources - - my %incres=%{$res}; - - $incres{ProcSet}=['/PDF', '/Text', '/ImageB', '/ImageC', '/ImageI']; - - ($mat->[4],$mat->[5])=split(' ',PutXY($xpos,$ypos)); - $pages->{'Resources'}->{'XObject'}->{$xonm}=BuildObj($xobj,{'Type' => '/XObject', 'BBox' => $BBox, 'Name' => "/$xonm", 'FormType' => 1, 'Subtype' => '/Form', 'Length' => 0, 'Type' => "/XObject", 'Resources' => \%incres}); - - BuildStream($xobj,$pdf,$pdf->[$page]->{OBJ}->{Contents}); - - $/=$keepsep; - return([$xonm,$BBox] ); -} - -sub BuildStream -{ - my $xobj=shift; - my $pdf=shift; - my $val=shift; - my $strm=''; - my $objs; - my $refval=ref($val); - - if ($refval eq 'OBJREF') - { - push(@{$objs}, $val); - } - elsif ($refval eq 'ARRAY') - { - $objs=$val; - } - else - { - Msg(0,"unexpected 'Contents'"); - } - - foreach my $o (@{$objs}) - { - $strm.="\n" if $strm; - $strm.=$pdf->[$$o]->{STREAM} if exists($pdf->[$$o]->{STREAM}); - } - - $obj[$xobj]->{STREAM}=$strm; -} - - -sub MapInsHash -{ - my $pdf=shift; - my $o=shift; - my $insmap=shift; - my $parent=shift; - my $val=shift; - - - foreach my $k (keys(%{$val})) - { - MapInsValue($pdf,$o,$k,$insmap,$parent,$val->{$k}) if $k ne 'Contents'; - } -} - -sub MapInsValue -{ - my $pdf=shift; - my $o=shift; - my $k=shift; - my $insmap=shift; - my $parent=shift; - my $val=shift; - my $refval=ref($val); - - if ($refval eq 'OBJREF') - { - if ($k ne 'Parent') - { - if (!exists($insmap->{IMP}->{$$val})) - { - $objct++; - $insmap->{CUR}->{$objct}=$$val; - $insmap->{IMP}->{$$val}=$objct; - $obj[$objct]->{DATA}=$pdf->[$$val]->{OBJ}; - $obj[$objct]->{STREAM}=$pdf->[$$val]->{STREAM} if exists($pdf->[$$val]->{STREAM}); - MapInsValue($pdf,$$val,'',$insmap,$o,$pdf->[$$val]->{OBJ}); - } - - $$val=$insmap->{IMP}->{$$val}; - } - else - { - $$val=$parent; - } - } - elsif ($refval eq 'ARRAY') - { - foreach my $v (@{$val}) - { - MapInsValue($pdf,$o,'',$insmap,$parent,$v) - } - } - elsif ($refval eq 'HASH') - { - MapInsHash($pdf,$o,$insmap,$parent,$val); - } - -} - -sub FindKey -{ - my $pdf=shift; - my $page=shift; - my $k=shift; - - if (exists($pdf->[$page]->{OBJ}->{$k})) - { - my $val=$pdf->[$page]->{OBJ}->{$k}; - $val=$pdf->[$$val]->{OBJ} if ref($val) eq 'OBJREF'; - return($val); - } - else - { - if (exists($pdf->[$page]->{OBJ}->{Parent})) - { - return(FindKey($pdf,${$pdf->[$page]->{OBJ}->{Parent}},$k)); - } - } - - return(undef); -} - -sub FindPage -{ - my $wantpg=shift; - my $pdf=shift; - my $catalog=${$pdf->[0]->{OBJ}->{Root}}; - my $pages=${$pdf->[$catalog]->{OBJ}->{Pages}}; - - return(NextPage($pdf,$pages,\$wantpg)); -} - -sub NextPage -{ - my $pdf=shift; - my $pages=shift; - my $wantpg=shift; - my $ret; - - if ($pdf->[$pages]->{OBJ}->{Type} eq '/Pages') - { - foreach my $kid (@{$pdf->[$pages]->{OBJ}->{Kids}}) - { - $ret=NextPage($pdf,$$kid,$wantpg); - last if $$wantpg<=0; - } - } - elsif ($pdf->[$pages]->{OBJ}->{Type} eq '/Page') - { - $$wantpg--; - $ret=$pages; - } - - return($ret); -} - -sub nextwd -{ - my $pdfwds=shift; - - my $wd=shift(@{$pdfwds}); - - return('') if !defined($wd); - - if ($wd=~m/^(.*?)(<<|>>|(?:(?<!\\)\[|\]))(.*)/) - { - if (defined($1) and length($1)) - { - unshift(@{$pdfwds},$3) if defined($3) and length($3); - unshift(@{$pdfwds},$2); - $wd=$1; - } - else - { - unshift(@{$pdfwds},$3) if defined($3) and length($3); - $wd=$2; - } - } - - return($wd); -} - -sub ParsePDFObj -{ - - my $pdfwds=shift; - my $rtn; - my $wd; - - while ($wd=nextwd($pdfwds),length($wd)) - { - if ($wd eq 'stream' or $wd eq 'endstream') - { - next; - } - elsif ($wd eq 'endobj' or $wd eq 'startxref') - { - last; - } - else - { - unshift(@{$pdfwds},$wd); - $rtn=ParsePDFValue($pdfwds); - } - } - - return($rtn); -} - -sub ParsePDFHash -{ - my $pdfwds=shift; - my $rtn={}; - my $wd; - - while ($wd=nextwd($pdfwds),length($wd)) - { - if ($wd eq '>>') - { - last; - } - - my (@w)=split('/',$wd,3); - - if ($w[0]) - { - Msg(0,"PDF Dict Key '$wd' does not start with '/'"); - exit 1; - } - else - { - unshift(@{$pdfwds},"/$w[2]") if $w[2]; - $wd=$w[1]; - (@w)=split('\(',$wd,2); - $wd=$w[0]; - unshift(@{$pdfwds},"($w[1]") if defined($w[1]); - (@w)=split('\<',$wd,2); - $wd=$w[0]; - unshift(@{$pdfwds},"<$w[1]") if defined($w[1]); - - $rtn->{$wd}=ParsePDFValue($pdfwds); - } - } - - return($rtn); -} - -sub ParsePDFValue -{ - my $pdfwds=shift; - my $rtn; - my $wd=nextwd($pdfwds); - - if ($wd=~m/^\d+$/ and $pdfwds->[0]=~m/^\d+$/ and $pdfwds->[1]=~m/^R(\]|\>|\/)?/) - { - shift(@{$pdfwds}); - if (defined($1) and length($1)) - { - $pdfwds->[0]=substr($pdfwds->[0],1); - } - else - { - shift(@{$pdfwds}); - } - return(bless(\$wd,'OBJREF')); - } - - if ($wd eq '<<') - { - return(ParsePDFHash($pdfwds)); - } - - if ($wd eq '[') - { - return(ParsePDFArray($pdfwds)); - } - - if ($wd=~m/(.*?)(\(.*)$/) - { - if (defined($1) and length($1)) - { - unshift(@{$pdfwds},$2); - $wd=$1; - } - else - { - return(ParsePDFString($wd,$pdfwds)); - } - } - - if ($wd=~m/(.*?)(\<.*)$/) - { - if (defined($1) and length($1)) - { - unshift(@{$pdfwds},$2); - $wd=$1; - } - else - { - return(ParsePDFHexString($wd,$pdfwds)); - } - } - - if ($wd=~m/(.+?)(\/.*)$/) - { - if (defined($2) and length($2)) - { - unshift(@{$pdfwds},$2); - $wd=$1; - } - } - - return($wd); -} - -sub ParsePDFString -{ - my $wd=shift; - my $rtn=''; - my $pdfwds=shift; - my $lev=0; - - while (length($wd)) - { - $rtn.=' ' if length($rtn); - - while ($wd=~m/(?<!\\)\(/g) {$lev++;} - while ($wd=~m/(?<!\\)\)/g) {$lev--;} - - - if ($lev<=0 and $wd=~m/^(.*?\))([^)]+)$/) - { - unshift(@{$pdfwds},$2) if defined($2) and length($2); - $wd=$1; - } - - $rtn.=$wd; - - last if $lev <= 0; - - $wd=nextwd($pdfwds); - } - - return($rtn); -} - -sub ParsePDFHexString -{ - my $wd=shift; - my $rtn=''; - my $pdfwds=shift; - my $lev=0; - - if ($wd=~m/^(<.+?>)(.*)/) - { - unshift(@{$pdfwds},$2) if defined($2) and length($2); - $rtn=$1; - } - - return($rtn); -} - -sub ParsePDFArray -{ - my $pdfwds=shift; - my $rtn=[]; - my $wd; - - while (1) - { - $wd=ParsePDFValue($pdfwds); - last if $wd eq ']' or length($wd)==0; - push(@{$rtn},$wd); - } - - return($rtn); -} - -sub Msg -{ - my ($lev,$msg)=@_; - - print STDERR "$env{SourceFile}: " if exists($env{SourceFile}); - print STDERR "$msg\n"; - exit 1 if $lev; -} - -sub PutXY -{ - my ($x,$y)=(@_); - - if ($frot) - { - return(d3($y)." ".d3($x)); - } - else - { - $y=$mediabox[3]-$y; - return(d3($x)." ".d3($y)); - } -} - -sub GraphY -{ - my $y=shift; - - if ($frot) - { - return($y); - } - else - { - return($mediabox[3]-$y); - } -} - -sub Put -{ - my $msg=shift; - - print $msg; - $fct+=length($msg); -} - -sub PutObj -{ - my $ono=shift; - my $msg="$ono 0 obj "; - $obj[$ono]->{XREF}=$fct; - if (exists($obj[$ono]->{STREAM})) - { - if ($gotzlib && !$debug && !exists($obj[$ono]->{DATA}->{'Filter'})) - { - $obj[$ono]->{STREAM}=Compress::Zlib::compress($obj[$ono]->{STREAM}); - $obj[$ono]->{DATA}->{'Filter'}='/FlateDecode'; - } - - $obj[$ono]->{DATA}->{'Length'}=length($obj[$ono]->{STREAM}); - } - PutField(\$msg,$obj[$ono]->{DATA}); - PutStream(\$msg,$ono) if exists($obj[$ono]->{STREAM}); - Put($msg."endobj\n"); -} - -sub PutStream -{ - my $msg=shift; - my $ono=shift; - - # We could 'flate' here - $$msg.="stream\n$obj[$ono]->{STREAM}endstream\n"; -} - -sub PutField -{ - my $pmsg=shift; - my $fld=shift; - my $term=shift||"\n"; - my $typ=ref($fld); - - if ($typ eq '') - { - $$pmsg.="$fld$term"; - } - elsif ($typ eq 'ARRAY') - { - $$pmsg.='['; - foreach my $cell (@{$fld}) - { - PutField($pmsg,$cell,' '); - } - $$pmsg.="]$term"; - } - elsif ($typ eq 'HASH') - { - $$pmsg.='<< '; - foreach my $key (sort keys %{$fld}) - { - $$pmsg.="/$key "; - PutField($pmsg,$fld->{$key}); - } - $$pmsg.=">>$term"; - } - elsif ($typ eq 'OBJREF') - { - $$pmsg.="$$fld 0 R$term"; - } -} - -sub BuildObj -{ - my $ono=shift; - my $val=shift; - - $obj[$ono]->{DATA}=$val; - - return("$ono 0 R "); -} - -sub LoadFont -{ - my $fontno=shift; - my $fontnm=shift; - my $ofontnm=$fontnm; - - return $fontlst{$fontno}->{OBJ} if (exists($fontlst{$fontno})); - - my $f; - OpenFile(\$f,$fontdir,"$fontnm"); - - if (!defined($f) and $Foundry) - { - # Try with no foundry - $fontnm=~s/.*?-//; - OpenFile(\$f,$fontdir,$fontnm); - } - - Msg(1,"Failed to open font '$ofontnm'") if !defined($f); - - my $foundry=''; - $foundry=$1 if $fontnm=~m/^(.*?)-/; - my $stg=1; - my %fnt; - my @fntbbox=(0,0,0,0); - my $capheight=0; - my $lastchr=0; - my $lastnm; - my $t1flags=0; - my $fixwid=-1; - my $ascent=0; - my $charset=''; - - $fnt{NM} = 'F'.$fontno; - $fnt{SUPPL} = 0; - my @remap = (128..138, 145..255); # ignore ligatures. see text.enc. - $fnt{REMAP} = \@remap; - my @used; - $used[$_] = 1 for 0..255; - $used[$_] = 0 for @remap; - - while (<$f>) - { - chomp; - - s/^ +//; - s/^#.*// if $stg == 1; - next if $_ eq ''; - - if ($stg == 1) - { - my ($key,$val)=split(' ',$_,2); - - $key=lc($key); - $stg=2,next if $key eq 'kernpairs'; - $stg=3,next if lc($_) eq 'charset'; - - $fnt{$key}=$val - } - elsif ($stg == 2) - { - $stg=3,next if lc($_) eq 'charset'; - - my ($ch1,$ch2,$k)=split; -# $fnt{KERN}->{$ch1}->{$ch2}=$k; - } - else - { - my (@r)=split; - my (@p)=split(',',$r[1]); - - if ($r[1] eq '"') - { - $fnt{NAM}->{$r[0]}=$fnt{NAM}->{$lastnm}; - next; - } - - $r[0]='u0020' if $r[3] == 32; - $r[0]="u00".hex($r[3]) if $r[0] eq '---'; -# next if $r[3] >255; - if ($fnt{NAM}->{$r[0]}) { - #Msg(0, "$r[0], $r[3], /$r[4] - dup in $ofontnm") if $debug; - next; - } - $fnt{NAM}->{$r[0]}=[$p[0],$r[3],'/'.$r[4],$r[3],0]; - $fnt{NAM}->{$r[0]}->[SUPPL] = 0; - $fnt{NAM}->{$r[0]}->[USED] = $used[$r[3]]; - $fnt{NO}->[$r[3]]=[$r[0],$r[0]]; - $lastnm=$r[0]; - $lastchr=$r[3] if $r[3] > $lastchr; - $fixwid=$p[0] if $fixwid == -1; - $fixwid=-2 if $fixwid > 0 and $p[0] != $fixwid; - - $fntbbox[1]=-$p[2] if defined($p[2]) and -$p[2] < $fntbbox[1]; - $fntbbox[2]=$p[0] if $p[0] > $fntbbox[2]; - $fntbbox[3]=$p[1] if defined($p[1]) and $p[1] > $fntbbox[3]; - $ascent=$p[1] if defined($p[1]) and $p[1] > $ascent and $r[3] >= 32 and $r[3] < 128; - $charset.='/'.$r[4] if defined($r[4]); - $capheight=$p[1] if length($r[4]) == 1 and $r[4] ge 'A' and $r[4] le 'Z' and $p[1] > $capheight; - } - } - - close($f); - - foreach my $j (0..$lastchr) - { - $fnt{NO}->[$j]=['',''] if !defined($fnt{NO}->[$j]); - } - - my $fno=0; - my $slant=0; - $fnt{DIFF}=[]; - $fnt{WIDTH}=[]; - $fnt{NAM}->{''}=[0,-1,'/.notdef',-1,0]; - $fnt{NAM}->{''}->[SUPPL] = 0; - $slant=-$fnt{'slant'} if exists($fnt{'slant'}); - $fnt{'spacewidth'}=700 if !exists($fnt{'spacewidth'}); - - $t1flags|=2**0 if $fixwid > -1; - $t1flags|=(exists($fnt{'special'}))?2**2:2**5; - $t1flags|=2**6 if $slant != 0; - my $fontkey="$foundry $fnt{internalname}"; - - if (exists($download{$fontkey})) - { - # Not a Base Font - my ($l1,$l2,$l3,$t1stream)=GetType1($download{$fontkey}); - Msg(0,"Incorrect font format for '$fontkey' ($l1)") if !defined($t1stream); - $fno=++$objct; - $fontlst{$fontno}->{OBJ}=BuildObj($objct, - {'Type' => '/Font', - 'Subtype' => '/Type1', - 'BaseFont' => '/'.$fnt{internalname}, - 'Widths' => $fnt{WIDTH}, - 'FirstChar' => 0, - 'LastChar' => $lastchr, - 'Encoding' => BuildObj($objct+1, - {'Type' => '/Encoding', - 'Differences' => $fnt{DIFF} - } - ), - 'FontDescriptor' => BuildObj($objct+2, - {'Type' => '/FontDescriptor', - 'FontName' => '/'.$fnt{internalname}, - 'Flags' => $t1flags, - 'FontBBox' => \@fntbbox, - 'ItalicAngle' => $slant, - 'Ascent' => $ascent, - 'Descent' => $fntbbox[1], - 'CapHeight' => $capheight, - 'StemV' => 0, -# 'CharSet' => "($charset)", - 'FontFile' => BuildObj($objct+3, - {'Length1' => $l1, - 'Length2' => $l2, - 'Length3' => $l3 - } - ) - } - ) - } - ); - - $objct+=3; - $fontlst{$fontno}->{NM}='/'.$fnt{NM}; - $pages->{'Resources'}->{'Font'}->{$fnt{NM}}=$fontlst{$fontno}->{OBJ}; - $fontlst{$fontno}->{FNT}=\%fnt; - $obj[$objct]->{STREAM}=$t1stream; - - } - else - { - $fno=++$objct; - $fontlst{$fontno}->{OBJ}=BuildObj($objct, - {'Type' => '/Font', - 'Subtype' => '/Type1', - 'BaseFont' => '/'.$fnt{internalname}, - 'Widths' => $fnt{WIDTH}, - 'FirstChar' => 0, - 'LastChar' => $lastchr, - 'Encoding' => BuildObj($objct+1, - {'Type' => '/Encoding', - 'Differences' => $fnt{DIFF} - } - ), - 'FontDescriptor' => BuildObj($objct+2, - {'Type' => '/FontDescriptor', - 'FontName' => '/'.$fnt{internalname}, - 'Flags' => $t1flags, - 'FontBBox' => \@fntbbox, - 'ItalicAngle' => $slant, - 'Ascent' => $ascent, - 'Descent' => $fntbbox[1], - 'CapHeight' => $capheight, - 'StemV' => 0, - 'CharSet' => "($charset)", - } - ) - } - ); - - $objct+=2; - $fontlst{$fontno}->{NM}='/'.$fnt{NM}; - $pages->{'Resources'}->{'Font'}->{$fnt{NM}}=$fontlst{$fontno}->{OBJ}; - $fontlst{$fontno}->{FNT}=\%fnt; - } - - if (defined($fnt{encoding}) and $fnt{encoding} eq 'text.enc' and $ucmap ne '') - { - if ($textenccmap eq '') - { - $textenccmap = BuildObj($objct+1,{}); - $objct++; - $obj[$objct]->{STREAM}=$ucmap; - } - $obj[$fno]->{DATA}->{'ToUnicode'}=$textenccmap; - } - -# PutObj($fno); -# PutObj($fno+1); -# PutObj($fno+2) if defined($obj[$fno+2]); -# PutObj($fno+3) if defined($obj[$fno+3]); -} - -sub GetType1 -{ - my $file=shift; - my ($l1,$l2,$l3); # Return lengths - my ($head,$body,$tail); # Font contents - my $f; - - OpenFile(\$f,$fontdir,"$file"); - Msg(1,"Failed to open '$file'") if !defined($f); - - $head=GetChunk($f,1,"currentfile eexec"); - $body=$tail=''; - $body=GetChunk($f,2,"00000000") if !eof($f); - $tail=GetChunk($f,3,"cleartomark") if !eof($f); - - $l1=length($head); - $l2=length($body); - $l3=length($tail); - - return($l1,$l2,$l3,"$head$body$tail"); -} - -sub GetChunk -{ - my $F=shift; - my $segno=shift; - my $ascterm=shift; - my ($type,$hdr,$chunk,@msg); - binmode($F); - my $enc="ascii"; - - while (1) - { - # There may be multiple chunks of the same type - - my $ct=read($F,$hdr,2); - - if ($ct==2) - { - if (substr($hdr,0,1) eq "\x80") - { - # binary chunk - - my $chunktype=ord(substr($hdr,1,1)); - $enc="binary"; - - if (defined($type) and $type != $chunktype) - { - seek($F,-2,1); - last; - } - - $type=$chunktype; - return if $chunktype == 3; - - $ct=read($F,$hdr,4); - - Msg(1,"Failed to read binary segment length"), return if $ct != 4; - - my $sl=unpack('V',$hdr); - my $data; - my $chk=read($F,$data,$sl); - - Msg(1 ,"Failed to read binary segment"), return if $chk != $sl; - - $chunk.=$data; - } - else - { - # ascii chunk - - my $hex=0; - seek($F,-2,1); - my $ct=0; - - while (1) - { - my $lin=<$F>; - - last if !$lin; - - $hex=1,$enc.=" hex" if $segno == 2 and !$ct and $lin=~m/^[A-F0-9a-f]{4,4}/; - - if ($segno !=2 and $lin=~m/^(.*$ascterm\n?)(.*)/) - { - $chunk.=$1; - seek($F,-length($2)-1,1) if $2; - last; - } - elsif ($segno == 2 and $lin=~m/^(.*?)($ascterm.*)/) - { - $chunk.=$1; - seek($F,-length($2)-1,1) if $2; - last; - } - - chomp($lin), $lin=pack('H*',$lin) if $hex; - $chunk.=$lin; $ct++; - } - - last; - } - } - else - { - push(@msg,"Failed to read 2 header bytes"); - } - } - - return $chunk; -} - -sub OutStream -{ - my $ono=shift; - - IsGraphic(); - $stream.="Q\n"; - $obj[$ono]->{STREAM}=$stream; - $obj[$ono]->{DATA}->{Length}=length($stream); - $stream=''; - PutObj($ono); -} - -sub do_p -{ - my $trans='BLOCK'; - - $trans='PAGE' if $firstpause; - NewPage($trans); - @XOstream=(); - @PageAnnots=(); - $firstpause=1; -} - -sub FixTrans -{ - my $t=shift; - my $style=$t->{S}; - - if ($style) - { - delete($t->{Dm}) if $style ne '/Split' and $style ne '/Blinds'; - delete($t->{M}) if !($style eq '/Split' or $style eq '/Box' or $style eq '/Fly'); - delete($t->{Di}) if !($style eq '/Wipe' or $style eq '/Glitter' or $style eq '/Fly' or $style eq '/Cover' or $style eq '/Uncover' or $style eq '/Push') or ($style eq '/Fly' and $t->{Di} eq '/None' and $t->{SS} != 1); - delete($t->{SS}) if !($style eq '/Fly'); - delete($t->{B}) if !($style eq '/Fly'); - } - - return($t); -} - -sub NewPage -{ - my $trans=shift; - # Start of pages - - if ($cpageno > 0) - { - if ($#XOstream>=0) - { - MakeXO() if $stream; - $stream=join("\n",@XOstream,''); - } - - my %t=%{$transition->{$trans}}; - $cpage->{MediaBox}=\@mediabox if $custompaper; - $cpage->{Trans}=FixTrans(\%t) if $t{S}; - - if ($#PageAnnots >= 0) - { - @{$cpage->{Annots}}=@PageAnnots; - } - - PutObj($cpageno); - OutStream($cpageno+1); - } - - $cpageno=++$objct; - - my $thispg=BuildObj($objct, - {'Type' => '/Page', - 'Group' => {'CS' => '/DeviceRGB', 'S' => '/Transparency'}, - 'Parent' => '2 0 R', - 'Contents' => [ BuildObj($objct+1, - {'Length' => 0} - ) ], - } - ); - - splice(@{$pages->{Kids}},++$pginsert,0,$thispg); - splice(@outlines,$pginsert,0,[$curoutlev,$#{$curoutlev}+1,$thislev]); - - $objct+=1; - $cpage=$obj[$cpageno]->{DATA}; - $pages->{'Count'}++; - $stream="q 1 0 0 1 0 0 cm\n$linejoin J\n$linecap j\n0.4 w\n"; - $stream.=$strkcol."\n", $curstrk=$strkcol if $strkcol ne ''; - $mode='g'; - $curfill=''; -# @mediabox=@defaultmb; -} - -sub MakeXO -{ - $stream.="%mode=$mode\n"; - IsGraphic(); - $stream.="Q\n"; - my $xobj=++$objct; - my $xonm="XO$xobj"; - $pages->{'Resources'}->{'XObject'}->{$xonm}=BuildObj($xobj,{'Type' => '/XObject', 'BBox' => \@mediabox, 'Name' => "/$xonm", 'FormType' => 1, 'Subtype' => '/Form', 'Length' => 0, 'Type' => "/XObject"}); - $obj[$xobj]->{STREAM}=$stream; - $stream=''; - push(@XOstream,"q") if $#XOstream==-1; - push(@XOstream,"/$xonm Do"); -} - -sub do_f -{ - my $par=shift; - my $fnt=$fontlst{$par}->{FNT}; - -# IsText(); - $cft="$par"; - $cftsup=0; - $fontchg=1; -# $stream.="/F$cft $cftsz Tf\n" if $cftsz; - $widtbl=CacheWid($par); - $origwidtbl=[]; - - foreach my $w (@{$fnt->{NO}}) - { - push(@{$origwidtbl},$fnt->{NAM}->{$w->[1]}->[WIDTH]); - } - -# $krntbl=$fnt->{KERN}; -} - -sub CacheWid -{ - my $par=shift; - - if (!defined($fontlst{$par}->{CACHE}->{$cftsz})) - { - $fontlst{$par}->{CACHE}->{$cftsz}=BuildCache($fontlst{$par}->{FNT}); - } - - return($fontlst{$par}->{CACHE}->{$cftsz}); -} - -sub BuildCache -{ - my $fnt=shift; - my @cwid; - $origwidtbl=[]; - - foreach my $w (@{$fnt->{NO}}) - { - my $wid=(defined($w) and defined($w->[1]))?$fnt->{NAM}->{$w->[1]}->[WIDTH]:0; - push(@cwid,$wid*$cftsz); - push(@{$origwidtbl},$wid); - } - - return(\@cwid); -} - -sub IsText -{ - if ($mode eq 'g') - { - $xpos+=$pendmv/$unitwidth; - $stream.="q BT\n$matrix ".PutXY($xpos,$ypos)." Tm\n"; - $poschg=0; - $fontchg=0; - $pendmv=0; - $matrixchg=0; - $tmxpos=$xpos; - $stream.=$textcol."\n", $curfill=$textcol if $textcol ne $curfill; - if (defined($cft)) - { - $whtsz=$fontlst{$cft}->{FNT}->{spacewidth}*$cftsz; - $stream.="/F$cft"; - $stream.=".$cftsup" if $cftsup; - $stream.=" $cftsz Tf\n"; - } - $stream.="$curkern Tc\n"; - } - - if ($poschg or $matrixchg) - { - PutLine(0) if $matrixchg; - $stream.="$matrix ".PutXY($xpos,$ypos)." Tm\n", $poschg=0; - $tmxpos=$xpos; - $matrixchg=0; - $stream.="$curkern Tc\n"; - } - - if ($fontchg) - { - PutLine(0); - if (defined($cft)) - { - $whtsz=$fontlst{$cft}->{FNT}->{spacewidth}*$cftsz; - $stream.="/F$cft"; - $stream.=".$cftsup" if $cftsup; - $stream.=" $cftsz Tf\n"; - $fontchg=0; - } - } - - $mode='t'; -} - -sub IsGraphic -{ - if ($mode eq 't') - { - PutLine(); - $stream.="ET Q\n"; - $xpos+=($pendmv-$nomove)/$unitwidth; - $pendmv=0; - $nomove=0; - $stream.=$strkcol."\n", $curstrk=$strkcol if $strkcol ne $curstrk; - $curfill=$fillcol; - } - $mode='g'; -} - -sub do_s -{ - my $par=shift; - $par/=$unitwidth; - - if ($par != $cftsz and defined($cft)) - { - PutLine(); - $cftsz=$par; - Set_LWidth() if $lwidth < 1; -# $stream.="/F$cft $cftsz Tf\n"; - $fontchg=1; - $widtbl=CacheWid($cft); - } - else - { - $cftsz=$par; - Set_LWidth() if $lwidth < 1; - } -} - -sub Set_LWidth -{ - IsGraphic(); - $stream.=((($desc{res}/(72*$desc{sizescale}))*$linewidth*$cftsz)/1000)." w\n"; - return; -} - -sub do_m -{ - # Groff uses /m[] for text & graphic stroke, and /M[] (DF?) for graphic fill. - # PDF uses G/RG/K for graphic stroke, and g/rg/k for text & graphic fill. - # - # This means that we must maintain g/rg/k state separately for text colour & graphic fill (this is - # probably why 'gs' maintains separate graphic states for text & graphics when distilling PS -> PDF). - # - # To facilitate this:- - # - # $textcol = current groff stroke colour - # $fillcol = current groff fill colour - # $curfill = current PDF fill colour - - my $par=shift; - my $mcmd=substr($par,0,1); - - $par=substr($par,1); - $par=~s/^ +//; - -# IsGraphic(); - - $textcol=set_col($mcmd,$par,0); - $strkcol=set_col($mcmd,$par,1); - - if ($mode eq 't') - { - PutLine(); - $stream.=$textcol."\n"; - $curfill=$textcol; - } - else - { - $stream.="$strkcol\n"; - $curstrk=$strkcol; - } -} - -sub set_col -{ - my $mcmd=shift; - my $par=shift; - my $upper=shift; - my @oper=('g','k','rg'); - - @oper=('G','K','RG') if $upper; - - if ($mcmd eq 'd') - { - # default colour - return("0 $oper[0]"); - } - - my (@c)=split(' ',$par); - - if ($mcmd eq 'c') - { - # Text CMY - return(d3($c[0]/65535).' '.d3($c[1]/65535).' '.d3($c[2]/65535)." 0 $oper[1]"); - } - elsif ($mcmd eq 'k') - { - # Text CMYK - return(d3($c[0]/65535).' '.d3($c[1]/65535).' '.d3($c[2]/65535).' '.d3($c[3]/65535)." $oper[1]"); - } - elsif ($mcmd eq 'g') - { - # Text Grey - return(d3($c[0]/65535)." $oper[0]"); - } - elsif ($mcmd eq 'r') - { - # Text RGB0 - return(d3($c[0]/65535).' '.d3($c[1]/65535).' '.d3($c[2]/65535)." $oper[2]"); - } -} - -sub do_D -{ - my $par=shift; - my $Dcmd=substr($par,0,1); - - $par=substr($par,1); - $xpos+=$pendmv/$unitwidth; - $pendmv=0; - - IsGraphic(); - - if ($Dcmd eq 'F') - { - my $mcmd=substr($par,0,1); - - $par=substr($par,1); - $par=~s/^ +//; - - $fillcol=set_col($mcmd,$par,0); - $stream.="$fillcol\n"; - $curfill=$fillcol; - } - elsif ($Dcmd eq 'f') - { - my $mcmd=substr($par,0,1); - - $par=substr($par,1); - $par=~s/^ +//; - ($par)=split(' ',$par); - - if ($par >= 0 and $par <= 1000) - { - $fillcol=set_col('g',int((1000-$par)*65535/1000),0); - } - else - { - $fillcol=lc($textcol); - } - - $stream.="$fillcol\n"; - $curfill=$fillcol; - } - elsif ($Dcmd eq '~') - { - # B-Spline - my (@p)=split(' ',$par); - my ($nxpos,$nypos); - - foreach my $p (@p) { $p/=$unitwidth; } - $stream.=PutXY($xpos,$ypos)." m\n"; - $xpos+=($p[0]/2); - $ypos+=($p[1]/2); - $stream.=PutXY($xpos,$ypos)." l\n"; - - for (my $i=0; $i < $#p-1; $i+=2) - { - $nxpos=(($p[$i]*$tnum)/(2*$tden)); - $nypos=(($p[$i+1]*$tnum)/(2*$tden)); - $stream.=PutXY(($xpos+$nxpos),($ypos+$nypos))." "; - $nxpos=($p[$i]/2 + ($p[$i+2]*($tden-$tnum))/(2*$tden)); - $nypos=($p[$i+1]/2 + ($p[$i+3]*($tden-$tnum))/(2*$tden)); - $stream.=PutXY(($xpos+$nxpos),($ypos+$nypos))." "; - $nxpos=(($p[$i]-$p[$i]/2) + $p[$i+2]/2); - $nypos=(($p[$i+1]-$p[$i+1]/2) + $p[$i+3]/2); - $stream.=PutXY(($xpos+$nxpos),($ypos+$nypos))." c\n"; - $xpos+=$nxpos; - $ypos+=$nypos; - } - - $xpos+=($p[$#p-1]-$p[$#p-1]/2); - $ypos+=($p[$#p]-$p[$#p]/2); - $stream.=PutXY($xpos,$ypos)." l\nS\n"; - $poschg=1; - } - elsif ($Dcmd eq 'p' or $Dcmd eq 'P') - { - # Polygon - my (@p)=split(' ',$par); - my ($nxpos,$nypos); - - foreach my $p (@p) { $p/=$unitwidth; } - $stream.=PutXY($xpos,$ypos)." m\n"; - - for (my $i=0; $i < $#p; $i+=2) - { - $xpos+=($p[$i]); - $ypos+=($p[$i+1]); - $stream.=PutXY($xpos,$ypos)." l\n"; - } - - if ($Dcmd eq 'p') - { - $stream.="s\n"; - } - else - { - $stream.="f\n"; - } - $poschg=1; - } - elsif ($Dcmd eq 'c') - { - # Stroke circle - $par=substr($par,1); - my (@p)=split(' ',$par); - - DrawCircle($p[0],$p[0]); - $stream.="s\n"; - $poschg=1; - } - elsif ($Dcmd eq 'C') - { - # Fill circle - $par=substr($par,1); - my (@p)=split(' ',$par); - - DrawCircle($p[0],$p[0]); - $stream.="f\n"; - $poschg=1; - } - elsif ($Dcmd eq 'e') - { - # Stroke ellipse - $par=substr($par,1); - my (@p)=split(' ',$par); - - DrawCircle($p[0],$p[1]); - $stream.="s\n"; - $poschg=1; - } - elsif ($Dcmd eq 'E') - { - # Fill ellipse - $par=substr($par,1); - my (@p)=split(' ',$par); - - DrawCircle($p[0],$p[1]); - $stream.="f\n"; - $poschg=1; - } - elsif ($Dcmd eq 'l') - { - # Line To - $par=substr($par,1); - my (@p)=split(' ',$par); - - foreach my $p (@p) { $p/=$unitwidth; } - $stream.=PutXY($xpos,$ypos)." m\n"; - $xpos+=$p[0]; - $ypos+=$p[1]; - $stream.=PutXY($xpos,$ypos)." l\n"; - - $stream.="S\n"; - $poschg=1; - } - elsif ($Dcmd eq 't') - { - # Line Thickness - $par=substr($par,1); - my (@p)=split(' ',$par); - - foreach my $p (@p) { $p/=$unitwidth; } - # $xpos+=$p[0]*100; # WTF!!! - #int lw = ((font::res/(72*font::sizescale))*linewidth*env->size)/1000; - $p[0]=(($desc{res}/(72*$desc{sizescale}))*$linewidth*$cftsz)/1000 if $p[0] < 0; - $lwidth=$p[0]; - $stream.="$p[0] w\n"; - $poschg=1; - $xpos+=$lwidth; - } - elsif ($Dcmd eq 'a') - { - # Arc - $par=substr($par,1); - my (@p)=split(' ',$par); - my $rad180=3.14159; - my $rad360=$rad180*2; - my $rad90=$rad180/2; - - foreach my $p (@p) { $p/=$unitwidth; } - - # Documentation is wrong. Groff does not use Dh1,Dv1 as centre of the circle! - - my $centre=adjust_arc_centre(\@p); - - # Using formula here : http://www.tinaja.com/glib/bezcirc2.pdf - # First calculate angle between start and end point - - my ($startang,$r)=RtoP(-$centre->[0],$centre->[1]); - my ($endang,$r2)=RtoP(($p[0]+$p[2])-$centre->[0],-($p[1]+$p[3]-$centre->[1])); - $endang+=$rad360 if $endang < $startang; - my $totang=($endang-$startang)/4; # do it in 4 pieces - - # Now 1 piece - - my $x0=cos($totang/2); - my $y0=sin($totang/2); - my $x3=$x0; - my $y3=-$y0; - my $x1=(4-$x0)/3; - my $y1=((1-$x0)*(3-$x0))/(3*$y0); - my $x2=$x1; - my $y2=-$y1; - - # Rotate to start position and draw 4 pieces - - foreach my $j (0..3) - { - PlotArcSegment($totang/2+$startang+$j*$totang,$r,$xpos+$centre->[0],GraphY($ypos+$centre->[1]),$x0,$y0,$x1,$y1,$x2,$y2,$x3,$y3); - } - - $xpos+=$p[0]+$p[2]; - $ypos+=$p[1]+$p[3]; - - $poschg=1; - } -} - -sub deg -{ - return int($_[0]*180/3.14159); -} - -sub adjust_arc_centre -{ - # Taken from geometry.cpp - - # We move the center along a line parallel to the line between - # the specified start point and end point so that the center - # is equidistant between the start and end point. - # It can be proved (using Lagrange multipliers) that this will - # give the point nearest to the specified center that is equidistant - # between the start and end point. - - my $p=shift; - my @c; - my $x = $p->[0] + $p->[2]; # (x, y) is the end point - my $y = $p->[1] + $p->[3]; - my $n = $x*$x + $y*$y; - if ($n != 0) - { - $c[0]= $p->[0]; - $c[1] = $p->[1]; - my $k = .5 - ($c[0]*$x + $c[1]*$y)/$n; - $c[0] += $k*$x; - $c[1] += $k*$y; - return(\@c); - } - else - { - return(undef); - } -} - - -sub PlotArcSegment -{ - my ($ang,$r,$transx,$transy,$x0,$y0,$x1,$y1,$x2,$y2,$x3,$y3)=@_; - my $cos=cos($ang); - my $sin=sin($ang); - my @mat=($cos,$sin,-$sin,$cos,0,0); - my $lw=$lwidth/$r; - - $stream.="q $r 0 0 $r $transx $transy cm ".join(' ',@mat)." cm $lw w $x0 $y0 m $x1 $y1 $x2 $y2 $x3 $y3 c S Q\n"; -} - -sub DrawCircle -{ - my $hd=shift; - my $vd=shift; - my $hr=$hd/2/$unitwidth; - my $vr=$vd/2/$unitwidth; - my $kappa=0.5522847498; - $hd/=$unitwidth; - $vd/=$unitwidth; - - - $stream.=PutXY(($xpos+$hd),$ypos)." m\n"; - $stream.=PutXY(($xpos+$hd),($ypos+$vr*$kappa))." ".PutXY(($xpos+$hr+$hr*$kappa),($ypos+$vr))." ".PutXY(($xpos+$hr),($ypos+$vr))." c\n"; - $stream.=PutXY(($xpos+$hr-$hr*$kappa),($ypos+$vr))." ".PutXY(($xpos),($ypos+$vr*$kappa))." ".PutXY(($xpos),($ypos))." c\n"; - $stream.=PutXY(($xpos),($ypos-$vr*$kappa))." ".PutXY(($xpos+$hr-$hr*$kappa),($ypos-$vr))." ".PutXY(($xpos+$hr),($ypos-$vr))." c\n"; - $stream.=PutXY(($xpos+$hr+$hr*$kappa),($ypos-$vr))." ".PutXY(($xpos+$hd),($ypos-$vr*$kappa))." ".PutXY(($xpos+$hd),($ypos))." c\n"; - $xpos+=$hd; - - $poschg=1; -} - -sub FindCircle -{ - my ($x1,$y1,$x2,$y2,$x3,$y3)=@_; - my ($Xo, $Yo); - - my $x=$x2+$x3; - my $y=$y2+$y3; - my $n=$x**2+$y**2; - - if ($n) - { - my $k=.5-($x2*$x + $y2*$y)/$n; - return(sqrt($n),$x2+$k*$x,$y2+$k*$y); - } - else - { - return(-1); - } - -} - -sub PtoR -{ - my ($theta,$r)=@_; - - return($r*cos($theta),$r*sin($theta)); -} - -sub RtoP -{ - my ($x,$y)=@_; - - return(atan2($y,$x),sqrt($x**2+$y**2)); -} - -sub PutLine -{ - - my $f=shift; - - IsText() if !defined($f); - - return if (scalar(@lin) == 0) or (!defined($lin[0]->[0]) and $#lin == 0); - -# $stream.="% --- wht=$whtsz, pend=$pendmv, nomv=$nomove\n" if $debug; - $pendmv-=$nomove; - $lin[$#lin]->[1]=-$pendmv/$cftsz if ($pendmv != 0); - - foreach my $wd (@lin) - { - next if !defined($wd->[0]); - $wd->[0]=~s/\\/\\\\/g; - $wd->[0]=~s/\(/\\(/g; - $wd->[0]=~s/\)/\\)/g; - $wd->[0]=~s/!\|!\|/\\/g; - $wd->[1]=d3($wd->[1]); - } - - if (0) - { - if (scalar(@lin) == 1 and (!defined($lin[0]->[1]) or $lin[0]->[1] == 0)) - { - $stream.="($lin[0]->[0]) Tj\n"; - } - else - { - $stream.="["; - - foreach my $wd (@lin) - { - $stream.="($wd->[0]) " if defined($wd->[0]); - $stream.="$wd->[1] " if defined($wd->[1]) and $wd->[1] != 0; - } - - $stream.="] TJ\n"; - } - } - else - { - if (scalar(@lin) == 1 and (!defined($lin[0]->[1]) or $lin[0]->[1] == 0)) - { - $stream.="0 Tw ($lin[0]->[0]) Tj\n"; - } - else - { - if ($wt>=-1 or $#lin == 0 or $lin[0]->[1]>=0) - { - $stream.="0 Tw ["; - - foreach my $wd (@lin) - { - $stream.="($wd->[0]) " if defined($wd->[0]); - $stream.="$wd->[1] " if defined($wd->[1]) and $wd->[1] != 0; - } - - $stream.="] TJ\n"; - } - else - { - # $stream.="\%dg 0 Tw ["; - # - # foreach my $wd (@lin) - # { - # $stream.="($wd->[0]) " if defined($wd->[0]); - # $stream.="$wd->[1] " if defined($wd->[1]) and $wd->[1] != 0; - # } - # - # $stream.="] TJ\n"; - # - # my $wt=$lin[0]->[1]||0; - - # while ($wt < -$whtsz/$cftsz) - # { - # $wt+=$whtsz/$cftsz; - # } - - $stream.=sprintf( "%.3f Tw ",-($whtsz+$wt*$cftsz)/$unitwidth-$curkern ); - if (!defined($lin[0]->[0]) and defined($lin[0]->[1])) - { - $stream.="[ $lin[0]->[1] ("; - shift @lin; - } - else - { - $stream.="[("; - } - - foreach my $wd (@lin) - { - my $wwt=$wd->[1]||0; - - while ($wwt <= $wt+.1) - { - $wwt-=$wt; - $wd->[0].=' '; - } - - if (abs($wwt) < .1 or $wwt == 0) - { - $stream.="$wd->[0]" if defined($wd->[0]); - } - else - { - $wwt=sprintf("%.3f",$wwt); - $stream.="$wd->[0]) $wwt (" if defined($wd->[0]); - } - } - $stream.=")] TJ\n"; - } - } - } - - @lin=(); - $xpos+=$pendmv/$unitwidth; - $pendmv=0; - $nomove=0; - $wt=-1; -} - -sub d3 -{ - return(sprintf("%.3f",shift || 0)); -} - -sub LoadAhead -{ - my $no=shift; - - foreach my $j (1..$no) - { - my $lin=<>; - chomp($lin); - $lin=~s/\r$//; - $lct++; - - push(@ahead,$lin); - $stream.="%% $lin\n" if $debug; - } -} - -sub do_V -{ - my $par=shift; - - if ($mode eq 't') - { - PutLine(); - } - else - { - $xpos+=$pendmv/$unitwidth; - $pendmv=0; - } - - $ypos=$par/$unitwidth; - - LoadAhead(1); - - if (substr($ahead[0],0,1) eq 'H') - { - $xpos=substr($ahead[0],1)/$unitwidth; - - $nomove=$pendmv=0; - @ahead=(); - - } - - $poschg=1; -} - -sub do_v -{ - my $par=shift; - - PutLine() if $mode eq 't'; - - $ypos+=$par/$unitwidth; - - $poschg=1; -} - -sub TextWid -{ - my $txt=shift; - my $sup=shift; - my $fnt=shift; - my $w=0; - my $ck=0; - - foreach my $c (split('',$txt)) - { - my $cn=ord($c); - $cn+=$sup*256; - $widtbl->[$cn]=$origwidtbl->[$cn]*$cftsz if !defined($widtbl->[$cn]); - $w+=$widtbl->[$cn]; - } - - $ck=length($txt)*$curkern; - - return(($w/$unitwidth)+$ck); -} - -sub do_t -{ - my $par=shift; - my $fnt=$fontlst{$cft}->{FNT}; - my $sup = shift || 0; - $fontchg=1 if $cftsup != $sup; - $cftsup = $sup; - - if ($kernadjust != $curkern) - { - PutLine(); - $stream.="$kernadjust Tc\n"; - $curkern=$kernadjust; - } - - my $par2=$par; - $par2=~s/^!\|!\|(\d\d\d)/chr(oct($1))/e; - - foreach my $j (0..length($par2)-1) - { - my $cn=ord(substr($par2,$j,1)); - $cn+=$sup*256; - my $chnm=$fnt->{NO}->[$cn]->[1]; - - if (!$fnt->{NAM}->{$chnm}->[USED]) - { - my ($cn2, $sup2) = RemapChr($cn, $fnt, $chnm); - $stream.="% MMM Remap $cn,$sup to $cn2,$sup2\n" if $debug; - Msg(0, "got: $fnt->{NM}.$sup2; expected: $fnt->{NM}.$sup\n") if $sup != $sup2; - - #if ($cn2) - { - substr($par2,$j,1)=chr($cn2); - - if ($par=~m/^!\|!\|(\d\d\d)/) - { - substr($par,4,3)=sprintf("%03o",$cn2); - } - else - { - substr($par,$j,1)=chr($cn2); - } - } - } - } - my $wid=TextWid($par2,$sup,$fnt); - - $par=reverse(split('',$par)) if $xrev and $par!~m/^!\|!\|(\d\d\d)/; - - if ($n_flg and defined($mark)) - { - $mark->{ypos}=$ypos; - $mark->{xpos}=$xpos; - } - - $n_flg=0; - IsText(); - - $xpos+=$wid; - $xpos+=($pendmv-$nomove)/$unitwidth; - - $stream.="% == '$par'=$wid 'xpos=$xpos\n" if $debug; - - # $pendmv = 'h' move since last 't' - # $nomove = width of char(s) added by 'C', 'N' or 'c' - # $w-flg = 'w' seen since last t - - if ($fontchg) - { - PutLine(); - if (defined($cft)) - { - $whtsz=$fontlst{$cft}->{FNT}->{spacewidth} * $cftsz; - $stream.="/F$cft"; - $stream.=".$cftsup" if $cftsup; - $stream.=" $cftsz Tf\n"; - $fontchg=0; - } - } - - $gotT=1; - - $stream.="% --- wht=$whtsz, pend=$pendmv, nomv=$nomove\n" if $debug; - -# if ($w_flg && $#lin > -1) -# { -# $lin[$#lin]->[0].=' '; -# $pendmv-=$whtsz; -# $dontglue=1 if $pendmv==0; -# } - - $wt=-$pendmv/$cftsz if $w_flg and $wt==-1; - $pendmv-=$nomove; - $nomove=0; - $w_flg=0; - - if ($xrev) - { - PutLine(0) if $#lin > -1; - MakeMatrix(1); - $stream.="$matrix ".PutXY($xpos,$ypos)." Tm\n", $poschg=0; - $stream.="$curkern Tc\n"; - $stream.="0 Tw "; - $stream.="($par) Tj\n"; - MakeMatrix(); - $stream.="$matrix ".PutXY($xpos,$ypos)." Tm\n", $poschg=0; - $matrixchg=0; - $stream.="$curkern Tc\n"; - return; - } - - if ($pendmv) - { - if ($#lin == -1) - { - push(@lin,[undef,-$pendmv/$cftsz]); - } - else - { - $lin[$#lin]->[1]=-$pendmv/$cftsz; - } - - push(@lin,[$par,undef]); -# $xpos+=$pendmv/$unitwidth; - $pendmv=0 - } - else - { - if ($#lin == -1) - { - push(@lin,[$par,undef]); - } - else - { - $lin[$#lin]->[0].=$par; - } - } -} - -sub do_u -{ - my $par=shift; - - $par=m/([+-]?\d+) (.*)/; - $kernadjust=$1/$unitwidth; - do_t($2); - $kernadjust=0; -} - -sub do_h -{ - $pendmv+=shift; -} - -sub do_H -{ - my $par=shift; - - if ($mode eq 't') - { - PutLine(); - } - else - { - $xpos+=$pendmv/$unitwidth; - $pendmv=0; - } - - my $newx=$par/$unitwidth; - $stream.=sprintf("%.3f",$newx-$tmxpos)." 0 Td\n" if $mode eq 't'; - $tmxpos=$xpos=$newx; - $pendmv=$nomove=0; -} - -sub do_C -{ - my $par=shift; - - do_t(FindChar($par)); - $nomove=$fontlst{$cft}->{FNT}->{NAM}->{$par}->[WIDTH]*$cftsz ; -} - -sub FindChar -{ - my $chnm=shift; - my $fnt=$fontlst{$cft}->{FNT}; - - if (exists($fnt->{NAM}->{$chnm})) - { - my ($ch,$sup,$used)=@{$fnt->{NAM}->{$chnm}}[ASSIGNED,SUPPL,USED]; - ($ch,$sup) = RemapChr($ch,$fnt,$chnm) if !$used; - return ($ch<32)? sprintf("!|!|%03o",$ch) : chr($ch), $sup; - } - else - { - return(' '); - } -} - -sub RemapChr -{ - my $ch=shift; - my $fnt=shift; - my $chnm=shift; - my $unused; - - if ($use_suppl_font) { - - while (defined(my $un = shift @{$fnt->{REMAP}})) { - my $ux = $un + $fnt->{SUPPL} * 256; - my $glyph = $fnt->{NO}->[$ux]->[1]; - $unused = $un, last if !$glyph || !$fnt->{NAM}->{$glyph}->[USED]; - } - - if (!defined $unused) { - if (!$fnt->{NEXT}) { - my $fnt2 = { - %{$fnt}{qw/NM NO NAM/}, - SUPPL => $fnt->{SUPPL} + 1, - REMAP => [ 0..31, 33..255 ], - }; - $fnt->{NEXT} = $fnt2; - } - return RemapChr($ch, $fnt->{NEXT}, $chnm); - } - - my $ux = $unused + $fnt->{SUPPL} * 256; - my $glyph = $fnt->{NO}->[$ux]->[1]; - delete($fontlst{$cft}->{CACHE}->{$cftsz}); - @{$fnt->{NAM}->{$chnm}}[ASSIGNED, SUPPL, USED] = ($unused, $fnt->{SUPPL}, 1); - $fnt->{NO}->[$ux]->[1] = $chnm; - $widtbl = CacheWid($cft); - - $stream .= "% AAA Assign $chnm ($ch) to $unused ($fnt->{SUPPL})\n" if $debug; - - $ch = $unused; - return ($ch, $fnt->{SUPPL}); - } - - foreach my $un (0..$#{$fnt->{NO}}) - { - next if $un >= 139 and $un <= 144; - $unused=$un,last if $fnt->{NO}->[$un]->[1] eq ''; - } - - if (!defined $unused) - { - foreach my $un (128..255) - { - next if $un >= 139 and $un <= 144; - my $glyph=$fnt->{NO}->[$un]->[1]; - $unused=$un,last if $fnt->{NAM}->{$glyph}->[USED] == 0; - } - } - - if (defined $unused && $unused <= 255) - { - my $glyph=$fnt->{NO}->[$unused]->[1]; - delete($fontlst{$cft}->{CACHE}->{$cftsz}); - $fnt->{NAM}->{$chnm}->[ASSIGNED]=$unused; - $fnt->{NO}->[$unused]->[1]=$chnm; - $widtbl=CacheWid($cft); - - $stream.="% AAA Assign $chnm ($ch) to $unused\n" if $debug; - - $ch=$unused; - return($ch,0); - } - else - { - Msg(0,"Too many glyphs used in font '$cft'"); - return(32,0); - } -} - -sub do_c -{ - my $par=shift; - - push(@ahead,substr($par,1)); - $par=substr($par,0,1); - my $ch=ord($par); - do_N($ch); -} - -sub do_N -{ - my $par=shift; - my $fnt=$fontlst{$cft}->{FNT}; - - if (!defined($fnt->{NO}->[$par])) - { - Msg(0,"No chr($par) in font $fnt->{internalname}"); - return; - } - - my $chnm=$fnt->{NO}->[$par]->[0]; - do_C($chnm); -} - -sub do_n -{ - $gotT=0; - PutLine(0); - $pendmv=$nomove=0; - $n_flg=1; - @lin=(); - PutHotSpot($xpos) if defined($mark); -} - - -1; -######################################################################## -### Emacs settings -# Local Variables: -# mode: CPerl -# End: diff --git a/scripts/LinuxManBook/hyphen.en b/scripts/LinuxManBook/hyphen.en deleted file mode 100644 index bd9b757..0000000 --- a/scripts/LinuxManBook/hyphen.en +++ /dev/null @@ -1,5018 +0,0 @@ -% title: Hyphenation patterns for American English -% copyright: Copyright (C) 1990, 2004, 2005 Gerard D.C. Kuiken -% notice: This file is part of the hyph-utf8 package. -% See http://www.hyphenation.org/tex for more information. -% language: -% name: English, American spelling -% tag: en-us -% version: 2005-05-30 -% authors: -% - -% name: Gerard D.C. Kuiken -% licence: -% text: > -% Copying and distribution of this file, with or without modification, -% are permitted in any medium without royalty provided the copyright -% notice and this notice are preserved. -% hyphenmins: -% typesetting: -% left: 2 -% right: 3 -% changes: -% March 1, 1990 Initial release -% May 30, 2005 Added copyright notice, no patterns change. -% texlive: -% encoding: ascii -% babelname: usenglishmax -% legacy_patterns: ushyphmax.tex -% message: Hyphenation patterns for American English -% package: english -% known_bugs: -% de-mo-c-rat: 'instead of dem-o-crat (see GitHub issue #15)' -% ========================================== -% -% ushyphmax.tex -- patterns for more hyphenation pattern memory (12000+). -% Also known as ushyphen.max. -% -% Needs extended pattern memory. -% Hyphenation trie becomes 7283 with 377 ops. -% -% These patterns are based on the Hyphenation Exception Log -% published in TUGboat, Volume 10 (1989), No. 3, pp. 337-341, -% and a large number of incorrectly hyphenated words not yet published. -% If added to Liang's before the closing bracket } of \patterns, -% the patterns run errorfree as far as known at this moment. -% -% These patterns find all admissible hyphens of the words in -% the Exception Log. ushyph2.tex is a smaller set. -% -% Please send bugs or suggestions to tex-live (at) tug.org. -% -% 2005-05-30 (karl): in the past, ushyphmax.tex was a file containing -% only the additional patterns, without the \patterns command, etc. -% This turned out not to be very useful, since in practice the TeX -% distributions need one self-contained file for a language. Therefore, -% ushyphmax.tex now contains both the additional patterns from -% Dr. Kuiken, and the original patterns and hyphenations from Knuth's -% hyphen.tex. -% -% The Plain TeX hyphenation tables. -\patterns{ % just type <return> if you're not using INITEX -.ach4 -.ad4der -.af1t -.al3t -.am5at -.an5c -.ang4 -.ani5m -.ant4 -.an3te -.anti5s -.ar5s -.ar4tie -.ar4ty -.as3c -.as1p -.as1s -.aster5 -.atom5 -.au1d -.av4i -.awn4 -.ba4g -.ba5na -.bas4e -.ber4 -.be5ra -.be3sm -.be5sto -.bri2 -.but4ti -.cam4pe -.can5c -.capa5b -.car5ol -.ca4t -.ce4la -.ch4 -.chill5i -.ci2 -.cit5r -.co3e -.co4r -.cor5ner -.de4moi -.de3o -.de3ra -.de3ri -.des4c -.dictio5 -.do4t -.du4c -.dumb5 -.earth5 -.eas3i -.eb4 -.eer4 -.eg2 -.el5d -.el3em -.enam3 -.en3g -.en3s -.eq5ui5t -.er4ri -.es3 -.eu3 -.eye5 -.fes3 -.for5mer -.ga2 -.ge2 -.gen3t4 -.ge5og -.gi5a -.gi4b -.go4r -.hand5i -.han5k -.he2 -.hero5i -.hes3 -.het3 -.hi3b -.hi3er -.hon5ey -.hon3o -.hov5 -.id4l -.idol3 -.im3m -.im5pin -.in1 -.in3ci -.ine2 -.in2k -.in3s -.ir5r -.is4i -.ju3r -.la4cy -.la4m -.lat5er -.lath5 -.le2 -.leg5e -.len4 -.lep5 -.lev1 -.li4g -.lig5a -.li2n -.li3o -.li4t -.mag5a5 -.mal5o -.man5a -.mar5ti -.me2 -.mer3c -.me5ter -.mis1 -.mist5i -.mon3e -.mo3ro -.mu5ta -.muta5b -.ni4c -.od2 -.odd5 -.of5te -.or5ato -.or3c -.or1d -.or3t -.os3 -.os4tl -.oth3 -.out3 -.ped5al -.pe5te -.pe5tit -.pi4e -.pio5n -.pi2t -.pre3m -.ra4c -.ran4t -.ratio5na -.ree2 -.re5mit -.res2 -.re5stat -.ri4g -.rit5u -.ro4q -.ros5t -.row5d -.ru4d -.sci3e -.self5 -.sell5 -.se2n -.se5rie -.sh2 -.si2 -.sing4 -.st4 -.sta5bl -.sy2 -.ta4 -.te4 -.ten5an -.th2 -.ti2 -.til4 -.tim5o5 -.ting4 -.tin5k -.ton4a -.to4p -.top5i -.tou5s -.trib5ut -.un1a -.un3ce -.under5 -.un1e -.un5k -.un5o -.un3u -.up3 -.ure3 -.us5a -.ven4de -.ve5ra -.wil5i -.ye4 -4ab. -a5bal -a5ban -abe2 -ab5erd -abi5a -ab5it5ab -ab5lat -ab5o5liz -4abr -ab5rog -ab3ul -a4car -ac5ard -ac5aro -a5ceou -ac1er -a5chet -4a2ci -a3cie -ac1in -a3cio -ac5rob -act5if -ac3ul -ac4um -a2d -ad4din -ad5er. -2adi -a3dia -ad3ica -adi4er -a3dio -a3dit -a5diu -ad4le -ad3ow -ad5ran -ad4su -4adu -a3duc -ad5um -ae4r -aeri4e -a2f -aff4 -a4gab -aga4n -ag5ell -age4o -4ageu -ag1i -4ag4l -ag1n -a2go -3agog -ag3oni -a5guer -ag5ul -a4gy -a3ha -a3he -ah4l -a3ho -ai2 -a5ia -a3ic. -ai5ly -a4i4n -ain5in -ain5o -ait5en -a1j -ak1en -al5ab -al3ad -a4lar -4aldi -2ale -al3end -a4lenti -a5le5o -al1i -al4ia. -ali4e -al5lev -4allic -4alm -a5log. -a4ly. -4alys -5a5lyst -5alyt -3alyz -4ama -am5ab -am3ag -ama5ra -am5asc -a4matis -a4m5ato -am5era -am3ic -am5if -am5ily -am1in -ami4no -a2mo -a5mon -amor5i -amp5en -a2n -an3age -3analy -a3nar -an3arc -anar4i -a3nati -4and -ande4s -an3dis -an1dl -an4dow -a5nee -a3nen -an5est. -a3neu -2ang -ang5ie -an1gl -a4n1ic -a3nies -an3i3f -an4ime -a5nimi -a5nine -an3io -a3nip -an3ish -an3it -a3niu -an4kli -5anniz -ano4 -an5ot -anoth5 -an2sa -an4sco -an4sn -an2sp -ans3po -an4st -an4sur -antal4 -an4tie -4anto -an2tr -an4tw -an3ua -an3ul -a5nur -4ao -apar4 -ap5at -ap5ero -a3pher -4aphi -a4pilla -ap5illar -ap3in -ap3ita -a3pitu -a2pl -apoc5 -ap5ola -apor5i -apos3t -aps5es -a3pu -aque5 -2a2r -ar3act -a5rade -ar5adis -ar3al -a5ramete -aran4g -ara3p -ar4at -a5ratio -ar5ativ -a5rau -ar5av4 -araw4 -arbal4 -ar4chan -ar5dine -ar4dr -ar5eas -a3ree -ar3ent -a5ress -ar4fi -ar4fl -ar1i -ar5ial -ar3ian -a3riet -ar4im -ar5inat -ar3io -ar2iz -ar2mi -ar5o5d -a5roni -a3roo -ar2p -ar3q -arre4 -ar4sa -ar2sh -4as. -as4ab -as3ant -ashi4 -a5sia. -a3sib -a3sic -5a5si4t -ask3i -as4l -a4soc -as5ph -as4sh -as3ten -as1tr -asur5a -a2ta -at3abl -at5ac -at3alo -at5ap -ate5c -at5ech -at3ego -at3en. -at3era -ater5n -a5terna -at3est -at5ev -4ath -ath5em -a5then -at4ho -ath5om -4ati. -a5tia -at5i5b -at1ic -at3if -ation5ar -at3itu -a4tog -a2tom -at5omiz -a4top -a4tos -a1tr -at5rop -at4sk -at4tag -at5te -at4th -a2tu -at5ua -at5ue -at3ul -at3ura -a2ty -au4b -augh3 -au3gu -au4l2 -aun5d -au3r -au5sib -aut5en -au1th -a2va -av3ag -a5van -ave4no -av3era -av5ern -av5ery -av1i -avi4er -av3ig -av5oc -a1vor -3away -aw3i -aw4ly -aws4 -ax4ic -ax4id -ay5al -aye4 -ays4 -azi4er -azz5i -5ba. -bad5ger -ba4ge -bal1a -ban5dag -ban4e -ban3i -barbi5 -bari4a -bas4si -1bat -ba4z -2b1b -b2be -b3ber -bbi4na -4b1d -4be. -beak4 -beat3 -4be2d -be3da -be3de -be3di -be3gi -be5gu -1bel -be1li -be3lo -4be5m -be5nig -be5nu -4bes4 -be3sp -be5str -3bet -bet5iz -be5tr -be3tw -be3w -be5yo -2bf -4b3h -bi2b -bi4d -3bie -bi5en -bi4er -2b3if -1bil -bi3liz -bina5r4 -bin4d -bi5net -bi3ogr -bi5ou -bi2t -3bi3tio -bi3tr -3bit5ua -b5itz -b1j -bk4 -b2l2 -blath5 -b4le. -blen4 -5blesp -b3lis -b4lo -blun4t -4b1m -4b3n -bne5g -3bod -bod3i -bo4e -bol3ic -bom4bi -bon4a -bon5at -3boo -5bor. -4b1ora -bor5d -5bore -5bori -5bos4 -b5ota -both5 -bo4to -bound3 -4bp -4brit -broth3 -2b5s2 -bsor4 -2bt -bt4l -b4to -b3tr -buf4fer -bu4ga -bu3li -bumi4 -bu4n -bunt4i -bu3re -bus5ie -buss4e -5bust -4buta -3butio -b5uto -b1v -4b5w -5by. -bys4 -1ca -cab3in -ca1bl -cach4 -ca5den -4cag4 -2c5ah -ca3lat -cal4la -call5in -4calo -can5d -can4e -can4ic -can5is -can3iz -can4ty -cany4 -ca5per -car5om -cast5er -cas5tig -4casy -ca4th -4cativ -cav5al -c3c -ccha5 -cci4a -ccompa5 -ccon4 -ccou3t -2ce. -4ced. -4ceden -3cei -5cel. -3cell -1cen -3cenc -2cen4e -4ceni -3cent -3cep -ce5ram -4cesa -3cessi -ces5si5b -ces5t -cet4 -c5e4ta -cew4 -2ch -4ch. -4ch3ab -5chanic -ch5a5nis -che2 -cheap3 -4ched -che5lo -3chemi -ch5ene -ch3er. -ch3ers -4ch1in -5chine. -ch5iness -5chini -5chio -3chit -chi2z -3cho2 -ch4ti -1ci -3cia -ci2a5b -cia5r -ci5c -4cier -5cific. -4cii -ci4la -3cili -2cim -2cin -c4ina -3cinat -cin3em -c1ing -c5ing. -5cino -cion4 -4cipe -ci3ph -4cipic -4cista -4cisti -2c1it -cit3iz -5ciz -ck1 -ck3i -1c4l4 -4clar -c5laratio -5clare -cle4m -4clic -clim4 -cly4 -c5n -1co -co5ag -coe2 -2cog -co4gr -coi4 -co3inc -col5i -5colo -col3or -com5er -con4a -c4one -con3g -con5t -co3pa -cop3ic -co4pl -4corb -coro3n -cos4e -cov1 -cove4 -cow5a -coz5e -co5zi -c1q -cras5t -5crat. -5cratic -cre3at -5cred -4c3reta -cre4v -cri2 -cri5f -c4rin -cris4 -5criti -cro4pl -crop5o -cros4e -cru4d -4c3s2 -2c1t -cta4b -ct5ang -c5tant -c2te -c3ter -c4ticu -ctim3i -ctu4r -c4tw -cud5 -c4uf -c4ui -cu5ity -5culi -cul4tis -3cultu -cu2ma -c3ume -cu4mi -3cun -cu3pi -cu5py -cur5a4b -cu5ria -1cus -cuss4i -3c4ut -cu4tie -4c5utiv -4cutr -1cy -cze4 -1d2a -5da. -2d3a4b -dach4 -4daf -2dag -da2m2 -dan3g -dard5 -dark5 -4dary -3dat -4dativ -4dato -5dav4 -dav5e -5day -d1b -d5c -d1d4 -2de. -deaf5 -deb5it -de4bon -decan4 -de4cil -de5com -2d1ed -4dee. -de5if -deli4e -del5i5q -de5lo -d4em -5dem. -3demic -dem5ic. -de5mil -de4mons -demor5 -1den -de4nar -de3no -denti5f -de3nu -de1p -de3pa -depi4 -de2pu -d3eq -d4erh -5derm -dern5iz -der5s -des2 -d2es. -de1sc -de2s5o -des3ti -de3str -de4su -de1t -de2to -de1v -dev3il -4dey -4d1f -d4ga -d3ge4t -dg1i -d2gy -d1h2 -5di. -1d4i3a -dia5b -di4cam -d4ice -3dict -3did -5di3en -d1if -di3ge -di4lato -d1in -1dina -3dine. -5dini -di5niz -1dio -dio5g -di4pl -dir2 -di1re -dirt5i -dis1 -5disi -d4is3t -d2iti -1di1v -d1j -d5k2 -4d5la -3dle. -3dled -3dles. -4dless -2d3lo -4d5lu -2dly -d1m -4d1n4 -1do -3do. -do5de -5doe -2d5of -d4og -do4la -doli4 -do5lor -dom5iz -do3nat -doni4 -doo3d -dop4p -d4or -3dos -4d5out -do4v -3dox -d1p -1dr -drag5on -4drai -dre4 -drea5r -5dren -dri4b -dril4 -dro4p -4drow -5drupli -4dry -2d1s2 -ds4p -d4sw -d4sy -d2th -1du -d1u1a -du2c -d1uca -duc5er -4duct. -4ducts -du5el -du4g -d3ule -dum4be -du4n -4dup -du4pe -d1v -d1w -d2y -5dyn -dy4se -dys5p -e1a4b -e3act -ead1 -ead5ie -ea4ge -ea5ger -ea4l -eal5er -eal3ou -eam3er -e5and -ear3a -ear4c -ear5es -ear4ic -ear4il -ear5k -ear2t -eart3e -ea5sp -e3ass -east3 -ea2t -eat5en -eath3i -e5atif -e4a3tu -ea2v -eav3en -eav5i -eav5o -2e1b -e4bel. -e4bels -e4ben -e4bit -e3br -e4cad -ecan5c -ecca5 -e1ce -ec5essa -ec2i -e4cib -ec5ificat -ec5ifie -ec5ify -ec3im -eci4t -e5cite -e4clam -e4clus -e2col -e4comm -e4compe -e4conc -e2cor -ec3ora -eco5ro -e1cr -e4crem -ec4tan -ec4te -e1cu -e4cul -ec3ula -2e2da -4ed3d -e4d1er -ede4s -4edi -e3dia -ed3ib -ed3ica -ed3im -ed1it -edi5z -4edo -e4dol -edon2 -e4dri -e4dul -ed5ulo -ee2c -eed3i -ee2f -eel3i -ee4ly -ee2m -ee4na -ee4p1 -ee2s4 -eest4 -ee4ty -e5ex -e1f -e4f3ere -1eff -e4fic -5efici -efil4 -e3fine -ef5i5nite -3efit -efor5es -e4fuse. -4egal -eger4 -eg5ib -eg4ic -eg5ing -e5git5 -eg5n -e4go. -e4gos -eg1ul -e5gur -5egy -e1h4 -eher4 -ei2 -e5ic -ei5d -eig2 -ei5gl -e3imb -e3inf -e1ing -e5inst -eir4d -eit3e -ei3th -e5ity -e1j -e4jud -ej5udi -eki4n -ek4la -e1la -e4la. -e4lac -elan4d -el5ativ -e4law -elaxa4 -e3lea -el5ebra -5elec -e4led -el3ega -e5len -e4l1er -e1les -el2f -el2i -e3libe -e4l5ic. -el3ica -e3lier -el5igib -e5lim -e4l3ing -e3lio -e2lis -el5ish -e3liv3 -4ella -el4lab -ello4 -e5loc -el5og -el3op. -el2sh -el4ta -e5lud -el5ug -e4mac -e4mag -e5man -em5ana -em5b -e1me -e2mel -e4met -em3ica -emi4e -em5igra -em1in2 -em5ine -em3i3ni -e4mis -em5ish -e5miss -em3iz -5emniz -emo4g -emoni5o -em3pi -e4mul -em5ula -emu3n -e3my -en5amo -e4nant -ench4er -en3dic -e5nea -e5nee -en3em -en5ero -en5esi -en5est -en3etr -e3new -en5ics -e5nie -e5nil -e3nio -en3ish -en3it -e5niu -5eniz -4enn -4eno -eno4g -e4nos -en3ov -en4sw -ent5age -4enthes -en3ua -en5uf -e3ny. -4en3z -e5of -eo2g -e4oi4 -e3ol -eop3ar -e1or -eo3re -eo5rol -eos4 -e4ot -eo4to -e5out -e5ow -e2pa -e3pai -ep5anc -e5pel -e3pent -ep5etitio -ephe4 -e4pli -e1po -e4prec -ep5reca -e4pred -ep3reh -e3pro -e4prob -ep4sh -ep5ti5b -e4put -ep5uta -e1q -equi3l -e4q3ui3s -er1a -era4b -4erand -er3ar -4erati. -2erb -er4bl -er3ch -er4che -2ere. -e3real -ere5co -ere3in -er5el. -er3emo -er5ena -er5ence -4erene -er3ent -ere4q -er5ess -er3est -eret4 -er1h -er1i -e1ria4 -5erick -e3rien -eri4er -er3ine -e1rio -4erit -er4iu -eri4v -e4riva -er3m4 -er4nis -4ernit -5erniz -er3no -2ero -er5ob -e5roc -ero4r -er1ou -er1s -er3set -ert3er -4ertl -er3tw -4eru -eru4t -5erwau -e1s4a -e4sage. -e4sages -es2c -e2sca -es5can -e3scr -es5cu -e1s2e -e2sec -es5ecr -es5enc -e4sert. -e4serts -e4serva -4esh -e3sha -esh5en -e1si -e2sic -e2sid -es5iden -es5igna -e2s5im -es4i4n -esis4te -esi4u -e5skin -es4mi -e2sol -es3olu -e2son -es5ona -e1sp -es3per -es5pira -es4pre -2ess -es4si4b -estan4 -es3tig -es5tim -4es2to -e3ston -2estr -e5stro -estruc5 -e2sur -es5urr -es4w -eta4b -eten4d -e3teo -ethod3 -et1ic -e5tide -etin4 -eti4no -e5tir -e5titio -et5itiv -4etn -et5ona -e3tra -e3tre -et3ric -et5rif -et3rog -et5ros -et3ua -et5ym -et5z -4eu -e5un -e3up -eu3ro -eus4 -eute4 -euti5l -eu5tr -eva2p5 -e2vas -ev5ast -e5vea -ev3ell -evel3o -e5veng -even4i -ev1er -e5verb -e1vi -ev3id -evi4l -e4vin -evi4v -e5voc -e5vu -e1wa -e4wag -e5wee -e3wh -ewil5 -ew3ing -e3wit -1exp -5eyc -5eye. -eys4 -1fa -fa3bl -fab3r -fa4ce -4fag -fain4 -fall5e -4fa4ma -fam5is -5far -far5th -fa3ta -fa3the -4fato -fault5 -4f5b -4fd -4fe. -feas4 -feath3 -fe4b -4feca -5fect -2fed -fe3li -fe4mo -fen2d -fend5e -fer1 -5ferr -fev4 -4f1f -f4fes -f4fie -f5fin. -f2f5is -f4fly -f2fy -4fh -1fi -fi3a -2f3ic. -4f3ical -f3ican -4ficate -f3icen -fi3cer -fic4i -5ficia -5ficie -4fics -fi3cu -fi5del -fight5 -fil5i -fill5in -4fily -2fin -5fina -fin2d5 -fi2ne -f1in3g -fin4n -fis4ti -f4l2 -f5less -flin4 -flo3re -f2ly5 -4fm -4fn -1fo -5fon -fon4de -fon4t -fo2r -fo5rat -for5ay -fore5t -for4i -fort5a -fos5 -4f5p -fra4t -f5rea -fres5c -fri2 -fril4 -frol5 -2f3s -2ft -f4to -f2ty -3fu -fu5el -4fug -fu4min -fu5ne -fu3ri -fusi4 -fus4s -4futa -1fy -1ga -gaf4 -5gal. -3gali -ga3lo -2gam -ga5met -g5amo -gan5is -ga3niz -gani5za -4gano -gar5n4 -gass4 -gath3 -4gativ -4gaz -g3b -gd4 -2ge. -2ged -geez4 -gel4in -ge5lis -ge5liz -4gely -1gen -ge4nat -ge5niz -4geno -4geny -1geo -ge3om -g4ery -5gesi -geth5 -4geto -ge4ty -ge4v -4g1g2 -g2ge -g3ger -gglu5 -ggo4 -gh3in -gh5out -gh4to -5gi. -1gi4a -gia5r -g1ic -5gicia -g4ico -gien5 -5gies. -gil4 -g3imen -3g4in. -gin5ge -5g4ins -5gio -3gir -gir4l -g3isl -gi4u -5giv -3giz -gl2 -gla4 -glad5i -5glas -1gle -gli4b -g3lig -3glo -glo3r -g1m -g4my -gn4a -g4na. -gnet4t -g1ni -g2nin -g4nio -g1no -g4non -1go -3go. -gob5 -5goe -3g4o4g -go3is -gon2 -4g3o3na -gondo5 -go3ni -5goo -go5riz -gor5ou -5gos. -gov1 -g3p -1gr -4grada -g4rai -gran2 -5graph. -g5rapher -5graphic -4graphy -4gray -gre4n -4gress. -4grit -g4ro -gruf4 -gs2 -g5ste -gth3 -gu4a -3guard -2gue -5gui5t -3gun -3gus -4gu4t -g3w -1gy -2g5y3n -gy5ra -h3ab4l -hach4 -hae4m -hae4t -h5agu -ha3la -hala3m -ha4m -han4ci -han4cy -5hand. -han4g -hang5er -hang5o -h5a5niz -han4k -han4te -hap3l -hap5t -ha3ran -ha5ras -har2d -hard3e -har4le -harp5en -har5ter -has5s -haun4 -5haz -haz3a -h1b -1head -3hear -he4can -h5ecat -h4ed -he5do5 -he3l4i -hel4lis -hel4ly -h5elo -hem4p -he2n -hena4 -hen5at -heo5r -hep5 -h4era -hera3p -her4ba -here5a -h3ern -h5erou -h3ery -h1es -he2s5p -he4t -het4ed -heu4 -h1f -h1h -hi5an -hi4co -high5 -h4il2 -himer4 -h4ina -hion4e -hi4p -hir4l -hi3ro -hir4p -hir4r -his3el -his4s -hith5er -hi2v -4hk -4h1l4 -hlan4 -h2lo -hlo3ri -4h1m -hmet4 -2h1n -h5odiz -h5ods -ho4g -hoge4 -hol5ar -3hol4e -ho4ma -home3 -hon4a -ho5ny -3hood -hoon4 -hor5at -ho5ris -hort3e -ho5ru -hos4e -ho5sen -hos1p -1hous -house3 -hov5el -4h5p -4hr4 -hree5 -hro5niz -hro3po -4h1s2 -h4sh -h4tar -ht1en -ht5es -h4ty -hu4g -hu4min -hun5ke -hun4t -hus3t4 -hu4t -h1w -h4wart -hy3pe -hy3ph -hy2s -2i1a -i2al -iam4 -iam5ete -i2an -4ianc -ian3i -4ian4t -ia5pe -iass4 -i4ativ -ia4tric -i4atu -ibe4 -ib3era -ib5ert -ib5ia -ib3in -ib5it. -ib5ite -i1bl -ib3li -i5bo -i1br -i2b5ri -i5bun -4icam -5icap -4icar -i4car. -i4cara -icas5 -i4cay -iccu4 -4iceo -4ich -2ici -i5cid -ic5ina -i2cip -ic3ipa -i4cly -i2c5oc -4i1cr -5icra -i4cry -ic4te -ictu2 -ic4t3ua -ic3ula -ic4um -ic5uo -i3cur -2id -i4dai -id5anc -id5d -ide3al -ide4s -i2di -id5ian -idi4ar -i5die -id3io -idi5ou -id1it -id5iu -i3dle -i4dom -id3ow -i4dr -i2du -id5uo -2ie4 -ied4e -5ie5ga -ield3 -ien5a4 -ien4e -i5enn -i3enti -i1er. -i3esc -i1est -i3et -4if. -if5ero -iff5en -if4fr -4ific. -i3fie -i3fl -4ift -2ig -iga5b -ig3era -ight3i -4igi -i3gib -ig3il -ig3in -ig3it -i4g4l -i2go -ig3or -ig5ot -i5gre -igu5i -ig1ur -i3h -4i5i4 -i3j -4ik -i1la -il3a4b -i4lade -i2l5am -ila5ra -i3leg -il1er -ilev4 -il5f -il1i -il3ia -il2ib -il3io -il4ist -2ilit -il2iz -ill5ab -4iln -il3oq -il4ty -il5ur -il3v -i4mag -im3age -ima5ry -imenta5r -4imet -im1i -im5ida -imi5le -i5mini -4imit -im4ni -i3mon -i2mu -im3ula -2in. -i4n3au -4inav -incel4 -in3cer -4ind -in5dling -2ine -i3nee -iner4ar -i5ness -4inga -4inge -in5gen -4ingi -in5gling -4ingo -4ingu -2ini -i5ni. -i4nia -in3io -in1is -i5nite. -5initio -in3ity -4ink -4inl -2inn -2i1no -i4no4c -ino4s -i4not -2ins -in3se -insur5a -2int. -2in4th -in1u -i5nus -4iny -2io -4io. -ioge4 -io2gr -i1ol -io4m -ion3at -ion4ery -ion3i -io5ph -ior3i -i4os -io5th -i5oti -io4to -i4our -2ip -ipe4 -iphras4 -ip3i -ip4ic -ip4re4 -ip3ul -i3qua -iq5uef -iq3uid -iq3ui3t -4ir -i1ra -ira4b -i4rac -ird5e -ire4de -i4ref -i4rel4 -i4res -ir5gi -ir1i -iri5de -ir4is -iri3tu -5i5r2iz -ir4min -iro4g -5iron. -ir5ul -2is. -is5ag -is3ar -isas5 -2is1c -is3ch -4ise -is3er -3isf -is5han -is3hon -ish5op -is3ib -isi4d -i5sis -is5itiv -4is4k -islan4 -4isms -i2so -iso5mer -is1p -is2pi -is4py -4is1s -is4sal -issen4 -is4ses -is4ta. -is1te -is1ti -ist4ly -4istral -i2su -is5us -4ita. -ita4bi -i4tag -4ita5m -i3tan -i3tat -2ite -it3era -i5teri -it4es -2ith -i1ti -4itia -4i2tic -it3ica -5i5tick -it3ig -it5ill -i2tim -2itio -4itis -i4tism -i2t5o5m -4iton -i4tram -it5ry -4itt -it3uat -i5tud -it3ul -4itz. -i1u -2iv -iv3ell -iv3en. -i4v3er. -i4vers. -iv5il. -iv5io -iv1it -i5vore -iv3o3ro -i4v3ot -4i5w -ix4o -4iy -4izar -izi4 -5izont -5ja -jac4q -ja4p -1je -jer5s -4jestie -4jesty -jew3 -jo4p -5judg -3ka. -k3ab -k5ag -kais4 -kal4 -k1b -k2ed -1kee -ke4g -ke5li -k3en4d -k1er -kes4 -k3est. -ke4ty -k3f -kh4 -k1i -5ki. -5k2ic -k4ill -kilo5 -k4im -k4in. -kin4de -k5iness -kin4g -ki4p -kis4 -k5ish -kk4 -k1l -4kley -4kly -k1m -k5nes -1k2no -ko5r -kosh4 -k3ou -kro5n -4k1s2 -k4sc -ks4l -k4sy -k5t -k1w -lab3ic -l4abo -laci4 -l4ade -la3dy -lag4n -lam3o -3land -lan4dl -lan5et -lan4te -lar4g -lar3i -las4e -la5tan -4lateli -4lativ -4lav -la4v4a -2l1b -lbin4 -4l1c2 -lce4 -l3ci -2ld -l2de -ld4ere -ld4eri -ldi4 -ld5is -l3dr -l4dri -le2a -le4bi -left5 -5leg. -5legg -le4mat -lem5atic -4len. -3lenc -5lene. -1lent -le3ph -le4pr -lera5b -ler4e -3lerg -3l4eri -l4ero -les2 -le5sco -5lesq -3less -5less. -l3eva -lev4er. -lev4era -lev4ers -3ley -4leye -2lf -l5fr -4l1g4 -l5ga -lgar3 -l4ges -lgo3 -2l3h -li4ag -li2am -liar5iz -li4as -li4ato -li5bi -5licio -li4cor -4lics -4lict. -l4icu -l3icy -l3ida -lid5er -3lidi -lif3er -l4iff -li4fl -5ligate -3ligh -li4gra -3lik -4l4i4l -lim4bl -lim3i -li4mo -l4im4p -l4ina -1l4ine -lin3ea -lin3i -link5er -li5og -4l4iq -lis4p -l1it -l2it. -5litica -l5i5tics -liv3er -l1iz -4lj -lka3 -l3kal -lka4t -l1l -l4law -l2le -l5lea -l3lec -l3leg -l3lel -l3le4n -l3le4t -ll2i -l2lin4 -l5lina -ll4o -lloqui5 -ll5out -l5low -2lm -l5met -lm3ing -l4mod -lmon4 -2l1n2 -3lo. -lob5al -lo4ci -4lof -3logic -l5ogo -3logu -lom3er -5long -lon4i -l3o3niz -lood5 -5lope. -lop3i -l3opm -lora4 -lo4rato -lo5rie -lor5ou -5los. -los5et -5losophiz -5losophy -los4t -lo4ta -loun5d -2lout -4lov -2lp -lpa5b -l3pha -l5phi -lp5ing -l3pit -l4pl -l5pr -4l1r -2l1s2 -l4sc -l2se -l4sie -4lt -lt5ag -ltane5 -l1te -lten4 -ltera4 -lth3i -l5ties. -ltis4 -l1tr -ltu2 -ltur3a -lu5a -lu3br -luch4 -lu3ci -lu3en -luf4 -lu5id -lu4ma -5lumi -l5umn. -5lumnia -lu3o -luo3r -4lup -luss4 -lus3te -1lut -l5ven -l5vet4 -2l1w -1ly -4lya -4lyb -ly5me -ly3no -2lys4 -l5yse -1ma -2mab -ma2ca -ma5chine -ma4cl -mag5in -5magn -2mah -maid5 -4mald -ma3lig -ma5lin -mal4li -mal4ty -5mania -man5is -man3iz -4map -ma5rine. -ma5riz -mar4ly -mar3v -ma5sce -mas4e -mas1t -5mate -math3 -ma3tis -4matiza -4m1b -mba4t5 -m5bil -m4b3ing -mbi4v -4m5c -4me. -2med -4med. -5media -me3die -m5e5dy -me2g -mel5on -mel4t -me2m -mem1o3 -1men -men4a -men5ac -men4de -4mene -men4i -mens4 -mensu5 -3ment -men4te -me5on -m5ersa -2mes -3mesti -me4ta -met3al -me1te -me5thi -m4etr -5metric -me5trie -me3try -me4v -4m1f -2mh -5mi. -mi3a -mid4a -mid4g -mig4 -3milia -m5i5lie -m4ill -min4a -3mind -m5inee -m4ingl -min5gli -m5ingly -min4t -m4inu -miot4 -m2is -mis4er. -mis5l -mis4ti -m5istry -4mith -m2iz -4mk -4m1l -m1m -mma5ry -4m1n -mn4a -m4nin -mn4o -1mo -4mocr -5mocratiz -mo2d1 -mo4go -mois2 -moi5se -4mok -mo5lest -mo3me -mon5et -mon5ge -moni3a -mon4ism -mon4ist -mo3niz -monol4 -mo3ny. -mo2r -4mora. -mos2 -mo5sey -mo3sp -moth3 -m5ouf -3mous -mo2v -4m1p -mpara5 -mpa5rab -mpar5i -m3pet -mphas4 -m2pi -mpi4a -mp5ies -m4p1in -m5pir -mp5is -mpo3ri -mpos5ite -m4pous -mpov5 -mp4tr -m2py -4m3r -4m1s2 -m4sh -m5si -4mt -1mu -mula5r4 -5mult -multi3 -3mum -mun2 -4mup -mu4u -4mw -1na -2n1a2b -n4abu -4nac. -na4ca -n5act -nag5er. -nak4 -na4li -na5lia -4nalt -na5mit -n2an -nanci4 -nan4it -nank4 -nar3c -4nare -nar3i -nar4l -n5arm -n4as -nas4c -nas5ti -n2at -na3tal -nato5miz -n2au -nau3se -3naut -nav4e -4n1b4 -ncar5 -n4ces. -n3cha -n5cheo -n5chil -n3chis -nc1in -nc4it -ncour5a -n1cr -n1cu -n4dai -n5dan -n1de -nd5est. -ndi4b -n5d2if -n1dit -n3diz -n5duc -ndu4r -nd2we -2ne. -n3ear -ne2b -neb3u -ne2c -5neck -2ned -ne4gat -neg5ativ -5nege -ne4la -nel5iz -ne5mi -ne4mo -1nen -4nene -3neo -ne4po -ne2q -n1er -nera5b -n4erar -n2ere -n4er5i -ner4r -1nes -2nes. -4nesp -2nest -4nesw -3netic -ne4v -n5eve -ne4w -n3f -n4gab -n3gel -nge4n4e -n5gere -n3geri -ng5ha -n3gib -ng1in -n5git -n4gla -ngov4 -ng5sh -n1gu -n4gum -n2gy -4n1h4 -nha4 -nhab3 -nhe4 -3n4ia -ni3an -ni4ap -ni3ba -ni4bl -ni4d -ni5di -ni4er -ni2fi -ni5ficat -n5igr -nik4 -n1im -ni3miz -n1in -5nine. -nin4g -ni4o -5nis. -nis4ta -n2it -n4ith -3nitio -n3itor -ni3tr -n1j -4nk2 -n5kero -n3ket -nk3in -n1kl -4n1l -n5m -nme4 -nmet4 -4n1n2 -nne4 -nni3al -nni4v -nob4l -no3ble -n5ocl -4n3o2d -3noe -4nog -noge4 -nois5i -no5l4i -5nologis -3nomic -n5o5miz -no4mo -no3my -no4n -non4ag -non5i -n5oniz -4nop -5nop5o5li -nor5ab -no4rary -4nosc -nos4e -nos5t -no5ta -1nou -3noun -nov3el3 -nowl3 -n1p4 -npi4 -npre4c -n1q -n1r -nru4 -2n1s2 -ns5ab -nsati4 -ns4c -n2se -n4s3es -nsid1 -nsig4 -n2sl -ns3m -n4soc -ns4pe -n5spi -nsta5bl -n1t -nta4b -nter3s -nt2i -n5tib -nti4er -nti2f -n3tine -n4t3ing -nti4p -ntrol5li -nt4s -ntu3me -nu1a -nu4d -nu5en -nuf4fe -n3uin -3nu3it -n4um -nu1me -n5umi -3nu4n -n3uo -nu3tr -n1v2 -n1w4 -nym4 -nyp4 -4nz -n3za -4oa -oad3 -o5a5les -oard3 -oas4e -oast5e -oat5i -ob3a3b -o5bar -obe4l -o1bi -o2bin -ob5ing -o3br -ob3ul -o1ce -och4 -o3chet -ocif3 -o4cil -o4clam -o4cod -oc3rac -oc5ratiz -ocre3 -5ocrit -octor5a -oc3ula -o5cure -od5ded -od3ic -odi3o -o2do4 -odor3 -od5uct. -od5ucts -o4el -o5eng -o3er -oe4ta -o3ev -o2fi -of5ite -ofit4t -o2g5a5r -og5ativ -o4gato -o1ge -o5gene -o5geo -o4ger -o3gie -1o1gis -og3it -o4gl -o5g2ly -3ogniz -o4gro -ogu5i -1ogy -2ogyn -o1h2 -ohab5 -oi2 -oic3es -oi3der -oiff4 -oig4 -oi5let -o3ing -oint5er -o5ism -oi5son -oist5en -oi3ter -o5j -2ok -o3ken -ok5ie -o1la -o4lan -olass4 -ol2d -old1e -ol3er -o3lesc -o3let -ol4fi -ol2i -o3lia -o3lice -ol5id. -o3li4f -o5lil -ol3ing -o5lio -o5lis. -ol3ish -o5lite -o5litio -o5liv -olli4e -ol5ogiz -olo4r -ol5pl -ol2t -ol3ub -ol3ume -ol3un -o5lus -ol2v -o2ly -om5ah -oma5l -om5atiz -om2be -om4bl -o2me -om3ena -om5erse -o4met -om5etry -o3mia -om3ic. -om3ica -o5mid -om1in -o5mini -5ommend -omo4ge -o4mon -om3pi -ompro5 -o2n -on1a -on4ac -o3nan -on1c -3oncil -2ond -on5do -o3nen -on5est -on4gu -on1ic -o3nio -on1is -o5niu -on3key -on4odi -on3omy -on3s -onspi4 -onspir5a -onsu4 -onten4 -on3t4i -ontif5 -on5um -onva5 -oo2 -ood5e -ood5i -oo4k -oop3i -o3ord -oost5 -o2pa -ope5d -op1er -3opera -4operag -2oph -o5phan -o5pher -op3ing -o3pit -o5pon -o4posi -o1pr -op1u -opy5 -o1q -o1ra -o5ra. -o4r3ag -or5aliz -or5ange -ore5a -o5real -or3ei -ore5sh -or5est. -orew4 -or4gu -4o5ria -or3ica -o5ril -or1in -o1rio -or3ity -o3riu -or2mi -orn2e -o5rof -or3oug -or5pe -3orrh -or4se -ors5en -orst4 -or3thi -or3thy -or4ty -o5rum -o1ry -os3al -os2c -os4ce -o3scop -4oscopi -o5scr -os4i4e -os5itiv -os3ito -os3ity -osi4u -os4l -o2so -os4pa -os4po -os2ta -o5stati -os5til -os5tit -o4tan -otele4g -ot3er. -ot5ers -o4tes -4oth -oth5esi -oth3i4 -ot3ic. -ot5ica -o3tice -o3tif -o3tis -oto5s -ou2 -ou3bl -ouch5i -ou5et -ou4l -ounc5er -oun2d -ou5v -ov4en -over4ne -over3s -ov4ert -o3vis -oviti4 -o5v4ol -ow3der -ow3el -ow5est -ow1i -own5i -o4wo -oy1a -1pa -pa4ca -pa4ce -pac4t -p4ad -5pagan -p3agat -p4ai -pain4 -p4al -pan4a -pan3el -pan4ty -pa3ny -pa1p -pa4pu -para5bl -par5age -par5di -3pare -par5el -p4a4ri -par4is -pa2te -pa5ter -5pathic -pa5thy -pa4tric -pav4 -3pay -4p1b -pd4 -4pe. -3pe4a -pear4l -pe2c -2p2ed -3pede -3pedi -pedia4 -ped4ic -p4ee -pee4d -pek4 -pe4la -peli4e -pe4nan -p4enc -pen4th -pe5on -p4era. -pera5bl -p4erag -p4eri -peri5st -per4mal -perme5 -p4ern -per3o -per3ti -pe5ru -per1v -pe2t -pe5ten -pe5tiz -4pf -4pg -4ph. -phar5i -phe3no -ph4er -ph4es. -ph1ic -5phie -ph5ing -5phisti -3phiz -ph2l -3phob -3phone -5phoni -pho4r -4phs -ph3t -5phu -1phy -pi3a -pian4 -pi4cie -pi4cy -p4id -p5ida -pi3de -5pidi -3piec -pi3en -pi4grap -pi3lo -pi2n -p4in. -pind4 -p4ino -3pi1o -pion4 -p3ith -pi5tha -pi2tu -2p3k2 -1p2l2 -3plan -plas5t -pli3a -pli5er -4plig -pli4n -ploi4 -plu4m -plum4b -4p1m -2p3n -po4c -5pod. -po5em -po3et5 -5po4g -poin2 -5point -poly5t -po4ni -po4p -1p4or -po4ry -1pos -pos1s -p4ot -po4ta -5poun -4p1p -ppa5ra -p2pe -p4ped -p5pel -p3pen -p3per -p3pet -ppo5site -pr2 -pray4e -5preci -pre5co -pre3em -pref5ac -pre4la -pre3r -p3rese -3press -pre5ten -pre3v -5pri4e -prin4t3 -pri4s -pris3o -p3roca -prof5it -pro3l -pros3e -pro1t -2p1s2 -p2se -ps4h -p4sib -2p1t -pt5a4b -p2te -p2th -pti3m -ptu4r -p4tw -pub3 -pue4 -puf4 -pul3c -pu4m -pu2n -pur4r -5pus -pu2t -5pute -put3er -pu3tr -put4ted -put4tin -p3w -qu2 -qua5v -2que. -3quer -3quet -2rab -ra3bi -rach4e -r5acl -raf5fi -raf4t -r2ai -ra4lo -ram3et -r2ami -rane5o -ran4ge -r4ani -ra5no -rap3er -3raphy -rar5c -rare4 -rar5ef -4raril -r2as -ration4 -rau4t -ra5vai -rav3el -ra5zie -r1b -r4bab -r4bag -rbi2 -rbi4f -r2bin -r5bine -rb5ing. -rb4o -r1c -r2ce -rcen4 -r3cha -rch4er -r4ci4b -rc4it -rcum3 -r4dal -rd2i -rdi4a -rdi4er -rdin4 -rd3ing -2re. -re1al -re3an -re5arr -5reav -re4aw -r5ebrat -rec5oll -rec5ompe -re4cre -2r2ed -re1de -re3dis -red5it -re4fac -re2fe -re5fer. -re3fi -re4fy -reg3is -re5it -re1li -re5lu -r4en4ta -ren4te -re1o -re5pin -re4posi -re1pu -r1er4 -r4eri -rero4 -re5ru -r4es. -re4spi -ress5ib -res2t -re5stal -re3str -re4ter -re4ti4z -re3tri -reu2 -re5uti -rev2 -re4val -rev3el -r5ev5er. -re5vers -re5vert -re5vil -rev5olu -re4wh -r1f -rfu4 -r4fy -rg2 -rg3er -r3get -r3gic -rgi4n -rg3ing -r5gis -r5git -r1gl -rgo4n -r3gu -rh4 -4rh. -4rhal -ri3a -ria4b -ri4ag -r4ib -rib3a -ric5as -r4ice -4rici -5ricid -ri4cie -r4ico -rid5er -ri3enc -ri3ent -ri1er -ri5et -rig5an -5rigi -ril3iz -5riman -rim5i -3rimo -rim4pe -r2ina -5rina. -rin4d -rin4e -rin4g -ri1o -5riph -riph5e -ri2pl -rip5lic -r4iq -r2is -r4is. -ris4c -r3ish -ris4p -ri3ta3b -r5ited. -rit5er. -rit5ers -rit3ic -ri2tu -rit5ur -riv5el -riv3et -riv3i -r3j -r3ket -rk4le -rk4lin -r1l -rle4 -r2led -r4lig -r4lis -rl5ish -r3lo4 -r1m -rma5c -r2me -r3men -rm5ers -rm3ing -r4ming. -r4mio -r3mit -r4my -r4nar -r3nel -r4ner -r5net -r3ney -r5nic -r1nis4 -r3nit -r3niv -rno4 -r4nou -r3nu -rob3l -r2oc -ro3cr -ro4e -ro1fe -ro5fil -rok2 -ro5ker -5role. -rom5ete -rom4i -rom4p -ron4al -ron4e -ro5n4is -ron4ta -1room -5root -ro3pel -rop3ic -ror3i -ro5ro -ros5per -ros4s -ro4the -ro4ty -ro4va -rov5el -rox5 -r1p -r4pea -r5pent -rp5er. -r3pet -rp4h4 -rp3ing -r3po -r1r4 -rre4c -rre4f -r4reo -rre4st -rri4o -rri4v -rron4 -rros4 -rrys4 -4rs2 -r1sa -rsa5ti -rs4c -r2se -r3sec -rse4cr -rs5er. -rs3es -rse5v2 -r1sh -r5sha -r1si -r4si4b -rson3 -r1sp -r5sw -rtach4 -r4tag -r3teb -rten4d -rte5o -r1ti -rt5ib -rti4d -r4tier -r3tig -rtil3i -rtil4l -r4tily -r4tist -r4tiv -r3tri -rtroph4 -rt4sh -ru3a -ru3e4l -ru3en -ru4gl -ru3in -rum3pl -ru2n -runk5 -run4ty -r5usc -ruti5n -rv4e -rvel4i -r3ven -rv5er. -r5vest -r3vey -r3vic -rvi4v -r3vo -r1w -ry4c -5rynge -ry3t -sa2 -2s1ab -5sack -sac3ri -s3act -5sai -salar4 -sal4m -sa5lo -sal4t -3sanc -san4de -s1ap -sa5ta -5sa3tio -sat3u -sau4 -sa5vor -5saw -4s5b -scan4t5 -sca4p -scav5 -s4ced -4scei -s4ces -sch2 -s4cho -3s4cie -5scin4d -scle5 -s4cli -scof4 -4scopy -scour5a -s1cu -4s5d -4se. -se4a -seas4 -sea5w -se2c3o -3sect -4s4ed -se4d4e -s5edl -se2g -seg3r -5sei -se1le -5self -5selv -4seme -se4mol -sen5at -4senc -sen4d -s5ened -sen5g -s5enin -4sentd -4sentl -sep3a3 -4s1er. -s4erl -ser4o -4servo -s1e4s -se5sh -ses5t -5se5um -5sev -sev3en -sew4i -5sex -4s3f -2s3g -s2h -2sh. -sh1er -5shev -sh1in -sh3io -3ship -shiv5 -sho4 -sh5old -shon3 -shor4 -short5 -4shw -si1b -s5icc -3side. -5sides -5sidi -si5diz -4signa -sil4e -4sily -2s1in -s2ina -5sine. -s3ing -1sio -5sion -sion5a -si2r -sir5a -1sis -3sitio -5siu -1siv -5siz -sk2 -4ske -s3ket -sk5ine -sk5ing -s1l2 -s3lat -s2le -slith5 -2s1m -s3ma -small3 -sman3 -smel4 -s5men -5smith -smol5d4 -s1n4 -1so -so4ce -soft3 -so4lab -sol3d2 -so3lic -5solv -3som -3s4on. -sona4 -son4g -s4op -5sophic -s5ophiz -s5ophy -sor5c -sor5d -4sov -so5vi -2spa -5spai -spa4n -spen4d -2s5peo -2sper -s2phe -3spher -spho5 -spil4 -sp5ing -4spio -s4ply -s4pon -spor4 -4spot -squal4l -s1r -2ss -s1sa -ssas3 -s2s5c -s3sel -s5seng -s4ses. -s5set -s1si -s4sie -ssi4er -ss5ily -s4sl -ss4li -s4sn -sspend4 -ss2t -ssur5a -ss5w -2st. -s2tag -s2tal -stam4i -5stand -s4ta4p -5stat. -s4ted -stern5i -s5tero -ste2w -stew5a -s3the -st2i -s4ti. -s5tia -s1tic -5stick -s4tie -s3tif -st3ing -5stir -s1tle -5stock -stom3a -5stone -s4top -3store -st4r -s4trad -5stratu -s4tray -s4trid -4stry -4st3w -s2ty -1su -su1al -su4b3 -su2g3 -su5is -suit3 -s4ul -su2m -sum3i -su2n -su2r -4sv -sw2 -4swo -s4y -4syc -3syl -syn5o -sy5rin -1ta -3ta. -2tab -ta5bles -5taboliz -4taci -ta5do -4taf4 -tai5lo -ta2l -ta5la -tal5en -tal3i -4talk -tal4lis -ta5log -ta5mo -tan4de -tanta3 -ta5per -ta5pl -tar4a -4tarc -4tare -ta3riz -tas4e -ta5sy -4tatic -ta4tur -taun4 -tav4 -2taw -tax4is -2t1b -4tc -t4ch -tch5et -4t1d -4te. -tead4i -4teat -tece4 -5tect -2t1ed -te5di -1tee -teg4 -te5ger -te5gi -3tel. -teli4 -5tels -te2ma2 -tem3at -3tenan -3tenc -3tend -4tenes -1tent -ten4tag -1teo -te4p -te5pe -ter3c -5ter3d -1teri -ter5ies -ter3is -teri5za -5ternit -ter5v -4tes. -4tess -t3ess. -teth5e -3teu -3tex -4tey -2t1f -4t1g -2th. -than4 -th2e -4thea -th3eas -the5at -the3is -3thet -th5ic. -th5ica -4thil -5think -4thl -th5ode -5thodic -4thoo -thor5it -tho5riz -2ths -1tia -ti4ab -ti4ato -2ti2b -4tick -t4ico -t4ic1u -5tidi -3tien -tif2 -ti5fy -2tig -5tigu -till5in -1tim -4timp -tim5ul -2t1in -t2ina -3tine. -3tini -1tio -ti5oc -tion5ee -5tiq -ti3sa -3tise -tis4m -ti5so -tis4p -5tistica -ti3tl -ti4u -1tiv -tiv4a -1tiz -ti3za -ti3zen -2tl -t5la -tlan4 -3tle. -3tled -3tles. -t5let. -t5lo -4t1m -tme4 -2t1n2 -1to -to3b -to5crat -4todo -2tof -to2gr -to5ic -to2ma -tom4b -to3my -ton4ali -to3nat -4tono -4tony -to2ra -to3rie -tor5iz -tos2 -5tour -4tout -to3war -4t1p -1tra -tra3b -tra5ch -traci4 -trac4it -trac4te -tras4 -tra5ven -trav5es5 -tre5f -tre4m -trem5i -5tria -tri5ces -5tricia -4trics -2trim -tri4v -tro5mi -tron5i -4trony -tro5phe -tro3sp -tro3v -tru5i -trus4 -4t1s2 -t4sc -tsh4 -t4sw -4t3t2 -t4tes -t5to -ttu4 -1tu -tu1a -tu3ar -tu4bi -tud2 -4tue -4tuf4 -5tu3i -3tum -tu4nis -2t3up. -3ture -5turi -tur3is -tur5o -tu5ry -3tus -4tv -tw4 -4t1wa -twis4 -4two -1ty -4tya -2tyl -type3 -ty5ph -4tz -tz4e -4uab -uac4 -ua5na -uan4i -uar5ant -uar2d -uar3i -uar3t -u1at -uav4 -ub4e -u4bel -u3ber -u4bero -u1b4i -u4b5ing -u3ble. -u3ca -uci4b -uc4it -ucle3 -u3cr -u3cu -u4cy -ud5d -ud3er -ud5est -udev4 -u1dic -ud3ied -ud3ies -ud5is -u5dit -u4don -ud4si -u4du -u4ene -uens4 -uen4te -uer4il -3ufa -u3fl -ugh3en -ug5in -2ui2 -uil5iz -ui4n -u1ing -uir4m -uita4 -uiv3 -uiv4er. -u5j -4uk -u1la -ula5b -u5lati -ulch4 -5ulche -ul3der -ul4e -u1len -ul4gi -ul2i -u5lia -ul3ing -ul5ish -ul4lar -ul4li4b -ul4lis -4ul3m -u1l4o -4uls -uls5es -ul1ti -ultra3 -4ultu -u3lu -ul5ul -ul5v -um5ab -um4bi -um4bly -u1mi -u4m3ing -umor5o -um2p -unat4 -u2ne -un4er -u1ni -un4im -u2nin -un5ish -uni3v -un3s4 -un4sw -unt3ab -un4ter. -un4tes -unu4 -un5y -un5z -u4ors -u5os -u1ou -u1pe -uper5s -u5pia -up3ing -u3pl -up3p -upport5 -upt5ib -uptu4 -u1ra -4ura. -u4rag -u4ras -ur4be -urc4 -ur1d -ure5at -ur4fer -ur4fr -u3rif -uri4fic -ur1in -u3rio -u1rit -ur3iz -ur2l -url5ing. -ur4no -uros4 -ur4pe -ur4pi -urs5er -ur5tes -ur3the -urti4 -ur4tie -u3ru -2us -u5sad -u5san -us4ap -usc2 -us3ci -use5a -u5sia -u3sic -us4lin -us1p -us5sl -us5tere -us1tr -u2su -usur4 -uta4b -u3tat -4ute. -4utel -4uten -uten4i -4u1t2i -uti5liz -u3tine -ut3ing -ution5a -u4tis -5u5tiz -u4t1l -ut5of -uto5g -uto5matic -u5ton -u4tou -uts4 -u3u -uu4m -u1v2 -uxu3 -uz4e -1va -5va. -2v1a4b -vac5il -vac3u -vag4 -va4ge -va5lie -val5o -val1u -va5mo -va5niz -va5pi -var5ied -3vat -4ve. -4ved -veg3 -v3el. -vel3li -ve4lo -v4ely -ven3om -v5enue -v4erd -5vere. -v4erel -v3eren -ver5enc -v4eres -ver3ie -vermi4n -3verse -ver3th -v4e2s -4ves. -ves4te -ve4te -vet3er -ve4ty -vi5ali -5vian -5vide. -5vided -4v3iden -5vides -5vidi -v3if -vi5gn -vik4 -2vil -5vilit -v3i3liz -v1in -4vi4na -v2inc -vin5d -4ving -vio3l -v3io4r -vi1ou -vi4p -vi5ro -vis3it -vi3so -vi3su -4viti -vit3r -4vity -3viv -5vo. -voi4 -3vok -vo4la -v5ole -5volt -3volv -vom5i -vor5ab -vori4 -vo4ry -vo4ta -4votee -4vv4 -v4y -w5abl -2wac -wa5ger -wag5o -wait5 -w5al. -wam4 -war4t -was4t -wa1te -wa5ver -w1b -wea5rie -weath3 -wed4n -weet3 -wee5v -wel4l -w1er -west3 -w3ev -whi4 -wi2 -wil2 -will5in -win4de -win4g -wir4 -3wise -with3 -wiz5 -w4k -wl4es -wl3in -w4no -1wo2 -wom1 -wo5ven -w5p -wra4 -wri4 -writa4 -w3sh -ws4l -ws4pe -w5s4t -4wt -wy4 -x1a -xac5e -x4ago -xam3 -x4ap -xas5 -x3c2 -x1e -xe4cuto -x2ed -xer4i -xe5ro -x1h -xhi2 -xhil5 -xhu4 -x3i -xi5a -xi5c -xi5di -x4ime -xi5miz -x3o -x4ob -x3p -xpan4d -xpecto5 -xpe3d -x1t2 -x3ti -x1u -xu3a -xx4 -y5ac -3yar4 -y5at -y1b -y1c -y2ce -yc5er -y3ch -ych4e -ycom4 -ycot4 -y1d -y5ee -y1er -y4erf -yes4 -ye4t -y5gi -4y3h -y1i -y3la -ylla5bl -y3lo -y5lu -ymbol5 -yme4 -ympa3 -yn3chr -yn5d -yn5g -yn5ic -5ynx -y1o4 -yo5d -y4o5g -yom4 -yo5net -y4ons -y4os -y4ped -yper5 -yp3i -y3po -y4poc -yp2ta -y5pu -yra5m -yr5ia -y3ro -yr4r -ys4c -y3s2e -ys3ica -ys3io -3ysis -y4so -yss4 -ys1t -ys3ta -ysur4 -y3thin -yt3ic -y1w -za1 -z5a2b -zar2 -4zb -2ze -ze4n -ze4p -z1er -ze3ro -zet4 -2z1i -z4il -z4is -5zl -4zm -1zo -zo4m -zo5ol -zte4 -4z1z2 -z4zy -% hyphen.tex patterns end here, and additional patterns begin: -.con5gr -.de5riva -.dri5v4 -.eth1y6l1 -.eu4ler -.ev2 -.ever5si5b -.ga4s1om1 -.ge4ome -.ge5ot1 -.he3mo1 -.he3p6a -.he3roe -.in5u2t -.kil2n3i -.ko6r1te1 -.le6ices -.me4ga1l -.met4ala -.mim5i2c1 -.mi1s4ers -.ne6o3f -.noe1th -.non1e2m -.poly1s -.post1am -.pre1am -.rav5en1o -.semi5 -.sem4ic -.semid6 -.semip4 -.semir4 -.sem6is4 -.semiv4 -.sph6in1 -.spin1o -.ta5pes1tr -.te3legr -.to6pog -.to2q -.un3at5t -.un5err5 -.vi2c3ar -.we2b1l -.re1e4c -a5bolic -a2cabl -af6fish -am1en3ta5b -anal6ys -ano5a2c -ans5gr -ans3v -anti1d -an3ti1n2 -anti1re -a4pe5able -ar3che5t -ar2range -as5ymptot -ath3er1o1s -at6tes. -augh4tl -au5li5f -av3iou -back2er. -ba6r1onie -ba1thy -bbi4t -be2vie -bi5d2if -bil2lab -bio5m -bi1orb -bio1rh -b1i3tive -blan2d1 -blin2d1 -blon2d2 -bor1no5 -bo2t1u1l -brus4q -bus6i2er -bus6i2es -buss4ing -but2ed. -but4ted -cad5e1m -cat1a1s2 -4chs. -chs3hu -chie5vo -cig3a3r -cin2q -cle4ar -co6ph1o3n -cous2ti -cri3tie -croc1o1d -cro5e2co -c2tro3me6c -1cu2r1ance -2d3alone -data1b -dd5a5b -d2d5ib -de4als. -de5clar1 -de2c5lina -de3fin3iti -de2mos -des3ic -de2tic -dic1aid -dif5fra -3di1methy -di2ren -di2rer -2d1lead -2d1li2e -3do5word -dren1a5l -drif2t1a -d1ri3pleg5 -drom3e5d -d3tab -du2al. -du1op1o1l -ea4n3ies -e3chas -edg1l -ed1uling -eli2t1is -e1loa -en1dix -eo3grap -1e6p3i3neph1 -e2r3i4an. -e3spac6i -eth1y6l1ene -5eu2clid1 -feb1rua -fermi1o -3fich -fit5ted. -fla1g6el -flow2er. -3fluor -gen2cy. -ge3o1d -ght1we -g1lead -get2ic. -4g1lish -5glo5bin -1g2nac -gnet1ism -gno5mo -g2n1or. -g2noresp -2g1o4n3i1za -graph5er. -griev1 -g1utan -hair1s -ha2p3ar5r -hatch1 -hex2a3 -hite3sid -h3i5pel1a4 -hnau3z -ho6r1ic. -h2t1eou -hypo1tha -id4ios -ifac1et -ign4it -ignit1er -i4jk -im3ped3a -infra1s2 -i5nitely. -irre6v3oc -i1tesima -ith5i2l -itin5er5ar -janu3a -japan1e2s -je1re1m -1ke6ling -1ki5netic -1kovian -k3sha -la4c3i5e -lai6n3ess -lar5ce1n -l3chai -l3chil6d1 -lead6er. -lea4s1a -1lec3ta6b -le3g6en2dre -1le1noid -lith1o5g -ll1fl -l2l3ish -l5mo3nell -lo1bot1o1 -lo2ges. -load4ed. -load6er. -l3tea -lth5i2ly -lue1p -1lunk3er -1lum5bia. -3lyg1a1mi -ly5styr -ma1la1p -m2an. -man3u1sc -mar1gin1 -medi2c -med3i3cin -medio6c1 -me3gran3 -m2en. -3mi3da5b -3milita -mil2l1ag -mil5li5li -mi6n3is. -mi1n2ut1er -mi1n2ut1est -m3ma1b -5maph1ro1 -5moc1ra1t -mo5e2las -mol1e5c -mon4ey1l -mono3ch -mo4no1en -moro6n5is -mono1s6 -moth4et2 -m1ou3sin -m5shack2 -mu2dro -mul2ti5u -n3ar4chs. -n3ch2es1t -ne3back -2ne1ski -n1dieck -nd3thr -nfi6n3ites -4n5i4an. -nge5nes -ng1ho -ng1spr -nk3rup -n5less -5noc3er1os -nom1a6l -nom5e1no -n1o1mist -non1eq -non1i4so -5nop1oly. -no1vemb -ns5ceiv -ns4moo -ntre1p -obli2g1 -o3chas -odel3li -odit1ic -oerst2 -oke1st -o3les3ter -oli3gop1o1 -o1lo3n4om -o3mecha6 -onom1ic -o3norma -o3no2t1o3n -o3nou -op1ism. -or4tho3ni4t -orth1ri -or5tively -o4s3pher -o5test1er -o5tes3tor -oth3e1o1s -ou3ba3do -o6v3i4an. -oxi6d1ic -pal6mat -parag6ra4 -par4a1le -param4 -para3me -pee2v1 -phi2l3ant -phi5lat1e3l -pi2c1a3d -pli2c1ab -pli5nar -poin3ca -1pole. -poly1e -po3lyph1ono -1prema3c -pre1neu -pres2pli -pro2cess -proc3i3ty. -pro2g1e -3pseu2d -pseu3d6o3d2 -pseu3d6o3f2 -pto3mat4 -p5trol3 -pu5bes5c -quain2t1e -qu6a3si3 -quasir6 -quasis6 -quin5tes5s -qui3v4ar -r1abolic -3rab1o1loi -ra3chu -r3a3dig -radi1o6g -r2amen -3ra4m5e1triz -ra3mou -ra5n2has -ra1or -r3bin1ge -re2c3i1pr -rec5t6ang -re4t1ribu -r3ial. -riv1o1l -6rk. -rk1ho -r1krau -6rks. -r5le5qu -ro1bot1 -ro5e2las -ro5epide1 -ro3mesh -ro1tron -r3pau5li -rse1rad1i -r1thou -r1treu -r1veil -rz1sc -sales3c -sales5w -5sa3par5il -sca6p1er -sca2t1ol -s4chitz -schro1ding1 -1sci2utt -scrap4er. -scy4th1 -sem1a1ph -se3mes1t -se1mi6t5ic -sep3temb -shoe1st -sid2ed. -side5st -side5sw -si5resid -sky1sc -3slova1kia -3s2og1a1my -so2lute -3s2pace -1s2pacin -spe3cio -spher1o -spi2c1il -spokes5w -sports3c -sports3w -s3qui3to -s2s1a3chu1 -ss3hat -s2s3i4an. -s5sign5a3b -1s2tamp -s2t1ant5shi -star3tli -sta1ti -st5b -1stor1ab -strat1a1g -strib5ut -st5scr -stu1pi4d1 -styl1is -su2per1e6 -1sync -1syth3i2 -swimm6 -5tab1o1lism -ta3gon. -talk1a5 -t1a1min -t6ap6ath -5tar2rh -tch1c -tch3i1er -t1cr -teach4er. -tele2g -tele1r6o -3ter1gei -ter2ic. -t3ess2es -tha4l1am -tho3don -th1o5gen1i -tho1k2er -thy4l1an -thy3sc -2t3i4an. -ti2n3o1m -t1li2er -tolo2gy -tot3ic -trai3tor1 -tra1vers -travers3a3b -treach1e -tr4ial. -3tro1le1um -trof4ic. -tro3fit -tro1p2is -3trop1o5les -3trop1o5lis -t1ro1pol3it -tsch3ie -ttrib1ut1 -turn3ar -t1wh -ty2p5al -ua3drati -uad1ratu -u5do3ny -uea1m -u2r1al. -uri4al. -us2er. -v1ativ -v1oir5du1 -va6guer -vaude3v -1verely. -v1er1eig -ves1tite -vi1vip3a3r -voice1p -waste3w6a2 -wave1g4 -w3c -week1n -wide5sp -wo4k1en -wrap3aro -writ6er. -x1q -xquis3 -y5che3d -ym5e5try -y1stro -yes5ter1y -z3ian. -z3o1phr -z2z3w -% end of additional patterns. -} -% DEK's hyphenation exception list, from hyphen.tex; not changed. -\hyphenation{ -as-so-ciate -as-so-ciates -dec-li-na-tion -oblig-a-tory -phil-an-thropic -present -presents -project -projects -reci-procity -re-cog-ni-zance -ref-or-ma-tion -ret-ri-bu-tion -ta-ble -} diff --git a/scripts/LinuxManBook/hyphenex.en b/scripts/LinuxManBook/hyphenex.en deleted file mode 100644 index 768c0af..0000000 --- a/scripts/LinuxManBook/hyphenex.en +++ /dev/null @@ -1,115 +0,0 @@ -% Hyphenation exceptions for US English, -% based on hyphenation exception log articles in TUGboat. -% -% Copyright 2008 TeX Users Group. -% You may freely use, modify and/or distribute this file. -% -% Stripped down by the GNU roff project to only include the patterns -% that hyphenate differently when using the hyph-utf8 project's -% hyph-en-us.tex file (version 2005-05-30). -% -% Please contact the TUGboat editorial staff <tugboat@tug.org> -% for corrections and omissions. -% -\hyphenation{ - anti-deriv-a-tive - anti-deriv-a-tives - bathy-scaphe - co-designer - co-designers - electro-mechan-i-cal - electro-mechano-acoustic - fluoro-car-bon - free-loaders - grand-uncle - grand-uncles - griev-ances - ignore-spaces - im-ped-ances - input-enc - line-spacing - meta-stable - meta-table - meta-tables - micro-eco-nomic - micro-eco-nomics - micro-econ-omy - micro-en-ter-prise - micro-en-ter-prises - micro-organ-ism - micro-organ-isms - mid-after-noon - mine-sweepers - mono-spacing - nitro-meth-ane - non-euclid-ean - ortho-nitro-toluene - para-di-methyl-benzene - para-fluoro-toluene - phe-nol-phthalein - phtha-lam-ic - phthal-ate - phthi-sis - pre-proces-sor - pre-proces-sors - re-imple-ment - re-imple-ments - re-imple-mented - re-imple-men-ta-tion - ring-leaders - round-table - round-tables - single-space - single-spaced - single-spacing - sky-scrapers - sports-writers - sub-tables - super-deri-va-tion - super-deri-va-tions - super-ego - super-egos - waste-water - Bembo - Chiang - Cohen - Duane - Engle - Engel - Hibbs - Hoek-water - Huber - Image-Magick - Krishna - Krish-na-ism - Krish-nan - Le-gendre - Lucas - MacBeth - Nietz-sche - Noord-wijker-hout - Open-Office - Pres-by-terian - Pres-by-terians - Pyong-yang - Ra-dha-krish-nan - Ravi-kumar - Reich-lin - Schwert - Skoup - Thiruv-ananda-puram - Vieth - viiith - viith - xviiith - xviith - xxiiird - xxiind - Ying-yong Shu-xue Ji-suan -} -% Here's an erratum from the aforementioned hyph-en-us.tex. -\hyphenation{ - dem-o-crat -} - -% EOF diff --git a/scripts/LinuxManBook/prepare.pl b/scripts/LinuxManBook/prepare.pl new file mode 100755 index 0000000..735cfcf --- /dev/null +++ b/scripts/LinuxManBook/prepare.pl @@ -0,0 +1,248 @@ +#!/usr/bin/perl -w +# +# BuildLinuxMan.pl : Build Linux manpages book +# Deri James (& Brian Inglis) : 15 Dec 2022 +# +# Params:- +# +# $1 = Directory holding the man pages +# +# (C) Copyright 2022, Deri James +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details +# (http://www.gnu.org/licenses/gpl-2.0.html). +# + +use strict; +use File::Basename; + +my $inTS=0; +my $inBlock=0; + +my %Sections= +( + "1" => "General Commands Manual", + "2" => "System Calls Manual", + "2type" => "System Calls Manual (types)", + "3" => "Library Functions Manual", + "3const" => "Library Functions Manual (constants)", + "3head" => "Library Functions Manual (headers)", + "3type" => "Library Functions Manual (types)", + "4" => "Kernel Interfaces Manual", + "5" => "File Formats Manual", + "6" => "Games Manual", + "7" => "Miscellaneous Information Manual", + "8" => "System Manager's Manual", + "9" => "Kernel Developer's Manual", +); + +my $dir=shift || '.'; +my $dir2=$dir; +$dir2=~tr[.][_]; +my %files; +my %aliases; +my %target; + +foreach my $al (`grep -E '^\\.so' $dir/man*/*`) +{ + #$al=~tr[.][_]; + $al=~m/^$dir\/man\d[a-z]*\/(.*):\.\s*so\s*man\d[a-z]*\/(.*)/o; + + $aliases{$1}=$2; +} + +while (my ($k,$v)=each %aliases) +{ + while (exists($aliases{$v})) { + $v=$aliases{$v}; + } +} + +foreach my $fn (glob "$dir/man*/*") +{ + my ($nm,$sec)=GetNmSec($fn,qr/\.\d[a-z]*/); + $files{"${nm}.$sec"}=[$fn,(exists($aliases{"${nm}.$sec"}))?$aliases{"${nm}.$sec"}:"${nm}.$sec"]; +} + +my $Section=''; + +BuildBook(); + +sub BuildBook +{ + print ".pdfpagenumbering D . 1\n.nr PDFOUTLINE.FOLDLEVEL 0\n.defcolor pdf:href.colour rgb 0.00 0.25 0.75\n.pdfinfo /Title \"The Linux man-pages Book\"\n.special TINOR S\n"; + + foreach my $bkmark (sort sortman keys %files) { + BuildPage($bkmark); + } +} + +sub BuildPage +{ + my $bkmark=shift; + + my $fn=$files{$bkmark}->[0]; + my ($nm,$sec,$srt)=GetNmSec($bkmark,qr/\.[\da-z]+/); + + my $title= "$nm\\($sec\\)"; + + print ".\\\" >>>>>> $nm($sec) <<<<<<\n.lf 0 $bkmark\n"; + + # If this is an alias, just add it to the outline panel. + + # if new section add top level bookmark + + if ($sec ne $Section) { + print ".nr PDFOUTLINE.FOLDLEVEL 1\n"; + print ".pdfbookmark 1 $Sections{$sec}\n"; + print ".nr PDFOUTLINE.FOLDLEVEL 2\n"; + $Section=$sec; + } + + if (exists($aliases{$bkmark})) { + print ".eo\n.device ps:exec [/Dest /$aliases{$bkmark} /Title ($title) /Level 2 /OUT pdfmark\n.ec\n.fl\n"; + return; + } + + if (open(F,'<',$fn)) { + while (<F>) { + if (m/^\.\\"/) { + print $_; + next; + } + + chomp; + + # This code is to determine whether we are within a tbl block and in a text block + # T{ and T}. This is fudge code particularly for the syscalls(7) page. + + $inTS=1 if m/\.TS/; + $inTS=0,$inBlock=0 if m/\.TE/; + + next if !$_; +# s/^\s+//; + + s/\\-/-/g if /^\.[BM]R\s+/; + + if (m/^\.BR\s+([-\w\\.]+)\s+\((.+?)\)(.*)/ or m/^\.MR\s+([-\w\\.]+)\s+(\w+)\s+(.*)/ or m/^\\fB([-\w\\.]+)\\fR\((.+?)\)(.*)$/) { + my $bkmark="$1"; + my $sec=$2; + my $after=$3; + $after=~s/\s\\".*//; + my $dest=$bkmark; + $dest=~s/\\-/-/g; + + if (exists($files{"${bkmark}.$sec"})) { + my $dest=$files{"${bkmark}.$sec"}->[1]; + $_=".pdfhref L -D \"$dest\" -A \"$after\" -- \\fI$bkmark\\fP($sec)"; + } else { + $_=".IR $bkmark ($sec)\\c\n$after"; + } + } + + s/^\.BI \\fB/.BI /; + s/^\.BR\s+(\S+)\s*$/.B $1/; + s/^\.BI\s+(\S+)\s*$/.B $1/; + s/^\.IR\s+(\S+)\s*$/.I $1/; + + # Fiddling for syscalls(7) :-( + + if ($inTS) { + my @cols=split(/\t/,$_); + + foreach my $c (@cols) { + $inBlock+=()=$c=~m/T\{/g; + $inBlock-=()=$c=~m/T\}/g; + + my $mtch=$c=~s/\s*\\fB([-\w.]+)\\fP\((\w+)\)/doMR($1,$2)/ge; + $c="T{\n${c}\nT}" if $mtch and !$inBlock; + } + + $_=join("\t",@cols); + s/\n\n/\n/g; + } + + s/\\&\././ if m/^.TH /; + + if (m/^\.TH\s+"?([-\w\\.]+)"?\s+"?(\w+)"?/) { + + print "$_\n"; + + # Add a level two bookmark. We don't set it in the TH macro since the name passed + # may be different from the filename, i.e. file = unimplemented.2, TH = UNIMPLEMENTED 2 + + print ".pdfbookmark -T $bkmark 2 $nm($sec)\n"; + + next; + } + print "$_\n"; + } + close(F); + } +} + +sub doMR +{ + my $nm=shift; + my $sec=shift; + + if (exists($files{"${nm}.$sec"})) { + return("\n.pdfhref L -D \"$files{\"${nm}.$sec\"}->[1]\" -A \"\\c\" -- \\fI$nm\\fP($sec)\n"); + } else { + return("\\fI$nm\\fP($sec)"); + } +} + +sub GetNmSec +{ + my ($nm,$pth,$sec)=fileparse($_[0],$_[1]); + $sec=substr($sec,1); + my $srt=$nm; + $srt=~s/\..+?$//; + $srt=~s/^_+//; + $srt=$1.sprintf("%04d",$2) if $srt=~m/^(.+)(\d+)$/; + #$srt="$sec/$srt"; + return($nm,$sec,$srt); +} + +# add rpmvercmp +#use RPM::VersionSort; +#use Sort::Versions; + +sub sortman +{ +# Sort - ignore case but frig it so that intro is the first entry. + + my (undef,$s1,$c)=GetNmSec($a,qr/\.\d[a-z]*/); + my (undef,$s2,$d)=GetNmSec($b,qr/\.\d[a-z]*/); + + my $cmp=$s1 cmp $s2; + + return $cmp if $cmp; + return -1 if ($c=~m/^intro/ and $d!~m/^intro/); + return 1 if ($d=~m/^intro/ and $c!~m/^intro/); + $c=~tr[-_(][!" ]; + $d=~tr[-_(][!" ]; + $cmp=lc($c) cmp lc($d); + return($c cmp $d) if $cmp == 0; + return($cmp); +} + +sub strhex +{ + my $res=''; + + foreach my $c (split('',$_[0])) { + $res.=sprintf("%02X",ord($c)); + } + + return($res); +} diff --git a/scripts/LinuxManBook/troffrc b/scripts/LinuxManBook/troffrc deleted file mode 100644 index a2784d7..0000000 --- a/scripts/LinuxManBook/troffrc +++ /dev/null @@ -1,71 +0,0 @@ -.\" startup file for GNU troff -.\" -.\" Use .do for any groff extensions so that this file works with -C. -. -.\" This is tested by pic. -.nr 0p 0 -. -.\" Load composite mappings. -.do mso composite.tmac -. -.\" Load generic fallback mappings. -.do mso fallbacks.tmac -. -.\" The groff command defines the .X register if -X was given. -.do ie r .X \ -. do ds troffrc!ps Xps.tmac -.el \ -. do ds troffrc!ps ps.tmac -.do ds troffrc!pdf pdf.tmac -.do ds troffrc!dvi dvi.tmac -.do ds troffrc!X75 X.tmac -.do ds troffrc!X75-12 X.tmac -.do ds troffrc!X100 X.tmac -.do ds troffrc!X100-12 X.tmac -.do ds troffrc!ascii tty.tmac -.do ds troffrc!latin1 tty.tmac -.do ds troffrc!utf8 tty.tmac -.do ds troffrc!cp1047 tty.tmac -.do ds troffrc!lj4 lj4.tmac -.do ds troffrc!lbp lbp.tmac -.do ds troffrc!html html.tmac -.do if d troffrc!\*[.T] \ -. do mso \*[troffrc!\*[.T]] -.do rm \ -troffrc!ps \ -troffrc!pdf \ -troffrc!dvi \ -troffrc!X75 \ -troffrc!X75-12 \ -troffrc!X100 \ -troffrc!X100-12 \ -troffrc!ascii \ -troffrc!latin1 \ -troffrc!utf8 \ -troffrc!cp1047 \ -troffrc!lj4 \ -troffrc!lbp \ -troffrc!html -. -.\" Test whether we work under EBCDIC and map the no-break space -.\" character accordingly. -.do ie '\[char97]'a' \ -. do tr \[char160]\~ -.el \ -. do tr \[char65]\~ -. -.\" Set the input localization to English. -.do mso en.tmac -. -.\" Handle paper formats on typesetting devices. -.if t .do mso papersize.tmac -. -.\" Handle Encapsulated PostScript images. -.do mso pspic.tmac -.do mso pdfpic.tmac -. -.\" Local Variables: -.\" mode: nroff -.\" fill-column: 72 -.\" End: -.\" vim: set filetype=groff textwidth=72: diff --git a/scripts/LinuxManBook/utp.mac b/scripts/LinuxManBook/utp.mac deleted file mode 100644 index ed9027a..0000000 --- a/scripts/LinuxManBook/utp.mac +++ /dev/null @@ -1,742 +0,0 @@ -.ig -vim:syntax=off - -Macros for typesetting _Unix Text Processing_. -Based on the macros from Chapter 17 and Appendix F -of that book. - -Adapted by Jon Snader as part of a project to make this classic -book available again. - -Version of 16 November 2002 -.. -.RT -.nr nH 0 \" don't number [ABCD]-heads -.nr gE 0 \" don't add chapter number to [ABCD]-heads -.nr chapter_page 0 \" avoid diag. if there's no .Se call -.ds chapter_name -\# -\# Redefine LP so that it can take an argument to suppress spacing -\# -.de par*start*nospace -.ds@auto-end -.nr \\n[.ev]:pli \\$1 -.nr \\n[.ev]:pri \\$2 -.par@reset -.ne 1v+\\n(.Vu -.. -.de LP \"Non indented paragraph. Don't skip space if \\$1 == 0 -.ie '\\$1'0' .par*start*nospace 0 0 -.el .par*start 0 0 -.nr \\n[.ev]:ai \\n[\\n[.ev]:PI] -.. -\# -\# Nh - set behavior of numbered headings -\# $1: -\# 0 - no numbering -\# 1 - number all headings -\# 2 - number A-head only -\# -\# $2 (if present): -\# 0 - don't add section numbers to headers -\# 1 - prefix headers with section number -\# -.de Nh -. nr nH \\$1 -. if !'\\$2'' .nr gE \\$2 -.. -\# -\# Square centered vertically -\# -.ds square \v'-.25v'\s6\(sq\s0\v'.25v' -\# -\# Special A-head for UTP -\# -.de utp_Ah -.sp 26p -.RT -.pdfbookmark 2 \\$1 -.ne 6 -.ps 14 -.vs 16 -.lg 0 -.ce -\fB\*[square] \\$1 \*[square]\fP -.LP 0 -.lg -.sp 18p -.ns -.if \\n[Ref] .tm Ah: \\*[PDFBOOKMARK.NAME] \\n(PN \\$1 -.. -\# -\# The [ABCD]-head macros -\# -.de standard_Ah \" A-head. $1: title -.sp 26p -.RT -.ne 6 -.ps 14 -.vs 16 -.lg 0 -.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ -\fB\c -.if \\n[nH] \{. \"if producing numbered headings -. ie \\n[gE] .sec# 2 \" if Se (chapter) macro is -. \" numbered, then this is on the second level -. el .sec# 1 \" otherwise it's on the first level -.\} -\&\\$1\fP -.LP 0 \" reset paragraph, but not font size, etc. -.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz -.lg -.sp 18p -.ns -.. -.als Ah standard_Ah -\# -.de Bh \" B-head. $1: title -.sp 23p -.pdfbookmark 3 \\$1 -.RT -.ne 6 -.ps 14 -.vs 16 -.lg 0 -\fB\c -.if '\\n[nH]'1' \{. \"if producing numbered headings -. ie \\n[gE] .sec# 3 \" if Se (chapter) macro is -. \" numbered, then this is on the third level -. el .sec# 2 \" otherwise it's on the second level -.\} -\&\\$1\fP -.LP 0 \" reset paragraph, but not font size, etc. -.lg -.sp 15.5p -.ns -.. -\# -.de Ch \" C-head. $1: title -.sp 18p -.RT -.ne 6 -.ps 12 -.vs 14 -.lg 0 -\fB\c -.if '\\n[nH]'1' \{. \"if producing numbered headings -. ie \\n[gE] .sec# 4 \" if Se (chapter) macro is -. \" numbered, then this is on the fourth level -. el .sec# 3 \" otherwise it's on the third level -.\} -\&\\$1\fP -.LP 0 \" reset paragraph, but not font size, etc. -.lg -.sp 12p -.ns -.. -\# -.de Dh \" D-head. $1: title -.sp 18p -.RT -.ne 6 -.ps 10 -.vs 12 -.lg 0 -\fB\c -.if '\\n[nH]'1' \{. \"if producing numbered headings -. ie \\n[gE] .sec# 5 \" if Se (chapter) macro is -. \" numbered, then this is on the fifth level -. el .sec# 4 \" otherwise it's on the fourth level -.\} -\&\\$1.\fP -.lg -.. -\# -\# The Section macro -\# -\# This is for Chapters and Appendices -\# -.de Se \" Section. $1: number, $2: name -. \" $3: type (Chapter, Appendix, ...) -. \" $4: non-null => don't map to uppercase -.if e \{\ -\& -.bp -.\} -.ds chapter_name \\$2 -.ie !'\\$1'' \{. \" If we have a section number -. utpbookmark -T "\\$3\\$1" 1 "\\$1. \\$2" -. ds chapter_head \\$1 -. nr is_alpha 0 -. if '\\$1'A' .set_section 1 -. if '\\$1'B' .set_section 2 -. if '\\$1'C' .set_section 3 -. if '\\$1'D' .set_section 4 -. if '\\$1'E' .set_section 5 -. if '\\$1'F' .set_section 6 -. if '\\$1'G' .set_section 7 -. if '\\$1'H' .set_section 8 -. if '\\$1'I' .set_section 9 -. if '\\$1'J' .set_section 10 -. if '\\$1'K' .set_section 11 -. if '\\$1'L' .set_section 12 -. if '\\$1'M' .set_section 13 -. if '\\$1'N' .set_section 14 -. if '\\$1'O' .set_section 15 -. if '\\$1'P' .set_section 16 -. if '\\$1'Q' .set_section 17 -. if '\\$1'R' .set_section 18 -. if '\\$1'S' .set_section 19 -. if '\\$1'T' .set_section 20 -. if '\\$1'U' .set_section 21 -. if '\\$1'V' .set_section 22 -. if '\\$1'W' .set_section 23 -. if '\\$1'X' .set_section 24 -. if '\\$1'Y' .set_section 25 -. if '\\$1'Z' .set_section 26 -. if !\\n[is_alpha] \{\ -. nr section \\$1 -. nr intH1 \\$1 -. \} -.\} -.el \{. \" Illegal Chapter Appendix number -. nr section 0 -. utpbookmark -T \\$2 1 \\$2 -. \" Might be Preface, etc. so no error diag. -.\} -.nr chapter_page2 1 \" Next page starts a chapter, so no header -.if \\n[%]>1 .bp -.nr PN \\n[%] -.ie '\\$3'NONE' .af PN i -.el .af PN 1 -.nr chapter_page 1 \" This page starts a chapter, number at bottom -.if !\\n[gE] .nr intH1 0 -.nr intH2 0 \" rescind lower level numbering -.nr intH3 0 -.nr intH4 0 -.nr intH5 0 -.nr fig_num 0 \" Reset figure number -.nr table_num 0 \" Reset table number -.format_section "\\$1" "\\$2" \\$3 \\$4 -.ie '\\$1'' \{\ -.ie '\\$2'' .if \\n[Ref] .tm Se: \\*[PDFBOOKMARK.NAME] \\n(PN \\$3 -.el .if \\n[Ref] .tm Se: \\*[PDFBOOKMARK.NAME] \\n(PN \\$1 \\$2 -.\} -.el .if \\n[Ref] .tm Se: \\*[PDFBOOKMARK.NAME] \\n(PN \\$1 \\$2 -.. -\# -\# Set section number for alphabet chapters (appendices) -\# -.de set_section -.nr intH1 \\$1 -.af intH1 A -.nr section \\$1 -.nr is_alpha 1 -.. -\# -\# Draw a horizontal line -\# -.de horizontal_line -.br -\l'\\n[.l]u-\\n[.i]u\&\\$1' -.br -.. -.als Hl horizontal_line -\# -\# Standard Section Formatting Routine -\# -.de format_standard_section -.RT -.in 0 -.lg 0 -.if '\\$4'' .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ -.sp -.na -.\" Set section type--default is Chapter -.ie !'\\$3'' \{\ -. ie '\\$3'NONE' .ds chapter_type -. el .ds chapter_type \\$3 -.\} -.el .ds chapter_type Chapter -.\" If there is a section number, output Type and section number -.if !'\\$1'' \s14\fB\\*[chapter_type] \\$1\fP\s0 -.\" If there is no section number, but there is a type, then output it -.if '\\$1'' .if !'\\$3'' \s14\fB\\*[chapter_type]\fP\s0 -.sp 5p -.\" Print the section title if there is one -\#.if !'\\$2'' \s14\fB\\$2\fP\s0 -.if !'\\$2'' \{\ -.ps 14 -.B -\&\\$2 -.R -.ps \\n[PS] \" Reset to PS in case of inline \s -.\} -.sp 6p -.ad b \" Adjust both margins -.horizontal_line \" Draw horizontal line -.if '\\$4'' .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz -.sp 3 -.ns -.. -.als format_section format_standard_section -\# -\# numbered header Macros -\# Special version of NH to generate just the string -\# Used internally. -\# -.de sec# -.nr NS \\$1 \" Current level -.if !\\n[.$] .nr NS 1 \" Default is level 1 -.if !\\n[NS] .nr NS 1 \" In case it's NULL or negative -.nr intH\\n[NS] +1 \" Increment count on current level -.\" Rescind lower levels -.if !\\n[NS]-4 .nr intH5 0 -.if !\\n[NS]-3 .nr intH4 0 -.if !\\n[NS]-2 .nr intH3 0 -.if !\\n[NS]-1 .nr intH2 0 -.\" Build up the string -.if !\\$1 .if \\n[.$] .nr intH1 1 -.ds SN \\n[intH1] -.ie \\n[NS]-1 .as SN .\\n[intH2] -.el .as SN . \" either x.y or x. -.if \\n[NS]-2 .as SN .\\n[intH3] -.if \\n[NS]-3 .as SN .\\n[intH4] -.if \\n[NS]-4 .as SN .\\n[intH5] -'ti \\n[.i]u -\\*[SN] \" print answer -.. -\# -\# Figure start and end macros -\# -.de Fs \" start figure $1: reserved space $2: float figure -.RT -.ie 'F'\\$2' \{. \" if figure can float -. nr floating_keep 1 -. KF -.\} -.el .nr floating_keep 0 -.if !'\\$1'' \{. \" if space specified -. ne \\$1 -. fl -. rs -. sp \\$1 -.\} -.. -.de Fe \" end figure $1: title -.sp -.nr fig_num +1 \" increment figure counter -.ie \\n[section] .ds figure \\*[chapter_head].\\n[fig_num] -.el .ds figure \\n[fig_num] -.ce -\f[BI]Figure \\*[figure] \\$1\fP -.sp -.if \\n[floating_keep] .KE -.. -\# -\# Table start and end macros -\# -.de Ts \" table start $1: title -.nr table_num +1 \" increment table number -.ie \\n[section] .ds table \\*[chapter_head].\\n[table_num] -.el .ds table \\n[table_num] -.sp -.ce -\f[BI]Table \\*[table] \\$1\fP -.LP -.. -.de Te -.RT -.sp -.. -\# -\# Numbered lists -\# -.nr l0 0 1 -.de Ls -.\" list start $1: A - ALPHA -.\" a - alpha -.\" B - bullet -.\" N - numeric -.\" R - ROMAN NUMERALS -.\" r - roman numerals -.\" $2: indent -.\" $3: alternate bullet character -.br -.if !'\\$1'A' .if !'\\$1'a' .if !'\\$1'B' .if !'\\$1'N' \ -. if !'\\$1'R' .if !'\\$1'r' .if !'\\$1'' \ -. tm Ls: Need A, a, B, N, R, or r as type -.nr l\\n+[l0] 0 1 -.ie '\\$1'' \{. \" set defaults -. if '\\n[l0]'1' .af l\\n[l0] 1 \"numeric at 1st level -. if '\\n[l0]'2' .af l\\n[l0] a \"alpha at 2nd level -. if '\\n[l0]'3' .af l\\n[l0] i \"roman at 3rd level -. if '\\n[l0]'4' .ds l\\n[l0] \(bu \"bullet at 4th level -. if '\\n[l0]'5' .ds l\\n[l0] \- \"dash at 5th level -. if \\n[l0]-5 .ds l\\n[l0] \(bu \"bullet above 5th level -. if \\n[l0]-3 .nr l\\n[l0] 0-1 \"mark bullet and dash as non-incrementing -.\} -.el \{\ -. if '\\$1'A' .af l\\n[l0] A -. if '\\$1'a' .af l\\n[l0] a -. if '\\$1'B' \{\ -. ie '\\$3'' .ds l\\n[l0] \(bu -. el .ds l\\n[l0] \\$3 -. nr l\\n[l0] 0-1 \"mark as non-incrementing -. \} -. if '\\$1'R' .af l\\n[l0] I -. if '\\$1'r' .af l\\n[l0] i -.\} -.ie !'\\$2'' .nr i\\n[l0] \\$2 \"set list indent -.el .nr i\\n[l0] 5 \"default indent -.RS -.. -.de Li \" List start $1 == 0: no blank line preceding -.br -.if '\\$1'0' .ns -.ie '\\n[l\\n[l0]]'-1' .intIP "\\*[l\\n[l0]]" "\\n[i\\n[l0]]" -.el \{\ -. nr l\\n[l0] +1 -. intIP "\\n[l\\n[l0]]." "\\n[i\\n[l0]]" -.\} -.. -.de Le \" List end $1 == 0: no blank line after -.br -.rr l\\n[l0] \" remove number registers -.rr i\\n[l0] -.rm l\\n[l0] \" and string register, if any -.nr l0 -1 \" back one level of nesting -.RE -.ie !\\n[l0] \{\ -. ie '\\$1'0' .LP 0 -. el .LP -.\} -.el .if !'\\$1'0' .sp \\n[PD]u -.. -\# -\# intIP - internal version of IP that centers tag -\# -.de intIP -.sp \\n[PD]u -.in \\n[\\n[.ev]:il]u*\\n[PI]u-\\n[PI]u+\\$2n -.nr indent1 \\$2n/2u+\w'\\$1' \" amount to move left -\#.nr indent2 \\$2n+\w'\\$1' \" amount to move back -\#.ta \\n[indent2]u -.ta \\n[indent1]u -.ti -\\n[indent1]u -\\$1\t\c -.. -\# -\# Printout and listing macros -\# -.ev printout \" set up the listing environment -.ns -.ps 9 -.vs 10 -.ft C -.nf -.ev -.de Ps \" printout start $1: indent -.br -.ev printout -.sp \\n[PD]u -.ie !'\\$1'' .in +\\$1n -.el .in +5n -.. -.de Pe \" printout end $1: non-null => no following space -.br -.if '\\$1'' .sp \\n[PD]u -.in -.ev -.. -\# -\# X[1-4]: Side by side virtual display screens -\# Contributed by Heinz-Jürgen Oertel -\# -.\" Macro definition -.\" window width -.\" Should be calculated, so that the width is 25 equal spaced chars -.nr my_wid \w'\f(CW12345678901234567890123456\fP' -.de X1 -.sp -.mk x_box -.nf -.\" left and right page offset -.po +(u;\\n[.ll]/40) -.ll \n[my_wid]u -.in +1n -.CW -.. -.de X2 -.mk here -.in -1n -.draw_screen \n[my_wid]u \\n[here]u-\\n[x_box]u+\\n[.v]u -.po +(u;\n[my_wid]) -.\" line length of the centered text -.ll (u;(\\n[LL]u)-(2*\n[my_wid]u)-(\\n[LL]/20u)) -.sp |\\n[x_box]u -.ce 10 -.R -.. -.de X3 -.ce 0 -.sp |\\n[x_box]u -.po +(u;(\\n[LL]u)-(2*\n[my_wid]u)-(\\n[LL]/20u)) -.ll \n[my_wid]u -.nf -.in +1n -.CW -.. -.de X4 -.in -1n -.draw_screen \n[my_wid]u \\n[here]u-\\n[x_box]u+\\n[.v]u -.R -.fi -.po \\n(POu -.ll \\n(LLu -.. -\# -\# Helvetica font change macros -\# -.de H \" Helvetica -.ie !\\n[.$] .ft H -.el \&\\$3\fH\\$1\fP\\$2 -.. -.de HB \" Helvetica Bold -.ie !\\n[.$] .ft HB -.el \&\\$3\f[HB]\\$1\fP\\$2 -.. -.de HI \" Helvetica Italic -.ie !\\n[.$] .ft HI -.el \&\\$3\f[HI]\\$1\fP\\$2 -.. -\# -\# Screen Boxes -\# -.de draw_screen \" Draw box with rounded corners, $1: wid $2: ht -.nr radius (((\\$1)<?(\\$2))/4u)<?.25i -\v'-\\n[radius]u'\D'a \\n[radius]u 0 0 \\n[radius]u'\c -\D'l (\\$1)-(2u*\\n[radius]u) 0'\c -\D'a 0 -\\n[radius]u \\n[radius]u 0'\D'l 0 -(\\$2)+(2u*\\n[radius]u)'\c -\D'a -\\n[radius]u 0 0 -\\n[radius]u'\D'l -(\\$1)+(2u*\\n[radius]u) 0'\c -\D'a 0 \\n[radius]u -\\n[radius]u 0'\D'l 0 (\\$2)-(2u*\\n[radius]u)' -.. -.de SS -.nr li_save \\n[\\n[.ev]:li] -.nr ri_save \\n[\\n[.ev]:ri] -.nr \\n[.ev]:li +3n -.nr \\n[.ev]:ri +3n -.br -.sp \\n[SS_prefix]u -.ie \\n[.$] \{\ -. nr width \\$1 -. nr height \\$2 -. mk screen_start -.\} -.el .nr width 0 -.di screen_div -.sp .5v -.in +3n \" Leave extra room for the rounded corners -.ll -3n -.lt -3n -\& -.. -.de SE -.br -.di -.ne \\n[dn]u -.ev nf -.screen_div -.ev -.in -3n -.ll +3n -.lt +3n -.nr \\n[.ev]:li \\n[li_save] -.nr \\n[.ev]:ri \\n[ri_save] -.ie !\\n[width] \{\ -. mk screen_end -\#. draw_screen \\n[dl]u+3n \\n[dn]u+\\n[.v]u -. draw_screen \\n[.l]u \\n[dn]u+\\n[.v]u -.\} -.el \{\ -. sp |\\n[screen_start]u+\\n[height]u-\\n[.v]u -. mk screen_end -. draw_screen \\n[width]u \\n[height]u -.\} -.sp |\\n[screen_end]u+1 -.. -\# -\# Notes macros -\# -.nr note_counter 0 -.nr rnotes 0 -.ev notes -.par*env-init -.ll \n[LL]u -.lt \n[LL]u -.ps \n[PS] -.vs \n[VS] -.ev -.de Rn \" Reviewer note, $1: note -.sp -\fBNote to reviewers:\fP \\$1 -.sp -.ev notes -.da rev_notes -.sp 0.2v -.in 0 -.ie \\n[do-page] \(sq Page \\n[PN] (\\*[page-utp]): \\$1 -.el \(sq Page \\n(PN: \\$1 -.br -.da -.nr rnotes 1 -.ev -.. -.de Pn \" Personal note, $1: note -.ev notes -.if \\n[note_counter]<1 .nr note_counter 0 1 -.da pers_notes -.br -.IP \\n+[note_counter]. 5n -\\$1 -.ie \\n[do-page] \ (Page \\n[PN]/\\*[page-utp]) -.el \ (Page \\n(PN) -.br -.da -.ev -.. -\# -\# End Macro -\# -\# Output diverted material -\# -.de EM -.br -.if \\n[rnotes]=1 \{\ -\&\c -' bp -. ce -\fBNotes to Reviewers\fP -. sp 2 -. ev notes -. nf -. rev_notes -. ev -.\} -.if \\n[note_counter]>0 \{\ -. br -\&\c -' bp -. ce -\fBPersonal Notes\fP -. sp 2 -. ev notes -. nf -. pers_notes -. ev -.\} -.. -\# -\# UTP top and bottom page processing -\# -.de utp_top -.ev header_footer -.nr PN \\n[%] -.if !\\n[chapter_page2] \{. \" if this page doesn't start a chapter -. ie o .tl ''\\*[chapter_name]'\\n[PN]' -. el .tl '\\n[PN]'\*[square] Unix Text Processing \*[square]'' -.\} -.ev -.. -.de utp_bottom -.ev header_footer -.if \\n[chapter_page] \{\ -. tl ''\\n[PN]'' -. nr chapter_page 0 -. nr chapter_page2 0 -.\} -.ev -.. -\#.de page -\#.mk page-vpos -\#.nr page-hpos \\n[.k] -\#.po \\n[PO]u-4n -\#.br -\#\\$1 -\#.br -\#.po \\n[PO]u -\#.sp |\\n[page-vpos]u -\#\h'|\\n[page-hpos]u' -\#.. -.de do-page \" Enable the .page macro -.nr do-page 1 -.. -.de page \" Capture the original UTP page numbers -.ds page-utp \\$1 -.if \\n[do-page] \{\ -. mk page-pos -. ev page-env -' di page-num -' nf -\\$1 -. ev -. di -. mk page-trap -. nr page-trap +.1v -. wh \\n[page-trap]u page-put -.\} -.. -.de page-put \" Place the UTP page number in the left margin -.mk page-end -.wh \\n[page-trap]u -'sp |\\n[page-pos]u -.ev page-env -'po \\n[PO]u-5n -'fi -.page-num -.br -.ev -'po \\n[PO]u -'sp |\\n[page-end]u -.. -.de ix -.ie '\\n(.z'' \{\ -. if !'\\$1'%end' \{\ -. ds ixbk ix:bm\\n+[ixno] -. pdfhref M -N \\*[ixbk] -. \} -. if \\n[Ref] .tm ix: \\$* \\n% \\*[ixbk] -.\} -.el \\!.ix \\$* -.. -\# -\# Set defaults for UTP -\# -.de utp -.ps 10 -.vs 12 -.nr PS 10 -.nr VS 12 -.nr SS_prefix 1v -.nr do-page 0 -.Nh 0 0 -.als Ah utp_Ah -.als chapter Se -.als PT utp_top -.als BT utp_bottom -.ev header_footer -.ll \\n[LL]u -.lt \\n[LL]u -.ps \\n[PS] -.vs \\n[VS] -.ev -.. -.de utpbookmark -.ie '\\*[.T]'ps' \{\ -. pdfhref M -N \\$2 -- \\$4 -. if !dpdf:href.map .tm gropdf-info:href \\$2 \\$4 -. pdfbookmark \\$3 \\$4 -.\} -.el .pdfbookmark \\$* -.. -.em EM diff --git a/scripts/README b/scripts/README index 6b29c54..2ad6bc8 100644 --- a/scripts/README +++ b/scripts/README @@ -1,4 +1,4 @@ The files in this directory are scripts for man-pages maintenance tasks. -They may be useful for downstream man-pages package maintainers or for +They may be useful for downstream man-pages package maintainers or for man-pages translators. This directory does not contain any files that need to be installed in order to use the manual pages. diff --git a/scripts/add_parens_for_own_funcs.sh b/scripts/add_parens_for_own_funcs.sh index 1bf6d2a..49ec629 100755 --- a/scripts/add_parens_for_own_funcs.sh +++ b/scripts/add_parens_for_own_funcs.sh @@ -8,13 +8,13 @@ # The problem is how to determine what is a "function name". # The approach this script takes is the following: # -# For each manual page named in the command line that contains +# For each manual page named in the command line that contains # more than one line (i.e., skip man-page link files) # Create a set of names taken from the .SH section of the -# page and from grepping all pages for names that +# page and from grepping all pages for names that # have .so links to this page # For each name obtained above -# If we can find something that looks like a prototype on +# If we can find something that looks like a prototype on # the page, then # Try to substitute instances of that name on the page. # (instances are considered to be words formatted @@ -37,7 +37,7 @@ # # and take a good look at the output. In particular, you can scan # the output for *possible* problems by looking for the pattern: /^%%%/ -# The script's output should be enough to help you determine if the +# The script's output should be enough to help you determine if the # problem is real or not. # # Suggested usage (in this case to fix pages in Section 2): @@ -48,7 +48,7 @@ # Use the "-n" option for a dry run, in order to see what would be # done, without actually doing it. # -# (And, yes, there are many ways that this script could probably be +# (And, yes, there are many ways that this script could probably be # made to work faster...) # ###################################################################### @@ -58,7 +58,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -66,7 +66,7 @@ # (http://www.gnu.org/licenses/gpl-2.0.html). # # -# +# file_base="tmp.$(basename $0)" @@ -96,7 +96,7 @@ done shift $(( $OPTIND - 1 )) -# Only process files with > 1 line -- single-line files are link files +# Only process files with > 1 line -- single-line files are link files for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ grep -v '^total'); do @@ -108,8 +108,8 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ # be our guesses about function names to look for sh_nlist=$(cat $page | \ - awk 'BEGIN { p = 0 } - /^\.SH NAME/ { p = NR } + awk 'BEGIN { p = 0 } + /^\.SH NAME/ { p = NR } /^.SH/ && NR > p { p = 0 } # Stop at the next .SH directive p > 0 && NR > p { print $0 } # These are the lines between # the two .SH directives @@ -117,8 +117,8 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ sh_nlist=$(echo $sh_nlist | sed -e 's/ *\\-.*//' -e 's/, */ /g') echo "### .SH name list:" $sh_nlist - # Some pages like msgop.2 don't actually list the function names in - # the .SH section -- but we can try using link pages to give us + # Some pages like msgop.2 don't actually list the function names in + # the .SH section -- but we can try using link pages to give us # another guess at the right function names to look for so_nlist=$(grep -l "^\\.so.*/$(echo $page| \ @@ -128,11 +128,11 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ echo "### .so name list:" $so_nlist # Combine the two lists, eliminate duplicates - + nlist=$(echo $sh_nlist $so_nlist | tr ' ' '\012' | sort -u) maybechanged=0 - + cp $page $work_dst_file rm -f $matches_for_all_names; # touch $matches_for_all_names @@ -146,7 +146,7 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ echo "########## trying $rname ##########" rm -f $matches_for_this_name - + grep "^.BR* $name *$" $page | \ >> $matches_for_this_name grep "^.BR $name [^(\"]$" $page | \ @@ -155,7 +155,7 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ >> $matches_for_this_name grep '\\fB'"$name"'\\f[PR]$' $page | \ >> $matches_for_this_name - + cat $matches_for_this_name | sed -e 's/^/### MATCH: /' cat $matches_for_this_name >> $matches_for_all_names @@ -163,10 +163,10 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ # like a function prototype for this name in the page if grep -q "$name *(" $page || \ - grep -q "$name\\\\f.[\\ ]*(" $page; then + grep -q "$name\\\\f.[\\ ]*(" $page; then # '.B name$' - # '.BR name [^("]*$ + # '.BR name [^("]*$ # (The use of [^"] in the above eliminates lines # like: .BR func " and " func # Those lines better be done manually.) @@ -211,7 +211,7 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ # If the file was changed, then: # show "diff -U" output to user; - # and count number of changed lines and compare it with what + # and count number of changed lines and compare it with what # we expected, displaying a warning if it wasn't what was expected if test $maybechanged -ne 0 && ! cmp -s $page $work_dst_file; then @@ -220,7 +220,7 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ made_matches=$(diff -U 0 $page $work_dst_file | grep '^\+[^+]' | \ wc -l | awk '{print $1}') - # The following line makes the changes -- comment it out if you + # The following line makes the changes -- comment it out if you # just want to do a dry run to see what changes would be made. if test $really_do_it -ne 0; then @@ -242,8 +242,8 @@ for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ echo "%%%%%%%%%% WARNING: NOT ENOUGH MATCHES: " \ "$made_matches < $min_match" fi - -done + +done # clean up diff --git a/scripts/convert_to_utf_8.sh b/scripts/convert_to_utf_8.sh index 28f5a72..b0d222c 100755 --- a/scripts/convert_to_utf_8.sh +++ b/scripts/convert_to_utf_8.sh @@ -17,7 +17,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/scripts/find_dots_no_parens.sh b/scripts/find_dots_no_parens.sh index 79d1c32..27072d3 100755 --- a/scripts/find_dots_no_parens.sh +++ b/scripts/find_dots_no_parens.sh @@ -8,13 +8,13 @@ # This script is designed to help with "by hand" tidy-ups after # the automated changes made by add_parens_for_own_funcs.sh. # -# The first argument to this script names a manual page directory where -# 'man2' and 'man3' subdirectories can be found. The pages names in -# these directories are used to generate a series of regular expressions -# that can be used to search the manual page files that are named in +# The first argument to this script names a manual page directory where +# 'man2' and 'man3' subdirectories can be found. The pages names in +# these directories are used to generate a series of regular expressions +# that can be used to search the manual page files that are named in # the remaining command-line arguments. # -# Example usage: +# Example usage: # # cd man-pages-x.yy # sh find_dots_no_parens.sh . man?/*.? > matches.log @@ -26,7 +26,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -53,7 +53,7 @@ echo "This will take probably a few moments..." 1>&2 awk_script_file=tmp.$0.awk rm -f $awk_script_file -# We grep out a few page names that are likely to generate false +# We grep out a few page names that are likely to generate false # positives... echo '{' >> $awk_script_file @@ -63,9 +63,9 @@ echo ' if ( myvar == "NOMATCHESFORTHIS" || ' >> $awk_script_file for page in $( - find $dir/man2/* $dir/man3/* -type f -name '*.[23]' | + find $dir/man2/* $dir/man3/* -type f -name '*.[23]' | egrep -v '/(stderr|stdin|stdout|errno|termios|string)\..$'); do - + base=$(basename $page | sed -e 's/\.[23]$//') echo " myvar == \"$base\" ||" >> $awk_script_file @@ -75,7 +75,7 @@ echo ' myvar == "NOMATCHESFORTHIS" )' >> $awk_script_file echo ' print $0' >> $awk_script_file echo '}' >> $awk_script_file -grep '^\.[BRI][BRI]* [a-zA-Z0-9_][a-zA-Z0-9_]*[^a-zA-Z_]*$' $* | +grep '^\.[BRI][BRI]* [a-zA-Z0-9_][a-zA-Z0-9_]*[^a-zA-Z_]*$' $* | awk -f $awk_script_file | grep -v '([0-9]*)' rm -f $awk_script_file diff --git a/scripts/find_repeated_words.sh b/scripts/find_repeated_words.sh index 747872e..2306082 100755 --- a/scripts/find_repeated_words.sh +++ b/scripts/find_repeated_words.sh @@ -15,7 +15,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -24,13 +24,13 @@ # # -for file in "$@" ; do +for file in "$@" ; do # Do not process files that are redirects. grep -qE "^\.so man.*" "$file" if test $? -ne 0; then words=$(MANWIDTH=2000 man -l "$file" 2> /dev/null | col -b | \ tr ' \008' '\012' | sed -e '/^$/d' | \ - sed 's/ *$//' | + sed 's/ *$//' | awk 'BEGIN {p=""} {if (p==$0) print p; p=$0}' | \ grep '[a-zA-Z]' | tr '\012' ' ') if test -n "$words"; then diff --git a/scripts/find_slashes_no_parens.sh b/scripts/find_slashes_no_parens.sh index 086faac..c53034a 100755 --- a/scripts/find_slashes_no_parens.sh +++ b/scripts/find_slashes_no_parens.sh @@ -8,13 +8,13 @@ # This script is designed to help with "by hand" tidy-ups after # the automated changes made by add_parens_for_own_funcs.sh. # -# The first argument to this script names a manual page directory where -# 'man2' and 'man3' subdirectories can be found. The pages names in -# these directories are used to generate a series of regular expressions -# that can be used to search the manual page files that are named in +# The first argument to this script names a manual page directory where +# 'man2' and 'man3' subdirectories can be found. The pages names in +# these directories are used to generate a series of regular expressions +# that can be used to search the manual page files that are named in # the remaining command-line arguments. # -# Example usage: +# Example usage: # # cd man-pages-x.yy # sh find_slashes_no_parens.sh . man?/*.? > matches.log @@ -26,7 +26,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -53,14 +53,14 @@ echo "This will probably take a few minutes..." 1>&2 regexp_file=tmp.$0.regexp rm -f $regexp_file -# We grep out a few page names that are likely to generate false +# We grep out a few page names that are likely to generate false # positives... for page in $( - find $dir/man2/* $dir/man3/* -type f -name '*.[23]' | + find $dir/man2/* $dir/man3/* -type f -name '*.[23]' | egrep -v '/(stderr|stdin|stdout|errno|termios|string)\..$'); do - + base=$(basename $page | sed -e 's/\.[23]$//') echo "\\\\f[BI]$base\\\\f[PB][^(]" >> $regexp_file diff --git a/scripts/man_show_fixme.sh b/scripts/man_show_fixme.sh index 6a42b33..9c64745 100755 --- a/scripts/man_show_fixme.sh +++ b/scripts/man_show_fixme.sh @@ -7,7 +7,7 @@ for f in $*; do cat $f | awk ' /^\.\\" *FIXME/ { if ($0 ~ /.*FIXME *\..*/) { - # FIXMES of the form "FIXME ." are "private" and + # FIXMES of the form "FIXME ." are "private" and # ignored by this script } else { sub("FIXME[: ]*", "") diff --git a/scripts/sortman b/scripts/sortman new file mode 100755 index 0000000..6d1d92f --- /dev/null +++ b/scripts/sortman @@ -0,0 +1,15 @@ +#!/bin/sh + +# Copyright 2023, Alejandro Colomar <alx@kernel.org> +# SPDX-License-Identifier: GPL-3.0-or-later + +sed -E '/\/intro./ s/.*\.([[:digit:]])/\10\t&/' \ +| sed -E '/\/intro./! s/.*\.([[:digit:]])\>/\11\t&/' \ +| sed -E '/\/intro./! s/.*\.([[:digit:]])([[:alpha:]][[:alnum:]]*\>)/\12.\2\t&/' \ +| sed -E ' s/\t(.*)/&\n\1/' \ +| sed -E '/\t/ s/\.[[:digit:]]([[:alpha:]][[:alnum:]]*)?\>.*//' \ +| sed -E '/\t/ s/\/[_-]*/\//g' \ +| sed -E '/\t/ s/[_-]/ /g' \ +| sed -E '/\t/ {N;s/\n/\t/;}' \ +| sort -fV -k1,2 \ +| cut -f3; diff --git a/scripts/unformat_parens.sh b/scripts/unformat_parens.sh index 06bbb48..37e183a 100755 --- a/scripts/unformat_parens.sh +++ b/scripts/unformat_parens.sh @@ -12,7 +12,7 @@ # .BR name () # # This script changes instances to the latter format. -# It does not fix all such instances: some will have to be +# It does not fix all such instances: some will have to be # done manually. # # Use the "-n" option for a dry run, in order to see what would be @@ -25,7 +25,7 @@ # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -56,7 +56,7 @@ done shift $(( $OPTIND - 1 )) -# Only process files with > 1 line -- single-line files are link files +# Only process files with > 1 line -- single-line files are link files for page in $(wc "$@" 2> /dev/null | awk '$1 > 1 {print $4}'| \ grep -v '^total'); do |