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

一些技术问题 #5

Open
XiangyunHuang opened this issue Sep 5, 2021 · 0 comments
Open

一些技术问题 #5

XiangyunHuang opened this issue Sep 5, 2021 · 0 comments

Comments

@XiangyunHuang
Copy link
Owner

XiangyunHuang commented Sep 5, 2021

1. showtextdb 安装 Google 字体失败

# 安装到 showtextdb 字体目录下
showtextdb::font_installed()
# 安装字体目前存在问题
# https://github.com/yixuan/showtextdb/issues/1
showtextdb::font_install(showtextdb::google_fonts("Noto Sans"), quiet = TRUE)
showtextdb::font_install(showtextdb::google_fonts("Noto Serif SC"), quiet = TRUE)
# sysfonts::font_add_google 不可重复使用,重启 R 会话就会丢失
for (font in c("Noto Sans", "Noto Serif SC")) {
  if (!font %in% sysfonts::font_families()) {
    sysfonts::font_add_google(name = font)
  }
}

2. 开源的 fandol 字体范围有限

比如许宝騄的「騄」字,刘思喆的「喆」就没法正常显示,还没深究是何原因。

3. bookdown 相关

  1. bookdown::clean_book 似乎会把 _book/ 目录也给删掉
  2. bookdown 配置文件里 before_chapter_script: _common.R 似乎在 new_session: true 不起作用
  3. bookdown 的 bs4_book 不支持 chap:book 这样的 https://d.cosx.org/d/422312-bookdown-bs4-book-heading-identifiers
  4. bookdown 不支持交互式 Python 图形的交叉引用

4. roboto 字体

tinytex::tlmgr_install('noto')
tinytex::tlmgr_install('notocondensed')
# roboto 字体目录
paste(tinytex::tinytex_root(), "texmf-dist/fonts/opentype/google/roboto", sep = "/")

sysfonts::font_add("xkcd", regular = "~/Library/Fonts/xkcd.otf")

roboto_dir <- paste(tinytex::tinytex_root(), "texmf-dist/fonts/opentype/google/roboto", sep = "/")
list.files(path = roboto_dir)
Roboto-Black.otf                Roboto-ThinItalic.otf           RobotoMono-LightItalic.otf
Roboto-BlackItalic.otf          RobotoCondensed-Bold.otf        RobotoMono-Medium.otf
Roboto-Bold.otf                 RobotoCondensed-BoldItalic.otf  RobotoMono-MediumItalic.otf
Roboto-BoldItalic.otf           RobotoCondensed-Italic.otf      RobotoMono-Regular.otf
Roboto-Italic.otf               RobotoCondensed-Light.otf       RobotoMono-Thin.otf
Roboto-Light.otf                RobotoCondensed-LightItalic.otf RobotoMono-ThinItalic.otf
Roboto-LightItalic.otf          RobotoCondensed-Regular.otf     RobotoSlab-Bold.otf
Roboto-Medium.otf               RobotoMono-Bold.otf             RobotoSlab-Light.otf
Roboto-MediumItalic.otf         RobotoMono-BoldItalic.otf       RobotoSlab-Regular.otf
Roboto-Regular.otf              RobotoMono-Italic.otf           RobotoSlab-Thin.otf
Roboto-Thin.otf                 RobotoMono-Light.otf
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

No branches or pull requests

1 participant