Skip to content

Commit

Permalink
Fix the placement of AKA names
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 12, 2023
1 parent b88abf3 commit d634579
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions gedcom
Original file line number Diff line number Diff line change
Expand Up @@ -2687,15 +2687,18 @@ sub print_person
# }
}

my $bio = Data::Text->new("\t");
my @phrases;
my $bio = Data::Text->new("\t");
my $phrase = Data::Text->new();
my $haveprintedspousename;
my $noun = $firstname // $pronoun;

if($aob || $aod || $relationship || $spouserelationship) {
$phrase->set("$noun, ");
$noun = $pronoun;
if(my $aka = $person->as_string({ use_aka => 1 })) {
$phrase->append("also known as $aka, ");
}
}

if($relationship) {
Expand Down Expand Up @@ -2730,10 +2733,6 @@ sub print_person
my @occupations = get_all_occupations(person => $person);
my $same_occupation_as_father;

if(my $aka = $person->as_string({ use_aka => 1 })) {
$phrase->append("(also known as $aka) ");
}

if($aob && $aod) {
if($aob == $aod) {
$phrase->append("was born and died $aod years ago ");
Expand Down Expand Up @@ -2830,13 +2829,16 @@ sub print_person
}
} else {
if(scalar(@phrases) == 0) {
$phrase->set(ucfirst("$noun "));
$phrase->set(ucfirst($noun));
$noun = $pronoun;
if(my $aka = $person->as_string({ use_aka => 1 })) {
$phrase->append(", also known as $aka,");
}
}
if(is_alive(person => $person)) {
$phrase->append('is ');
$phrase->append(' is ');
} else {
$phrase->append('was ');
$phrase->append(' was ');
}
if($language eq 'French') {
$phrase->append('l');
Expand Down Expand Up @@ -5332,8 +5334,8 @@ sub print_person
$text = $pdfpage->text();
$text->font($params{'font'}, 12);
pdfprint(string => $bio, text => $text, pdfpage => $pdfpage);
$bio = Data::Text->new(' ');
}
$bio = Data::Text->new(' ');
} else {
$bio->rtrim()->append("\n\t");
}
Expand Down Expand Up @@ -6946,6 +6948,7 @@ sub print_person
$text = $pdfpage->text();
$text->font($params{'font'}, 12);
die 'Print failure' if(!pdfprint(string => $bio, text => $text, pdfpage => $pdfpage));
$bio = Data::Text->new();
}
$phrase = undef;
}
Expand Down

0 comments on commit d634579

Please sign in to comment.