OpenMoHAA
0.82.1
Loading...
Searching...
No Matches
uifont.h
1
/*
2
===========================================================================
3
Copyright (C) 2015 the OpenMoHAA team
4
5
This file is part of OpenMoHAA source code.
6
7
OpenMoHAA source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
11
12
OpenMoHAA source code is distributed in the hope that it will be
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with OpenMoHAA source code; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
===========================================================================
21
*/
22
23
#pragma once
24
25
class
UIRect2D
;
26
27
typedef
enum
{
28
FONT_JUSTHORZ_CENTER,
29
FONT_JUSTHORZ_LEFT,
30
FONT_JUSTHORZ_RIGHT
31
} fonthorzjustify_t;
32
33
typedef
enum
{
34
FONT_JUSTVERT_TOP,
35
FONT_JUSTVERT_CENTER,
36
FONT_JUSTVERT_BOTTOM
37
} fontvertjustify_t;
38
39
class
UIFont
40
{
41
protected
:
42
unsigned
int
m_listbase;
43
UColor
color;
44
fontheader_t *m_font;
45
46
//
47
// Added in OPM
48
//
49
str
name;
50
int
refHandle;
51
52
public
:
53
UIFont();
54
UIFont(
const
char
*fn);
55
56
void
Print(
float
x,
float
y,
const
char
*text,
size_t
maxlen = -1,
const
float
*virtualScreen = NULL);
57
void
PrintJustified(
58
const
UIRect2D
& rect,
59
fonthorzjustify_t horz,
60
fontvertjustify_t vert,
61
const
char
*text,
62
const
float
*vVirtualScale
63
);
64
void
PrintOutlinedJustified(
65
const
UIRect2D
& rect,
66
fonthorzjustify_t horz,
67
fontvertjustify_t vert,
68
const
char
*text,
69
const
UColor
& outlineColor,
70
const
float
*vVirtualScale
71
);
72
void
setColor(
UColor
col);
73
void
setAlpha(
float
alpha);
74
void
setFont(
const
char
*fontname);
75
int
getMaxWidthIndex(
const
char
*text,
int
maxlen);
76
int
getWidth(
const
char
*text,
int
maxlen);
77
int
getCharWidth(
unsigned
short
ch);
78
int
getHeight(
const
char
*text,
int
maxlen,
const
float
*virtualScale = NULL);
79
int
getHeight(
const
float
*virtualScale = NULL);
80
int
CodeSearch(
unsigned
short
uch);
81
bool
DBCSIsLeadByte(
unsigned
short
uch);
82
bool
DBCSIsMaekin(
unsigned
short
uch);
83
bool
DBCSIsAtokin(
unsigned
short
uch);
84
int
DBCSGetWordBlockCount(
const
char
*text,
int
maxlen);
85
86
private
:
87
void
CheckRefreshFont();
88
};
89
90
int
UI_FontStringWidth(fontheader_t *pFont,
const
char
*pszString,
int
iMaxLen);
UColor
Definition
ucolor.h:26
UIRect2D
Definition
uirect2d.h:29
str
Definition
str.h:77
code
uilib
uifont.h
Generated by
1.13.2