Page MenuHome

Add kerning support for 3DText
Needs ReviewPublic

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



This is my second approach on adding kerning support for the 3DText objects.
For a reference here is my first approach:

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

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…


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 ?).


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.

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!