Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tree doc Tex] fix issues around localization #960

Closed
wants to merge 10 commits into from

Conversation

romjerome
Copy link
Contributor

@romjerome romjerome commented Dec 6, 2019

  • specific non-ASCII glyphs related to our locale are not properly displayed on PDF
  • date cannot be parsed (one date format and in english)
  • genealogytree macro needs a lang set in english

* specific non-ASCII characters related to our locale are not displayed on PDF
* date cannot be parsed (one calendar format and in english)
genealogytree macro needs a lang set in english
@romjerome
Copy link
Contributor Author

After forcing to run gramps in english I got an error ...
\gtrset{language=english (usa)}
sorry, need to avoid such string as lang set.

@codecov-io
Copy link

codecov-io commented Dec 6, 2019

Codecov Report

Merging #960 into master will increase coverage by 0.64%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #960      +/-   ##
==========================================
+ Coverage   41.95%   42.59%   +0.64%     
==========================================
  Files        1070     1071       +1     
  Lines      145320   148215    +2895     
==========================================
+ Hits        60972    63139    +2167     
- Misses      84348    85076     +728
Impacted Files Coverage Δ
gramps/gen/plug/docgen/treedoc.py 19.57% <33.33%> (+0.45%) ⬆️
gramps/plugins/tool/removespaces.py 0% <0%> (ø) ⬆️
gramps/plugins/webreport/updates.py 57.23% <0%> (ø)
gramps/plugins/webreport/thumbnail.py 97.7% <0%> (+1.11%) ⬆️
gramps/plugins/webreport/place.py 70.62% <0%> (+1.12%) ⬆️
gramps/plugins/webreport/person.py 62.59% <0%> (+1.73%) ⬆️
gramps/plugins/webreport/webcal.py 82.38% <0%> (+1.8%) ⬆️
gramps/plugins/webreport/media.py 68.26% <0%> (+2.75%) ⬆️
gramps/plugins/webreport/common.py 71.52% <0%> (+4%) ⬆️
gramps/plugins/webreport/narrativeweb.py 82.28% <0%> (+4.61%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc9e5c2...fe0f125. Read the comment docs.

@romjerome
Copy link
Contributor Author

before_after
Before change|After

@romjerome
Copy link
Contributor Author

romjerome commented Dec 7, 2019

A proper solution might be to use the lang selector available on reports dialog as an option.

@romjerome
Copy link
Contributor Author

Sorry, need to have something like:
self.write(0, '\\usepackage{lmodern}\n')
I thought on a separated pull request, but I cannot test local support with an incomplete
characters support for my locale. So it will be added.

@romjerome
Copy link
Contributor Author

latin

@romjerome
Copy link
Contributor Author

romjerome commented Dec 7, 2019

Still some specific issues for few characters (not common under my locale!):
'ÿ' on "L'Haÿ-les-Roses",
Haÿ-les-Roses
'ß' on "Hänßeler"
Hänßeler

@romjerome romjerome changed the title fix issues around localization [Tree doc Tex] fix issues around localization Dec 8, 2019
@sam-m888 sam-m888 added this to the v5.2 milestone Dec 9, 2019
Copy link
Member

@Nick-Hall Nick-Hall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The libertine package should also be made conditional. It supports Greek and Cyrillic characters.

Is there a better font package for the Germanic/Nordic languages?

Is there a font package that supports Chinese characters?

gramps/gen/plug/docgen/treedoc.py Outdated Show resolved Hide resolved
if lang_en in LANG_SUPPORT:
self.write(0, '\\gtrset{language=%s}\n' % lang_en)
if lang_en in LATIN:
self.write(0, '\\usepackage{lmodern}\n')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check that the package exists as we already do with libertine.

Copy link
Contributor Author

@romjerome romjerome Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is maybe a problem with code like:
IfFileExists{libertine.sty}! e.g., got an issue with 'shellesc', where " shellesc.sty"
does not exist anymore on recent TeX packages. Need it for 'tcolorbox'.
There is now (with recent TeX versions) something like compressed "doc and source" into a "shellesc.dtx" file.
https://www.ctan.org/tex-archive/macros/latex/required/tools

'lmodern' should be a standard (ok, an old one)
https://www.ctan.org/pkg/lm

I did not try 'cm-super', 'fontspec' or 'oldstandard' (set of supported fonts).

@romjerome
Copy link
Contributor Author

romjerome commented Dec 9, 2019

I have some issues with libertine package version 5.3.0 (2019-05-20).
Package available under my TeX environment but I need to hide/remove the section.
I do not remember well but it seems that some of these issues were fixed by adding:
\usepackage{anyfontsize}. So it has not been included on this pull request. (need tests)

Got few issues by only including old 'lmodern' package...
\gtrset{language=...} is only for date format and localization.

There is an other issue because I have "german" characters and my locale is french...
So, non-ASCII characters handling is still incomplete but better than before.
I suppose that in english too some glyphes might be not always fully displayed ?

@Nick-Hall
Copy link
Member

There is an other issue because I have "german" characters and my locale is french...

Yes. Users may wish to display names in a variety of alphabets irrespective of their locale setting. I found this problem when I attempted to produce a report using the example database which includes names using the cyrillic alphabet.

Libertine was a font recommended by someone of the mailing list. Their may well be better alternatives available.

@romjerome romjerome closed this Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants