Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

候选项中出现emoji时导致输入法行高增加 #1175

Closed
Yikai-Liao opened this issue Apr 8, 2024 · 16 comments · Fixed by #1177
Closed

候选项中出现emoji时导致输入法行高增加 #1175

Yikai-Liao opened this issue Apr 8, 2024 · 16 comments · Fixed by #1177

Comments

@Yikai-Liao
Copy link

Yikai-Liao commented Apr 8, 2024

上报前请检查

  • [ ✔] 我遇到的问题没有其他人在 issue 里提到过
  • [ ✔] 我的小狼毫版本于 rime/weasel 下载
  • [ ✔] 我在使用小狼毫的最新发布版本,或最新发布版本后的 CI 构建

操作系统信息

  • OS 详细版本: Windows 10 22H2 19045.4239
  • 小狼毫版本: 0.15.0.0

描述遇到的问题
候选项中出现emoji时导致输入法行高增加。具体情况与鼠须管中已经解决的issue一致(鼠须管已经在2021年修复该bug::rime/squirrel#559 )。希望可以跟进修复这个bug。

image

@fxliang
Copy link
Contributor

fxliang commented Apr 8, 2024

检查确认 #1177 的产出,适当调整 新增的两个参数的数值,看是否可以解决这个问题吧。

@Yikai-Liao
Copy link
Author

我应该怎么测试呢?nightly build还没有编译这个新版本

@fxliang
Copy link
Contributor

fxliang commented Apr 9, 2024

https://github.com/rime/weasel/actions/runs/8598045790
下方的artifact下载,里面有安装包

基本原理大概是通过linespacing调大行距,通过baseline调整基线位置,相当于调大了出来的back的高度(竖排文字时宽度)。

但是呢,如果使用的两种字体的基线位置相差太多的话,还是会无法对齐行内的不同字体的字形的,这个是字体设计的问题。

patch:
  style/layout/baseline: 100  # 100% of font point height
  style/layout/linespacing: 140   # 140% of font point height, when flicker happened, should be a value larger than 100

@Yikai-Liao
Copy link
Author

没有效果,我是不是得调整emoji行高去了

@fxliang
Copy link
Contributor

fxliang commented Apr 9, 2024

没有效果,我是不是得调整emoji行高去了

默认没有调的,要类似我上面例子那样修改微调到满意效果。当然如果你是要一样字形高度,那只能字体解了

@Yikai-Liao
Copy link
Author

我把配置文件复制过去了,但是感觉没生效?怎么改linespacing 感觉行高都没区别。

@fxliang
Copy link
Contributor

fxliang commented Apr 10, 2024

image

  style/layout/linespacing: 200
  style/layout/baseline: 100

@Yikai-Liao
Copy link
Author

image
image

我不确定我的配置写的有没有问题,但是我感觉修改style/layout/linespacing 并没有让我的输入法外观出现变化。

或者你能推荐一下什么emoji行高与一般字符一致的字体吗😢

@mirtlecn
Copy link
Contributor

mirtlecn commented Apr 11, 2024

能推荐一下什么emoji行高与一般字符一致的字体吗 @Yikai-Liao

font_face: 等距更纱黑体 SC, Noto Color Emoji # 或者更纱黑体 SC
font_face: 思源黑体 CN:41:5A, 思源黑体 CN:61:9A, Segoe UI Emoji, 思源黑体 CN, 遍黑体P1, 遍黑体P2

不过也仅限于 emoji 和部分中文字符了。这个问题不仅影响 emoji,

阿拉伯数字、全角字符等都会导致候选高度变化。

@fxliang
Copy link
Contributor

fxliang commented Apr 11, 2024

image image

我不确定我的配置写的有没有问题,但是我感觉修改style/layout/linespacing 并没有让我的输入法外观出现变化。

或者你能推荐一下什么emoji行高与一般字符一致的字体吗😢

不是在default.custom.yaml 里是weasel.custom.yaml 里

@fxliang
Copy link
Contributor

fxliang commented Apr 11, 2024

能推荐一下什么emoji行高与一般字符一致的字体吗 @Yikai-Liao

font_face: 等距更纱黑体 SC, Noto Color Emoji # 或者更纱黑体 SC
font_face: 思源黑体 CN:41:5A, 思源黑体 CN:61:9A, Segoe UI Emoji, 思源黑体 CN, 遍黑体P1, 遍黑体P2

不过也仅限于 emoji 和部分中文字符了。这个问题不仅影响 emoji,

阿拉伯数字、全角字符等都会导致候选高度变化。

是,所以这个尝试其实本质是个掩耳盗铃,强行拉高,目标是减少闪烁。我试过会跳的组合似乎有效果,但是不确定是不是总有效果

@mirtlecn
Copy link
Contributor

你配置写错地方了,当然有效果

@Yikai-Liao
Copy link
Author

你配置写错地方了,当然有效果

😦,应该写哪啊🤦‍♂️

@mirtlecn
Copy link
Contributor

不是在default.custom.yaml 里是weasel.custom.yaml 里

@Yikai-Liao
Copy link
Author

生效了,我这现在不跳了

@changzaicl
Copy link

未fix_emoji前,字体大小设置为16及以上,打出emoji就不会跳。但是小于16就肯定会跳。
现在fix_emoji后,设置字体小于16也不会跳了。很好用。
谢谢!

patch:
  style/layout/baseline: 100  # 100% of font point height
  style/layout/linespacing: 140   # 140% of font point height, when flicker happened, should be a value larger than 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants