This is center.pl in view mode; [Download] [Up]
#!@@PERL@@ -s
#
# This script is part of rtfdtohtml.
# Copyright (c) 1996 Elmar Ludwig - Universitaet Osnabrueck
#
# Centering of lines should be taken care of by the rtftohtml filter.
# It currently ignores this, so here is a quick hack.
$out = '';
while (<>)
{
print $out;
if (/^\\qc\W/ || /[^\\]\\qc\W/)
{
print '{\\v1\\shad1</DIV>\\shad0\\v0}' if $align eq 'right';
print '{\\v1\\shad1<CENTER>\\shad0\\v0}' if $align ne 'center';
$align = 'center';
}
elsif (/^\\qr\W/ || /[^\\]\\qr\W/)
{
print '{\\v1\\shad1</CENTER>\\shad0\\v0}' if $align eq 'center';
print '{\\v1\\shad1<DIV align=right>\\shad0\\v0}' if $align ne 'right';
$align = 'right';
}
elsif (/^\\q[lj]\W/ || /[^\\]\\q[lj]\W/ || /^\\pard\W/ || /[^\\]\\pard\W/)
{
print '{\\v1\\shad1</CENTER>\\shad0\\v0}' if $align eq 'center';
print '{\\v1\\shad1</DIV>\\shad0\\v0}' if $align eq 'right';
$align = '';
}
$out = $_;
}
print '{\\v1\\shad1</CENTER>\\shad0\\v0}' if $align eq 'center';
print '{\\v1\\shad1</DIV>\\shad0\\v0}' if $align eq 'right';
print $out;
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.