字体设置

参考:Fonts Customization

调整NexT v7.5.0的字体和大小

大小调整

参考:hexo(Next主题)修改文字大小

修改源文件/source/css/_variables/base.styl

// $font-size-smallest       = .75em;     # 12px
// $font-size-smaller        = .8125em;   # 13px

$font-size-smallest       = .625em;       # 10px
$font-size-smaller        = .75em;        # 12px

1em等于16px

字体设置

参考:

Google Fonts 已支持思源宋体!

Next修改字体

默认NexT使用微软雅黑字体,当前调整中文字体为思源宋体(Noto Serif SC

google fonts挑选中英文字体,参考10种经典的谷歌开源英文字体,值得收藏! ,选择英文字体为Roboto

修改NexT _config.yml

# ---------------------------------------------------------------
# Font Settings
# See: https://theme-next.org/docs/theme-settings/#Fonts-Customization
# ---------------------------------------------------------------
# Find fonts on Google Fonts (https://www.google.com/fonts)
# All fonts set here will have the following styles:
#   light | light italic | normal | normal italic | bold | bold italic
# Be aware that setting too much fonts will cause site running slowly
# ---------------------------------------------------------------
# To avoid space between header and sidebar in scheme Pisces / Gemini, Web Safe fonts are recommended for `global` (and `title`):
# Arial | Tahoma | Helvetica | Times New Roman | Courier New | Verdana | Georgia | Palatino | Garamond | Comic Sans MS | Trebuchet MS
# ---------------------------------------------------------------

font:
  enable: false

  # Uri of fonts host, e.g. //fonts.googleapis.com (Default).
  host:

  # Font options:
  # `external: true` will load this font family from `host` above.
  # `family: Times New Roman`. Without any quotes.
  # `size: x.x`. Use `em` as unit. Default: 1 (16px)

  # Global font settings used for all elements inside <body>.
  global:
    external: true
    family: Lato
    size:
。。。
。。。
  • 设置font enable属性为true
  • 设置host属性为https://fonts.loli.net
  • 设置global external属性为true
  • 设置global family属性为Roboto

修改/source/css/_variables/base.styl

// Font families.
// $font-family-chinese      = "PingFang SC", "Microsoft YaHei";
$font-family-chinese      = "Noto Serif SC"

修改/layout/partials/head/head.swig,在最后面添加

<link href="https://fonts.googleapis.com/css?family=Noto+Serif+SC|Roboto&display=swap" rel="stylesheet">