/FreeTypeAbstraction.jl

A Julian abstraction layer over FreeType.jl

Primary LanguageJuliaOtherNOASSERTION

codecov

Build Status

FreeTypeAbstraction

Draw text into a Matrix.

using FreeTypeAbstraction

# load a font
face = FTFont("hack_regular.ttf")

# render a character
img, metric = renderface(face, 'C')

# render a string into an existing matrix
myarray = zeros(UInt8, 100, 100)
pixelsize = 10
x0, y0 = 90, 10
renderstring!(myarray, "hello", face, pixelsize, x0, y0, halign=:hright)

credits to @aaalexandrov from whom most of the early code comes.