home icon indicating copy to clipboard operation
home copied to clipboard

界面多字体支持

Open tongyuantongyu opened this issue 7 years ago • 15 comments

折腾了下小狼毫对生僻字的支持,发现了一个问题。 weasel.custom.yaml中"style/font_face"只能设定一个字体

我配置中按自己喜好指定了思源宋体 部分生僻字思源也没有收,于是windows自动fallback到Sun-ExtB(简体windows10状况,繁体会选择MingLiu-ExtB) 但还是有一些汉字(比如这个CJK扩展F区汉字𮢲(U+2E8B2))依然无法显示,只有一个方框。要显示这个汉字必须使用花园明朝(HanaMin-B),但是鉴于这个字体的质量我并不打算将其作为主字体。(有一点神奇的是安装后我的浏览器(Chrome)不需要其他设置就可以显示这个字了) 但小狼毫不支持,这个情况就需要设定多个字体了。(我觉得在mac和linux上应该是一样的情况) 如果不复杂的话希望能够支持这一点

tongyuantongyu avatar Apr 07 '18 15:04 tongyuantongyu

Squirrel on macOS supports fonts fallback, this problem is specific to Weasel on Windows.

LEOYoon-Tsaw avatar May 03 '18 09:05 LEOYoon-Tsaw

Squirrel 的确支持多字体. https://github.com/rime/squirrel/commit/caf806d4fa018f768b507c2057d9fbc1e13c4add

JohnWang1023 avatar Jun 13 '18 21:06 JohnWang1023

你装的是海峰“中日韩汉字超大字符集(SuperCJK)通用字体支持包6.0”即Unifonts 6.0吧,那个本身不支持CJK-F,五笔吧小吧主LSJ天道酬勤有扩补版本https://pan.baidu.com/s/1hq5kedm,不过貌似是按草案扩补的,该区字符与编码和Unicode 10.0.0正式版不一致,也是不能用。

除了花园明朝,建议用方正字库给制作的中华书局宋体 http://www.ancientbooks.cn/helpcore?font ,也可以用字海网站长DIY的天珩全字库 http://yedict.com/download/ ,这两个真支持CJK-F

参考:https://github.com/CNMan/UnicodeCJK-WuBi06/issues/17

2018-10-04_105639

CNMan avatar Oct 03 '18 12:10 CNMan

Any updates?

sgalal avatar Apr 04 '20 03:04 sgalal

Any updates about Weasel "style/font_face" fallback ?

lliding avatar Sep 14 '22 16:09 lliding

现在weasel的最新版本支持如何了?另外,linux下的fcitx5-rime的支持情况如何?

TurnOffNOD avatar Feb 15 '23 14:02 TurnOffNOD

现在weasel的最新版本支持如何了?另外,linux下的fcitx5-rime的支持情况如何?

現在似乎是支持了,但文檔沒有更新不知道該怎麼寫。。。

Bobo-alcazar avatar Jun 06 '23 10:06 Bobo-alcazar

@Bobo-alcazar 还没有写具体文档,下面的先大概看吧

  style/font_face:          "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"
  style/label_font_face:    "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"
  style/comment_font_face:  "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"

# code point in hex [0-9a-fA-F]
# to define start and end point like this 
#   fontname : start_code_point : end_code_point
# to define start code point only like this
#   fontname : start_code_point
# to define end code point only like this
#   fontname : : end_code_point

# font weight before the first coma, [] for optional.
#  fontname0 : start_code_point : end_code_point [ : bold] [ : italic ]  [  , fontname1, fontname2 ]
# weight(defalt normal if not set, case insensitive):
# 	thin extra_light ultra_light light semi_light medium demi_bold semi_bold bold extra_bold ultra_bold black heavy extra_black ultra_black normal
# 
# style(defalt normal if not set, case insensitive):
# 	italic oblique normal

fxliang avatar Jun 06 '23 12:06 fxliang

@Bobo-alcazar 还没有写具体文档,下面的先大概看吧

  style/font_face:          "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"
  style/label_font_face:    "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"
  style/comment_font_face:  "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"

# code point in hex [0-9a-fA-F]
# to define start and end point like this 
#   fontname : start_code_point : end_code_point
# to define start code point only like this
#   fontname : start_code_point
# to define end code point only like this
#   fontname : : end_code_point

