tanghaibao / jcvi

Python library to facilitate genome assembly, annotation, and comparative genomics
BSD 2-Clause "Simplified" License
711 stars 185 forks source link

Dotplots: Allow for free fonts #629

Closed alpapan closed 4 months ago

alpapan commented 4 months ago

Current repo works fine for OSX but the allowed font list seems to be limited to propriotary fonts

e.g. jcvi/lib/python3.9/site-packages/jcvi/apps/base.py

        allowed_fonts = ("Helvetica", "Palatino", "Schoolbook", "Arial")

Could you please add Liberation Sans for those of us working on servers?

This is the command I had to do to make dotplots work but not sure if these files are all and if all necessary

sed -i '~s/Helvetica/Liberation Sans/g' /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/apps/base.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/apps/ks.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/assembly/allmaps.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/assembly/hic.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/graphics/base.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/graphics/grabseeds.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/graphics/graph.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/projects/allmaps.py /apps/packages/miniconda/3.1/envs/jcvi/lib/python3.9/site-packages/jcvi/projects/str.py

Not a tex person so not sure if providing a sans-serif font family might be easiest

tanghaibao commented 4 months ago

@alpapan

Thanks for the report. Just added "Liberation Sans" to the supported font. You should be able to just do --font "Liberation Sans" to access the font.

There are other references of "Helvetica" littered around the codebase. I (was lazy) did not change those to the global font setup. Let me know if you have issues on accessing and I'll fix.

Haibao