-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
programatically fork Tamzen font from Tamsyn 1.8
- Loading branch information
Showing
13 changed files
with
42,376 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.