本文作者原创,首发在本博客;CSDN 上的同名文章已标注为转载并回链到本页:https://blog.csdn.net/qq_30220519/article/details/145042789
回退表
{
“blocks”: [
“UBLOCK_BASIC_LATIN”,
],
“font”: {
“family”: “Noto Sans SC”,
“style”: [
{
“name”: “Thin”,
“weight”: 250,
“sha1”: “xxxxx”
},
]
}
}
语言块
1 | blockTable.emplace("UBLOCK_BASIC_LATIN", UBLOCK_BASIC_LATIN); |
数据定义
1 | struct FontKey { |
回退解析
1 | std::unordered_map<std::string, FontKeys> uBlockStrToFontList; |
回退策略
1 | std::set<int> matchFontWeight(const std::string& style) |
使用示例
1 | FontKey oldKey { "Inter", "Regular", "xxxx"}; |
参考
C++字体库开发之字体回退三_c++shx字体-CSDN博客
创作不易,小小的支持一下吧!

