blob: 43526ada4ed945d82fc0cf7310e09312e79612e5 (
plain) (
blame)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
//-----------------------------------------------------------------------------
// Name: FontMaker.h
//
// Desc: Defines the class behaviors for the application.
//
// Hist: 09.06.02 - Revised Fontmaker sample
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#ifndef FONTMAKER_H
#define FONTMAKER_H
#include "resource.h"
#include "BitmapFontFile.h"
#include <math.h>
#include "..\toollib\toollib.h"
#include "..\toollib\scriplib.h"
#include "..\toollib\piclib.h"
//-----------------------------------------------------------------------------
// Name: class CFontMakerView
// Desc: The scroll view class for viewing the font texture image
//-----------------------------------------------------------------------------
class CFontMakerView : public CScrollView
{
protected:
CFontMakerView() {}
DECLARE_DYNCREATE(CFontMakerView)
CDC m_memDC;
public:
VOID OnNewFontGlyphs();
virtual ~CFontMakerView();
public:
// Overridden functions
//{{AFX_VIRTUAL(CFontMakerView)
public:
virtual void OnDraw(CDC* pDC);
virtual void OnInitialUpdate();
protected:
//}}AFX_VIRTUAL
protected:
// Message map functions
//{{AFX_MSG(CFontMakerView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//-----------------------------------------------------------------------------
// Name: class CFontMakerFrameWnd
// Desc: The main frame window class for the app, which contains the dialog bar
// full of controls and the scroll view to view the font texture image.
//-----------------------------------------------------------------------------
class CFontMakerFrameWnd : public CFrameWnd
{
public:
CFontMakerFrameWnd() {}
virtual ~CFontMakerFrameWnd() {}
CDialogBar m_wndDialogBar;
CDialogBar* GetDialogBar() { return &m_wndDialogBar; }
protected:
DECLARE_DYNCREATE(CFontMakerFrameWnd)
// Message map functions
//{{AFX_MSG(CFontMakerFrameWnd)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//-----------------------------------------------------------------------------
// Name: class CFontMakerApp
// Desc: The main app class
//-----------------------------------------------------------------------------
class CFontMakerApp : public CWinApp
{
CDialogBar* m_pDialogBar;
CFontMakerView* m_pView;
HCURSOR m_hWaitCursor;
public:
CFontMakerApp() {}
~CFontMakerApp() {}
VOID UpdateSelectedGlyph( BOOL bGlyphSelected, int iSelectedGlyph = 0 );
HRESULT CalculateAndRenderGlyphs();
VOID InsertGlyph();
void SetTextureSize( int width, int height );
// Overrides
//{{AFX_VIRTUAL(CFontMakerApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CFontMakerApp)
afx_msg void OnNewFontButton();
afx_msg void OnEffectsCheck();
afx_msg void OnGlyphsFromRangeRadio();
afx_msg void OnChangeGlpyhsRangeEdit();
afx_msg void OnGlyphsFromFileRadio();
afx_msg void OnChangeGlyphsFileEdit();
afx_msg void OnGlyphsFileSelectorButton();
afx_msg void OnTextureSizeButton();
afx_msg void OnMagnifyButton();
afx_msg void OnGlyphSpecial();
afx_msg void OnUpdateButton( CCmdUI* pCmdUI );
afx_msg void OnSaveButton();
afx_msg void OnExit();
afx_msg void OnAbout();
afx_msg void OnHelp();
afx_msg void OnGlyphsCustom();
afx_msg void OnLoadButton();
afx_msg void OnLoadCustomFontButton();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
// External reference to the unique application instance
extern CFontMakerApp theApp;
#endif // FONTMAKER_H
|