-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e16ba39
commit 193c160
Showing
4 changed files
with
334 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,326 @@ | ||
--- | ||
layout: post | ||
title: "MS PGothic and an additional 90 new fonts from Office are now available in fontist" | ||
date: 2024-01-23 | ||
categories: documentation | ||
authors: | ||
- | ||
name: Ronald Tse | ||
email: [email protected] | ||
social_links: | ||
- https://github.com/ronaldtse | ||
- | ||
name: Alexey Morozov | ||
email: [email protected] | ||
social_links: | ||
- https://github.com/alexeymorozov | ||
|
||
excerpt: >- | ||
Discover new fonts you can use with `fontist` and which packages you found | ||
online could be converted into fonts formulas. | ||
--- | ||
|
||
|
||
== Introduction | ||
|
||
As a fontist team, we received a request from our user to add the "MS PGothic" | ||
font. At that time we have already a nearly identical font "HGPGothicM" but it | ||
is not either metric-compatible, or registered as the "MS PGothic" name, so | ||
dependent software could not use it as is. | ||
|
||
The "Office Preview" formula has been added, and `fontist` has been developed the | ||
necessary functionality to support a package within this formula. | ||
|
||
https://github.com/fontist/formulas/blob/v3/Formulas/office_preview.yml[The | ||
formula] includes 91 new fonts, such as "MS PGothic", and many others with | ||
updated versions, totalling 149 fonts. Additionally, support for XAR | ||
decompression has been incorporated into `fontist`, allowing it to be utilized | ||
for new formulas going forward. | ||
|
||
|
||
== Prerequisites | ||
|
||
The Ruby interpreter is a requirement for `fontist` and there is a way to | ||
install it on all platforms with | ||
https://www.ruby-lang.org/en/documentation/installation/[the following guide]. | ||
|
||
When Ruby is set up, `fontist` can be installed as a gem (a Ruby library): | ||
|
||
[source,shell] | ||
$ gem install fontist | ||
|
||
|
||
== How to install MS PGothic, MS PMincho and other Office fonts? | ||
|
||
First, new formula should be fetched from the fontist formulas repository: | ||
|
||
[source,shell] | ||
$ fontist update | ||
|
||
Then new fonts can be installed: | ||
|
||
[source,shell] | ||
---- | ||
$ fontist install "MS PGothic" | ||
Fonts installed at: | ||
- /Users/john/.fontist/fonts/msgothic.ttc | ||
---- | ||
|
||
As an alternative way, all these fonts from the formula can be installed by a | ||
formula name: | ||
|
||
[source,shell] | ||
---- | ||
$ fontist install --formula office_preview | ||
Fonts installed at: | ||
- /Users/john/.fontist/fonts/Rockwell Extra Bold.ttf | ||
- /Users/john/.fontist/fonts/webdings.ttf | ||
- /Users/john/.fontist/fonts/Dengb.ttf | ||
- /Users/john/.fontist/fonts/Candarai.ttf | ||
- /Users/john/.fontist/fonts/Cambria.ttc | ||
- /Users/john/.fontist/fonts/Verdana Bold.ttf | ||
- /Users/john/.fontist/fonts/GillSansUltraBold.ttf | ||
.. | ||
---- | ||
|
||
`fontist` supports flags that can be utilized in Continuous Integration | ||
systems. For instance, the following command installs a font, gathering | ||
acceptance from a command-line option. It ensures that `fontist` installs the | ||
font even if it's already present in the system, thereby guaranteeing its | ||
presence in the target path. | ||
|
||
[source,shell] | ||
$ fontist install --accept-all-licenses --force "MS PGothic" | ||
|
||
Here is a full list of fonts from the Office package: | ||
|
||
.Click to expand the list | ||
[%collapsible] | ||
==== | ||
* Abadi MT Condensed Extra Bold | ||
* Abadi MT Condensed Light | ||
* Arial | ||
* Arial Black | ||
* Arial Narrow | ||
* Arial Rounded MT Bold | ||
* Baskerville Old Face | ||
* Batang | ||
* BatangChe | ||
* Bauhaus 93 | ||
* Bell MT | ||
* Bernard MT Condensed | ||
* Book Antiqua | ||
* Bookman Old Style | ||
* Bookshelf Symbol 7 | ||
* Braggadocio | ||
* Britannic Bold | ||
* Calibri | ||
* Calibri Light | ||
* Calisto MT | ||
* Cambria | ||
* Cambria Math | ||
* Candara | ||
* Century | ||
* Century Gothic | ||
* Century Schoolbook | ||
* Colonna MT | ||
* Comic Sans MS | ||
* Consolas | ||
* Constantia | ||
* Copperplate Gothic Bold | ||
* Corbel | ||
* Curlz MT | ||
* DengXian | ||
* DengXian Light | ||
* Desdemona | ||
* Dotum | ||
* DotumChe | ||
* Edwardian Script ITC | ||
* Engravers MT | ||
* Eurostile | ||
* FangSong | ||
* Footlight MT Light | ||
* Franklin Gothic Book | ||
* Franklin Gothic Demi | ||
* Franklin Gothic Demi Cond | ||
* Franklin Gothic Heavy | ||
* Franklin Gothic Medium | ||
* Franklin Gothic Medium Cond | ||
* Gabriola | ||
* Garamond | ||
* Gill Sans MT | ||
* Gill Sans MT Condensed | ||
* Gill Sans MT Ext Condensed Bold | ||
* Gill Sans Ultra Bold | ||
* Gloucester MT Extra Condensed | ||
* Goudy Old Style | ||
* Gulim | ||
* GulimChe | ||
* Gungsuh | ||
* GungsuhChe | ||
* HGGothicE | ||
* HGMaruGothicMPRO | ||
* HGMinchoE | ||
* HGPGothicE | ||
* HGPMinchoE | ||
* HGPSoeiKakugothicUB | ||
* HGSGothicE | ||
* HGSMinchoE | ||
* HGSSoeiKakugothicUB | ||
* HGSoeiKakugothicUB | ||
* Haettenschweiler | ||
* Harrington | ||
* Imprint MT Shadow | ||
* KaiTi | ||
* Kino MT | ||
* Lucida Blackletter | ||
* Lucida Bright | ||
* Lucida Calligraphy | ||
* Lucida Console | ||
* Lucida Fax | ||
* Lucida Handwriting | ||
* Lucida Sans | ||
* Lucida Sans Typewriter | ||
* Lucida Sans Unicode | ||
* MS Gothic | ||
* MS Mincho | ||
* MS PGothic | ||
* MS PMincho | ||
* MS Reference Sans Serif | ||
* MS Reference Specialty | ||
* MS UI Gothic | ||
* MT Extra | ||
* Malgun Gothic | ||
* Malgun Gothic Semilight | ||
* Marlett | ||
* Matura MT Script Capitals | ||
* Meiryo | ||
* Microsoft Himalaya | ||
* Microsoft JhengHei | ||
* Microsoft New Tai Lue | ||
* Microsoft Tai Le | ||
* Microsoft YaHei | ||
* Microsoft Yi Baiti | ||
* MingLiU | ||
* MingLiU-ExtB | ||
* MingLiU_HKSCS | ||
* MingLiU_HKSCS-ExtB | ||
* Mistral | ||
* Modern No. 20 | ||
* Mongolian Baiti | ||
* Monotype Corsiva | ||
* Monotype Sorts | ||
* News Gothic MT | ||
* Onyx | ||
* PMingLiU | ||
* PMingLiU-ExtB | ||
* Palatino Linotype | ||
* Perpetua | ||
* Perpetua Titling MT | ||
* Rockwell | ||
* Rockwell Condensed | ||
* Rockwell Extra Bold | ||
* STHupo | ||
* STLiti | ||
* STXingkai | ||
* STXinwei | ||
* STZhongsong | ||
* Segoe Print | ||
* Segoe Script | ||
* SimHei | ||
* SimSun | ||
* SimSun-ExtB | ||
* Stencil | ||
* Tahoma | ||
* Trebuchet MS | ||
* Tw Cen MT | ||
* Tw Cen MT Condensed | ||
* Tw Cen MT Condensed Extra Bold | ||
* Verdana | ||
* Webdings | ||
* Wide Latin | ||
* Wingdings | ||
* Wingdings 2 | ||
* Wingdings 3 | ||
* Yu Gothic | ||
* Yu Gothic Light | ||
* Yu Gothic Medium | ||
* Yu Mincho | ||
==== | ||
|
||
|
||
== How to automatically extract fonts from a package found online? | ||
|
||
Consider this scenario: you require a specific font for either your Continuous | ||
Integration system or your software. If the font is available in the fontist | ||
formulas repository, you can easily utilize it as described earlier. But what | ||
if it's not there yet? | ||
|
||
You can create a font formula from a package found online, even if it is | ||
complex and has an archive-in-archive structure. | ||
|
||
First you need to create a formula providing a url to an archive: | ||
|
||
[source,shell] | ||
---- | ||
$ bin/fontist create-formula http://example.com/archive.pkg | ||
some_font.yml formula has been successfully created | ||
---- | ||
|
||
Then this formula should be placed in a formula repository, and the fontist | ||
index should be rebuild: | ||
|
||
[source,shell] | ||
---- | ||
$ cp some_font.yml ~/.fontist/versions/v3/formulas/Formulas/ | ||
$ fontist rebuild-index | ||
---- | ||
|
||
That's it! Now the fonts from the package can be installed and used: | ||
|
||
[source,shell] | ||
---- | ||
$ fontist install "Some Font" | ||
Fonts installed at: | ||
- /Users/john/.fontist/fonts/some_font.ttf | ||
---- | ||
|
||
Currently Fontist supports 8 compression methods which are commonly used for | ||
fonts packages, including `xar` now: | ||
|
||
* cab | ||
* cpio | ||
* zip, including a self-extracting one | ||
* gzip | ||
* ole, it is used in the msi files | ||
* rpm | ||
* tar | ||
* xar in the pkg files | ||
|
||
You can view the latest list of supported compression methods | ||
https://github.com/fontist/excavate/blob/main/lib/excavate/archive.rb#L14[here]. | ||
|
||
An important thing here is that `fontist` now | ||
https://github.com/fontist/ffi-libarchive-binary[supports] unarchiving through | ||
the comprehensive `libarchive` library. This enhancement opens up the | ||
possibility of easily supporting a wide range of compression methods. | ||
|
||
|
||
== Final thoughts | ||
|
||
`fontist` now supports a growing number of fonts and can serve as a convenient | ||
method to install fonts programatically, especially on Continuous Integration | ||
systems. | ||
|
||
Small announcement. A standalone package of `fontist` is currently in | ||
development. Soon, there would be even no need to install Ruby separately to | ||
use `fontist`. | ||
|
||
|
||
== References | ||
|
||
* https://github.com/fontist/fontist[fontist] | ||
* https://github.com/fontist/excavate[excavate] | ||
* https://github.com/fontist/ffi-libarchive-binary[ffi-libarchive-binary] | ||
* https://github.com/fontist/formulas[List of formulas and their supported fonts] | ||
* https://www.ruby-lang.org/en/[Ruby] |