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

Provide separate factory methods for SystemFontMetrics and IndexedFontMetrics #1

Closed
obecker opened this issue Jul 3, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@obecker
Copy link

obecker commented Jul 3, 2021

Hi, it would be great if the SimpleFontMetrics API could be extended to select specifically either the SystemFontMetrics or the IndexedFontMetrics implementation (actually - for my use case it would be enough to have access to the IndexedFontMetrics).

Background: I'm using this library for creating SVG images and have some tests that contain assertions for the entire generated markup. To my surprise these tests failed when executed automatically within GitHub Actions (I guess this might be a problem in general on CI environments). The cause were slightly different values returned from the fontmetrics library. Apparently the SystemFontMetrics on the CI environment and on my local machine behave differently.

Now I was able to implement a workaround that uses only the IndexedFontMetrics (luckily these inner classes are public and static), and this fixed the tests. However, it would be great if I could get rid of this extra code and use an appropriate factory method in SimpleFontMetrics instead.

Thanks for this library! 🙂

@ggrandes ggrandes self-assigned this Jan 7, 2022
@ggrandes ggrandes added the enhancement New feature or request label Jan 7, 2022
@ggrandes
Copy link
Owner

I will appreciate the feedback!

@obecker
Copy link
Author

obecker commented Jan 12, 2022

Thank you! This simplifies my code significantly. 😄

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

No branches or pull requests

2 participants