mirror of
https://github.com/sunaku/tamzen-font.git
synced 2024-10-05 15:49:41 +03:00
GH-9: ensure *.fnt embedded font names are unique
This commit is contained in:
parent
bae79897b2
commit
ee2c8d4d64
10
Rakefile
10
Rakefile
@ -242,6 +242,16 @@ file '.fontforge' => ['.tamzen', '.powerline'] + FONTFORGE_FORMATS do
|
||||
sh 'fontforge', '-script', script.path, src
|
||||
end
|
||||
end
|
||||
|
||||
# make embedded font names in *.fnt unique
|
||||
# so they don't overwrite each other when
|
||||
# drag-dropped into Windows' fonts folder
|
||||
FileList['fnt/*.fnt'].each do |fnt|
|
||||
name, tag = fnt.pathmap('%n').sub(/-\d+$/, '').split(/(?=\d)/, 2)
|
||||
unique = File.read(fnt, mode: 'rb').sub(/(?<=#{name})(?=\0\z)/, tag)
|
||||
File.write fnt, unique
|
||||
end
|
||||
|
||||
touch '.fontforge'
|
||||
end
|
||||
CLOBBER.include '.fontforge', *FONTFORGE_FORMATS
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user