Skip to content

Commit

Permalink
move *.bdf and *.png into their own subfolders too
Browse files Browse the repository at this point in the history
  • Loading branch information
sunaku committed May 20, 2015
1 parent 6e70c3e commit 72b0582
Show file tree
Hide file tree
Showing 59 changed files with 60 additions and 51 deletions.
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,60 @@ Screenshots
-----------

### Tamzen-9
![Tamzen5x9r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen5x9r.png)
![Tamzen5x9b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen5x9b.png)
![Tamzen5x9r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen5x9r.png)
![Tamzen5x9b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen5x9b.png)

### Tamzen-12
![Tamzen6x12r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen6x12r.png)
![Tamzen6x12b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen6x12b.png)
![Tamzen6x12r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen6x12r.png)
![Tamzen6x12b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen6x12b.png)

### Tamzen-13
![Tamzen7x13r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen7x13r.png)
![Tamzen7x13b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen7x13b.png)
![Tamzen7x13r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen7x13r.png)
![Tamzen7x13b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen7x13b.png)

### Tamzen-14
![Tamzen7x14r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen7x14r.png)
![Tamzen7x14b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen7x14b.png)
![Tamzen7x14r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen7x14r.png)
![Tamzen7x14b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen7x14b.png)

### Tamzen-15
![Tamzen8x15r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen8x15r.png)
![Tamzen8x15b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen8x15b.png)
![Tamzen8x15r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen8x15r.png)
![Tamzen8x15b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen8x15b.png)

### Tamzen-16
![Tamzen8x16r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen8x16r.png)
![Tamzen8x16b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen8x16b.png)
![Tamzen8x16r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen8x16r.png)
![Tamzen8x16b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen8x16b.png)

