V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
wjpauli
V2EX  ›  Angular

怎么他喵的会有这种事

  •  
  •   wjpauli · Aug 25, 2023 · 6098 views
    This topic created in 961 days ago, the information mentioned may be changed or developed.

    都是最新版,用了 sass 和 material 。 模板里这样: <mat-toolbar> 文字 1 <button mat-button>文字 2<button> </mat-toolbar>

    此时文字 1 自动使用了 Material 的 Roboto 字体,但是在我的 windows 10 台式机的 chrome 下,文字 2 却使用了 Arial 字体。在 Windows 11 笔记本的 chrome 下,文字 2 也使用了 Arial 字体,但是好看很多。

    把 sass 改成这样: mat-toolbar button color: red font-family: Roboto, "Helvetica Neue", sans-serif

    发现文字 2 变成了红色,在 windows11 中也使用了 Roboto 字体,但是在 windows10 中居然还保持 Arial 字体。请问这是什么情况?

    3 replies    2023-08-26 07:33:25 +08:00
    Justin13
        1
    Justin13  
       Aug 25, 2023 via Android
    你猜猜是不是所有的系统都支持所有的字体?
    wjpauli
        2
    wjpauli  
    OP
       Aug 25, 2023
    不是阿大哥,你没有看我的问题么。我左右两个 span ,左面的支持,右面的不支持。
    chnwillliu
        3
    chnwillliu  
       Aug 26, 2023 via Android
    不要看模板要看最后 render 出来的 DOM 节点。选中那个文字节点,看下 font-family 从哪里来的就知道。说不定有 chrome 插件会往页面塞 CSS 呢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2824 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 15:27 · PVG 23:27 · LAX 08:27 · JFK 11:27
    ♥ Do have faith in what you're doing.