/[groff]/groff/tmac/www.tmac
ViewVC logotype

Diff of /groff/tmac/www.tmac

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.38 by wl, Sat Dec 18 08:09:39 2004 UTC revision 1.39 by wl, Wed Feb 16 14:07:24 2005 UTC
# Line 10  Installed position: groff's main macro d Line 10  Installed position: groff's main macro d
10    
11  This file is part of groff, the GNU roff type-setting system.  This file is part of groff, the GNU roff type-setting system.
12    
13  Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.  Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
14  written by Gaius Mulley <gaius@glam.ac.uk>, with additions by  written by Gaius Mulley <gaius@glam.ac.uk>, with additions by
15  Werner Lemberg <wl@gnu.org> and Bernd Warken <bwarken@mayn.de>.  Werner Lemberg <wl@gnu.org> and Bernd Warken <bwarken@mayn.de>.
16    
# Line 524  www functionality.  It should work with Line 524  www functionality.  It should work with
524  .  wh \\n[www-left-ll-trap]u  .  wh \\n[www-left-ll-trap]u
525  .  nr www-left-ll-trap 0  .  nr www-left-ll-trap 0
526  ..  ..
527    .
528    .\" www-handle-percent arg N1 N2 S1
529    .\"                    arg - input string (number or number%)
530    .\"                    output parameters:
531    .\"                    N1 - name of number register 1=absolute 0=percentage
532    .\"                    N2 - number register name for absolute value
533    .\"                    S1 - string register name for percentage value
534    .
535    .de www-handle-percent
536    .  ds www-percent \\$1\"
537    .  substring www-percent -1 -1
538    .
539    .  ie '\\*[www-percent]'%' \{\
540    .    ds www-abs \\$1\"
541    .    substring www-abs 0 -2
542    .    nr \\$2 0
543    .    nr \\$3 \\*[www-abs]
544    .    ds \\$4 \\$1\"
545    .  \}
546    .  el \{\
547    .    nr \\$2 1
548    .    nr \\$3 \\$1
549    .    ds \\$4 none\"
550    .  \}
551    ..
552    .
553  .\" --------------------------------------------------------------------  .\" --------------------------------------------------------------------
554  .\" MPIMG [-R|-L] [-G gap] filename [width [height]]  .\" MPIMG [-R|-L] [-G gap] filename [width [height]]
555  .\"  .\"
# Line 531  www functionality.  It should work with Line 557  www functionality.  It should work with
557  .\"   -Tps and -Thtml.  The default value for WIDTH is 1i; default value  .\"   -Tps and -Thtml.  The default value for WIDTH is 1i; default value
558  .\"   for HEIGHT is WIDTH; the default alignment is left (-L).  .\"   for HEIGHT is WIDTH; the default alignment is left (-L).
559  .\"   -G is used to insert a gap between the text and the image.  .\"   -G is used to insert a gap between the text and the image.
560    .\"   The height and width can also be given as a percentage.
561    .\"   The PostScript device converts the percentage width into an
562    .\"   absolute value by using \\n[.l], and the height by using \\n[.p].
563    .\"  
564  .\"  .\"
565  .\" Note: This macro can only be used with the `-U' option of groff,  .\" Note: This macro can only be used with the `-U' option of groff,
566  .\"       activating unsafe mode, if not used with -Thtml; the PNG image  .\"       activating unsafe mode, if not used with -Thtml; the PNG image
# Line 561  www functionality.  It should work with Line 591  www functionality.  It should work with
591  .    \}  .    \}
592  .    break  .    break
593  .  \}  .  \}
594    .
595  .  nr www-width 1i  .  nr www-width 1i
596  .  if !'\\$2'' \  .  nr www-height 1i
597  .    nr www-width \\$2  .  ds www-size-specs "width=\\n[www-width] height=\\n[www-height]\"
598  .  nr www-height \\n[www-width]  .  ie !'\\$2'' \{\
599  .  if !'\\$3'' \  .    nr www-is-absolute 0
600  .    nr www-height \\$3  .    nr www-absolute 0
601  .  nr www-width (\\n[www-width] * 100 / 240)  .    ds www-percentage none\"
602  .  nr www-height (\\n[www-height] * 100 / 240)  .    www-handle-percent \\$2 www-is-absolute www-absolute www-percentage
603    .    ie !\\n[www-is-absolute] \{\
604    .      \" percentage of linelength requested
605    .      nr www-width (\\n[www-absolute] * \\n[.l] / 100)
606    .      if \\n[www-html] \
607    .        nr www-width (\\n[www-width] * 100 / 240)
608    .      ds www-size-specs "width=\\*[www-percentage]\"
609    .    \}
610    .    el \{\
611    .      nr www-width \\n[www-absolute]
612    .      if \\n[www-html] \
613    .        nr www-width (\\n[www-width] * 100 / 240)
614    .      ds www-size-specs "width=\\n[www-width]\"
615    .    \}
616    .
617    .    nr www-height \\n[www-width]
618    .    ie !'\\$3'' \{\
619    .      nr www-is-absolute 0
620    .      nr www-absolute 0
621    .      ds www-percentage none\"
622    .      www-handle-percent \\$3 www-is-absolute www-absolute www-percentage
623    .      ie !\\n[www-is-absolute] \{\
624    .        \" percentage of pagelength requested
625    .        nr www-height (\\n[www-absolute] * \\n[.p] / 100)
626    .        if \\n[www-html] \
627    .           nr www-height (\\n[www-height] * 100 / 240)
628    .        ds www-size-specs "\\*[www-size-specs] height=\\*[www-percentage]\"
629    .      \}
630    .      el \{\
631    .        nr www-height \\n[www-absolute]
632    .        if \\n[www-html] \
633    .           nr www-height (\\n[www-height] * 100 / 240)
634    .        ds www-size-specs "\\*[www-size-specs] height=\\*[www-height]\"
635    .      \}
636    .    \}
637    .  \}
638    .  el \{\
639    .    \" height not specified; use width value
640    .    ie !\\n[www-is-absolute] \{\
641    .       \" percentage value
642    .       ds www-size-specs "\\*[www-size-specs] height=\\*[www-percentage]\"
643    .       nr www-height \\n[www-width]
644    .    \}
645    .    el \{\
646    .       ds www-size-specs "\\*[www-size-specs] height=\\*[www-width]\"
647    .       nr www-height \\n[www-width]
648    .    \}
649    .  \}
650  .  .
651  .  ie \\n[www-html] \{\  .  ie \\n[www-html] \{\
652  .    ie !\\n[www-image-just] \  .    ie !\\n[www-image-just] \
653  .      HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \  .      HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \
654               align=right width=\\n[www-width] height=\\n[www-height]>               align=right \\*[www-size-specs]>
655  .    el \  .    el \
656  .      HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \  .      HTML <img src="\\$1" alt="Image \\$1" hspace=\\n[www-htmlimage-gap] \
657               align=left width=\\n[www-width] height=\\n[www-height]>               align=left \\*[www-size-specs]>
658  .  \}  .  \}
659  .  el \{\  .  el \{\
660    .    tm www-width is \\n[www-width]
661    .    tm www-height is \\n[www-height]
662  .    if !r ps4html \{\  .    if !r ps4html \{\
663  .      www-make-unique-name  .      www-make-unique-name
664  .      sy pngtopnm \\$1 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps  .      sy pngtopnm \\$1 | pnmcrop -white | @PNMTOPS_NOSETPAGE@ -noturn > \\*[www-unique-name].eps
# Line 589  www functionality.  It should work with Line 669  www functionality.  It should work with
669  .          wh \\n[www-left-ll-trap]u  .          wh \\n[www-left-ll-trap]u
670  .        if (\\n[www-left-po-trap] > 0) \  .        if (\\n[www-left-po-trap] > 0) \
671  .          wh \\n[www-left-po-trap]u  .          wh \\n[www-left-po-trap]u
672  .        PSPIC -R \\*[www-unique-name].eps \\$2 \\$3  .        PSPIC -R \\*[www-unique-name].eps \\n[www-width]u \\n[www-height]u
673  .        sp -\\n[ps-desht]u  .        sp -\\n[ps-desht]u
674  .        nr www-right-indent \\n[ps-deswid]u  .        nr www-right-indent \\n[ps-deswid]u
675  .        \" we want to have some space between text and image,  .        \" we want to have some space between text and image,
# Line 608  www functionality.  It should work with Line 688  www functionality.  It should work with
688  .        \" we must now disable a possible right image trap  .        \" we must now disable a possible right image trap
689  .        if (\\n[www-right-ll-trap] > 0) \  .        if (\\n[www-right-ll-trap] > 0) \
690  .          wh \\n[www-right-ll-trap]u  .          wh \\n[www-right-ll-trap]u
691  .        PSPIC -L \\*[www-unique-name].eps \\$2 \\$3  .        PSPIC -L \\*[www-unique-name].eps \\n[www-width]u \\n[www-height]u
692  .        sp -\\n[ps-desht]u  .        sp -\\n[ps-desht]u
693  .        nr www-left-indent \\n[ps-deswid]u  .        nr www-left-indent \\n[ps-deswid]u
694  .        \" increase offset by gap  .        \" increase offset by gap
# Line 790  www functionality.  It should work with Line 870  www functionality.  It should work with
870  .    ds www-dropcolor \\$3  .    ds www-dropcolor \\$3
871  .  ie '\*(.T'html' \{\  .  ie '\*(.T'html' \{\
872  .    www-make-unique-name  .    www-make-unique-name
873  .    MPIMG -L \\*[www-unique-name].png "(\\n[.v] * 2u)"  .    nr www-drop-width (100u * \\n[.v]u * 3u / \\n[.l]u)
874    .    MPIMG -L \\*[www-unique-name].png "\\n[www-drop-width]%"
875  .  \}  .  \}
876  .  el \{\  .  el \{\
877  .    ie r ps4html \{\  .    ie r ps4html \{\
# Line 801  www functionality.  It should work with Line 882  www functionality.  It should work with
882  .      \" glyphs overlap.  .      \" glyphs overlap.
883  .      bp  .      bp
884  .      ev www-DC  .      ev www-DC
885  .      vs 80p  .      vs 320p
886  .      nop \O[5i\\*[www-unique-name].png]\O[1]  .      nop \O[5i\\*[www-unique-name].png]\O[1]
887  .      nop \m[\\*[www-dropcolor]]\s[40]\O[3]\\$1\O[4]  .      nop \m[\\*[www-dropcolor]]\s[160]\O[3]\\$1\O[4]
888  .      nop \O[2]\O[0]  .      nop \O[2]\O[0]
889  .      br  .      br
890  .      ev  .      ev

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26