1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

LibGUI: Enable the use of font properties through GML

You can now specify the font, font_size, font_weight
and font_type (fixed_width/normal) through GML
This commit is contained in:
Edgar Araújo 2021-03-22 19:51:06 +00:00 committed by Andreas Kling
parent 243d7d9ecf
commit 532e0090fc
4 changed files with 76 additions and 0 deletions

View file

@ -347,4 +347,18 @@ T* Object::find_descendant_of_type_named(const String& name) requires IsBaseOf<O
{ Gfx::TextAlignment::CenterRight, "CenterRight" }, \
{ Gfx::TextAlignment::TopRight, "TopRight" }, \
{ Gfx::TextAlignment::BottomRight, "BottomRight" })
#define REGISTER_FONT_WEIGHT_PROPERTY(property_name, getter, setter) \
REGISTER_ENUM_PROPERTY( \
property_name, getter, setter, unsigned, \
{ Gfx::FontWeight::Thin, "Thin" }, \
{ Gfx::FontWeight::ExtraLight, "ExtraLight" }, \
{ Gfx::FontWeight::Light, "Light" }, \
{ Gfx::FontWeight::Regular, "Regular" }, \
{ Gfx::FontWeight::Medium, "Medium" }, \
{ Gfx::FontWeight::SemiBold, "SemiBold" }, \
{ Gfx::FontWeight::Bold, "Bold" }, \
{ Gfx::FontWeight::ExtraBold, "ExtraBold" }, \
{ Gfx::FontWeight::Black, "Black" }, \
{ Gfx::FontWeight::ExtraBlack, "ExtraBlack" })
}