diff options
Diffstat (limited to 'Libraries/LibHTML/CSS')
-rw-r--r-- | Libraries/LibHTML/CSS/StyleProperties.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibHTML/CSS/StyleProperties.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibHTML/CSS/StyleProperties.cpp b/Libraries/LibHTML/CSS/StyleProperties.cpp index 2c74171e28..e0386e63b0 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.cpp +++ b/Libraries/LibHTML/CSS/StyleProperties.cpp @@ -91,3 +91,9 @@ void StyleProperties::load_font() const m_font = Font::load_from_file(String::format("/res/fonts/%s", file_name.characters())); } + +int StyleProperties::line_height() const +{ + // FIXME: Allow overriding the line-height. We currently default to 140% which seems to look nice. + return (int)(font().glyph_height() * 1.4f); +} diff --git a/Libraries/LibHTML/CSS/StyleProperties.h b/Libraries/LibHTML/CSS/StyleProperties.h index 650836eed1..c18b87ef93 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.h +++ b/Libraries/LibHTML/CSS/StyleProperties.h @@ -32,6 +32,8 @@ public: return *m_font; } + int line_height() const; + private: HashMap<unsigned, NonnullRefPtr<StyleValue>> m_property_values; |