Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to write something in the shape of this "coat of arms".

enter image description here

I'd like to have the text filling the coat but with a hole roughly in the shape of the sword. I know there is the \shapepar command to create paragraph shapes so I tried to use ShapePatch, a patch for XFig that allows you to draw the shape you want but it never worked on my computer (Mac OS X). I also know I can build the shape by myself with shapepar syntax but it seems really complicated and I don't think I'll make a lot of shapes. So if anybody has ShapePatch working on his computer or knows shapepar syntax very well, could he give me the code?

share|improve this question
6  
It would be helpful to show what you have done so far, so that those trying to help don't have to recreate everything from scratch. –  Peter Grill Oct 28 '11 at 21:23
    
The difficulty here is the hole, I believe. The \parshape primitive takes for each line of a paragraph an indent and a length. This way only the outer shape can be modeled but not the hole. Would it be possible to use two paragraphs side by side such that the hole would be formed by the right edge of the left paragraph and the left side of the rift paragraph? –  Christian Lindig Oct 29 '11 at 10:36

2 Answers 2

up vote 37 down vote accepted

Here’s my attempt, using Xfig. I have simplified the shape a bit, to make it work better for shorter paragraphs.

\def\coatpar#1{\shapepar{\coatshape}#1\par}
\def\coatshape{%
{25.1761}%
{0.176056}b{0.176056}\\%
{0.176056}t{0.176056}{50}\\%
{1.05634}t{0.176056}{0.880282}st{1.05634}{49.1197}\\%
{2.28873}t{0.176056}{0.352113}t{2.46479}{47.7113}\\%
{3.52113}t{0.176056}{1.46262}t{3.87324}{46.3028}\\%
{23.5915}t{0.176056}{19.5481}t{26.8109}{23.3652}\\%
{25.1761}t{0.459004}{20.6929}t{28.6217}{21.5543}\\%
{26.0563}t{0.616197}{21.3289}t{29.6278}{7.16801}st{36.7958}{13.1756}\\%
{28.5211}t{1.05634}{23.1098}t{32.4447}{1.88632}t{39.2606}{10.1376}\\%
{29.4014}t{1.33929}{23.6201}e{33.4507}t{40.1408}{9.05257}\\%
{32.7465}t{2.41449}{25.5591}t{36.6503}{11.7652}\\%
{33.4507}t{2.64085}{25.9673}t{35.9155}{12.1144}\\%
{34.331}t{3.14767}{26.2537}t{36.9312}{10.6166}\\%
{36.7958}t{4.56679}{22.3698}b{32.7465}t{39.7752}{6.42283}\\%
{37.5}t{4.97226}{21.2601}t{32.0423}{1.39245}t{40.5878}{5.22462}\\%
{39.2606}t{5.98592}{22.3592}t{30.2817}{4.87356}t{42.6192}{2.22908}\\%
{40.1408}t{6.62612}{22.7753}jt{29.4014}{6.61412}t{43.6349}{0.73131}\\%
{40.3169}t{6.75416}{29.4334}t{43.838}{0.377263}\\%
{44.5423}t{9.82715}{30.4898}jt{40.3169}{0.27666}\\%
{45.0704}t{10.2113}{29.9296}\\%
{49.2958}t{15.1408}{20.1344}\\%
{50.8803}t{17.5593}{15.8914}\\%
{52.6408}t{20.2465}{9.31246}\\%
{54.2254}e{26.0563}%
}

Just input the above commands directly in the source .tex file, or (preferably) save it as an external file and \input it. To create a coat of arms paragraph, just enclose the paragraph text in a \coatpar command, like this:

\coatpar{Lorem ipsum dolor sit amet …}

Note that for the resulting coat of arms paragraph to look good, you should try ending the paragraph with a few short words. It’s also a good idea to load the microtype package, which will in general give less hyphenated words and fewer large interword spaces.

Here’s an image showing the result for a rather long paragraph. There will naturally be fewer shape details visible for shorter paragraphs.

Image showing the resulting coat of arms paragraph.

