dl
dl_font.h
浏览该文件的文档.
1
11#pragma once
12
13#include "render/dl_image.h"
14
15namespace dl
16{
17
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
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
49{
52 float _bearingX;
53 float _bearingY;
54 float _advance;
56 {
57 delete _image;
58 delete _imageOutline;
59 }
60};
61
62}
图像对象
Vector2< uint32_t, unsigned > Image
字符图像数据
~CharImage()
水平步进
Image * _imageOutline
float _bearingY
左侧离 对齐点的距离
float _advance
顶部到 基线的距离
size_t operator()(const CharInfo &info) const
字符信息
std::size_t _font
unsigned _outline
bool operator==(const CharInfo &b) const
unsigned _size