- made adjustments to the text placement on the summary screen.

With extended fonts much of the old code did not work anymore, this needed more precise checks for the sources of the printed texts.
This commit is contained in:
Christoph Oelckers 2019-07-30 10:52:24 +02:00
commit c36dc137ba
5 changed files with 122 additions and 23 deletions

View file

@ -2032,6 +2032,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, StringWidth, StringWidth)
ACTION_RETURN_INT(StringWidth(self, str));
}
static int GetMaxAscender(FFont* font, const FString& str)
{
const char* txt = str[0] == '$' ? GStrings(&str[1]) : str.GetChars();
return font->GetMaxAscender(txt);
}
DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetMaxAscender, GetMaxAscender)
{
PARAM_SELF_STRUCT_PROLOGUE(FFont);
PARAM_STRING(str);
ACTION_RETURN_INT(GetMaxAscender(self, str));
}
static int CanPrint(FFont *font, const FString &str)
{
const char *txt = str[0] == '$' ? GStrings(&str[1]) : str.GetChars();