mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-09 01:01:05 +00:00
- Exported GetDisplayTopOffset for font characters to ZScript
This commit is contained in:
parent
1b762474f0
commit
78360c1888
2 changed files with 14 additions and 0 deletions
|
@ -719,6 +719,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetDefaultKerning, GetDefaultKerning)
|
||||||
ACTION_RETURN_INT(self->GetDefaultKerning());
|
ACTION_RETURN_INT(self->GetDefaultKerning());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static double GetDisplayTopOffset(FFont* font, int c)
|
||||||
|
{
|
||||||
|
auto texc = font->GetChar(c, CR_UNDEFINED, nullptr);
|
||||||
|
return texc ? texc->GetDisplayTopOffset() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_NATIVE(FFont, GetDisplayTopOffset, GetDisplayTopOffset)
|
||||||
|
{
|
||||||
|
PARAM_SELF_STRUCT_PROLOGUE(FFont);
|
||||||
|
PARAM_INT(code);
|
||||||
|
ACTION_RETURN_FLOAT(GetDisplayTopOffset(self, code));
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// file system
|
// file system
|
||||||
|
|
|
@ -649,6 +649,7 @@ struct Font native
|
||||||
|
|
||||||
native static int FindFontColor(Name color);
|
native static int FindFontColor(Name color);
|
||||||
native double GetBottomAlignOffset(int code);
|
native double GetBottomAlignOffset(int code);
|
||||||
|
native double GetDisplayTopOffset(int code);
|
||||||
native static Font FindFont(Name fontname);
|
native static Font FindFont(Name fontname);
|
||||||
native static Font GetFont(Name fontname);
|
native static Font GetFont(Name fontname);
|
||||||
native BrokenLines BreakLines(String text, int maxlen);
|
native BrokenLines BreakLines(String text, int maxlen);
|
||||||
|
|
Loading…
Reference in a new issue