FreeTypeAbstraction.jl icon indicating copy to clipboard operation
FreeTypeAbstraction.jl copied to clipboard

Linux compatibility

Open orswan opened this issue 6 months ago • 0 comments

The following code works properly on Windows, but outputs a zero array on Linux:

using FreeTypeAbstraction, Images, FileIO

sz = (128,128)
str = "c"
pixelsize = sz[2] ÷ length(str)
face = findfont("arial bold")
x0, y0 = sz .÷ 2
arr = zeros(UInt8,sz...)
renderstring!(arr,str,face,pixelsize, x0, y0; halign=:hcenter, valign=:vcenter)

Gray.(convert.(Float64,arr)./255)

Windows output:

windows_output

Linux output:

linux_out

orswan avatar Aug 23 '24 03:08 orswan