当前位置:网站首页>[CEGUI] font loading optimization
[CEGUI] font loading optimization
2022-06-12 10:09:00 【Lindo】
CEGUI Font loading optimization
- CEGUI See... For font loading process 【CEGUI】Font Resource loading process
- CEGUI For font loading , for example Freetype Type font , Will pass libfreetype Traverse all font indexes of the font file , And keep its corresponding character code .
void FreeTypeFont::initialiseGlyphMap()
{
FT_UInt gindex;
// d_fontFace Is the of this font FontFace object , Get the corresponding character code through the font index .
FT_ULong codepoint = FT_Get_First_Char(d_fontFace, &gindex);
FT_ULong max_codepoint = codepoint;
// Here you will find all the font styles
while (gindex)
{
if (max_codepoint < codepoint)
max_codepoint = codepoint;
// Build character code map
d_cp_map[codepoint] = FontGlyph();
codepoint = FT_Get_Next_Char(d_fontFace, codepoint, &gindex);
}
setMaxCodepoint(max_codepoint);
}
- Optimize : For the same font file , Its font index and character code . It's basically the same . So different sizes of the same font , When loading resources , You can take . Character code and font index resources .
- for example ( Pseudo code )
void FreeTypeFont::initialiseGlyphMap()
{
// d_font_codePitonMap Is a static member variable
// By font name , Find out if the font has been loaded .
isFontLoaded(fontName);
if ( Loaded ) {
d_cp_map = d_font_codePitonMap[fontName];
// Other treatments
} else {
// The original logic
d_font_codePitonMap[fontName] = d_cp_map;
}
}
- In this case , For each font , It will consume more memory ( Keep a wearable character code map), But the speed of loading fonts will be significantly improved .
边栏推荐
- Docker compose integrates redis, MySQL and microservices, and services are containerized
- Redis (I) Internal data structure
- [chromium] location information kernel debugging
- Implementation of fruit mall wholesale platform based on SSM
- Explanation of the principle of MySQL's leftmost matching principle
- postgresql 使用存储过程,拼接多张表,查询数据
- Papaya Mobile: cross border marketing has entered the era of "information flow", allowing independent station sellers to share opportunities to go to sea
- [untitled]
- [DDS] dds-rpc implementation based on opendds
- Auto. JS learning notes 7: JS file calls functions and variables in another JS file to solve various problems of call failure
猜你喜欢

【926. 将字符串翻转到单调递增】

Raw socket usage

HALCON联合C#检测表面缺陷——仿射变换(三)

Redis (I) Internal data structure

SAP Hana error message sys_ XSA authentication failed SQLSTATE - 28000

001: what is a data lake?

Create simple windowing programs using Visual Studio 2017

JVM (III) Virtual machine performance monitoring & fault handling tool
Docker compose integrates redis, MySQL and microservices, and services are containerized
Detailed explanation and use of redis data types: key and string types
随机推荐
Using C language code to realize factory LCD RGB test program
The white paper "protecting our digital heritage: DNA data storage" was released
MySQL 7 affair
Spark complex structure data retrieval method
哈希表的理论讲解
np.meshgrid()函数 以及 三维空间中的坐标位置生成 以及 numpy.repeat()函数介绍
Papaya Mobile has a comprehensive layout of cross-border e-commerce SaaS papaya orange. What are the opportunities for this new track?
002: what are the characteristics of the data lake
2021-02-21
Transport layer protocol -- TCP protocol
MySQL优化之慢日志查询
奇葩错误 -- 轮廓检测检测到边框、膨胀腐蚀开闭运算效果颠倒
Auto. JS learning note 10: instantiate a custom object and use json The stringify() method causes an error (resolved)
Canal ha mode configuration
[preview of the open class of Jishu] arm's strongest MCU core cortex-m85 processor helps the innovation of the Internet of things in an all-round way (there is a lottery)
2021-02-22
Enumerate all USB device codes
Differences among list, set and map
OpenCV中CLAHE用于16位图像增强显示
Crazy temporary products: super low price, big scuffle and new hope