windows - Windows字体光栅化,黑盒错误?
问题描述
因为我不想做提示,所以我放弃了自己光栅化 TTF 的努力,所以我转向了 Windows 的方法......我想我发现了一个错误。
我使用了 Windows 的DrawText函数,左栏中是GLYPHMETRICS结构,其中加载了GetGlyphOutline:
SetRect(&rect, 10,0,5,5);
SetTextColor(glyph_hdc, RGB(255,0,0));
DrawText(glyph_hdc, TEXT("A"), -1,&rect, DT_NOCLIP);
...
SetRect(&rect, 70,0,5,5);
SetTextColor(glyph_hdc, RGB(255,0,0));
DrawText(glyph_hdc, TEXT("!"), -1,&rect, DT_NOCLIP);
GetGlyphOutlineA(glyph_hdc, ascii_code, GGO_BITMAP, &glyph_metric_A, 10000, win_bitmap, &m2);
我在 Adobe Illustrator 中使用灰色 2x1 矩形来测量距离...
我希望图片能很好地说明明显的错误:BlackBoxX 和 BlackBoxY 应该包含字形。你认为这是一个内部错误吗?你知道如何纠正这个吗?似乎黑匣子没有考虑到提示。
解决方案
推荐阅读
- git - 尝试执行 git push origin master 命令时,Git 说 403
- shell - 如何在我创建的每个子文件夹中创建一个 .psv 文件?我正在使用 bourne shell 脚本
- c - 是否可以使用 udp_sendto 重新发送 UDP 数据包?
- python - Discord bot在验证后未提供验证角色
- javascript - 如何在 fetch API 请求中包含 if-else 条件?
- web3js - 如何在 New Web3js 1.5.0 版本中调用智能合约读取方法?
- r - 如何绘制拉普拉斯噪声分布?
- linux - Selenium Chrome Webdriver 内存泄漏问题
- mysql - MySQL 使用不同的 where 子句从一个表进行多次计算
- angular - Angular ngx-bootstrap datepicker如何限制未来的月份和年份