Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Melroy van den Berg
dotfiles
Commits
1ea3b99f
Commit
1ea3b99f
authored
Oct 18, 2022
by
Melroy van den Berg
Browse files
Upload New File
parent
98a1c5ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
home/melroy/bin/convertotf
0 → 100644
View file @
1ea3b99f
#!/usr/bin/env python3
# Convert OTF fonts to compressed WOFF2 format,
# using fonttools https://github.com/fonttools/fonttools:
# $ pip3 install fonttools
# $ pip3 install brotli
import
os
from
fontTools.ttLib.woff2
import
compress
for
file
in
os
.
listdir
(
'.'
):
if
os
.
path
.
isfile
(
file
)
and
file
.
endswith
(
'.otf'
):
name
=
file
.
split
(
'.otf'
)[
0
]
newfile
=
name
+
'.woff2'
compress
(
file
,
newfile
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment