使用 Jsonnet 配置「元书」皮肤。
免责声明 / Disclaimer
本主题是基于 Google Gboard iOS 键盘的简单视觉仿制作品,专为元书输入法设计,仅供学习和个人使用。本项目不是 Gboard 原版应用的替代品或重新分发版本,也不隶属于、认可或赞助于 Google LLC。所有 Gboard 相关商标和品牌归其各自所有者所有。
关于元书输入法本身的功能、支持或其他问题,请联系输入法的原作者/提供者,而非本主题的制作者。This theme is a simple visual replica of the Google Gboard iOS keyboard, designed specifically for Hamster Input Method (元书输入法), for educational and personal use only. This project is not a replacement or redistribution of the original Gboard application, and is not affiliated with, endorsed, or sponsored by Google LLC. All Gboard-related trademarks and brands are property of their respective owners.
For questions about Hamster Input Method itself (features, support, etc.), please contact the original author/provider of the input method, not the theme creator.
关于源文件来源 / About Source Files
本项目的原始文件从 QQ 群中获取,由于缺少 Git 信息,遗失了原始仓库的详细信息。本人(ann61c)无意进行抄袭或将他人的作品据为己有。上述原作者信息基于文件中可追溯的署名,若有遗漏或错误,欢迎指正。The original files for this project were obtained from a QQ group communication, and due to the absence of Git information, the original repository details were lost. I (ann61c) have no intention to plagiarize or claim others' work as my own. The original authors listed above are based on attributions found in the files. If there are any omissions or errors, please let me know.
原作者: 叙白, 一土白申改
作者 / Author: ann61c
本项目是一个为 iOS 键盘应用「元书」设计的主题皮肤,采用 Google Gboard 风格。支持亮色/暗色主题、多种键盘布局(14键/18键/26键),以及完整的中文输入体验。
Gboard_theme/
├── light/ # 亮色主题资源目录
│ ├── resources/ # 存放图片及描述文件
│ ├── pinyin_26_portrait.yaml
│ ├── numeric_9_portrait.yaml
│ └── ...
├── dark/ # 暗色主题资源目录
│ ├── resources/
│ └── ...
├── jsonnet/ # 核心配置目录
│ ├── main.jsonnet # 主配置文件(入口)
│ ├── keyboard/ # 键盘布局配置
│ │ ├── pinyin_26_portrait.jsonnet
│ │ ├── numeric_9_portrait.jsonnet
│ │ ├── symbolic_portrait.jsonnet
│ │ └── ...
│ └── lib/ # 共享库文件
│ ├── color.libsonnet
│ ├── fontSize.libsonnet
│ ├── keyboardLayout.libsonnet
│ └── ...
├── demo.png # 皮肤预览图(PNG格式)
├── config.yaml # 生成的配置文件
└── README.md # 本文档
| 文件 | 说明 |
|---|---|
color.libsonnet |
主题颜色定义(亮色/暗色) |
fontSize.libsonnet |
各处字体大小配置 |
keyboardLayout.libsonnet |
中文键盘布局定义(14/18/26键) |
keyboardLayouten.libsonnet |
英文键盘布局定义 |
toolbar.libsonnet |
工具栏配置 |
swipeData.libsonnet |
上划/下划手势动作及显示 |
center.libsonnet |
文本偏移及缩放参数 |
others.libsonnet |
键盘高度、方案绑定等 |
| 文件 | 说明 |
|---|---|
pinyin_26_portrait.jsonnet |
中文拼音键盘(横竖屏) |
alphabetic_26_portrait.jsonnet |
英文键盘(横竖屏) |
numeric_9_portrait.jsonnet |
数字键盘竖屏 |
symbolic_portrait.jsonnet |
符号键盘竖屏 |
emoji_portrait.jsonnet |
Emoji 键盘 |
panel.jsonnet |
键盘面板 |
- 将皮肤导入「元书」应用
- 长按皮肤,选择「运行 main.jsonnet」生成键盘配置
- 配置完成后即可使用该皮肤
修改 jsonnet/keyboard/pinyin_26_portrait.jsonnet 中的 layoutType:
// 支持 14, 17, 18, 26 键
local layoutType = 26;修改后需重新运行 main.jsonnet 生效。
修改 jsonnet 源文件后,需要重新生成 YAML 文件:
cd jsonnet
jsonnet -m .. main.jsonnet底部按键宽度分配(总计 100%):
| 按键 | 宽度 | 说明 |
|---|---|---|
| 123键/中文键 | 11.5% | 切换键盘 |
| settings键 | 10.0% | 设置面板 |
| emoji键 | 10.0% | 表情键盘 |
| space键 | 43.5% | 空格 |
| enter键 | 25.0% | 回车确认 |
所有键盘采用统一的 padding 配置:
keyboardStyle insets: { top: 3, bottom: 3, left: 4, right: 4 }
字母键 insets: { top: 4, left: 3, bottom: 4, right: 3 }
功能键 insets: { top: 5, left: 3, bottom: 6, right: 3 }
- 在
lib/color.libsonnet中定义颜色变量 - 在
main.jsonnet中引用新主题 - 重新生成 YAML 文件
编辑 lib/others.libsonnet 中的高度配置:
'竖屏': {
'preedit高度': 55,
'toolbar高度': 48,
'keyboard高度': 275,
}- 底部按键尺寸统一: 所有键盘(拼音/数字/符号)的 enter 键统一为 25%,space 键扩展为 43.5%
- 内边距统一: 修复各键盘间 padding 不一致问题
- 文字偏移统一: 修复数字键盘中 space/enter 键文字位置偏移问题
- 英文键盘优化: enter 键尺寸与中文键盘保持一致
原始作者:叙白、一土白申改
欢迎提交 Issue 和 PR 改进此主题。
本项目遵循原作者的许可协议。