Open tejanium opened 3 years ago
@tejanium firstly apologies for the delay in getting back here, this got lost in our backlog.
Regarding the customer font, you can just URL encode the space before making the request and it will work e.g. https://res.cloudinary.com/cookpad/image/upload/l_text:Open%20Sans_60:Text%20with%20spaces/sample.jpg
let me know if resolves your issue?
Thank you for getting back to me
Regarding the customer font, you can just URL encode the space before making the request and it will work e.g. res.cloudinary.com/cookpad/image/upload/l_text:Open%20Sans_60:Text%20with%20spaces/sample.jpg
Yes, this is what we ended up doing. But I think this should be part of the library.
@tejanium no problem and fair point, let me raise it internally and hopefully we will have a fix soon.
also as a workaround, for now, you could escape the space when it comes to fonts with spaces like font_family: "Open%20Sans"
Yes, that's what we did
def safe_font_family
ERB::Util.url_encode(font_family)
end
so this is in our list to fix but no ETA currently but will keep you posted.
Cloudinary supports all of Google's fonts https://support.cloudinary.com/hc/en-us/articles/203352832-What-is-the-list-of-supported-fonts-for-text-overlay-transformation- and some of them have spaces on them, for example, "Open Sans"
But unlike Text Transformation where spaces are escaped https://github.com/cloudinary/cloudinary_gem/blob/28a9ee65d24c6bac0654919a5a76de95cf356510/lib/cloudinary/utils.rb#L399 font family aren't https://github.com/cloudinary/cloudinary_gem/blob/28a9ee65d24c6bac0654919a5a76de95cf356510/lib/cloudinary/utils.rb#L452
resulting in an invalid URL