1 /* 2 SPDX-FileCopyrightText: 2020-2020 Gustavo Carneiro <gcarneiroa@hotmail.com> 3 SPDX-FileCopyrightText: 2007-2008 Robert Knight <robertknight@gmail.com> 4 SPDX-FileCopyrightText: 1997, 1998 Lars Doelle <lars.doelle@on-line.de> 5 6 SPDX-License-Identifier: GPL-2.0-or-later 7 */ 8 9 #ifndef TERMINALFONTS_H 10 #define TERMINALFONTS_H 11 12 #include <QWidget> 13 14 #include "profile/Profile.h" 15 16 class QFont; 17 18 namespace Konsole 19 { 20 class TerminalFont 21 { 22 public: 23 explicit TerminalFont(QWidget *parent = nullptr); 24 ~TerminalFont() = default; 25 26 void applyProfile(const Profile::Ptr &profile); 27 28 void setVTFont(const QFont &f); 29 QFont getVTFont() const; 30 31 void increaseFontSize(); 32 void decreaseFontSize(); 33 void resetFontSize(); 34 35 void setLineSpacing(uint); 36 uint lineSpacing() const; 37 38 int fontHeight() const; 39 int fontWidth() const; 40 int fontAscent() const; 41 bool boldIntense() const; 42 bool antialiasText() const; 43 bool useFontLineCharacters() const; 44 45 protected: 46 void fontChange(const QFont &); 47 48 private: 49 QWidget *m_parent; 50 uint m_lineSpacing; 51 int m_fontHeight; 52 int m_fontWidth; 53 int m_fontAscent; 54 bool m_boldIntense; 55 bool m_antialiasText; 56 bool m_useFontLineCharacters; 57 58 Profile::Ptr m_profile; 59 }; 60 61 } 62 63 #endif 64