Closed piface314 closed 7 months ago
Hi @piface314,
There have been a few fixes to font handling since 8.12 (three years ago). I would update your libvips.
I tried with current stable:
#!/usr/bin/luajit
vips = require "vips"
local image = vips.Image.text("TEST1", {
font = "MissFajardose 10",
fontfile = "/home/john/pics/MissFajardose-Regular.ttf",
dpi = 600
})
image:write_to_file("test1.png")
image = vips.Image.text("TEST2", {
font = "PT Serif, Bold 10",
fontfile = "/home/john/pics/PT_Serif-Web-Bold.ttf",
dpi = 600
})
image:write_to_file("test2.png")
To make:
I get the same result if I swap the two text render operations.
Oh, I see. I was using this version because it seems to be the newest version available on apt
. In this case, should I build from source?
Yes, or update your OS, of course. There are various libvips PPAs as well.
Thanks! I found a PPA with a more recent version and it solved the problem.
I have multiple .ttf fonts in different file paths, and in my application, if I try to create two text images with different font files, only the first one is properly rendered with the font.
For instance, running the code:
produces:
If I swap the lines, I get a different result:
What could be the reason behind this?
vips version: 8.12.1