Clipped Text in HUD

Clipped Text, how do I do it? Say for example, I would like to have an area at the position (200, 200) and with the dimensions (400, 400), into which i can write text of varying length.

But if the text hits the right end of this area, it should make an automated line break.

That doesen’t sound too difficult, does it? But what would be the code to achieve this? I tried the following and it prints my text, but doesen’t do any clipping at all:

    Canvas->OrgX = PosX;
	Canvas->OrgY = PosY;
	Canvas->SetClip(PosX + Width, PosY + Height);


	FCanvasTextItem TextItem(FVector2D(PosX, PosY), Text, Font, TextColor);
	TextItem.Scale = FVector2D(Scale, Scale);
	TextItem.BlendMode = SE_BLEND_Translucent;
	FFontRenderInfo fri = FFontRenderInfo();
	fri.bClipText = true;
	TextItem.FontRenderInfo = fri;
	TextItem.EnableShadow(StandardShadowColor, FVector2D(-2 * Scale, 2 * Scale));
	Canvas->DrawItem(TextItem);

	Canvas->OrgX = 0;
	Canvas->OrgY = 0;
	Canvas->SetClip(Canvas->SizeX, Canvas->SizeY);

Thanks in advance!

Since nobody answered, I wrote my own function for clipped Text. If anyone is interested, here is my code:

MyHUD.h

//Draw a simple String with drop shadow (CLIPPED)
		UFUNCTION(BlueprintCallable, Category = MyHUD)
			void TextWithShadow_Clipped(float PosX, float PosY, FText Text, class UFont* Font, FLinearColor TextColor = FLinearColor::White, float Scale = 1.f, float Width = 0.f, float Height = 0.f);

MyHUD.cpp

void MyHUD::TextWithShadow_Clipped(float PosX, float PosY, FText Text, class UFont* Font, FLinearColor TextColor, float Scale, float Width, float Height)
{
	FString BaseString, TempString, ClippedString;
	TArray<FString> LineArray;
	int32 LastSpace, x;
	float TextScale, XL, YL, XL_Part, YL_Part;

	XL_Part = 0;
	YL_Part = 0;

	//Match Sizes with the Scale factor
	TextScale = Scale * .25f;
	Width *= Scale;
	Height *= Scale;

	//Visualize Clipping Region
	//Canvas->Canvas->DrawTile(PosX, PosY, Width, Height, 0, 0, 0, 0, FLinearColor(0.101, 0.062, 0.4, 0.5));


	//Convert Text to String
	BaseString = Text.ToString();

	GetTextSize(BaseString, XL, YL, Font, TextScale);

	if (XL > Width)
	{

		//repeat until BaseString is empty
		while (BaseString.Len() >= 1)
		{
			GetTextSize(BaseString, XL, YL, Font, TextScale);
			if (XL > Width)
			{
				while (XL_Part < Width)
				{
					TempString = BaseString.Left(TempString.Len() + 1);
					GetTextSize(TempString, XL_Part, YL_Part, Font, TextScale);

					//Save last known space character
					if (TempString.Right(1) == " ")
					{
						LastSpace = TempString.Len();
					}
				}

				//Add new Line (TempString till space) to the Array
				LineArray.Add(TempString.Left(LastSpace));

				//Delete the Line from the Base String
				BaseString = BaseString.Right(BaseString.Len() - LastSpace);
			}
			else
			{
				//Add new Line (whole TempString) to the Array
				LineArray.Add(BaseString);

				//Delete the whole Base String
				BaseString = "";
			}

			//Empty the required variables for the next loop
			TempString = "";
			XL = 0;
			YL = 0;
			XL_Part = 0;
			YL_Part = 0;
			LastSpace = 0;
		}

		//Assemble the ClippedString using the LineArray
		for (x = 0; x < LineArray.Num(); x++)
		{
			ClippedString += LineArray[x];
			ClippedString += "\n";
		}
		x = 0;
	}
	else
	{
		//If the basic text's width doesen't exceed the width of the Area
		ClippedString = BaseString;
	}

	//Draw final clipped Text
	DrawText(ClippedString, FLinearColor(0, 0, 0, 0.5), PosX - 2 * Scale, PosY + 2 * Scale, Font, TextScale, false);
	DrawText(ClippedString, TextColor, PosX, PosY, Font, TextScale, false);

}