Skip to content

Conversation

@kbrock
Copy link

@kbrock kbrock commented Sep 27, 2024

fixes:

warning: lib/prawn/fonts.rb:9: warning: loading in progress, circular require considered harmful - lib/prawn/font.rb

Aah.

Fixes: #1349

@radwo
Copy link

radwo commented Mar 7, 2025

Hey team!

Any idea if this is going to be merge?

warning: lib/prawn/fonts.rb:9: warning: loading in progress, circular require considered harmful - lib/prawn/font.rb
@kbrock
Copy link
Author

kbrock commented Mar 7, 2025

update:

  • rebased to ensure an easy merge.

Thanks for the ping @radwo
I too hope this can be merged

@practicingdev
Copy link
Contributor

I was curious about why this was happening to begin with and it looks like it's due to the compatibility shim that sets constants on Font::* to point to the Fonts::** namespace.

Fonts::AFM and Fonts::TTF do inherit from Font so it does need to be loaded first. However, because this happens in font.rb and the fonts.rb file is not loaded from anywhere else, it does seem safe to simply remove that line.

Did not attempt to run the code, just dropping a note based on what I found reading things.

@kbrock
Copy link
Author

kbrock commented Apr 25, 2025

This failure is unrelated.
It only fails on ruby head and no other version.
The failure is based upon a change in encoding.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Circular require warning in prawn 2.5.0

3 participants