I have many fontfiles stored in an s3 bucket. Currently I write them to a temp file, then read them, something like this:
res = s3.get_object(bucket: 'bucket', key: 'key', response_target: "#{Dir.tmpdir()}/#{font}.ttf")
text = Vips::Image.text("some text", {fontfile: "#{Dir.tmpdir()}/#{font}.ttf", font: font_name})
This seems to have a significant impact on the performance of the whole processing operation, compared to just loading images, which can be done without writing to disk. Is there a similar way to load fontfiles? I don't assume that a stream would help much, since unlike images, I imagine the font files must be read entirely before the fonts can be applied, but how about reading from a buffer? If this is not supported, would it be possible to add? As far as I can tell from the source, it seems like the Image::text method comes directly from libvips, but perhaps I am missing something.
I have many fontfiles stored in an s3 bucket. Currently I write them to a temp file, then read them, something like this:
res = s3.get_object(bucket: 'bucket', key: 'key', response_target: "#{Dir.tmpdir()}/#{font}.ttf")text = Vips::Image.text("some text", {fontfile: "#{Dir.tmpdir()}/#{font}.ttf", font: font_name})This seems to have a significant impact on the performance of the whole processing operation, compared to just loading images, which can be done without writing to disk. Is there a similar way to load fontfiles? I don't assume that a stream would help much, since unlike images, I imagine the font files must be read entirely before the fonts can be applied, but how about reading from a buffer? If this is not supported, would it be possible to add? As far as I can tell from the source, it seems like the Image::text method comes directly from libvips, but perhaps I am missing something.