programatically fork Tamzen font from Tamsyn 1.8

This commit is contained in:
Suraj N. Kurapati 2011-12-18 14:27:56 -08:00
parent 59f4b42a76
commit 5c5cb2e52f
13 changed files with 42376 additions and 0 deletions

10
LICENSE Normal file
View File

@ -0,0 +1,10 @@
Tamsyn font is free. You are hereby granted permission to use, copy, modify,
and distribute it as you see fit.
Tamsyn font is provided "as is" without any express or implied warranty.
The author makes no representations about the suitability of this font for
a particular purpose.
In no event will the author be held liable for damages arising from the use
of this font.

34
README.markdown Normal file
View File

@ -0,0 +1,34 @@
Tamzen font
===========
This is [my personal fork][1] of the wonderful [Tamsyn font][2] by Scott Fial.
It is programatically forked from Tamsyn version 1.8 by the `Tamzen.rb` script
(needs `gem install grit` library) and diverges from it in the following ways:
* Medium "g" is backported from Tamsyn 1.6.
* Medium "h" is backported from Tamsyn 1.6.
* Medium "m" is backported from Tamsyn 1.6.
* Bold and medium "l" are backported from Tamsyn 1.6.
* Bold and medium "w" are backported from Tamsyn 1.6.
* Bold and medium "y" are backported from Tamsyn 1.6.
* Deliberately empty glyphs are deleted (marked as unimplemented) so that they
do not block secondary fonts from supplying real glyphs at those codepoints.
Installation
------------
Copy the `Tamzen*.bdf` files into your `~/.fonts` directory and run:
mkfontdir ~/.fonts
xset +fp ~/.fonts
xset fp rehash
Now you should be able to access the "Tamzen" font family in xfontsel.
License
-------
Distributed under the same terms as Tamsyn itself. See `LICENSE` file.
[1]: http://snk.tuxfamily.org/log/tamsyn-1.7b-review.html
[2]: http://www.fial.com/~scott/tamsyn-font/

52
Tamzen.rb Normal file
View File

@ -0,0 +1,52 @@
class Font < Struct.new(:file, :props, :chars)
def initialize blob
head, *body, @tail = blob.data.split(/(?=\nSTARTCHAR|\nENDFONT)/)
props = Hash[head.lines.map {|s| s.chomp.split(' ', 2) }]
chars = Hash[body.map {|s| [Integer(s[/ENCODING (\d+)/, 1]), s] }]
super blob.name, props, chars
end
def to_s
props['CHARS'] = chars.length
[
props.map {|*a| a.join(' ') }.join("\n"), "\n",
chars.values,
@tail
].join
end
end
require 'grit'
GIT = Grit::Repo.new('.')
GIT.tree('v1.8').blobs.each do |blob|
if blob.name =~ /\.bdf$/
font = Font.new(blob)
# delete empty glyphs except space and non-breaking space
font.chars.each do |code, char|
if code != 32 && code != 160 && char =~ /BITMAP\n(?:00\n)+ENDCHAR/
font.chars.delete code
end
end
# backport characters from older versions of the font
[
['g'.ord, /Medium/, 'v1.6'],
['h'.ord, /Medium/, 'v1.6'],
['m'.ord, /Medium/, 'v1.6'],
['l'.ord, //, 'v1.6'],
['w'.ord, //, 'v1.6'],
['y'.ord, //, 'v1.6'],
].
each do |code, weight, version|
if font.props['WEIGHT_NAME'] =~ weight
old = Font.new(GIT.tree(version)/font.file)
font.chars[code] = old.chars[code]
end
end
# output the modified font under a different name
rename = ['Tamsyn', 'Tamzen']
File.write font.file.sub(*rename), font.to_s.gsub(*rename)
end
end

4270
Tamzen6x11b.bdf Normal file

File diff suppressed because it is too large Load Diff

4270
Tamzen6x11r.bdf Normal file

File diff suppressed because it is too large Load Diff

4453
Tamzen7x12b.bdf Normal file

File diff suppressed because it is too large Load Diff

4453
Tamzen7x12r.bdf Normal file

File diff suppressed because it is too large Load Diff

2673
Tamzen7x14b.bdf Normal file

File diff suppressed because it is too large Load Diff

4125
Tamzen7x14r.bdf Normal file

File diff suppressed because it is too large Load Diff

4334
Tamzen8x15b.bdf Normal file

File diff suppressed because it is too large Load Diff

4311
Tamzen8x15r.bdf Normal file

File diff suppressed because it is too large Load Diff

4708
Tamzen8x17b.bdf Normal file

File diff suppressed because it is too large Load Diff

4683
Tamzen8x17r.bdf Normal file

File diff suppressed because it is too large Load Diff