mirror of
https://github.com/sunaku/tamzen-font.git
synced 2024-09-11 11:55:40 +03:00
GH-2: drop blank glyphs from Powerline font patcher
These blank glyphs prevented other fonts from supplying real ones. https://github.com/sunaku/tamzen-font/issues/2#issuecomment-51993873
This commit is contained in:
parent
4b4b0aceb1
commit
044e858aca
7
Rakefile
7
Rakefile
@ -28,7 +28,7 @@ class Font < Struct.new(:file, :props, :chars)
|
||||
|
||||
# delete empty glyphs except space (32) and non-breaking space (160)
|
||||
chars.each do |code, char|
|
||||
if char =~ /BITMAP\n(?:00\n)+ENDCHAR/ && code != 32 && code != 160
|
||||
if char =~ /BITMAP\n(?:0+\n)+ENDCHAR/ && code != 32 && code != 160
|
||||
chars.delete code
|
||||
end
|
||||
end
|
||||
@ -92,12 +92,13 @@ end
|
||||
|
||||
desc 'Build Tamzen fonts for Powerline.'
|
||||
task :powerline => [:tamzen, 'bitmap-font-patcher'] do
|
||||
rename = [/Tamzen/, '\&ForPowerline']
|
||||
FileList['Tamzen[0-9]*.bdf'].each do |src|
|
||||
dst = src.sub(*rename)
|
||||
IO.popen('python bitmap-font-patcher/fontpatcher.py', 'w+') do |patcher|
|
||||
rename = [/Tamzen/, '\&ForPowerline']
|
||||
patcher.write File.read(src).gsub(*rename).gsub('ISO8859', 'ISO10646')
|
||||
patcher.close_write
|
||||
File.write src.sub(*rename), patcher.read
|
||||
File.write dst, Font.new(dst, patcher.read)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user