Norman Feske 96a068f90a terminal: improve internal structure
This patch reorganizes the terminal's source code to become easier to
extend. It also enables the strict warning level.
2018-02-09 14:04:32 +01:00

48 lines
917 B
C++

/*
* \brief Terminal font handling
* \author Norman Feske
* \date 2018-02-06
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _FONT_FAMILY_H_
#define _FONT_FAMILY_H_
/* local includes */
#include "types.h"
namespace Terminal {
typedef Text_painter::Font Font;
class Font_family;
}
class Terminal::Font_family
{
private:
Font const &_regular;
public:
Font_family(Font const &regular) : _regular(regular) { }
/**
* Return font for specified face
*
* For now, we do not support font faces other than regular.
*/
Font const &font(Font_face) const { return _regular; }
unsigned cell_width() const { return _regular.str_w("m"); }
unsigned cell_height() const { return _regular.str_h("m"); }
};
#endif /* _FONT_FAMILY_H_ */