4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include "Screen/Font.hpp"
26 #include "Screen/Layout.hpp"
31 Font normal_font
, small_font
, bold_font
, monospace_font
;
34 GetStandardMonospaceFontFace()
37 return _T("Droid Sans Mono");
43 InitialiseLogfont(LOGFONT
* font
, const TCHAR
* facename
, int height
,
44 bool bold
= false, bool italic
= false,
45 bool variable_pitch
= true)
47 memset((char *)font
, 0, sizeof(LOGFONT
));
49 _tcscpy(font
->lfFaceName
, facename
);
52 font
->lfPitchAndFamily
= (variable_pitch
? VARIABLE_PITCH
: FIXED_PITCH
)
56 font
->lfHeight
= (long)height
;
57 font
->lfWeight
= (long)(bold
? FW_BOLD
: FW_MEDIUM
);
58 font
->lfItalic
= italic
;
62 font
->lfQuality
= NONANTIALIASED_QUALITY
;
64 font
->lfQuality
= ANTIALIASED_QUALITY
;
71 const TCHAR
*face
= _T("Tahoma");
74 UPixelScalar font_height
= Layout::SmallScale(IsAndroid() ? 30 : 24);
76 UPixelScalar font_height
= Layout::SmallScale(35);
80 InitialiseLogfont(&lf
, face
, font_height
/ 2);
83 InitialiseLogfont(&lf
, face
, font_height
/ 2 - Layout::Scale(2));
86 InitialiseLogfont(&lf
, face
, font_height
/ 2, true);
89 InitialiseLogfont(&lf
, GetStandardMonospaceFontFace(),
90 10, false, false, false);
91 monospace_font
.Load(lf
);
97 monospace_font
.Destroy();
100 normal_font
.Destroy();