forked from microsoft/Xbox-ATG-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FontViewerScreen.h
40 lines (31 loc) · 1.23 KB
/
FontViewerScreen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//--------------------------------------------------------------------------------------
// FontViewerScreen.h
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#pragma once
#include "PanelScreen.h"
#include "NavigationHint.h"
#include <map>
class FontViewerScreen : public PanelScreen
{
public:
FontViewerScreen(FrontPanelManager *owner, const wchar_t *faceName, unsigned titleHeight, const wchar_t *fileName);
void AddFontFile(unsigned height, const wchar_t *fileName, const wchar_t *sampleText = s_defaultSampleText);
void RenderFrontPanel() override;
bool OnButtonPressed(XBOX_FRONT_PANEL_BUTTONS whichButton) override;
private:
struct FontData
{
const wchar_t *filename;
const wchar_t *sampleText;
};
using HeightToFontFile = std::map<unsigned, FontData>;
unsigned m_titleHeight;
const wchar_t *m_faceName;
HeightToFontFile m_heightToFontFile;
HeightToFontFile::const_iterator m_currentFont;
BasicNavigationHint m_nav;
static const wchar_t *s_defaultSampleText;
};