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

--*MA50B50H100T0C0W30I100S24O0FHomerton.Bold.Oblique
--*PW280H100
--*SRX0Y0W280H100T0O0EcM0
--*TIMX140Y70S12C16711680EsV1FTrinity.Medium:Tfullname
--*SLX140Y100W140H150T0O0eCM1
--*TALX64Y40S12C0exV1FTrinity.Medium:Tb.
--*TALX64Y15S12C0exV1FTrinity.Medium:Td.
--*TILX90Y40S12C0ExV1FTrinity.Medium:Tdate of birth
--*TILX90Y15S12C0ExV1FTrinity.Medium:Tdate of death
--*TILX230Y10S12C0exV2FTrinity.Medium:Tid
--*RW84H100
--*SLX224Y0W224H-25T0O0ecM2
--*SLX-140Y-25W224H-25T0O0EcM0
--*SLX-140Y0W-140H-25T0O0ecM0
--*SLX42Y-25W42H-50T0O0eCM1
--*TIMX42Y-20S12C0exV1FTrinity.Medium:Tdate


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",12);
fontp3=ClaimFont("Trinity.Medium",12);
fontp4=ClaimFont("Trinity.Medium",12);
fontp5=ClaimFont("Trinity.Medium",12);
fontp6=ClaimFont("Trinity.Medium",12);
fontp7=ClaimFont("Trinity.Medium",12);
fontm4=ClaimFont("Trinity.Medium",12);

function PersonChanged(person)
w=personwidth;
tx=GetTextDimensions(fontp1,GetField(person,"fullname"));
if tx+12>w then w=tx+12 end
tx=GetTextDimensions(fontp5,GetField(person,"date of birth"));
if tx+90+12>w then w=tx+90+12 end
tx=GetTextDimensions(fontp6,GetField(person,"date of death"));
if tx+90+12>w then w=tx+90+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=16711680;
sex=GetField(person,"sex");if sex=="M" then colour=4278190080 end
if sex=="F" then colour=65280 end
text=GetField(person,"fullname");
tx=GetTextDimensions(fontp1,text);
PlotText(x+140+mh-tx/2,y+70,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="b.";
PlotText(x+64+mh,y+40,fontp3,4294967040,colour,text)
colour=0;
text="d.";
PlotText(x+64+mh,y+15,fontp4,4294967040,colour,text)
colour=0;
text=GetField(person,"date of birth");
PlotText(x+90+mh,y+40,fontp5,4294967040,colour,text)
colour=0;
text=GetField(person,"date of death");
PlotText(x+90+mh,y+15,fontp6,4294967040,colour,text)
colour=0;
text=GetField(person,"id");
PlotText(x+230+m,y+10,fontp7,4294967040,colour,text)
end

function RedrawMarriage(marriage,x,y,width,height)
m=width-marriagewidth;
mh=m/2;
PlotLine(x+224+m,y+0,x+224+m,y+-25,0,0);
PlotLine(x+-140,y+-25,x+224+m,y+-25,0,0);
PlotLine(x+-140,y+0,x+-140,y+-25,0,0);
if GetChild(marriage) then PlotLine(x+42+mh,y+-25,x+42+mh,y+-50,0,0); end
colour=0;
text=GetField(marriage,"date");
tx=GetTextDimensions(fontm4,text);
PlotText(x+42+mh-tx/2,y+-20,fontm4,4294967040,colour,text)
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

