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

Allow TTFunk to open HTTP and HTTPS urls #16

Closed
wants to merge 2 commits into from

Conversation

packetmonkey
Copy link
Contributor

This PR lets us pass in HTTP and HTTPS urls for ttfunk to open, allowing us to open up files hosted on a remote server (like S3).

@packetmonkey
Copy link
Contributor Author

Unsure why the build failed, Travis shows all the gems got installed but the const isn't found in the Rakefile, I'll dig into it shortly to see why it works locally but not on travis.

@practicingruby
Copy link
Member

I feel like explicitly handling network I/O is not what I'd like to do here... instead can we take an approach like what we do for Prawn#image that allows IO-like objects? This would facilitate the use of open-uri or any custom font loading class, rather than just supporting URLs.

@packetmonkey
Copy link
Contributor Author

I totally agree that is the cleaner solution, the reason I handled it this way is when passing the new font into prawn it expects a string with a file extension so it knows what font class to load. By allowing ttfunk to accept a URL I am able to pass that URL to prawn and have it remote load the font without what I suspect would be a bit of work. I can PR in support for io objects and take another look at prawns font handling to try and make that work.

@practicingruby
Copy link
Member

@packetmonkey Let's think of a way to extend Prawn's API to accomodate this case rather than working around the problem as you've done here. That's a luxury we have as maintainers of both projects. 😁

@practicingruby
Copy link
Member

Closed, but feel free to re-open or file a new pull request once we've got an I/O based solution.

@pointlessone pointlessone deleted the http-https-urls branch December 30, 2020 08:00
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.

None yet

2 participants