typopro-dtp 4.2.5 → 4.2.7
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.
- package/etc/Windows-System-Install.bat +8 -0
- package/etc/Windows-System-Uninstall.bat +8 -0
- package/etc/Windows-User-Install.bat +7 -0
- package/etc/Windows-User-Uninstall.bat +7 -0
- package/etc/Windows-Util.ps1 +126 -0
- package/etc/macOS-System-Install.sh +21 -0
- package/etc/macOS-System-Uninstall.sh +16 -0
- package/etc/macOS-User-Install.sh +21 -0
- package/etc/macOS-User-Uninstall.sh +16 -0
- package/index.pdf +0 -0
- package/package.json +3 -3
- package/etc/install-all-fonts-win.bat +0 -8
- package/etc/install-all-fonts-win.ps1 +0 -37
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
##
|
|
2
|
+
## Windows-util.ps1 (PowerShell script)
|
|
3
|
+
##
|
|
4
|
+
|
|
5
|
+
# determine command-line options
|
|
6
|
+
param (
|
|
7
|
+
[switch]$forUser = $false,
|
|
8
|
+
[switch]$forSystem = $false,
|
|
9
|
+
[switch]$doInstall = $false,
|
|
10
|
+
[switch]$doUninstall = $false
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# determine administrator privileges
|
|
14
|
+
$theuser = [Security.Principal.WindowsIdentity]::GetCurrent()
|
|
15
|
+
$isAdmin = (New-Object Security.Principal.WindowsPrincipal $theuser).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
|
|
16
|
+
|
|
17
|
+
# sanity check execution scenarios
|
|
18
|
+
if ($forSystem -and (-not ($isAdmin))) {
|
|
19
|
+
Write-Host "** ERROR: installing for system requested as non-administrator"
|
|
20
|
+
sleep 2
|
|
21
|
+
exit 1
|
|
22
|
+
}
|
|
23
|
+
if ($forUser -and $isAdmin) {
|
|
24
|
+
Write-Host "** ERROR: installing for user requested as administrator"
|
|
25
|
+
sleep 2
|
|
26
|
+
exit 1
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
# determine the system's font folder and corresponding registry tree
|
|
30
|
+
if ($isAdmin) {
|
|
31
|
+
$fontFilePath = "$env:SYSTEMROOT\Fonts"
|
|
32
|
+
$fontRegistryPath = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
$fontFilePath = "$env:LOCALAPPDATA\Microsoft\Windows\Fonts"
|
|
36
|
+
$fontRegistryPath = "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Fonts"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# display hint about installation
|
|
40
|
+
if ($doInstall) {
|
|
41
|
+
Write-Host "## Installing msg Fonts"
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
Write-Host "## Uninstalling msg Fonts"
|
|
45
|
+
}
|
|
46
|
+
Write-Host "++ Font file tree: $($fontFilePath)"
|
|
47
|
+
Write-Host "++ Font registry tree: $($fontRegistryPath)"
|
|
48
|
+
|
|
49
|
+
# remember if a reboot may be necessary afterwards
|
|
50
|
+
# (which is the case if a font is re-installed in-place)
|
|
51
|
+
$rebootFlag = $false
|
|
52
|
+
|
|
53
|
+
# iterate over all font files
|
|
54
|
+
$FontFiles = Get-ChildItem "..\dtp" -Include "*.ttf" -Recurse
|
|
55
|
+
foreach ($FontFile in $FontFiles) {
|
|
56
|
+
if (Test-Path $FontFile.FullName -pathType leaf) {
|
|
57
|
+
# determine font name
|
|
58
|
+
$shell = New-Object -COMObject Shell.Application
|
|
59
|
+
$folder = Split-Path $FontFile
|
|
60
|
+
$file = Split-Path $FontFile -Leaf
|
|
61
|
+
$shellfolder = $shell.Namespace($folder)
|
|
62
|
+
$shellfile = $shellfolder.ParseName($file)
|
|
63
|
+
$FontName = $shellfolder.getDetailsOf($shellfile, 21)
|
|
64
|
+
|
|
65
|
+
# determine target
|
|
66
|
+
$FontFullName = "$($FontName) (TrueType)"
|
|
67
|
+
$targetPath = Join-Path $fontFilePath $FontFile.Name
|
|
68
|
+
|
|
69
|
+
# dispatch according to action
|
|
70
|
+
if ($doInstall) {
|
|
71
|
+
Write-Host "-- Installing font ""$($FontName)"""
|
|
72
|
+
|
|
73
|
+
# install font file
|
|
74
|
+
Write-Host " File-Source: $($FontFile.FullName)"
|
|
75
|
+
if (Test-Path $targetPath) {
|
|
76
|
+
Write-Host " File-Target: $($targetPath) [REPLACE]"
|
|
77
|
+
Remove-Item $targetPath -Force
|
|
78
|
+
Copy-Item $FontFile.FullName $targetPath -Force
|
|
79
|
+
$rebootFlag = $true
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
Write-Host " File-Target: $($targetPath) [NEW]"
|
|
83
|
+
Copy-Item $FontFile.FullName $targetPath
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
# register font file
|
|
87
|
+
$regTest = Get-ItemProperty -Path $fontRegistryPath -Name "$FontFullName" -ErrorAction SilentlyContinue
|
|
88
|
+
if ($regTest) {
|
|
89
|
+
Write-Host " Registry-Key: ""$($FontFullName)"" [REPLACE]"
|
|
90
|
+
Set-ItemProperty -Name $FontFullName -Path $fontRegistryPath -Value $targetPath | out-null
|
|
91
|
+
$rebootFlag = $true
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
Write-Host " Registry-Key: ""$($FontFullName)"" [NEW]"
|
|
95
|
+
New-ItemProperty -Name $FontFullName -Path $fontRegistryPath -PropertyType string -Value $targetPath | out-null
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
Write-Host "-- Uninstalling font ""$($FontName)"""
|
|
100
|
+
|
|
101
|
+
# unregister font file
|
|
102
|
+
$regTest = Get-ItemProperty -Path $fontRegistryPath -Name "$FontFullName" -ErrorAction SilentlyContinue
|
|
103
|
+
if ($regTest) {
|
|
104
|
+
Write-Host " Registry-Key: ""$($FontFullName)"" [DELETE]"
|
|
105
|
+
Remove-ItemProperty -Name $FontFullName -Path $fontRegistryPath -Force | out-null
|
|
106
|
+
sleep 1
|
|
107
|
+
$rebootFlag = $true
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# uninstall font file
|
|
111
|
+
if (Test-Path $targetPath) {
|
|
112
|
+
Write-Host " File-Target: $($targetPath) [DELETE]"
|
|
113
|
+
Remove-Item $targetPath -Force
|
|
114
|
+
$rebootFlag = $true
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
# follow-up message
|
|
121
|
+
if ($rebootFlag) {
|
|
122
|
+
Write-Host "** NOTICE: At least one existing font file was overwritten or the registry changed."
|
|
123
|
+
Write-Host "** NOTICE: As a result, a system reboot is now strongly advised!"
|
|
124
|
+
sleep 1
|
|
125
|
+
}
|
|
126
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
##
|
|
3
|
+
## macOS-System-Install.sh
|
|
4
|
+
##
|
|
5
|
+
|
|
6
|
+
dst="/Library/Fonts"
|
|
7
|
+
echo "++ Installing fonts into system"
|
|
8
|
+
for font in ../dtp/*/*.ttf; do
|
|
9
|
+
ttf=`echo $font | sed -e 's;^.*/;;'`
|
|
10
|
+
echo "-- Installing font \"$ttf\""
|
|
11
|
+
echo " File-Source: $font"
|
|
12
|
+
if [ -f "$dst/$ttf" ]; then
|
|
13
|
+
echo " File-Target: $dst/$ttf [REPLACE]"
|
|
14
|
+
sudo rm -f "$dst/$ttf"
|
|
15
|
+
sudo cp "$font" "$dst/$ttf"
|
|
16
|
+
else
|
|
17
|
+
echo " File-Target: $dst/$ttf [NEW]"
|
|
18
|
+
sudo cp "$font" "$dst/$ttf"
|
|
19
|
+
fi
|
|
20
|
+
done
|
|
21
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
##
|
|
3
|
+
## macOS-System-Uninstall.sh
|
|
4
|
+
##
|
|
5
|
+
|
|
6
|
+
dst="/Library/Fonts"
|
|
7
|
+
echo "++ Uninstalling fonts from system"
|
|
8
|
+
for font in ../dtp/*/*.ttf; do
|
|
9
|
+
ttf=`echo $font | sed -e 's;^.*/;;'`
|
|
10
|
+
echo "-- Uninstalling font \"$ttf\""
|
|
11
|
+
if [ -f "$dst/$ttf" ]; then
|
|
12
|
+
echo " File-Target: $dst/$ttf [DELETE]"
|
|
13
|
+
sudo rm -f "$dst/$ttf"
|
|
14
|
+
fi
|
|
15
|
+
done
|
|
16
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
##
|
|
3
|
+
## macOS-User-Install.sh
|
|
4
|
+
##
|
|
5
|
+
|
|
6
|
+
dst="$HOME/Library/Fonts"
|
|
7
|
+
echo "++ Installing fonts into user"
|
|
8
|
+
for font in ../dtp/*/*.ttf; do
|
|
9
|
+
ttf=`echo $font | sed -e 's;^.*/;;'`
|
|
10
|
+
echo "-- Installing font \"$ttf\""
|
|
11
|
+
echo " File-Source: $font"
|
|
12
|
+
if [ -f "$dst/$ttf" ]; then
|
|
13
|
+
echo " File-Target: $dst/$ttf [REPLACE]"
|
|
14
|
+
rm -f "$dst/$ttf"
|
|
15
|
+
cp "$font" "$dst/$ttf"
|
|
16
|
+
else
|
|
17
|
+
echo " File-Target: $dst/$ttf [NEW]"
|
|
18
|
+
cp "$font" "$dst/$ttf"
|
|
19
|
+
fi
|
|
20
|
+
done
|
|
21
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
##
|
|
3
|
+
## macOS-User-Uninstall.sh
|
|
4
|
+
##
|
|
5
|
+
|
|
6
|
+
dst="$HOME/Library/Fonts"
|
|
7
|
+
echo "++ Uninstalling fonts from user"
|
|
8
|
+
for font in ../dtp/*/*.ttf; do
|
|
9
|
+
ttf=`echo $font | sed -e 's;^.*/;;'`
|
|
10
|
+
echo "-- Uninstalling font \"$ttf\""
|
|
11
|
+
if [ -f "$dst/$ttf" ]; then
|
|
12
|
+
echo " File-Target: $dst/$ttf [DELETE]"
|
|
13
|
+
rm -f "$dst/$ttf"
|
|
14
|
+
fi
|
|
15
|
+
done
|
|
16
|
+
|
package/index.pdf
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typopro-dtp",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.7",
|
|
4
4
|
"description": "Fonts for Professional Typography (DTP)",
|
|
5
5
|
"homepage": "https://github.com/rse/typopro-dtp",
|
|
6
6
|
"license": "MIT AND Apache-2.0 AND OFL-1.1 AND CC0-1.0",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"url": "http://github.com/rse/typopro/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"npm-install-fetch": "1.
|
|
24
|
-
"shx": "0.3.
|
|
23
|
+
"npm-install-fetch": "1.3.12",
|
|
24
|
+
"shx": "0.3.4"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"install": "npm-install-fetch",
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
##
|
|
2
|
-
## install-all-fonts-win.ps1 (PowerShell script)
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
# determine the system's font folder
|
|
6
|
-
$Shell = New-Object -ComObject Shell.Application
|
|
7
|
-
$ssfFonts = 0x14
|
|
8
|
-
$SystemFontsFolder = $Shell.Namespace($ssfFonts)
|
|
9
|
-
$SystemFontsPath = $SystemFontsFolder.Self.Path
|
|
10
|
-
|
|
11
|
-
# remember if a reboot may be necessary afterwards
|
|
12
|
-
$rebootFlag = $false
|
|
13
|
-
|
|
14
|
-
# iterate over all TypoPRO files
|
|
15
|
-
$FontFiles = Get-ChildItem "..\dtp" -Include "*.ttf" -Recurse
|
|
16
|
-
foreach ($FontFile in $FontFiles) {
|
|
17
|
-
if (Test-Path $FontFile.FullName -pathType leaf) {
|
|
18
|
-
$targetPath = Join-Path $SystemFontsPath $FontFile.Name
|
|
19
|
-
if (Test-Path $targetPath) {
|
|
20
|
-
Write-Host "++ installing $($FontFile.Name) [REPLACE]"
|
|
21
|
-
Remove-Item $targetPath -Force
|
|
22
|
-
Copy-Item $FontFile.FullName $targetPath -Force
|
|
23
|
-
$rebootFlag = $true
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
Write-Host "++ installing $($FontFile.Name)"
|
|
27
|
-
$SystemFontsFolder.CopyHere($FontFile.fullname)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
# follow-up message
|
|
33
|
-
if ($rebootFlag) {
|
|
34
|
-
Write-Host "NOTICE: At least one existing font was overwritten."
|
|
35
|
-
Write-Host "NOTICE: A reboot may be necessary!"
|
|
36
|
-
}
|
|
37
|
-
|