### Tamzen-20
![Tamzen10x20r.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen10x20r.png)
![Tamzen10x20b.bdf](https://github.com/sunaku/tamzen-font/raw/master/Tamzen10x20b.png)
![Tamzen10x20r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen10x20r.png)
![Tamzen10x20b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/Tamzen10x20b.png)

### TamzenForPowerline-9
![TamzenForPowerline5x9r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline5x9r.png)
![TamzenForPowerline5x9b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline5x9b.png)
![TamzenForPowerline5x9r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline5x9r.png)
![TamzenForPowerline5x9b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline5x9b.png)

### TamzenForPowerline-12
![TamzenForPowerline6x12r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline6x12r.png)
![TamzenForPowerline6x12b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline6x12b.png)
![TamzenForPowerline6x12r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline6x12r.png)
![TamzenForPowerline6x12b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline6x12b.png)

### TamzenForPowerline-13
![TamzenForPowerline7x13r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline7x13r.png)
![TamzenForPowerline7x13b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline7x13b.png)
![TamzenForPowerline7x13r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline7x13r.png)
![TamzenForPowerline7x13b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline7x13b.png)

### TamzenForPowerline-14
![TamzenForPowerline7x14r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline7x14r.png)
![TamzenForPowerline7x14b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline7x14b.png)
![TamzenForPowerline7x14r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline7x14r.png)
![TamzenForPowerline7x14b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline7x14b.png)

### TamzenForPowerline-15
![TamzenForPowerline8x15r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline8x15r.png)
![TamzenForPowerline8x15b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline8x15b.png)
![TamzenForPowerline8x15r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline8x15r.png)
![TamzenForPowerline8x15b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline8x15b.png)

### TamzenForPowerline-16
![TamzenForPowerline8x16r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline8x16r.png)
![TamzenForPowerline8x16b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline8x16b.png)
![TamzenForPowerline8x16r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline8x16r.png)
![TamzenForPowerline8x16b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline8x16b.png)

### TamzenForPowerline-20
![TamzenForPowerline10x20r.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline10x20r.png)
![TamzenForPowerline10x20b.bdf](https://github.com/sunaku/tamzen-font/raw/master/TamzenForPowerline10x20b.png)
![TamzenForPowerline10x20r.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline10x20r.png)
![TamzenForPowerline10x20b.bdf](https://github.com/sunaku/tamzen-font/raw/master/png/TamzenForPowerline10x20b.png)

Installation
------------
Expand All @@ -89,14 +89,15 @@ NOTE: For non-Linux platforms, try using the font files in these subfolders:
NOTE: [Arch Linux](https://www.archlinux.org) users may also install this font
through [this AUR package](https://aur.archlinux.org/packages.php?ID=57298).

Copy the `Tamzen*.bdf` files into your `~/.fonts` directory and run:
[Download] this Git repository to `~/.fonts/tamzen-font` and then run:

mkfontdir ~/.fonts
xset +fp ~/.fonts
xset +fp ~/.fonts/tamzen-font/bdf
xset fp rehash

Now you should be able to access the "Tamzen" font family in xfontsel.

[Download]: https://github.com/sunaku/tamzen-font/archive/master.zip

### XTerm integration

The following Xresources let you dynamically switch between the various Tamzen
Expand Down
48 changes: 28 additions & 20 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ task 'default' => ['.screenshots', '.fontforge']
# index
#-----------------------------------------------------------------------------

file 'fonts.dir' => ['.tamzen', '.powerline'] do
sh 'mkfontdir'
sh 'xset', '+fp', Dir.pwd
directory 'bdf'
file 'bdf/fonts.dir' => ['bdf', '.tamzen', '.powerline'] do
sh 'mkfontdir', 'bdf'
sh 'xset', '+fp', File.expand_path('bdf')
sh 'xset', 'fp', 'rehash'
end
CLOBBER.include 'fonts.dir'
CLOBBER.include 'bdf'

#-----------------------------------------------------------------------------
# fonts
Expand Down Expand Up @@ -98,7 +99,7 @@ TAMZEN_BACKPORT_SPECS = {
}

desc 'Build Tamzen fonts.'
file '.tamzen' => __FILE__ do
file '.tamzen' => ['bdf', __FILE__] do
require 'git'
git = Git.open('.')

Expand Down Expand Up @@ -139,17 +140,18 @@ file '.tamzen' => __FILE__ do

# save backported font under a different name
rename = ['Tamsyn', 'Tamzen']
File.write target_file.sub(*rename), target_font.to_s.gsub(*rename)
dst = File.join('bdf', target_file.sub(*rename))
File.write dst, target_font.to_s.gsub(*rename)
end

touch '.tamzen'
end
CLOBBER.include '.tamzen', '*.bdf'
CLOBBER.include '.tamzen'

desc 'Build Tamzen fonts for Powerline.'
file '.powerline' => ['.tamzen', 'bitmap-font-patcher'] do
rename = [/Tamzen/, '\&ForPowerline']
FileList['*.bdf'].exclude('*ForPowerline*').each do |src|
FileList['bdf/*.bdf'].exclude('bdf/*ForPowerline*').each do |src|
dst = src.sub(*rename)
IO.popen('python bitmap-font-patcher/fontpatcher.py', 'w+') do |patcher|
patcher.write File.read(src).gsub(*rename).gsub('ISO8859', 'ISO10646')
Expand Down Expand Up @@ -181,15 +183,15 @@ FONTFORGE_FORMATS = [
end

FONTFORGE_COMMANDS = ['Open($1)'] + FONTFORGE_FORMATS.map do |format|
"Generate(#{(format + '/').inspect} + $1:r + #{('.' + format).inspect})"
"Generate(#{(format + '/').inspect} + $1:t:r + #{('.' + format).inspect})"
end

desc 'Build Tamzen fonts for other platforms.'
file '.fontforge' => ['.tamzen', '.powerline'] + FONTFORGE_FORMATS do
Tempfile.open(['fontforge', '.pe']) do |script|
script.puts FONTFORGE_COMMANDS
script.close
FileList['*.bdf'].each do |src|
FileList['bdf/*.bdf'].each do |src|
sh 'fontforge', '-script', script.path, src
end
end
Expand All @@ -201,18 +203,24 @@ CLOBBER.include '.fontforge', *FONTFORGE_FORMATS
# screenshots
#-----------------------------------------------------------------------------

directory 'png'
desc 'Build font preview screenshots.'
file '.screenshots' => 'fonts.dir' do
FileList['*.bdf'].ext('png').each do |png|
Rake::Task[png].invoke
file '.screenshots' => ['bdf/fonts.dir'] do
FileList['bdf/*.bdf'].each do |bdf|
Rake::Task[bdf.sub('bdf', 'png').ext('png')].invoke
end
touch '.screenshots'
end
CLEAN.include '.screenshots', '*.png'
CLEAN.include '.screenshots', 'png'

rule %r{^png/.+\.png$} => [->(png){ png.sub('png', 'bdf').ext('bdf') }, 'png',
'bdf/fonts.dir'] do |t|

src = File.basename(t.source)
dst = t.name

rule '.png' => ['.bdf', 'fonts.dir'] do |t|
# translate the BDF font filename into its full X11 font name
@bdf_to_x11 ||= Hash[File.readlines('fonts.dir').map(&:split)]
@bdf_to_x11 ||= Hash[File.readlines('bdf/fonts.dir').map(&:split)]

# assemble sample text for rendering
lines = [
Expand All @@ -226,7 +234,7 @@ rule '.png' => ['.bdf', 'fonts.dir'] do |t|
"Illegal1i = oO0 \uE0A0 \uE0A1 \uE0A2 \uE0B0 \uE0B1 \uE0B2 \uE0B3"
]
width = lines.first.length
lines.unshift t.source.center(width)
lines.unshift src.center(width)

# store sample text in a file because it's the easiest way to render
sample_text_file = Tempfile.open('screenshot')
Expand All @@ -237,12 +245,12 @@ rule '.png' => ['.bdf', 'fonts.dir'] do |t|
sh 'xterm',
'-fg', 'black',
'-bg', 'white',
'-T', t.source,
'-font', @bdf_to_x11[t.source],
'-T', src,
'-font', @bdf_to_x11[src],
'-geometry', "#{lines.first.length}x#{lines.length}",
'-e', [
'tput civis', # hide the cursor
"cat #{sample_text_file.path.inspect}", # show sample text
"import -window $WINDOWID #{t.name.inspect}", # take a screenshot
"import -window $WINDOWID #{dst.inspect}", # take a screenshot
].join(' && ')
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 72b0582

Please sign in to comment.