-- Roots style file
-- Saved by the Roots style editor

--*MA50B50H100T0C0W30I100S24O0FHomerton.Bold.Oblique
--*PW280H100
--*SRX0Y0W280H100T0O0EcM0
--*TIMX140Y75S12C0ExV1FTrinity.Medium.Italic:Tforenames
--*SLX140Y100W140H150T0O0eCM1
--*TIMX140Y42S12C0ExV1FHomerton.Medium:Tsurname
--*TIMX140Y6S12C0ExV1FTrinity.Medium:Tdate of birth
--*RW84H100
--*SLX0Y30W84H30T0O0EcM0
--*SLX0Y70W84H70T0O0EcM0
--*SLX42Y30W42H-50T0O0eCM1


gapheightabove=50;
gapheightbelow=50;
personwidth=280;
personheight=100;
gapwidth=100;
marriagewidth=84;
windowborder=30;
titleheight=100;

fontt0=ClaimFont("Homerton.Bold.Oblique",24);
fontp1=ClaimFont("Trinity.Medium.Italic",12);
fontp3=ClaimFont("Homerton.Medium",12);
fontp4=ClaimFont("Trinity.Medium",12);

function PersonChanged(person)
w=personwidth;
tx=GetTextDimensions(fontp1,GetField(person,"forenames"));
if tx+12>w then w=tx+12 end
tx=GetTextDimensions(fontp3,GetField(person,"surname"));
if tx+12>w then w=tx+12 end
tx=GetTextDimensions(fontp4,GetField(person,"date of birth"));
if tx+12>w then w=tx+12 end
SetWidth(person,w);
end

function RedrawLine(x,y,width,height)
PlotLine(x,y,x+width,y+height,0,0);
end

function RedrawPerson(person,x,y,width,height)
m=width-personwidth;
mh=m/2;
PlotRectangle(x+0,y+0,280+m,100,0,0);
colour=0;
text=GetField(person,"forenames");
tx=GetTextDimensions(fontp1,text);
PlotText(x+140+mh-tx/2,y+75,fontp1,4294967040,colour,text)
if GetParentsMarriage(person) then PlotLine(x+140+mh,y+100,x+140+mh,y+150,0,0); end
colour=0;
text=GetField(person,"surname");
tx=GetTextDimensions(fontp3,text);
PlotText(x+140+mh-tx/2,y+42,fontp3,4294967040,colour,text)
colour=0;
text=GetField(person,"date of birth");
tx=GetTextDimensions(fontp4,text);
PlotText(x+140+mh-tx/2,y+6,fontp4,4294967040,colour,text)
end

function RedrawMarriage(marriage,x,y,width,height)
m=width-marriagewidth;
mh=m/2;
PlotLine(x+0,y+30,x+84+m,y+30,0,0);
PlotLine(x+0,y+70,x+84+m,y+70,0,0);
if GetChild(marriage) then PlotLine(x+42+mh,y+30,x+42+mh,y+-50,0,0); end
end

function RedrawTitle(title,x,y,width,height)
tx=GetTextDimensions(fontt0,title);
PlotText(x+(width-tx)/2,y+height/2,fontt0,4294967040,0,title);
end

