当前位置:网站首页>OSG笔记:使用setFontResolution设置字体分辨率
OSG笔记:使用setFontResolution设置字体分辨率
2022-08-09 22:01:00 【shanql】
setFontResolution
使用类osgText::Text成员函数setFontResolution, 可以设置字符的分辨,值越大,字符越清晰。这个要看出效果,可以将单个字符的高度设置的大一点,如300, 然后调用setFontResolution(16, 16)
。这样就可以看出效果。
示例核心代码
osg::ref_ptr<osg::Group> pRoot = new osg::Group();
osg::ref_ptr<osg::Geode> pTextGeode = new osg::Geode();
pRoot->addChild(pTextGeode);
for (int i = 0; i < 10; ++i)
{
osgText::Text* pText = new osgText::Text();
pText->setFont("simfang.ttf");
pText->setFontResolution(8*(i+1), 8*(i+1));//字体分辨率,值越大越清晰
pText->setText(L"中文支持你好");
pText->setPosition(osg::Vec3(0, i*320, 0));
pText->setCharacterSize(300, 1.0 );
pTextGeode->addDrawable(pText);
}
运行截图
边栏推荐
- B. Applejack and Storages
- Presto Event Listener开发
- 面试官:Redis 大 key 要如何处理?
- 跨端技术方案选什么好?
- Jinshanyun earthquake, the epicenter is in bytes?
- R语言修改dataframe数据列的名称:使用dplyr包的rename函数修改列名、使用colnmaes函数修改列名、在数据筛选的时候重命名列名
- Domestic mobile phone manufacturers once fought for it, but now it is the first to collapse...
- 重装系统后新建文本文档打不开怎么办
- JS Deobfuscation - AST Restoration Case
- 好未来,想成为第二个新东方
猜你喜欢
Chatting embarrassing scenes, have you encountered it?Teach you to get the Doutu emoticon package with one click, and become a chat expert
C 在函数声明前加typedef
AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
leetcode:323. 无向图中连通分量的数目
孙正义亏掉1500亿:当初投贵了
How do task flow executors work?
Multiple reasons for MySQL slow query
JSON 基本使用
Presto Event Listener开发
聊天尬死名场面,你遇到过吗?教你一键获取斗图表情包,晋升聊天达人
随机推荐
Evolution of MLOps
In-depth analysis of Apache EventMesh cloud-native distributed event-driven architecture
mysql 找不到或无法加载已注册的 .Net Framework Data Provider。
18-GuliMall 压力测试与性能监控
Xiaohei leetcode's refreshing rainy day trip, just finished eating Yufei Beef Noodles, Mala Tang and Beer: 112. Path Sum
One Pass 2074: [21CSPJ Popularization Group] Candy
级联下拉菜单的实现「建议收藏」
【LaTex】 Font “FandolSong-Regular“ does not contain requested(fontspec)Script “CJK“.如何抑制此种警告?
FileZilla搭建FTP服务器图解教程
JSON 基本使用
反射机制篇
十步以内,用小程序快速生成App!
【微服务~Nacos】Nacos之配置中心
用户代码未处理MetadataException
开发者必备:一文快速熟记【数据库系统】和【软件开发模型】常用知识点
Flask introductory learning tutorial
【技术分享】SLA(服务等级协议)原理与配置
Quotefancy ,提供鼓舞人心语录的壁纸网站 - 倾城之链
README_Albumentations
大型分布式存储方案MinIO介绍,看完你就懂了!