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

Static image font is messed up #269

Open
makmanalp opened this issue Oct 28, 2014 · 1 comment
Open

Static image font is messed up #269

makmanalp opened this issue Oct 28, 2014 · 1 comment
Assignees
Labels

Comments

@makmanalp
Copy link
Contributor

For some reason the static image rendering is using the wrong font. E.g.
screen shot 2015-01-30 at 10 36 29 am

when it should look like:

screen shot 2015-01-30 at 10 36 17 am

The font is in /home/vagrant/.fonts/PTN57.ttf and my understanding was that any font here would be used by the SVG renderer (we use cairosvg) automatically. This might be where the bug is happening. Could help to just test the prerendered_html_to_image function by itself on an SVG file generated by the atlas. It used to work okay but stopped working at some point - I'm not sure if this was because I changed some code.

The static image stuff runs in a celery task in the background (http://www.celeryproject.org/) and you can find the code in https://github.com/cid-harvard/atlas-economic-complexity/blob/beta/django_files/atlas/celery_tasks.py You can check if the automatic celery task is running by typing sudo supervisorctl status celery. It might help to kill that process and run your own one manually to see debug information.

Let me know if you need help understanding how the static image code works or if you need help running it.

@makmanalp makmanalp added the bug label Oct 28, 2014
@makmanalp makmanalp self-assigned this Oct 28, 2014
@makmanalp makmanalp assigned sibamohanty and unassigned makmanalp Jan 30, 2015
@sibamohanty
Copy link
Contributor

It looks like cairosvg supports a very few fonts and with no support for svg fonts. Also the font element is ignored completely. Here's the documentation http://cairosvg.org/svg_support/#idid10

In order to support (Helvetica Neue) or (PT Sans Narrow) which I can see is being used in viz_general.js, either we can explore other svg2png rendering engine, or we can change the fonts to CSS2 font face which will be supported by cairosvg natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants