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 ." 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-git或PowerLine或以上所有功能。
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可能看起来像这样。
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中得到以下可爱提示:
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代码版本中,如下所示:
1 | scott@IRONHEART:/mnt/d/github/nerd-fonts$ fontforge -script font-patcher /mnt/c/Users/scott/Downloads/Cascadia.ttf<br>Copyright (c) 2000-2014 by George Williams. See AUTHORS for Contributors.<br> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html><br> with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.<br> Based on sources from 11:21 UTC 24-Sep-2017-ML-D.<br> Based on source from git with hash:<br>The following table(s) in the font have been ignored by FontForge<br> Ignoring 'DSIG' digital signature table<br>Warning: Mac string is a subset of the Windows string in the 'name' table<br> for the License string in the English (US) language.<br>Adding 53 Glyphs from Seti-UI + Custom Set<br>╢████████████████████████████████████████╟ 100%<br>Adding 198 Glyphs from Devicons Set<br>╢████████████████████████████████████████╟ 100%<br><br>Done with Patch Sets, generating font...<br><br>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提示!
Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!
发起人:是否对软件错误缺乏明确的了解? 通过Raygun.com进行错误监视,为您的客户提供应有的期望和期望的体验。 几分钟即可安装,立即尝试!
关于斯科特 (About Scott)
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。
About
关于
Newsletter
时事通讯
Hosting By
主持人
翻译自: https://www.hanselman.com/blog/patching-the-new-cascadia-code-to-include-powerline-glyphs-and-other-nerd-fonts-for-the-windows-terminal