# font weight before the first coma, [] for optional.
#  fontname0 : start_code_point : end_code_point [ : bold] [ : italic ]  [  , fontname1, fontname2 ]
# weight(defalt normal if not set, case insensitive):
# 	thin extra_light ultra_light light semi_light medium demi_bold semi_bold bold extra_bold ultra_bold black heavy extra_black ultra_black normal
# 
# style(defalt normal if not set, case insensitive):
# 	italic oblique normal

感谢!

Bobo-alcazar avatar Jun 07 '23 04:06 Bobo-alcazar

@Bobo-alcazar 还没有写具体文档,下面的先大概看吧

  style/font_face:          "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"
  style/label_font_face:    "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"
  style/comment_font_face:  "Segoe UI Emoji:20:39, Noto Color Emoji SVG:80, Segoe UI Emoji:80, Arial:600:6ff, LXGW Wenkai Narrow"

# code point in hex [0-9a-fA-F]
# to define start and end point like this 
#   fontname : start_code_point : end_code_point
# to define start code point only like this
#   fontname : start_code_point
# to define end code point only like this
#   fontname : : end_code_point

# font weight before the first coma, [] for optional.
#  fontname0 : start_code_point : end_code_point [ : bold] [ : italic ]  [  , fontname1, fontname2 ]
# weight(defalt normal if not set, case insensitive):
# 	thin extra_light ultra_light light semi_light medium demi_bold semi_bold bold extra_bold ultra_bold black heavy extra_black ultra_black normal
# 
# style(defalt normal if not set, case insensitive):
# 	italic oblique normal

请问是否可以不设置 code point 范围而仅设置字重呢?我想用 Source Han Serif 的粗体,一直没有找到设置的方法

Tseing avatar Aug 28 '23 13:08 Tseing

Source Han Serif SC:bold或者思源宋体:bold

image

Source Han Serif SC:heavy 或者 思源宋体:heavy

image

fxliang avatar Aug 29 '23 05:08 fxliang

@fxliang 感谢!

我找到一直设置不成功的原因了,例如我的设置为

font_face: "Segoe UI Emoji, 思源宋体 CN:heavy"

由于 Segoe UI Emoji 的缺省字重是 normal,导致思源宋体的字重也是 normal

只有设置为

font_face: "Segoe UI Emoji:heavy, 思源宋体 CN:heavy"

思源宋体才会显示为 heavy,不知道是不是bug

Tseing avatar Aug 29 '23 07:08 Tseing

如果是最新ci产出,有几个点要纠正一下:

不用每个字体设定bold/heavy,整个设定中只要有任意一个是设定字重就可以的。如果是0.15.0,没有记错当时应该还是要第一个字体family设定字重。

另外,与Segoe UI Emoji默认字重无关,那个字段只是提供了字体family的名字。

例子

  style/font_face:          "Segoe UI Emoji:30:39:heavy, 思源宋体, LXGW Wenkai Narrow:7c:7c, Segoe UI Emoji:30:39, Segoe UI Emoji:23:23, Segoe UI Emoji:2a:2a, Segoe UI Emoji:fe0f:fe0f, Segoe UI Emoji:20e3:20e3, LXGW Wenkai Narrow, Segoe UI Emoji, Noto Color Emoji SVG, Arial:600:6ff"
  style/label_font_face:    "Segoe UI Emoji:30:39, Noto Color Emoji SVG, Arial:600:6ff, LXGW Wenkai Narrow"
  style/comment_font_face:  "Segoe UI Emoji:30:39, Noto Color Emoji SVG, Arial:600:6ff, LXGW Wenkai Narrow"

image

fxliang avatar Aug 29 '23 08:08 fxliang

@fxliang 明白了,感谢!

原来是以首个字体的字重为准,是我误以为每个字体都可以分别设定字重了

Tseing avatar Aug 29 '23 09:08 Tseing

@fxliang 明白了,感谢!

原来是以首个字体的字重为准,是我误以为每个字体都可以分别设定字重了

新ci的逻辑是第一个读到的字重为准,可以不是第一个字体family上设置,扩展一点兼容。其他没有差别

fxliang avatar Aug 29 '23 09:08 fxliang