dl
dl
render
dl_font.h
浏览该文件的文档.
1
11
#pragma once
12
13
#include "
render/dl_image.h
"
14
15
namespace
dl
16
{
17
19
struct
CharInfo
20
{
21
std::size_t
_font
;
22
char32_t
_ch
;
23
unsigned
_size
;
24
unsigned
_outline
;
25
bool
operator==
(
const
CharInfo
& b)
const
26
{
27
return
_font
== b.
_font
28
&&
_ch
== b.
_ch
29
&&
_size
== b.
_size
30
&&
_outline
== b.
_outline
;
31
}
32
};
33
34
struct
CharInfoHash
35
{
36
//8 + 16 + 8 + 32
37
size_t
operator()
(
const
CharInfo
& info)
const
38
{
39
uint64_t n = ((uint64_t)info.
_font
<< 56)
40
| ((uint64_t)info.
_size
<< 40)
41
| ((uint64_t)info.
_outline
<< 32)
42
| ((uint64_t)info.
_ch
);
43
return
std::hash<uint64_t>()(n);
44
}
45
};
46
48
struct
CharImage
49
{
50
Image
*
_image
;
51
Image
*
_imageOutline
;
52
float
_bearingX
;
53
float
_bearingY
;
54
float
_advance
;
55
~CharImage
()
56
{
57
delete
_image
;
58
delete
_imageOutline
;
59
}
60
};
61
62
}
dl_image.h
图像对象
dl
定义
dl_array.h:22
dl::Image
Vector2< uint32_t, unsigned > Image
定义
dl_image.h:28
dl::CharImage
字符图像数据
定义
dl_font.h:49
dl::CharImage::_bearingX
float _bearingX
定义
dl_font.h:52
dl::CharImage::_image
Image * _image
定义
dl_font.h:50
dl::CharImage::~CharImage
~CharImage()
水平步进
定义
dl_font.h:55
dl::CharImage::_imageOutline
Image * _imageOutline
定义
dl_font.h:51
dl::CharImage::_bearingY
float _bearingY
左侧离 对齐点的距离
定义
dl_font.h:53
dl::CharImage::_advance
float _advance
顶部到 基线的距离
定义
dl_font.h:54
dl::CharInfoHash
定义
dl_font.h:35
dl::CharInfoHash::operator()
size_t operator()(const CharInfo &info) const
定义
dl_font.h:37
dl::CharInfo
字符信息
定义
dl_font.h:20
dl::CharInfo::_ch
char32_t _ch
定义
dl_font.h:22
dl::CharInfo::_font
std::size_t _font
定义
dl_font.h:21
dl::CharInfo::_outline
unsigned _outline
定义
dl_font.h:24
dl::CharInfo::operator==
bool operator==(const CharInfo &b) const
定义
dl_font.h:25
dl::CharInfo::_size
unsigned _size
定义
dl_font.h:23
制作者
1.13.1