Illegal call of non-static member function (Help - I now NOTHING!)

Hi,

(Can’t believe I typo’d ‘know’ in the thread title - now I look like a total 10 year old)

I’m trying to get kerning pairs for a text thing i’m working on. i’m pretty bad at c++, I think i’m nearly there but any help with my Illegal call of non-static member function error would be really handy (I know next to nothing about c++ and i’m brute forcing my way through it.

I haven’t fully populated the blueprint node with all of the inputs, but I figure when I can actually get ‘GetKerning’ to work I can fiddle with that.

I think i’ve managed to get the first character of each FString as a TCHAR (about 2 hours of keyboard mashing)

Here’s the .h



UFUNCTION(BlueprintPure, Category = "DansWonkyPlugins")
static int32 GetKerningData(FString LChar, FString RChar, FFontData InFontData);

and here’s the .cpp



int32 UMyBlueprintFunctionLibrary::GetKerningData(FString LChar, FString RChar, FFontData InFontData)
{

	int32 InSize = 100;
	const int32 Scale = 100;
	const TCHAR* First = *LChar;
	const TCHAR* Second = *RChar;
	return FSlateFontCache::GetKerning(InFontData, InSize, First[0], Second[0], Scale);
}

(I’ve added the slate and slatecore to the build file - the non-static error is the only one right now)

Help me C++ Kenobi, you’re my only hope.