Here’s a brief explanation of how to create the \coatpar command. It’s actually not that difficult.

  1. Open the Xfig program. It’s ugly and hard to use, but works well for drawing paragraph shapes.
  2. Use the polygon tool to draw the shield and the sword in the coat of arms. Note that you have to draw the shield (text containers) first and the sword (holes) last. I used the opacity feature of KDE to make the Xfig window partially transparent, so I could see the original coat of arms image on the Web site underneath. (Right-click on the title bar and choose Opacity.)
  3. Click the Edit button, and then click on the shield. Enter and apply the comment +. Do the same for the sword, but set the comment to -.
  4. Save the file as coat.fig, or any other file name you like.
  5. Run the command fig2dev -L shape -n coat coat.fig coat.shape. Here coat.fig is the file name you saved the figure as, and the TeX code will be stored in the file coat.shape. The -n argument specifies the name used to construct the shapepar shape and command; here they will be called \coatshape and \coatpar. The fig2dev application is found in a package called transfig in most Linux distros, or you can download it from the Xfig Web site.

It is also possible to use other tools than the polygon tool, but the result may not be as you expect. After drawing, for example, an arc, use the Edit tool to add a fill colour, which will indicate how the shape will be filled with text.

For more information, see the shapepatch documentation and the Xfig manual.

share|improve this answer
6  
This is fantastic! Could you put some details of the process for future reference. –  cmhughes Oct 30 '11 at 0:21
2  
@cmhughes I have now added a brief explanation on how to create the coat of arms paragraph shape using Xfig. –  Karl Ove Hufthammer Oct 30 '11 at 10:43
    
Do alternatives to Xfig exist? –  Nikos Alexandris Aug 28 '12 at 6:39
1  
For whom it may concern, autotrace will convert bitmap(s) to vector graphics and export to xfig(3.2)! Thus, it can be really handy :-) –  Nikos Alexandris Sep 3 '12 at 15:26

I usually only use \parshape primitive but not shapepar package and I always write a metafont program for this. Here is one of my metafont programs:

mode_setup;

def showmsg (expr s, m) = message s & "--> " & decimal m; enddef;

mn#:=10/10mm#;

em#:=18mn#;

u#:=1/18em#;

zekh#=1.5u#;

baseline#=1.75dd#;

define_pixels(mn,u,em,zekh,baseline);

%********

