修补新的Cascadia代码以包括Windows终端的电力线字形和其他Nerd字体

Microsoft released a nice new ligature-friendly open source font this week called Cascadia Code. It'll eventually be shipped with the open source Windows Terminal (you can get it from the store fee) but for now you can just download and install the TTF.

微软本周发布了一种不错的,适合连字的开源字体,称为Cascadia Code 。 它最终将随开源Windows终端一起交付(您可以从商店中获得),但是现在您可以下载并安装TTF

I've blogged about Fira Code and Monospaced Programming Fonts with Ligatures before. Just like keyboards, mice, monitors, text editors, and all the other things that we as developers put in our toolkits, Fonts are a very personal thing. Lots of folks have tweeted me, "why is this better than <font I use>." I dunno. Try it. Coke vs. Pepsi. If it makes you happy, use it.

我之前已经写过有关Fira代码和带有连字的宽编程字体的博客。 就像键盘,鼠标,显示器,文本编辑器以及开发人员将其放入工具箱中的所有其他内容一样,字体是非常个人的东西。 许多人在推特上说:“这为什么比<我使用的字体>好”。 我不知道。 试试吧。 可乐与百事可乐。 如果它使您快乐,请使用它。

I use Cascadia Code for my Terminals and I use Fira Code for my code editor. ¯\_(ツ)_/¯

我将Cascadia Code用于终端,并将Fira Code用于代码编辑器。 ¯\ _(ツ)_ /¯

That said, one important thing that you may want to know about is that you have FULL control of your fonts! Lots of folks want certain glyphs, or a fancy bash prompt, or they use posh-git, or PowerLine, or all of the above.

就是说,您可能要了解的一件事是,您可以完全控制字体! 许多人想要某些字形或精美的bash提示,或者使用posh-gitPowerLine或以上所有功能。

Right now Cascadia Code doesn't include every glyph in the world, but don't let that hold you back. Fix it.

目前,《卡斯卡迪亚密码》并未涵盖世界上的每一个字形,但请不要让它阻碍您。 修理它。

For example, if I go install "Oh my Posh" and spice up my PowerShell Core prompt, it might look like this with Cascadia Code today.

例如,如果我去安装“ Oh my Posh ”并为我的PowerShell Core提示添加一些趣味,那么今天的Cascadia Code可能看起来像这样。

Cascadia Code with no Nerd Fonts

But if I patch Cascadia Code on my own machine to include Nerd Fonts and other glyphs, I'll get this lovely prompt in Windows Terminal:

但是,如果我在自己的计算机上修补Cascadia代码以包含书呆子字体和其他字形,我将在Windows Terminal中得到以下可爱提示:

Cascadia Code with Nerd Fonts and PowerLine

So you have the power to do a lot of things. Don't be satisfied. Nest, and make your prompt your own! There are lots of Nerd Fonts but I want to patch Cascadia Code today (I'm sure they'll do it themselves one day, but I'm impatient) and make it look the way I want. You can to!

因此,您有能力去做很多事情。 不满意嵌套,让您自己输入提示! 有很多书呆子字体,但是我想今天修补Cascadia代码(我相信他们有一天会自己做,但我很急),并使它看起来像我想要的那样。 你可以!

在WSL下从Ubuntu中的FontForge开始 (Starting with FontForge in Ubuntu under WSL)

Using WSL2 and Ubuntu, I installed the Nerd Fonts Patcher and ran it on my downloaded version of Cascadia code like this:

使用WSL2和Ubuntu,我安装了Nerd Fonts Patcher并将其运行在我下载的Cascadia代码版本中,如下所示:

scott@IRONHEART:/mnt/d/github/nerd-fonts$ fontforge -script font-patcher /mnt/c/Users/scott/Downloads/Cascadia.ttf
Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
Based on sources from 11:21 UTC 24-Sep-2017-ML-D.
Based on source from git with hash:
The following table(s) in the font have been ignored by FontForge
Ignoring 'DSIG' digital signature table
Warning: Mac string is a subset of the Windows string in the 'name' table
for the License string in the English (US) language.
Adding 53 Glyphs from Seti-UI + Custom Set
╢████████████████████████████████████████╟ 100%
Adding 198 Glyphs from Devicons Set
╢████████████████████████████████████████╟ 100%

Done with Patch Sets, generating font...

Generated: Cascadia Code Nerd Font

Cool! I could even go nuts and add -c and add thousands of glyphs. It just depends on what I need. I could just go --powerline and --fontawesome and call it a day. It's up to you! Salt your Fonts to taste!

凉! 我什至可以发疯并添加-c并添加数千个字形。 这只取决于我需要什么。 我可以走--powerline和--fontawesome并称其为一天。 由你决定! 盐下字体尝尝

Now I can install my local modified TTF like any other, then go into my profile.json in Windows Terminal and set the font face to my new personal custom "CascadiaCode Nerd Font!" Boom. All set.

现在,我可以像安装其他任何程序一样安装本地修改的TTF,然后进入Windows Terminal中的profile.json并将字体设置为我的新个人定制“ CascadiaCode Nerd字体!”。 繁荣。 搞定。

UPDATE:  Alistair has created a forked version with the added glyphs. You may (or may not) be able to download his forked and renamed version from this Github comment. Slick!

更新: Alistair使用添加的字形创建了一个分叉的版本。 您可能(也可能无法)从此Github评论中下载他的分叉和重命名的版本。 光滑!

Please also check out my YouTube video on blinging out your PowerShell prompt in the Windows Terminal!

请查看我的YouTube视频,以在Windows终端中禁用PowerShell提示

翻译自: https://www.hanselman.com/blog/patching-the-new-cascadia-code-to-include-powerline-glyphs-and-other-nerd-fonts-for-the-windows-terminal

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值