Skip to content

Add support for text styles on Win32+Celiagg#726

Merged
jwiggins merged 2 commits into
masterfrom
feature/celiagg-windows-font-style
Mar 22, 2021
Merged

Add support for text styles on Win32+Celiagg#726
jwiggins merged 2 commits into
masterfrom
feature/celiagg-windows-font-style

Conversation

@jwiggins
Copy link
Copy Markdown
Member

@jwiggins jwiggins commented Mar 17, 2021

Fixes #643

Celiagg 2.1.0 introduces a new font object for win32 which allows specification of bold/italic styles.

@jwiggins
Copy link
Copy Markdown
Member Author

This will have to wait for the celiagg release, or else I'll have to add a check for the presence of FontWeight:

======================================================================
ERROR: test_text_clip (kiva.tests.test_celiagg_drawing.TestCeliaggDrawing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\enable\enable\.edm\envs\enable-test-3.6-pyqt\lib\site-packages\kiva\tests\drawing_tester.py", line 127, in test_text_clip
    self.gc.set_font(font)
  File "D:\a\enable\enable\.edm\envs\enable-test-3.6-pyqt\lib\site-packages\kiva\celiagg.py", line 624, in set_font
    weight = agg.FontWeight.Regular
AttributeError: module 'celiagg' has no attribute 'FontWeight'

Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

LGTM. I tested this locally on my windows machine and it worked like a charm - not with celiagg 2.0 on edm but 2.1.0 on pypi. Tested using the kiva_explorer with the default "Times New Roman" font.

@jwiggins jwiggins force-pushed the feature/celiagg-windows-font-style branch from 870d0bf to 9a1124f Compare March 22, 2021 15:19
@jwiggins
Copy link
Copy Markdown
Member Author

Thanks for the testing/review @rahulporuri!

@jwiggins jwiggins merged commit 11cc591 into master Mar 22, 2021
@jwiggins jwiggins deleted the feature/celiagg-windows-font-style branch March 22, 2021 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Celiagg backend font selection is wrong on Windows

2 participants