fontist 3.0.1 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/discover-fonts.yml +76 -0
- data/.github/workflows/rake.yml +103 -8
- data/TODO.audit-docs.md +164 -0
- data/TODO.improve-docs.md +114 -0
- data/TODO.upgrade-excavate.md +107 -0
- data/docs/guide/formulas.md +37 -1
- data/docs/guide/how-it-works.md +13 -0
- data/docs/guide/platforms/windows.md +67 -0
- data/lib/fontist/errors.rb +21 -0
- data/lib/fontist/font_installer.rb +2 -0
- data/lib/fontist/formula.rb +11 -0
- data/lib/fontist/import/create_formula.rb +5 -0
- data/lib/fontist/import/formula_builder.rb +9 -0
- data/lib/fontist/import/sil_importer.rb +2 -2
- data/lib/fontist/import/windows/fod_capabilities.yml +654 -0
- data/lib/fontist/import/windows/windows_license.txt +4 -0
- data/lib/fontist/import/windows.rb +162 -0
- data/lib/fontist/import.rb +1 -0
- data/lib/fontist/import_source.rb +1 -0
- data/lib/fontist/macos/catalog/catalog_manager.rb +1 -1
- data/lib/fontist/resource.rb +5 -1
- data/lib/fontist/resources/windows_fod_resource.rb +51 -0
- data/lib/fontist/resources.rb +1 -0
- data/lib/fontist/utils/downloader.rb +4 -3
- data/lib/fontist/utils/system.rb +17 -0
- data/lib/fontist/utils/user_agent.rb +95 -0
- data/lib/fontist/utils.rb +1 -0
- data/lib/fontist/version.rb +1 -1
- data/lib/fontist/windows_fod_metadata.rb +83 -0
- data/lib/fontist/windows_import_source.rb +54 -0
- data/lib/fontist.rb +2 -0
- data/script/generate_windows_formulas.rb +24 -0
- data/script/validate_windows_fod_ci.rb +175 -0
- metadata +14 -2
|
@@ -78,6 +78,73 @@ fontist install "Roboto" --location=system
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
+
## Windows Features on Demand (FOD) Fonts
|
|
82
|
+
|
|
83
|
+
Windows includes supplementary fonts that aren't pre-installed but can be enabled through **Features on Demand** (FOD). These include fonts for Japanese, Korean, Arabic, Pan-European, and other scripts.
|
|
84
|
+
|
|
85
|
+
### What Are FOD Fonts?
|
|
86
|
+
|
|
87
|
+
Windows FOD fonts are installed using `Add-WindowsCapability`, which downloads font packages from Windows Update. Fontist automates this process — when a formula specifies `source: windows_fod`, Fontist calls the appropriate PowerShell command to install the capability.
|
|
88
|
+
|
|
89
|
+
### Installing FOD Fonts
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
# Install a specific supplemental font
|
|
93
|
+
fontist install "Meiryo"
|
|
94
|
+
|
|
95
|
+
# Install Pan-European supplemental fonts
|
|
96
|
+
fontist install "Arial Nova"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Fontist checks whether the capability is already installed. If not, it runs:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
Add-WindowsCapability -Online -Name 'Language.Fonts.Jpan~~~und-JPAN~0.0.1.0'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Requirements
|
|
106
|
+
|
|
107
|
+
| Requirement | Details |
|
|
108
|
+
|-------------|---------|
|
|
109
|
+
| Windows version | Windows 10 or later |
|
|
110
|
+
| Internet connection | Required (fonts download from Windows Update) |
|
|
111
|
+
| Administrator | Required on Windows 10 for system-wide installation |
|
|
112
|
+
| WSUS/SCCM | Must not block Features on Demand |
|
|
113
|
+
|
|
114
|
+
### Available FOD Fonts
|
|
115
|
+
|
|
116
|
+
Fontist includes metadata for all Windows FOD font capabilities. Some common ones:
|
|
117
|
+
|
|
118
|
+
| Capability | Fonts Included |
|
|
119
|
+
|------------|---------------|
|
|
120
|
+
| Japanese Supplemental Fonts | Meiryo, MS Gothic, MS Mincho |
|
|
121
|
+
| Korean Supplemental Fonts | Batang, Dotum, Gulim |
|
|
122
|
+
| Arabic Script Supplemental Fonts | Sakkal Majalla, Simplified Arabic |
|
|
123
|
+
| Pan-European Supplemental Fonts | Arial Nova, Georgia Pro, Gill Sans Nova |
|
|
124
|
+
| Traditional Chinese Supplemental Fonts | MingLiU, DFKai-SB |
|
|
125
|
+
|
|
126
|
+
### FOD Font Installation Flow
|
|
127
|
+
|
|
128
|
+
1. Fontist looks up the font in the formula index
|
|
129
|
+
2. Checks if the Windows FOD capability is already installed via `Get-WindowsCapability`
|
|
130
|
+
3. If not installed, runs `Add-WindowsCapability` to download and install it
|
|
131
|
+
4. Returns paths to the installed font files in `C:\Windows\Fonts`
|
|
132
|
+
|
|
133
|
+
### Troubleshooting FOD Installation
|
|
134
|
+
|
|
135
|
+
If you see a `WindowsFodInstallError`:
|
|
136
|
+
|
|
137
|
+
1. **No internet connection** — FOD fonts require Windows Update access
|
|
138
|
+
2. **Insufficient permissions** — Run as Administrator on Windows 10
|
|
139
|
+
3. **WSUS/SCCM policy** — Your organization may block FOD downloads; contact your IT administrator
|
|
140
|
+
4. **Capability not found** — The capability name may differ on your Windows version; run `Get-WindowsCapability -Online -Name 'Language.Fonts.*'` to list available capabilities
|
|
141
|
+
|
|
142
|
+
::: info Platform Restriction
|
|
143
|
+
Windows FOD fonts are only installable on Windows. Fontist will raise a `PlatformMismatchError` if you attempt to install them on macOS or Linux.
|
|
144
|
+
:::
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
81
148
|
## Windows-Specific Considerations
|
|
82
149
|
|
|
83
150
|
### File Locking
|
data/lib/fontist/errors.rb
CHANGED
|
@@ -165,6 +165,27 @@ module Fontist
|
|
|
165
165
|
end
|
|
166
166
|
end
|
|
167
167
|
|
|
168
|
+
class WindowsFodInstallError < GeneralError
|
|
169
|
+
attr_reader :capability_name
|
|
170
|
+
|
|
171
|
+
def initialize(capability_name, stderr_output = nil)
|
|
172
|
+
@capability_name = capability_name
|
|
173
|
+
super(build_message(capability_name, stderr_output))
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
private
|
|
177
|
+
|
|
178
|
+
def build_message(cap_name, stderr)
|
|
179
|
+
msg = "Failed to install Windows font capability '#{cap_name}'."
|
|
180
|
+
msg += "\n#{stderr}" if stderr && !stderr.strip.empty?
|
|
181
|
+
msg += "\n\nPossible causes:" \
|
|
182
|
+
"\n - No internet connection (Windows Update required)" \
|
|
183
|
+
"\n - Insufficient permissions (admin required on Windows 10)" \
|
|
184
|
+
"\n - WSUS/SCCM policy blocking Features on Demand"
|
|
185
|
+
msg
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
168
189
|
class UnsupportedMacOSVersionError < GeneralError
|
|
169
190
|
def initialize(detected_version, available_frameworks)
|
|
170
191
|
super(build_message(detected_version, available_frameworks))
|
data/lib/fontist/formula.rb
CHANGED
|
@@ -45,6 +45,7 @@ module Fontist
|
|
|
45
45
|
"MacosImportSource",
|
|
46
46
|
"GoogleImportSource",
|
|
47
47
|
"SilImportSource",
|
|
48
|
+
"WindowsImportSource",
|
|
48
49
|
]
|
|
49
50
|
attribute :font_version, :string
|
|
50
51
|
|
|
@@ -68,6 +69,7 @@ module Fontist
|
|
|
68
69
|
files: :files,
|
|
69
70
|
format: :format,
|
|
70
71
|
variable_axes: :variable_axes,
|
|
72
|
+
capability_name: :capability_name,
|
|
71
73
|
}
|
|
72
74
|
map "digest", to: :digest
|
|
73
75
|
map "instructions", to: :instructions
|
|
@@ -86,6 +88,7 @@ module Fontist
|
|
|
86
88
|
"macos" => "Fontist::MacosImportSource",
|
|
87
89
|
"google" => "Fontist::GoogleImportSource",
|
|
88
90
|
"sil" => "Fontist::SilImportSource",
|
|
91
|
+
"windows" => "Fontist::WindowsImportSource",
|
|
89
92
|
},
|
|
90
93
|
}
|
|
91
94
|
map "font_version", to: :font_version
|
|
@@ -233,10 +236,18 @@ module Fontist
|
|
|
233
236
|
import_source.is_a?(SilImportSource)
|
|
234
237
|
end
|
|
235
238
|
|
|
239
|
+
def windows_import?
|
|
240
|
+
import_source.is_a?(WindowsImportSource)
|
|
241
|
+
end
|
|
242
|
+
|
|
236
243
|
def manual_formula?
|
|
237
244
|
import_source.nil?
|
|
238
245
|
end
|
|
239
246
|
|
|
247
|
+
def windows_fod?
|
|
248
|
+
source == "windows_fod" && platforms&.any? { |p| p == "windows" || p.start_with?("windows-") }
|
|
249
|
+
end
|
|
250
|
+
|
|
240
251
|
def compatible_with_current_platform?
|
|
241
252
|
return true unless macos_import?
|
|
242
253
|
|
|
@@ -47,6 +47,11 @@ module Fontist
|
|
|
47
47
|
version: @options[:import_source].version,
|
|
48
48
|
release_date: @options[:import_source].release_date,
|
|
49
49
|
)
|
|
50
|
+
when WindowsImportSource
|
|
51
|
+
builder.set_windows_import_source(
|
|
52
|
+
capability_name: @options[:import_source].capability_name,
|
|
53
|
+
min_windows_version: @options[:import_source].min_windows_version,
|
|
54
|
+
)
|
|
50
55
|
end
|
|
51
56
|
else
|
|
52
57
|
# Legacy support for backward compatibility
|
|
@@ -85,6 +85,15 @@ family_id:)
|
|
|
85
85
|
)
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
+
# Convenience method to set Windows import source
|
|
89
|
+
def set_windows_import_source(capability_name:, min_windows_version: "10.0")
|
|
90
|
+
@import_source = WindowsImportSource.new(
|
|
91
|
+
type: "windows",
|
|
92
|
+
capability_name: capability_name,
|
|
93
|
+
min_windows_version: min_windows_version,
|
|
94
|
+
)
|
|
95
|
+
end
|
|
96
|
+
|
|
88
97
|
private
|
|
89
98
|
|
|
90
99
|
def formula_attributes
|
|
@@ -272,7 +272,7 @@ module Fontist
|
|
|
272
272
|
end
|
|
273
273
|
|
|
274
274
|
def font_links
|
|
275
|
-
html = URI.parse(ROOT).open.read
|
|
275
|
+
html = URI.parse(ROOT).open("User-Agent" => Fontist::Utils::UserAgent.random_user_agent).read
|
|
276
276
|
document = Nokogiri::HTML.parse(html)
|
|
277
277
|
document.css("table.products div.title > a")
|
|
278
278
|
end
|
|
@@ -392,7 +392,7 @@ module Fontist
|
|
|
392
392
|
end
|
|
393
393
|
|
|
394
394
|
def find_archive_url_by_page_uri(uri)
|
|
395
|
-
response = uri.open
|
|
395
|
+
response = uri.open("User-Agent" => Fontist::Utils::UserAgent.random_user_agent)
|
|
396
396
|
current_url = response.base_uri
|
|
397
397
|
html = response.read
|
|
398
398
|
document = Nokogiri::HTML.parse(html)
|