FSlateFontMeasure::Measure inaccurate with oultine

I created a small widget with a icon and text block,then I compared two sizes

  1. Size of the text block geometry
  2. Size using FontMeasure
		auto WidgetInstance = StaticCast<UPOIUserWidget*>(GetWidget());
		auto FontMeasure = FSlateApplication::Get().GetRenderer()->GetFontMeasureService();
		auto  TextSize1 = WidgetInstance->Name->GetCachedGeometry().GetLocalSize();
		const FVector2D TextSize2 = FontMeasure->Measure(Data.Name, WidgetInstance->Name->GetFont());

TextSize1 = (98, 26)
TextSize1 = (96, 25)

Is this a bug?

after some searching on the internet, I found this article


const float LocalOutlineSize = (float)(GetFont().OutlineSettings.OutlineSize);

// Account for the outline width impacting both size of the text by multiplying by 2
// Outline size in Y is accounted for in MaxHeight calculation in Measure()
const FVector2D ComputedOutlineSize(LocalOutlineSize * 2.f, LocalOutlineSize);
const FVector2D TextSize = FSlateApplication::Get().GetRenderer()->GetFontMeasureService()->Measure(BoundText.Get(), GetFont()) + ComputedOutlineSize + LocalShadowOffset;