Skip to content

Fixes circular require warning#1363

Open
kbrock wants to merge 1 commit into
prawnpdf:masterfrom
kbrock:font_fix
Open

Fixes circular require warning#1363
kbrock wants to merge 1 commit into
prawnpdf:masterfrom
kbrock:font_fix

Conversation

@kbrock

@kbrock kbrock commented Sep 27, 2024

Copy link
Copy Markdown

fixes:

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

Aah.

Fixes: #1349

@radwo

radwo commented Mar 7, 2025

Copy link
Copy Markdown

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

kbrock commented Mar 7, 2025

Copy link
Copy Markdown
Author

update:

  • rebased to ensure an easy merge.

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

@practicingdev

Copy link
Copy Markdown
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

kbrock commented Apr 25, 2025

Copy link
Copy Markdown
Author

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