Vim

我們可以修補已經修補的字型嗎?

  • July 3, 2014

Powerline是 Vim 和 Gvim 的某種外掛。為了更有用,它使用添加了一些圖片(符號)的字型。換句話說,他們已經“修補”了字型集。最近 Powerline 表示程式碼已更改,您必須再次修補字型。可以在此處找到相同的連結。

問題

  • 我可以再次修補我已經修補過的字型,還是應該獲得新的源字型?
  • 什麼樣的字型可以打更新檔。(例如TTF或…)?

更新檔腳本可在其自己的 GitHub 儲存庫中訪問,標題為:powerline-patcher

一個實驗

我首先下載了上面的更新檔腳本。

$ git clone https://github.com/Lokaltog/powerline-fontpatcher.git

然後我選擇了一個範例.ttf文件來測試您的問題。

$ ls -lr | grep ttf
-rw-r--r--. 1 saml saml 242700 Jul  2 20:29 LucidaTypewriterRegular.ttf

執行字型修補腳本會產生以下輸出:

$ scripts/powerline-fontpatcher LucidaTypewriterRegular.ttf 
The glyph named fraction is mapped to U+2215.
But its name indicates it should be mapped to U+2044.
The glyph named periodcentered is mapped to U+2219.
But its name indicates it should be mapped to U+00B7.
The glyph named macron is mapped to U+02C9.
But its name indicates it should be mapped to U+00AF.
The glyph named stigma is mapped to U+03DA.
But its name indicates it should be mapped to U+03DB.
The glyph named digamma is mapped to U+03DC.
But its name indicates it should be mapped to U+03DD.
The glyph named koppa is mapped to U+03DE.
But its name indicates it should be mapped to U+03DF.
The glyph named sampi is mapped to U+03E0.
But its name indicates it should be mapped to U+03E1.
The glyph named fraction1 is mapped to U+2044.
But its name indicates it should be mapped to U+2215.

使用生成的文件:

$ ls -lr | grep ttf
-rw-r--r--. 1 saml saml 242700 Jul  2 20:29 LucidaTypewriterRegular.ttf
-rw-rw-r--. 1 saml saml 242576 Jul  2 21:02 Lucida Sans Typewriter Regular for Powerline.ttf

如果我在結果文件上再執行 2 次,每次都會得到與上面相同的輸出,導致文件如下所示:

$ ls -ltr | grep ttf
-rw-r--r--. 1 saml saml 242700 Jul  2 20:29 LucidaTypewriterRegular.ttf
-rw-rw-r--. 1 saml saml 242576 Jul  2 21:02 Lucida Sans Typewriter Regular for Powerline.ttf
-rw-rw-r--. 1 saml saml 242780 Jul  2 21:04 Lucida Sans Typewriter Regular for Powerline for Powerline.ttf
-rw-rw-r--. 1 saml saml 242984 Jul  2 21:07 Lucida Sans Typewriter Regular for Powerline for Powerline for Powerline.ttf

.ttf當我嘗試使用 ImageMagick 的display命令打開它們時,所有這些生成的文件似乎都是有效的:

$ display Lucida Sans Typewriter Regular for Powerline for Powerline for Powerline.ttf

    #1

外賣

所以看起來你可以使用修補腳本重新處理字型檔,我不清楚為什麼在你執行這個操作時大小會不斷增長,所以我會把原件放在手邊,以防萬一你遇到問題。

如果是我,為了安全起見,我可能會放棄以前打過更新檔的文件並重新生成它們。

參考

引用自:https://unix.stackexchange.com/questions/140327