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

renderface/renderstring! for Ptr{FreeType.LibFreeType.FT_FaceRec_} face type?

Open iuliancioarca opened this issue 4 years ago • 9 comments

I tried the examples in the readme but the face = newface("hack_regular.ttf") return type is Ptr{FreeType.LibFreeType.FT_FaceRec_} and it's not compatible with renderface/renderstring!, which needs ::FreeTypeAbstraction.FTFont.

As workaround I used face = FreeTypeAbstraction.FTFont(newface("DroidSansMono.ttf"))

iuliancioarca avatar Mar 15 '20 14:03 iuliancioarca

We should just deprecate newface!

face = FTFont("DroidSansMono.ttf")

Is the new way of doing things!

SimonDanisch avatar Mar 15 '20 15:03 SimonDanisch

If you want to make a PR to update the readme, that would help a lot :)

SimonDanisch avatar Mar 15 '20 16:03 SimonDanisch

Awesome! Thank you! Should I also export FTFont in FreeTypeAbstraction.jl?

iuliancioarca avatar Mar 15 '20 19:03 iuliancioarca

Yeah, sounds like a good idea!

SimonDanisch avatar Mar 15 '20 20:03 SimonDanisch

is a deprecations for newface in the works? i just encountered this error too.

bjarthur avatar Mar 16 '20 13:03 bjarthur

Yes, sorry... I didn't do this very cleanly :(

SimonDanisch avatar Mar 16 '20 13:03 SimonDanisch

i also got a renderstring! error about pixelsize now being a scalar instead of a tuple...

bjarthur avatar Mar 16 '20 14:03 bjarthur

You mean warning? https://github.com/JuliaGraphics/FreeTypeAbstraction.jl/blob/master/src/rendering.jl#L48 Yeah, I found out, that one can only reasonably set the size as 1 number

SimonDanisch avatar Mar 16 '20 14:03 SimonDanisch

warning, right. sorry.

bjarthur avatar Mar 16 '20 15:03 bjarthur