Golang:如何安装用于Golang开发的官方Go字体

huangapple go评论90阅读模式
英文:

Golang: How to install official Go fonts for Golang developement

问题

最近,Go宣布了适用于Go开发的Go字体。https://blog.golang.org/go-fonts博客文章中有一些详细信息。

然而,我不太清楚如何在我的Mac上安装它们以在Go开发中使用。有人可以帮我解决这个问题吗?谢谢。

英文:

Go recently announced Go font most suitable for go development.

https://blog.golang.org/go-fonts blog post has some details about it.

However it is not very clear to me how to install them in my mac to use them in Go development. Can anyone help me out here please.

答案1

得分: 15

  1. 下载官方字体 https://go.googlesource.com/image/+archive/master/font/gofont/ttfs.tar.gz

  2. 解压字体文件

> tar -xvzf image-master-font-gofont-ttfs.tar.gz

  1. 点击ttf文件安装相应的字体。在Mac上,默认会打开字体册。Ubuntu也有字体应用程序。点击安装。安装完所有的Go字体变体后,字体册将如下所示。

[![Go字体][1]][1]

  1. 进入你喜欢的Go编辑器,为go文件分配Go字体。

    在Sublime Text中,可以通过在<kbd>Preferences ▸ Settings</kbd>的右侧窗格中添加以下行来更改字体:

    > "font_face": "Go Mono",

    > "font_size": 10

额外提示:使用Go Mono字体。Go代码在其中看起来很棒。
[1]: https://i.stack.imgur.com/McOxy.png

英文:
  1. Download official fonts https://go.googlesource.com/image/+archive/master/font/gofont/ttfs.tar.gz

  2. Extract font files

> tar -xvzf image-master-font-gofont-ttfs.tar.gz

  1. Click on ttf file to install respective font. In Mac, Font Book will open by default. Ubuntu has font application too. Click on install. After installing all the go font variants, Font Book will look like following.

[![Go Fonts][1]][1]

  1. Go to your favorite Go editor and assign Go font for go files.

    In Sublime Text, Changing the font can be done via adding these lines to the right-hand pane of <kbd>Preferences ▸ Settings</kbd>:

    > "font_face": "Go Mono",

    > "font_size": 10

Bonus Tip: Use Go Mono font. Go code looks awesome in it.
[1]: https://i.stack.imgur.com/McOxy.png

答案2

得分: 4

这可能已经有答案了,但如果你正在使用计量连接(或者磁盘空间不足),并且此时不想克隆整个存储库,你也可以访问 https://go.googlesource.com/image/+/master/font/gofont/ttfs/ 并点击 tgz 选项。然后你会得到一个只包含TTF文件的tgz文件。

英文:

This may already be answered, but if you are on a metered connection (or are low on disk space) and don't want the entire repo cloned at this time, you can also go to https://go.googlesource.com/image/+/master/font/gofont/ttfs/ and click the tgz option. Then you get a tgz of just the TTFs.

huangapple
  • 本文由 发表于 2016年11月18日 04:12:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/40664163.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定