magicsunday / webtrees-fan-chart

SVG based ancestor fan chart module for webtrees genealogy application.
GNU General Public License v3.0
59 stars 18 forks source link

Reverse the logic keeping the first letter of names #60

Closed SodanWT closed 3 years ago

SodanWT commented 3 years ago

Hi,

Is it possible to reverse the logic that keeps only the first letter of the first names when there is not enough space?

I have a lot of individuals that have several first names, the first one being the one with which they're known. For instance : Pierre Jean Marie Henry Charles DUPOND is displayed P. J. M. H. Charles DUPOND, but should be Pierre J. M. H. C. DUPOND as he was commonly simply called Pierre DUPOND.

Regards,

magicsunday commented 3 years ago

You could mark the preferred name of an individual with an asterix in webtrees. Those preferred name is the last one which gets truncated.

In your case, change the name to: Pierre* Jean Marie Henry Charles DUPOND

SodanWT commented 3 years ago

Well, I don't think the asterisk should be used systematically. As stated in webtrees "If an individual was not known by their first given name, the preferred name should be indicated with an asterisk: John Paul* /Smith/", so I use it only in this case, which is rare.

Maybe could you add an option or parameter to achieve this, for those using webtrees the same way as I do? Or, as an alternative, could you guide me on what to change so I could make a patch?

Regards,

JustCarmen commented 3 years ago

I agree with SodanWT. The first name listed is the name one is commonly called with and should be the default. I see it happen with my own name in the middle. No one knows me by my second or third given name, but those are written in full while my first name is truncated to 1 letter. It is not common practice to set the first name as preferred name with an asterix, since that is normally the default.

magicsunday commented 3 years ago

Ok, so the first given name (if more than one) should be the last one which gets truncated or the preferred one. Correct?

SodanWT commented 3 years ago

Yes, that's it. Thanks 😀

magicsunday commented 3 years ago

@SodanWT

I had got some time to look at it again. I used a slightly different approach than you. May you take a look at it, whether this fixes your problem in the right way?

SodanWT commented 3 years ago

Hi Rico, Your fix looks good! Thank you for taking the time to do it :)