Page MenuHome

Add kerning support for 3DText
Needs ReviewPublic

Authored by Sebastian Witt (witt) on Oct 8 2016, 1:53 PM.

Details

Summary

This is my second approach on adding kerning support for the 3DText objects.
For a reference here is my first approach: https://developer.blender.org/T47725

Kerning is added by, keeping the Freetype2 Lib loaded and the data for the font face within the vFontData object.
So FT_Get_Kerning can be accessed while the vFontData exists.

I hope the code fits to all the standards!
Any kind of feedback is appreciated,

Sebastian Witt

Diff Detail

Repository
rB Blender

Event Timeline

Sebastian Witt (witt) retitled this revision from to Add kerning support for 3DText.
Sebastian Witt (witt) updated this object.
Sebastian Witt (witt) set the repository for this revision to rB Blender.

Patch is mostly OK I think, besides points noted below, and please respect our code style.

Wouldn’t mind @Sergey Sharybin (sergey)'s advice here though, he knows our 3DText code much better than I do…

source/blender/blenkernel/intern/font.c
271–275

Why remove this? it may lead to pf leaking? would rather add check on vfont->data->assoc_data (or maybe just remove the check on vfont->packedfile ?).

source/blender/blenlib/intern/freetypefont.c
504

Error, mismatch in signature with declaration of this func...

Sebastian Witt (witt) edited edge metadata.

I tried to address all the problems with the old revision.
Mainly possible packedfile data leaks and "BLI_vfontdata_freeft2" function definition.

If I can improve the code style in any way, I am happy and open for every critique/tips!
Kind regards
Sebastian Witt

Sebastian Witt (witt) marked 2 inline comments as done.Nov 4 2016, 4:38 PM
Sebastian Witt (witt) added inline comments.
source/blender/blenkernel/intern/font.c
271–275

You are right, I removed that due to the pf still containing the fontdata and which gets deleted if freed at this point. I am handling the pf memory later on when the vfont is removed. In case vfont is Null it still needs to be freed. Like you've said removing only vfont->packedfile should do the trick!