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

Unable to save pdf of ideogram #2204

Open
mjz1983 opened this issue Mar 24, 2023 · 7 comments
Open

Unable to save pdf of ideogram #2204

mjz1983 opened this issue Mar 24, 2023 · 7 comments

Comments

@mjz1983
Copy link

mjz1983 commented Mar 24, 2023

Error message:

Traceback (most recent call last):
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/reportlab/pdfbase/pdfmetrics.py", line 711, in getFont
return _fonts[fontName]
KeyError: 'helvetica'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/pyface/ui/qt4/action/action_item.py", line 371, in _qt4_on_triggered
self.controller.perform(action, action_event)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/pyface/tasks/action/task_action_controller.py", line 31, in perform
return action.perform(event)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/pyface/action/listening_action.py", line 74, in perform
method()
File "/Users/argonlab2/.pychron.1/updates/pychron/pipeline/tasks/task.py", line 457, in save_figure_pdf
save_pdf(ed.component, path=path, options=sfm.pdf_options, view=True)
File "/Users/argonlab2/.pychron.1/updates/pychron/core/pdf/save_pdf_dialog.py", line 150, in save_pdf
component, valign=options.valign, halign=options.halign
File "/Users/argonlab2/.pychron.1/updates/pychron/core/pdf/pdf_graphics_context.py", line 220, in render_component
component.draw(self, view_bounds=(0, 0, width, height))
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/component.py", line 427, in draw
self._draw(gc, view_bounds, mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/component.py", line 779, in _draw
self._dispatch_draw(layer, gc, view_bounds, mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/container.py", line 273, in _dispatch_draw
component._dispatch_draw(layer, gc, new_bounds, mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/container.py", line 273, in _dispatch_draw
component._dispatch_draw(layer, gc, new_bounds, mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/container.py", line 273, in _dispatch_draw
component._dispatch_draw(layer, gc, new_bounds, mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/component.py", line 799, in _dispatch_draw
handler(gc, view_bounds, mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/enable/component.py", line 877, in _draw_overlay
overlay.overlay(self, gc, view_bounds, mode)
File "/Users/argonlab2/.pychron.1/updates/pychron/pipeline/plot/overlays/mean_indicator_overlay.py", line 292, in overlay
o.overlay(other_component, gc, view_bounds=view_bounds, mode=mode)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/chaco/plot_label.py", line 89, in overlay
self._draw_overlay(gc, view_bounds, mode)
File "/Users/argonlab2/.pychron.1/updates/pychron/pipeline/plot/overlays/mean_indicator_overlay.py", line 97, in _draw_overlay
self._label.draw(gc)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/chaco/label.py", line 169, in draw
gc.set_font(self.font)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/kiva/pdf.py", line 629, in set_font
self.gc.setFont(face_name, font.size)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/reportlab/pdfgen/canvas.py", line 1691, in setFont
font = pdfmetrics.getFont(self._fontname)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/reportlab/pdfbase/pdfmetrics.py", line 713, in getFont
return findFontAndRegister(fontName)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/reportlab/pdfbase/pdfmetrics.py", line 695, in findFontAndRegister
face = getTypeFace(fontName)
File "/Users/argonlab2/miniconda2/envs/pychron3/lib/python3.7/site-packages/reportlab/pdfbase/pdfmetrics.py", line 652, in getTypeFace
return _typefaces[faceName]
KeyError: 'helvetica'

@mjz1983
Copy link
Author

mjz1983 commented Mar 24, 2023

Note that this is a problem on ArgonLab2

@jirhiker
Copy link
Member

helvetica is not an available font on ArgonLab2 and given the current version of pychron used on ArgonLab2 cannot be used. newer versions of pychron should handle fonts better

@mjz1983
Copy link
Author

mjz1983 commented Mar 24, 2023 via email

@mjz1983
Copy link
Author

mjz1983 commented Mar 24, 2023

The problem appears to be with ArgonLab2. However, ideograms cannot be saved with any of the fonts whereas all fonts work with spectrum/isochron. Does this mean ArgonLab2 can no longer be used for making pdfs of ideograms?

@mjz1983 mjz1983 reopened this Mar 24, 2023
@jirhiker
Copy link
Member

Thanks I think that should be useful information.

I'll have to get back to you on argonlab2. I don't know its status

@jirhiker
Copy link
Member

jirhiker commented Mar 25, 2023

I think there is a specific element in the ideogram that is breaking things. If you turn off mean indicator that may work

@mjz1983
Copy link
Author

mjz1983 commented Mar 27, 2023 via email

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

No branches or pull requests

2 participants