mirror of
https://github.com/sunaku/tamzen-font.git
synced 2024-09-11 11:55:40 +03:00
generate console fonts as PSF, not PCF (alike BDF)
This commit is contained in:
parent
ca8b8c1d5e
commit
b682c40d26
18
README.md
18
README.md
@ -102,10 +102,22 @@ through [this AUR package](https://aur.archlinux.org/packages/tamzen-font-git/).
|
||||
|
||||
Now you should be able to access the "Tamzen" font family in xfontsel.
|
||||
|
||||
NOTE: You can also use the `pcf/` fonts in your Linux console (VT).
|
||||
|
||||
[Download]: https://github.com/sunaku/tamzen-font/archive/master.zip
|
||||
|
||||
### Linux VT integration
|
||||
|
||||
1. Switch to a Linux VT (virtual terminal) by pressing Control-Alt-F1.
|
||||
|
||||
2. Run `showconsolefont` to see how the character map currently looks.
|
||||
|
||||
3. Run `setfont ~/.fonts/tamzen-font/psf/TamzenForPowerline10x20.psf`.
|
||||
|
||||
4. See how the character map now displays glyphs from the Tamzen font.
|
||||
|
||||
5. Try running `setfont` with other Tamzen fonts in the `psf/` folder.
|
||||
|
||||
See <https://wiki.archlinux.org/index.php/Fonts#Console_fonts> for details.
|
||||
|
||||
### XTerm integration
|
||||
|
||||
The following Xresources let you dynamically switch between the various Tamzen
|
||||
@ -206,7 +218,7 @@ You can build the Tamzen fonts for yourself by following this procedure.
|
||||
### Requirements
|
||||
|
||||
```sh
|
||||
sudo apt-get install ruby git imagemagick mercurial bdftopcf
|
||||
sudo apt-get install ruby git imagemagick mercurial bdftopcf bdf2psf
|
||||
gem install bundler
|
||||
bundle install
|
||||
```
|
||||
|
34
Rakefile
34
Rakefile
@ -1,7 +1,14 @@
|
||||
require 'tempfile'
|
||||
require 'rake/clean'
|
||||
|
||||
task 'default' => %w[ .tamzen .powerline .console .fontforge .screenshots ]
|
||||
task 'default' => %w[
|
||||
.tamzen
|
||||
.powerline
|
||||
.console
|
||||
.portable
|
||||
.fontforge
|
||||
.screenshots
|
||||
]
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# index
|
||||
@ -177,16 +184,35 @@ file 'bitmap-font-patcher' do
|
||||
sh 'hg', 'clone', 'https://bitbucket.org/ZyX_I/bitmap-font-patcher'
|
||||
end
|
||||
|
||||
directory 'psf'
|
||||
desc 'Build Tamzen fonts for the Linux Console (VT).'
|
||||
file '.console' => ['psf', '.tamzen', '.powerline'] do
|
||||
share = '/usr/share/bdf2psf'
|
||||
FileList['bdf/Tamzen*.bdf'].sort.each_slice(2) do |bold, regular|
|
||||
dst = regular.gsub('bdf', 'psf').sub(/r(?=\.psf$)/, '')
|
||||
Tempfile.open('symbols') do |symbols_file|
|
||||
symbols = File.read(regular).scan(/^STARTCHAR (\S+)$/)
|
||||
symbols_file.puts symbols
|
||||
symbols_file.close
|
||||
sh 'bdf2psf', '--fb', "#{regular}+#{bold}",
|
||||
"#{share}/standard.equivalents",
|
||||
symbols_file.path, symbols.length.to_s, dst
|
||||
end
|
||||
end
|
||||
touch '.console'
|
||||
end
|
||||
CLOBBER.include '.console', 'psf'
|
||||
|
||||
directory 'pcf'
|
||||
desc 'Build Tamzen fonts for Linux console.'
|
||||
file '.console' => ['pcf', '.tamzen', '.powerline'] do
|
||||
desc 'Build Tamzen fonts in Portable Compiled Format.'
|
||||
file '.portable' => ['pcf', '.tamzen', '.powerline'] do
|
||||
FileList['bdf/Tamzen*.bdf'].each do |src|
|
||||
dst = src.gsub('bdf', 'pcf')
|
||||
sh 'bdftopcf', '-o', dst, '-t', src
|
||||
end
|
||||
touch '.console'
|
||||
end
|
||||
CLOBBER.include '.console', 'pcf'
|
||||
CLOBBER.include '.portable', 'pcf'
|
||||
|
||||
FONTFORGE_FORMATS = [
|
||||
'dfont', # Apple bitmap only sfnt (dfont)
|
||||
|
Loading…
Reference in New Issue
Block a user