Permalink
Browse files

Total reorg to support running from anywhere.

Create your own font anywhere and use any dir for fontpath.

Updated documentation too.
  • Loading branch information...
1 parent 54dca11 commit 4c36f6b6e3f0ecefe521c9b4a47e35da582ce947 @MicahElliott committed Aug 1, 2011
View
@@ -2,34 +2,38 @@
Orp makes X font creation and installation easy. This package includes a few
small fonts to get you started. If you don’t fall in love with them, you can
-use this package to create your own.
+use this package to quickly create your own.
+
+<img src="https://github.com/downloads/MicahElliott/Orp-Font/orp-still-4.png" alt="Orp with clojure/solarized" title="Orp with clojure/solarized" align="right" />
This is a simplified extension/fork of the
[Unicode fonts and tools for X11](http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html)
project.
-I’ve created three new 6x12 bitmap fonts (plus a silly experimental font).
+Inside you’ll find five newly invented 6x12 bitmap fonts.
* Orp Medium (adapted from Pro Font with various changes)
+* Orp Italic (not perfect but can’t do perfect bitmap italic)
* Orp Bold (only possible readable 6x12 bold; most compelling piece of package)
* Orp Book (like Bookman Old Style; slightly ugly but nearly optimal)
-* Orp Italic (not perfect but can’t do perfect bitmap italic)
* ProFont (pretty close to [the original](http://en.wikipedia.org/wiki/Pro_font))
-The vertical height on all has been lowered by 1px.
+The vertical height on all has been lowered by 1px. In practice this causes no
+problems.
-About the name: Given that I am definitely not a “Pro” typographer and neither
-are you, I’ve named this Orp.
+About the name: Given that I am definitely not a “Pro” typographer (and
+neither are you) I’ve named this Orp.
## Quick start
-If you just want to start using Orp without tweaking glyphs or moving things
-around, all you need to do is run:
+If you just want to start using the provided Orp fonts without tweaking glyphs
+or moving things around, all you need to do is run:
- % xset +fp $PWD
+ % cd orp-font
+ % xset +fp $PWD/misc
-You should now be able to fire up an xterm and see the new Orp you just
-“installed”:
+You should now be able to fire up an xterm (or better: urxvt) and see the new
+Orp you just “installed”:
% xterm -geom 80x93 -fn '-misc-orp-medium-r-*--*-*-*-*-*-*-iso10646-1'
@@ -38,20 +42,23 @@ you’re now permanent! Read on for tweaking details, philosophy, and anecdotes
## Why a project out of a single font?
-It’s just a console font; why bother with this? To some, a font is really
-important.
+“It’s just a console font; why bother with this?” To some, a beautiful
+monospaced bitmap font is a way of life. Many of us need to tweak fonts,
+add glyphs, or totally redesign a font. So this project exists because:
-1. I finally have what I consider a perfect enough programming/do-everything
- font.
+1. *My ideal font.* I finally have what I consider a perfect enough
+ programming/do-everything font.
-2. It’s been non-trivial create, build, and install your own X11 font.
+2. *Ease of installation.* It’s been non-trivial to create, build, and install
+ your own X11 font.
-3. At some point in your life you’re going to long for a tweak to your font,
- or addition of some wacky glyph you’ve dreamed up.
+3. *Font hacking.* At some point in your life you’re going to long for a tweak
+ to your font, or addition of some wacky glyph you’ve dreamed up.
-4. There’s not much in here, but this README serves as a place where I can
- pontificate on my font ideals, and explain supporting of extensive glyphs
- and viewing a lot of text at a time.
+4. *Pontification.* There’s not a lot in here, but this README serves as a
+ place where I can rant about my font ideals, and explain the importance of
+ being able to view less common characters and the ability to view a lot of
+ text at a time.
Over the past decade I have spent several days here and there fiddling around
with finding good small fonts. Although I’ve been pretty (though not
@@ -62,38 +69,40 @@ code on my screens. It also had a few things I didn’t like (jagged slashes,
skinny zero, some inconsistent characters). It also had an extra pixel of
spacing per line, which was wasting 10% of the screen.
-Now finally, I’ve taken my very favorite monospace font,
-[Pro Font](http://en.wikipedia.org/wiki/Pro_font), adapted an xterm friendly
-BDF for it, and enhanced some of its glyphs to be slightly more friendly.
+I’ve taken my very favorite existing monospace font, [Pro
+Font](http://en.wikipedia.org/wiki/Pro_font), adapted an xterm friendly BDF
+for it, and enhanced some of its glyphs to be slightly more friendly. Plus,
+I’ve added a few other derivative fonts that make up the Orp family.
## Disclaimer
-I don’t know much about the X11 font system or the tools that manipulate them.
-I played with the package enough to see how new fonts are built and installed,
-and emulated that into a script that could operate on a single font.
+I don’t know a whole lot about the X11 font system or the tools that
+manipulate it. I’ve played with the packages enough to see how new fonts are
+built and installed, and emulated that into a script (`xfont-install`) that
+could operate on a single font.
## All you need to understand
A BDF file is the ‘source code’ of your font. It is modifiable via
-a tool called gbdfed (Gtk BDF EDitor), which is pretty easy for any noob to
+a tool called `gbdfed` (Gtk BDF EDitor), which is pretty easy for any n00b to
start whacking glyphs with. After you’re happy with your BDF you run it
through a bunch of tools that create an output (gzipped) PCF file. Finally you
tell X to start using the font/directory.
## Included in this repo
-* `*.bdf` — A few fonts that you may like or want to change/use as baseline.
+* *`*.bdf`* — A few fonts that you may like or want to change/use as baseline.
-* `xfont-install.zsh` — The little glue script that does what the full Makefile
- accomplishes for all X11 fonts. Though tiny, it does the full build, plus
+* *`xfont-install.zsh`* — The little glue script that could.
+ Though tiny, it does the full build, plus
installation and setup.
-* `xfont-test.zsh` — Just dumps a test file to the screen. Could do some other
- tests in the future.
+* *`xfont-test.zsh`*Dumps an glyph-intensive test file to the screen. Could
+ do some other tests in the future.
-* `*.pcf.gz` — I’ve included the two important Orp fonts in complied form
- since they’re tiny, and some will simply want to install them without
- tweaking.
+* *`*.pcf.gz`* — I’ve included the Orp fonts in complied form since they’re
+ tiny, and some will simply want to install them without tweaking/building.
+ They will be rebuilt if you recompile.
And things you shouldn’t care about:
@@ -113,15 +122,15 @@ And things you shouldn’t care about:
1. To create a new font, just copy a base font (you’ll likely want to start
with Orp Medium)
- % cp orp.bdf myfont.bdf
+ % cp orp-medium.bdf my-font.bdf
1. Fire up `gbdfed`, hack some glyphs, and set up your new font’s properties.
Just hit `C-P` to get to properties and make sure your font family name is
-myfont’.
+ ‘my-font’.
1. Build and install to CWD with
- % fontx.zsh myfont
+ % fontx.zsh my-font
The font tools magic happens via the few commands in there, but you
shouldn’t need to worry about it.
@@ -131,15 +140,15 @@ And things you shouldn’t care about:
% xfontsel
Make sure your new font shows up under ‘fmly’ and select it. You can past
- that crazy `-*-myfont-*-…` string into your `~/.Xdefaults-$(hostname)` file.
+ that crazy `-*-my font-*-…` string into your `~/.Xdefaults-$(hostname)` file.
xterm*font: -misc-orp-medium-r-*–*-*-*-*-*-*-iso10646-1
1. Test your new font
- % fontx-test.zsh myfont
+ % xfont-test.zsh
-1. Make it permanent by ensuring you've done the steps in the Quick Start
+1. Make it permanent by ensuring youve done the steps in the Quick Start
section above.
## Why bitmap? (vs truetype)
@@ -154,17 +163,17 @@ looking at data, or doing much of anything in an editor or terminal with a
variable width font. Programmers depend so much on indented and tabular
formatting that the world would fall apart without monospacing.
-Note to publishers: Please, please always use monospace fonts for your code
-samples.
+Note to book publishers: Please, please always use monospace fonts for your
+code samples.
## Why a bold font?
-Bold is beautiful too. It’s just that you may be used to seeing it rendered
-algorithmically as an adaptation from its ‘medium’ source. This results in
-fonts that become too heavy (e.g., solid block ‘m’ and ‘#’) and come out
-unreadable. However, the 6x12 set can be manually crafted as bold, to a
-lesser degree of boldness, and yet still be bold. (This is less of an issue
-with larger fonts.)
+Bold is beautiful too. But it’s often the ugly step-child of an existing
+system font. You’re probably used to seeing it rendered algorithmically as an
+adaptation from its ‘medium’ canonical cousin. This results in fonts that
+become too heavy (e.g., solid block ‘m’ and ‘#’) and come out unreadable.
+However, the 6x12 set can be manually crafted as bold, to a lesser degree of
+boldness, and yet still be bold. (This is less of an issue with larger fonts.)
You can see some of the basic effects in limited color with this:
@@ -183,7 +192,7 @@ You can even take color to an extreme level by doing standout/inversion, but
it’s rare to want this.
### Font/weight (bold vs medium)
-Terminals don’t really allow multiple fonts, but bold can be mixed in and
+Terminals don’t usually allow multiple fonts, but bold can be mixed in and
actually can be a different font.
Bold is great for distinguishing files in `ls` listings, standing forward
@@ -201,12 +210,16 @@ immediate attention.
### Sizing/obliqueness
Sadly, most terminals (including xterm) don’t offer much in the way of these.
-But you really need to use xterm (or one of its close cousins)…
-## Why xterm?
+But there’s great news!! Very recent versions of `urxvt` enable activation of
+several fonts at a time. My older Ubuntu required application of a patch to
+get full 256 colors, but I suspect newer systems will already have a sane
+build of `urxvt` installed.
+
+## Why xterm (family)?
* True bitmap fonts
-* All the ISO10646 glyphs (for math, prompts, drawing, etc)
+* All the ISO-10646 glyphs (for math, prompts, drawing, etc)
* Lightweight
* 256+ (RGB) color
* All Properties (bold, underline, inverse) work as expected (except oblique)
@@ -263,6 +276,8 @@ grid. I’ve tried creating other alternative characters (sometimes
accidentally) and found that there are probably several other glyph designs
that could work well. So feel free to experiment with new variations.
+Orp-Italic still needs an italicization treatment for its capital letters.
+
## Why not just use Markus’ package?
Maybe you should; that’s what I did before arriving here. There’s nothing
@@ -276,3 +291,4 @@ response from Markus in email to get Orp included, so it lives here.
* [Terminal codes](http://linuxgazette.net/issue65/padala.html)
* [Markus Kuhn’s X11 Fonts](http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html)
* [Adding a font to your system](http://osr507doc.sco.com/en/GECG/X_Font_ProcAddFn.html)
+* [Computer fonts explained](http://en.wikipedia.org/wiki/Computer_font)
View
@@ -0,0 +1,77 @@
+#!/usr/bin/perl
+#
+# bdftruncate.pl -- Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/>
+#
+# This Perl script allows you to generate from an ISO10646-1 encoded
+# BDF font other ISO10646-1 BDF fonts in which all characters above
+# a threshold code value are stored unencoded.
+#
+# $Id: bdftruncate.pl,v 1.8 2006-01-05 20:31:45+00 mgk25 Rel $
+
+# Subroutine to identify whether the ISO 10646/Unicode character code
+# ucs belongs into the East Asian Wide (W) or East Asian FullWidth
+# (F) category as defined in Unicode Technical Report #11.
+sub iswide ($) {
+ my $ucs = shift(@_);
+
+ return ($ucs >= 0x1100 &&
+ ($ucs <= 0x115f || # Hangul Jamo
+ ($ucs >= 0x2e80 && $ucs <= 0xa4cf &&
+ ($ucs & ~0x0011) != 0x300a && $ucs != 0x303f) || # CJK .. Yi
+ ($ucs >= 0xac00 && $ucs <= 0xd7a3) || # Hangul Syllables
+ ($ucs >= 0xf900 && $ucs <= 0xfaff) || # CJK Comp. Ideographs
+ ($ucs >= 0xfe30 && $ucs <= 0xfe6f) || # CJK Comp. Forms
+ ($ucs >= 0xff00 && $ucs <= 0xff5f) || # Fullwidth Forms
+ ($ucs >= 0xffe0 && $ucs <= 0xffe6) ||
+ ($ucs >= 0x20000 && $ucs <= 0x2ffff)));
+}
+
+# parse options
+if ($ARGV[0] eq '-w' || $ARGV[0] eq '+w') {
+ $removewide = $ARGV[0] eq '-w';
+ shift @ARGV;
+}
+
+print STDERR <<End if $#ARGV != 0;
+
+Usage: bdftruncate.pl [+w|-w] threshold <source.bdf >destination.bdf
+
+Example:
+
+ bdftruncate.pl 0x3200 <6x13.bdf >6x13t.bdf
+
+will generate the file 6x13t.bdf in which all glyphs with codes
+>= 0x3200 will only be stored unencoded (i.e., ENCODING -1).
+Option -w removes East Asian Wide and East Asian FullWidth characters
+(default if threshold <= 0x3200), and option +w keeps them.
+
+End
+
+exit 1 if $#ARGV != 0;
+
+# read threshold value from command line
+$threshold = $ARGV[0];
+if ($threshold =~ /^(0[xX]|U[+-]?)([0-9a-fA-F]+)$/) {
+ $threshold = hex($2);
+} elsif (!($threshold =~ /^[0-9]+$/)) {
+ die("Illegal threshold '$threshold'!\n");
+}
+$removewide = $threshold <= 0x3200 unless defined $removewide;
+
+# filter file
+while (<STDIN>) {
+ if (/^ENCODING\s+(-?\d+)/ &&
+ ($1 >= $threshold || ($removewide && iswide($1)))) {
+ print "ENCODING -1\n";
+ } elsif (/^STARTFONT/) {
+ print;
+ print "COMMENT AUTOMATICALLY GENERATED FILE. DO NOT EDIT!\n";
+ printf("COMMENT In this version of the font file, all characters >= " .
+ "U+%04X are\nCOMMENT not encoded to keep XFontStruct small.\n",
+ $threshold);
+ } else {
+ s/^COMMENT\s+\"(.*)\"$/COMMENT $1/;
+ s/^COMMENT\s+\$[I]d: (.*)\$\s*$/COMMENT Derived from $1\n/;
+ print;
+ }
+}
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.
@@ -2,5 +2,5 @@
orp-bold.pcf.gz -misc-orp-bold-r-semicondensed--12-110-75-75-c-60-iso10646-1
orp-book.pcf.gz -misc-orp-book-r-semicondensed--12-110-75-75-c-60-iso10646-1
orp-italic.pcf.gz -misc-orp-medium-i-semicondensed--12-110-75-75-c-60-iso10646-1
-orp-normal.pcf.gz -misc-orp-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
+orp-medium.pcf.gz -misc-orp-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
profont.pcf.gz -misc-profont-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
File renamed without changes.
File renamed without changes.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 4c36f6b

Please sign in to comment.