Glyphix
一个用于改进 Minecraft 字体支持的模组。
功能特性
- 完全客户端运行。安装了此模组的玩家都能正确显示表情符号(Emoji)。
- 默认支持完整的 twemoji。
- 精确的宽度计算。由于表情符号由多个字符组成,Minecraft 在处理其宽度时存在困难,但本模组解决了这一问题。
- 不同的表情符号图集(Atlas)。
- 快速高效。虽然此模组不会提升原版的速度,但由于其优化良好,即使增加了更多功能也不会导致性能下降。如果我想出任何能加速原版的方案,一定会加入到此模组中。
该模组目前仍处于测试阶段,因为重构 Minecraft 的字体系统非常棘手。如果遇到任何错误,请向 问题追踪器 报告。
如何使用表情符号
只需复制并粘贴原始的表情符号代码。在 unicode.org 上查看 browser 列的内容。twitter 列中的内容默认即可正常工作。
计划中的功能
- 从
.ttf 字体支持连字(Ligature)功能。表情符号本质上就是连字,因此添加更多支持应该不难。
- 渲染粗体时使用真正的粗体字体。目前 Minecraft 在需要粗体时只是简单地将文本渲染两次,我希望增加对指定粗体字体的支持。
- 渲染斜体时使用真正的斜体字体。目前 Minecraft 只是对文本进行切片处理。
- 修复一些奇怪的
.ttf 字体错误。目前在间距和 .ttf 字体方面存在一些不准确之处。项目的另一个目标是确保正确渲染。
- 解决文本框中与表情符号相关的异常问题。文本框在某些计算中使用的是字符串长度而非字形长度,这可能导致渲染异常。修复这些问题需要一定的工作量,但将提高可用性。
- 聊天钩子,自动将诸如
:grinning_face: 这样的字符串转换为 ?,适用于传入和传出的消息。
- 其他内置的表情符号字体
更改表情符号图集
有一个脚本 ./scripts/emoji_atlas.py,可将包含表情符号的目录转换为带有 JSON 文件指定位置的图集。表情符号的名称必须为 <unicode>.png,多字符表情符号则为 <unicode>-<unicode>.png,依此类推。如果您选择的表情符号采用不同的命名方案,修改 Python 脚本以适配名称应该并不困难。
该脚本将生成两个文件:emoji_atlas.png 和 emoji_positions.png。将它们放入资源包下的 assets/glyphix/emoji/ 目录中。重新加载纹理包后,新的表情符号应能正确渲染。
目前,表情符号必须是正方形才能正确渲染。
Glyphix
A mod to improve font support for Minecraft.
Features
- 100% client side. Anyone who has this mod will see emojis as properly rendered.
- Full twemoji support by default
- Proper width calculations. Because emojis are multiple characters, Minecraft has a hard time dealing with width, but
- Different emoji atlases
- Fast. This mod does not improve vanilla speed, but even with more features it does not slow down. If I can think of a way to speed up vanilla that will definitely get added to this mod.
This mod is still in beta because overhauling Minecraft's font is super finicky. If there are any bugs, please report them to the issue tracker.
How to use emojis
Just copy and paste the raw emoji. In unicode.org it's the browser column. Anything in the twitter column should work by default.
Planned Features
- Ligature support from
.ttf fonts. Emojis are essentially just ligatures so it probably won't be too hard to add more support.
- Use an actual bold font when rendering bold. Currently Minecraft just renders text twice when it is supposed to be bold, I want to add support for a specified bold font.
- Use an actual italic font when rendering italic. Currently minecraft just slices text.
- Fix some weird
.ttf bugs. There are some inaccuracies with spacing and .ttf font. Another goal of the project is to make it render correctly.
- Text box weirdness with emojis. Textboxes uses string length and not glyph length for some calculations which can make rendering weird. Fixing these will require a bit of work, but should improve usability.
- Chat hooks to automatically convert strings like
:grinning_face: -> ? for incoming and outgoing messages.
- Other built in emoji fonts
Changing Emoji Atlas
There is a script ./scripts/emoji_atlas.py that will convert a directory of emojis into an atlas with JSON file specifying locations. The emojis name has to be <unicode>.png with multi-character emojis as <unicode>-<unicode>.png and so on. It shouldn't be too hard to modify the python script to change the names if there is a different naming scheme for whatever emojis you choose.
The script will generate 2 files. emoji_atlas.png and emoji_positions.png. Put these into a resourcepack under assets/glyphix/emoji/. Reload texturepacks and the new emojis should render correctly.
Currently, emojis have to be square for them to render correctly.
评论 0
登录后参与评分
还没有评论,来抢沙发吧