The display is correct in Window independent mode, but loading the font on the mobile terminal fails. My code is as follows
Code:
#define APPEND_FONT(TYPEFACE, NAME, FILENAME, HINTING) \
(TYPEFACE).AppendFont(TEXT(NAME), FPaths::ProjectContentDir() / TEXT("Art") / TEXT("UI") / TEXT("Fonts") / TEXT(FILENAME), HINTING, EFontLoadingPolicy::LazyLoad)
TSharedRef<FCompositeFont> MutableDefaultFont = MakeShared<FStandaloneCompositeFont>();
APPEND_FONT(MutableDefaultFont->DefaultTypeface, "Bold", "Roboto-Bold.ttf", EFontHinting::Default);
APPEND_FONT(MutableDefaultFont->DefaultTypeface, "Light", "Roboto-Light.ttf", EFontHinting::Default);
SOverlay::Slot()
.HAlign(HAlign_Center)
.VAlign(VAlign_Center)
.Padding(0, 300, 0, 0)
[
SNew(STextBlock)
.Text(this, &SLoadingScreen::GetTipsText)
.Font(FSlateFontInfo(MutableDefaultFont, 15, FName("Light")))
.ColorAndOpacity(FSlateColor(FLinearColor(FColor(242, 231, 201, 128))))
]
Log:
09:40:50.048: D/UE4(7011): [2020.02.29-01.40.50:048][ 0]LogStreaming: Warning: Failed to read file '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' error.
02-29 09:40:50.048: D/UE4(7011): [2020.02.29-01.40.50:048][ 0]LogSlate: Warning: GetFontFace failed to load or process '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' with face index 0
02-29 09:40:50.048: D/UE4(7011): [2020.02.29-01.40.50:048][ 0]LogStreaming: Warning: Failed to read file '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' error.
02-29 09:40:50.048: D/UE4(7011): [2020.02.29-01.40.50:048][ 0]LogSlate: Warning: GetFontFace failed to load or process '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' with face index 0
02-29 09:40:50.049: D/UE4(7011): [2020.02.29-01.40.50:049][ 0]LogStreaming: Warning: Failed to read file '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' error.
02-29 09:40:50.049: D/UE4(7011): [2020.02.29-01.40.50:049][ 0]LogSlate: Warning: GetFontFace failed to load or process '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' with face index 0
02-29 09:40:50.049: D/UE4(7011): [2020.02.29-01.40.50:049][ 0]LogStreaming: Warning: Failed to read file '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' error.
02-29 09:40:50.049: D/UE4(7011): [2020.02.29-01.40.50:049][ 0]LogSlate: Warning: GetFontFace failed to load or process '../../../UE_game/Content/Art/UI/Fonts/Roboto-Bold.ttf' with face index 0