beginchar(12,33.3mn#,22.3mn#,0);

  path p[];

  pickup pencircle scaled .05u;

  numeric mntopt, pttodd,ddtopt;

  mntopt=25.4/72.27;

  pttodd=1238/1157;

  ddtopt=1157/1238;

let tttt=end;

x1=0;

y1=.5[y4,y2];

x2=.5[x1,x3];

x3-x1=y2-y4=22.3mn;

y3=y1;

y4=0;

x4=x2;



p1=z1{up}..{right}z2{right}..{down}z3{down}..{left}z4{left}

   ..{up}z1;

draw p1;

x3-x7=2.8mn;

x6=x8;

x6-x5=12.4mn;

x8-x7=13.8mn;

y6=y5;

y7=y8;

y7-y5=12mn;

y2-y7=3.8mn;



p2=z5--z6;

p3=z7--z8;

draw p2;

draw p3;





z5n=p2 intersectionpoint p1;

z7n=p3 intersectionpoint p1;

showmsg ("last line down", (x6-x5n)/1mm);

showmsg ("1th line up ", (x8-x7n)/1mm);

% showmsg ("fasel y8-y6", (y7-y5)/1mm);



%****************"2th line up";



x9=x7; x10=x8;

y9=y10=y8-baseline;

p4=z9--z10;

draw p4;

z9n=p4 intersectionpoint p1;



showmsg ("2th line up", (x10-x9n)/1mm);

% showmsg ("dd", (y8-y10)/1dd);

% showmsg ("fasel y10-y6", (y10-y6)/1mm);

%******************************"3th line up";

x11=x7; x12=x8;

y11=y12=y10-baseline;

p5=z11--z12;

draw p5;

z11n=p5 intersectionpoint p1;

showmsg ("3th line up", (x12-x11n)/1mm);

% showmsg ("dd", (y10-y12)/1dd);

% showmsg ("fasel y12-y6", (y12-y6)/1mm);

%**********************"4th line up";

x13=x7; x14=x8;

y13=y14=y12-baseline;

p6=z13--z14;

draw p6;

z13n=p6 intersectionpoint p1;

showmsg ("4th line up", (x14-x13n)/1mm);

% showmsg ("dd", (y12-y14)/1dd);

% showmsg ("fasel y14-y6", (y14-y6)/1mm);

% showmsg (" y14", y14/1mm);

% showmsg (" y3", y3/1mm);

%**********************"5th line up";

x15=x7; x16=x8;

y15=y16=y14-baseline;

p7=z15--z16;

draw p7;

z15n=p7 intersectionpoint p1;

showmsg ("5th line up", (x16-x15n)/1mm);

% showmsg ("dd", (y14-y16)/1dd);

% showmsg ("fasel y16-y6", (y16-y6)/1mm);

% showmsg (" y16", y16/1mm);

% showmsg (" y3", y3/1mm);

%**********************"6th line up";

x17=x7; x18=x8;

y17=y18=y16-baseline;

p8=z17--z18;

draw p8;

z17n=p8 intersectionpoint p1;

showmsg ("6th line up", (x18-x17n)/1mm);

% showmsg ("dd", (y16-y18)/1dd);

% showmsg ("fasel y18-y6", (y18-y6)/1mm);

% showmsg (" y18", y18/1mm);

% showmsg (" y3", y3/1mm);

%**********************"7th line up";

x19=x7; x20=x8;

y19=y20=y18-baseline;

p9=z19--z20;

draw p9;

z19n=p9 intersectionpoint p1;

showmsg ("7th line up", (x20-x19n)/1mm);

% showmsg ("dd", (y18-y20)/1dd);

% showmsg ("fasel y20-y6", (y20-y6)/1mm);

% showmsg (" y20", y20/1mm);

% showmsg (" y3", y3/1mm);

%**********************"8th line up";

x21=x7; x22=x8;

y21=y22=y20-baseline;

p10=z21--z22;

draw p10;

z21n=p10 intersectionpoint p1;

showmsg ("8th line up", (x22-x21n)/1mm);

% showmsg ("dd", (y20-y22)/1dd);

% showmsg ("fasel y22-y6", (y22-y6)/1mm);

% showmsg (" y22", y22/1mm);

% showmsg (" y3", y3/1mm);

%**********************"9th line up";

x23=x7; x24=x8;

y23=y24=y22-baseline;

p11=z23--z24;

draw p11;

z23n=p11 intersectionpoint p1;

showmsg ("9th line up", (x24-x23n)/1mm);

% showmsg ("dd", (y22-y24)/1dd);

% showmsg ("fasel y24-y6", (y24-y6)/1mm);

% showmsg (" y24", y24/1mm);

% showmsg (" y3", y3/1mm);

%**********************"10th line up";

x25=x7; x26=x8;

y25=y26=y24-baseline;

p12=z25--z26;

draw p12;

z25n=p12 intersectionpoint p1;

showmsg ("10th line up", (x26-x25n)/1mm);

% showmsg ("dd", (y24-y26)/1dd);

% showmsg ("fasel y26-y6", (y26-y6)/1mm);

% showmsg (" y26", y26/1mm);

% showmsg (" y3", y3/1mm);

%**********************"11th line up";

x27=x7; x28=x8;

y27=y28=y26-baseline;

p13=z27--z28;

draw p13;

z27n=p13 intersectionpoint p1;

showmsg ("11th line up", (x28-x27n)/1mm);

% showmsg ("dd", (y26-y28)/1dd);

% showmsg ("fasel y28-y6", (y28-y6)/1mm);

% showmsg (" y28", y28/1mm);

% showmsg (" y3", y3/1mm);

%**********************"12th line up";

x29=x7; x30=x8;

y29=y30=y28-baseline;

p14=z29--z30;

draw p14;

z29n=p14 intersectionpoint p1;

showmsg ("12th line up", (x30-x29n)/1mm);

% showmsg ("dd", (y28-y30)/1dd);

% showmsg ("fasel y30-y6", (y30-y6)/1mm);

% showmsg (" y30", y30/1mm);

% showmsg (" y3", y3/1mm);

%**********************"13th line up";

x31=x7; x32=x8;

y31=y32=y30-baseline;

p15=z31--z32;

draw p15;

z31n=p15 intersectionpoint p1;

showmsg ("13th line up", (x32-x31n)/1mm);

% showmsg ("dd", (y30-y32)/1dd);

% showmsg ("fasel y32-y6", (y32-y6)/1mm);

if y32-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y32", y32/1mm);

% showmsg (" y6", y6/1mm);

%**********************"14th line up";

x33=x7; x34=x8;

y33=y34=y32-baseline;

p16=z33--z34;

draw p16;

z33n=p16 intersectionpoint p1;

showmsg ("14th line up", (x34-x33n)/1mm);

% showmsg ("dd", (y32-y34)/1dd);

% showmsg ("fasel y34-y6", (y34-y6)/1mm);

if y34-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y34", y34/1mm);

% showmsg (" y6", y6/1mm);

%**********************"15th line up";

x35=x7; x36=x8;

y35=y36=y34-baseline;

p17=z35--z36;

draw p17;

z35n=p17 intersectionpoint p1;

showmsg ("15th line up", (x36-x35n)/1mm);

% showmsg ("dd", (y34-y36)/1dd);

% showmsg ("fasel y36-y6", (y36-y6)/1mm);

if y36-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y36", y36/1mm);

% showmsg (" y6", y6/1mm);

%**********************"16th line up";

x37=x7; x38=x8;

y37=y38=y36-baseline;

p18=z37--z38;

draw p18;

z37n=p18 intersectionpoint p1;

showmsg ("16th line up", (x38-x37n)/1mm);

% showmsg ("dd", (y36-y38)/1dd);

% showmsg ("fasel y38-y6", (y38-y6)/1mm);

if y38-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y38", y38/1mm);

% showmsg (" y6", y6/1mm);

%**********************"17th line up";

x39=x7; x40=x8;

y39=y40=y38-baseline;

p19=z39--z40;

draw p19;

z39n=p19 intersectionpoint p1;

showmsg ("17th line up", (x40-x39n)/1mm);

% showmsg ("dd", (y38-y40)/1dd);

% showmsg ("fasel y40-y6", (y40-y6)/1mm);

message " y40"; if y40-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

show y40/1mm;

% showmsg (" y6", y6/1mm);

%**********************"18th line up";

x41=x7; x42=x8;

y41=y42=y40-baseline;

p20=z41--z42;

draw p20;

z41n=p20 intersectionpoint p1;

showmsg ("18th line up", (x42-x41n)/1mm);

% showmsg ("dd", (y40-y42)/1dd);

% showmsg ("fasel y42-y6", (y42-y6)/1mm);

if y42-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y42", y42/1mm);

% showmsg (" y6", y6/1mm);

%**********************"19th line up";

x43=x7; x44=x8;

y43=y44=y42-baseline;

p21=z43--z44;

draw p21;

z43n=p21 intersectionpoint p1;

showmsg ("19th line up", (x44-x43n)/1mm);

% showmsg ("dd", (y42-y44)/1dd);

% showmsg ("fasel y44-y6", (y44-y6)/1mm);

if y44-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y44", y44/1mm);

% showmsg (" y6", y6/1mm);

%**********************"20th line up";

x45=x7; x46=x8;

y45=y46=y44-baseline;

p22=z45--z46;

draw p22;

z45n=p22 intersectionpoint p1;

showmsg ("20th line up", (x46-x45n)/1mm);

% showmsg ("dd", (y44-y46)/1dd);

% showmsg ("fasel y46-y6", (y46-y6)/1mm);

if y46-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y46", y46/1mm);

% showmsg (" y6", y6/1mm);

%**********************"21th line up";

x47=x7; x48=x8;

y47=y48=y46-baseline;

p23=z47--z48;

draw p23;

z47n=p23 intersectionpoint p1;

showmsg ("21th line up", (x48-x47n)/1mm);

% showmsg ("dd", (y46-y48)/1dd);

% showmsg ("fasel y48-y6", (y48-y6)/1mm);

if y48-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y48", y48/1mm);

% showmsg (" y6", y6/1mm);

%**********************"22th line up";

x49=x7; x50=x8;

y49=y50=y48-baseline;

p24=z49--z50;

draw p24;

z49n=p24 intersectionpoint p1;

showmsg ("22th line up", (x50-x49n)/1mm);

% showmsg ("dd", (y48-y50)/1dd);

% showmsg ("fasel y50-y6", (y50-y6)/1mm);

if y50-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y50", y50/1mm);

% showmsg (" y6", y6/1mm);

%**********************"23th line up";

x51=x7; x52=x8;

y51=y52=y50-baseline;

p25=z51--z52;

draw p25;

z51n=p25 intersectionpoint p1;

showmsg ("23th line up", (x52-x51n)/1mm);

% showmsg ("dd", (y50-y52)/1dd);

% showmsg ("fasel y52-y6", (y52-y6)/1mm);

if y52-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y52", y52/1mm);

% showmsg (" y6", y6/1mm);

%**********************"24th line up";

x53=x7; x54=x8;

y53=y54=y52-baseline;

p26=z53--z54;

draw p26;

z53n=p26 intersectionpoint p1;

showmsg ("24th line up", (x54-x53n)/1mm);

% showmsg ("dd", (y52-y54)/1dd);

% showmsg ("fasel y54-y6", (y54-y6)/1mm);

if y54-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y54", y54/1mm);

% showmsg (" y6", y6/1mm);

%**********************"25th line up";

x55=x7; x56=x8;

y55=y56=y54-baseline;

p27=z55--z56;

draw p27;

z55n=p27 intersectionpoint p1;

showmsg ("25th line up", (x56-x55n)/1mm);

% showmsg ("dd", (y54-y56)/1dd);

% showmsg ("fasel y56-y6", (y56-y6)/1mm);

if y56-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y56", y56/1mm);

% showmsg (" y6", y6/1mm);

%**********************"26th line up";

x57=x7; x58=x8;

y57=y58=y56-baseline;

p28=z57--z58;

draw p28;

z57n=p28 intersectionpoint p1;

showmsg ("26th line up", (x58-x57n)/1mm);

% showmsg ("dd", (y56-y58)/1dd);

% showmsg ("fasel y58-y6", (y58-y6)/1mm);

if y58-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y58", y58/1mm);

% showmsg (" y6", y6/1mm);

%**********************"27th line up";

x59=x7; x60=x8;

y59=y60=y58-baseline;

p29=z59--z60;

draw p29;

z59n=p29 intersectionpoint p1;

showmsg ("27th line up", (x60-x59n)/1mm);

% showmsg ("dd", (y58-y60)/1dd);

% showmsg ("fasel y60-y6", (y60-y6)/1mm);

if y60-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y60", y60/1mm);

% showmsg (" y6", y6/1mm);

%**********************"28th line up";

x61=x7; x62=x8;

y61=y62=y60-baseline;

p30=z61--z62;

draw p30;

z61n=p30 intersectionpoint p1;

showmsg ("28th line up", (x62-x61n)/1mm);

% showmsg ("dd", (y60-y62)/1dd);

% showmsg ("fasel y62-y6", (y62-y6)/1mm);

if y62-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y62", y62/1mm);

% showmsg (" y6", y6/1mm);

%**********************"29th line up";

x63=x7; x64=x8;

y63=y64=y62-baseline;

p31=z63--z64;

draw p31;

z63n=p31 intersectionpoint p1;

showmsg ("29th line up", (x64-x63n)/1mm);

% showmsg ("dd", (y62-y64)/1dd);

% showmsg ("fasel y64-y6", (y64-y6)/1mm);

if y64-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y64", y64/1mm);

% showmsg (" y6", y6/1mm);

%**********************"30th line up";

x65=x7; x66=x8;

y65=y66=y64-baseline;

p32=z65--z66;

draw p32;

z65n=p32 intersectionpoint p1;

showmsg ("30th line up", (x66-x65n)/1mm);

% showmsg ("dd", (y64-y66)/1dd);

% showmsg ("fasel y66-y6", (y66-y6)/1mm);

if y66-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y66", y66/1mm);

% showmsg (" y6", y6/1mm);

%**********************"31th line up";

x67=x7; x68=x8;

y67=y68=y66-baseline;

p33=z67--z68;

draw p33;

z67n=p33 intersectionpoint p1;

showmsg ("31th line up", (x68-x67n)/1mm);

% showmsg ("dd", (y66-y68)/1dd);

% showmsg ("fasel y68-y6", (y68-y6)/1mm);

if y68-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y68", y68/1mm);

% showmsg (" y6", y6/1mm);

%**********************"32th line up";

x69=x7; x70=x8;

y69=y70=y68-baseline;

p34=z69--z70;

draw p34;

z69n=p34 intersectionpoint p1;

showmsg ("32th line up", (x70-x69n)/1mm);

% showmsg ("dd", (y68-y70)/1dd);

% showmsg ("fasel y70-y6", (y70-y6)/1mm);

if y70-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y70", y70/1mm);

% showmsg (" y6", y6/1mm);

%**********************"33th line up";

x71=x7; x72=x8;

y71=y72=y70-baseline;

p35=z71--z72;

draw p35;

z71n=p35 intersectionpoint p1;

showmsg ("33th line up", (x72-x71n)/1mm);

% showmsg ("dd", (y70-y72)/1dd);

% showmsg ("fasel y72-y6", (y72-y6)/1mm);

if y72-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y72", y72/1mm);

% showmsg (" y6", y6/1mm);

%**********************"34th line up";

x73=x7; x74=x8;

y73=y74=y72-baseline;

p36=z73--z74;

draw p36;

z73n=p36 intersectionpoint p1;

showmsg ("34th line up", (x74-x73n)/1mm);

% showmsg ("dd", (y72-y74)/1dd);

% showmsg ("fasel y74-y6", (y74-y6)/1mm);

if y74-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y74", y74/1mm);

% showmsg (" y6", y6/1mm);

%**********************"35th line up";

x75=x7; x76=x8;

y75=y76=y74-baseline;

p37=z75--z76;

draw p37;

z75n=p37 intersectionpoint p1;

showmsg ("35th line up", (x76-x75n)/1mm);

% showmsg ("dd", (y74-y76)/1dd);

% showmsg ("fasel y76-y6", (y76-y6)/1mm);

if y76-y6 >= baseline :

   let next=relax;

 else:

     def next=endgroup; tttt; enddef;

 fi;

 next;

% showmsg (" y76", y76/1mm);

% showmsg (" y6", y6/1mm);

%**********************





endchar;

bye;

and if you run metafont on this, you get:

last line down--> 12.01291
1th line up --> 13.76529
2th line up--> 13.23064
3th line up--> 12.77202
4th line up--> 12.37909
5th line up--> 12.04422
6th line up--> 11.76205
7th line up--> 11.52835
8th line up--> 11.33994
9th line up--> 11.19461
10th line up--> 11.09041
11th line up--> 11.02611
12th line up--> 11.00049
13th line up--> 11.01324
14th line up--> 11.06444
15th line up--> 11.15503
16th line up--> 11.28639
17th line up--> 11.45995
 y40
>> 7.9702
18th line up--> 11.6781
19th line up--> 11.9436 )
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.