Skip to content

Commit 9d179bb

Browse files
committed
update Makefile and install instructions
1 parent aba42cd commit 9d179bb

File tree

3 files changed

+67
-54
lines changed

3 files changed

+67
-54
lines changed

Makefile

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
PREFIX ?= /usr/local
2-
OPENTYPE_DIR = $(PREFIX)/share/fonts/opentype/tkw-font/
3-
X11_DIR = $(PREFIX)/share/fonts/X11/misc/
4-
USER_FONT_DIR = $(HOME)/.fonts
1+
SYSCONFDIR ?= /etc
2+
PREFIX ?= /usr/
53

6-
ifeq ($(INDEX),true)
7-
RULE_INDEX = index
4+
ifeq ($(INSTALL_USER),true)
5+
OPENTYPE_DIR = $(HOME)/.fonts
6+
X11_DIR = $(HOME)/.fonts
7+
FONTS_CONF_DIR = $(HOME)/.fonts.conf.d
8+
INDEX ?= index rehash
89
else
9-
RULE_INDEX = noindex
10+
OPENTYPE_DIR = $(PREFIX)/share/fonts/opentype/tkw-font/
11+
X11_DIR = $(PREFIX)/share/fonts/X11/misc/
12+
FONTS_CONF_DIR = $(SYSCONFDIR)/fonts/conf.d
1013
endif
1114

1215
default: all-fonts
@@ -37,31 +40,25 @@ clean:
3740
# Build all font formats
3841
all-fonts: otb pcf pcf.gz
3942

40-
index:
41-
ifeq ($(INSTALL_USER),true)
42-
mkfontdir $(USER_FONT_DIR)
43-
else
44-
mkfontdir $(DESTDIR)/$(X11_DIR)/
45-
endif
43+
index: install-fonts install-conf
44+
mkfontdir $(DESTDIR)$(X11_DIR)/
4645

47-
rehash:
48-
xset fp rehash
49-
fc-cache -fvr
46+
rehash: install-fonts install-conf
47+
-xset fp rehash
48+
-fc-cache -fr
5049

5150
noindex:
5251

5352
install-fonts: all-fonts
54-
ifeq ($(INSTALL_USER),true)
55-
mkdir -p $(USER_FONT_DIR)
56-
install -m644 *.otb $(USER_FONT_DIR)/
57-
install -m644 *.pcf.gz $(USER_FONT_DIR)/
58-
else
59-
mkdir -p $(DESTDIR)/$(OPENTYPE_DIR)/
60-
install -m644 *.otb $(DESTDIR)/$(OPENTYPE_DIR)/
61-
mkdir -p $(DESTDIR)/$(X11_DIR)/
62-
install -m644 *.pcf.gz $(DESTDIR)/$(X11_DIR)/
63-
endif
53+
mkdir -p $(DESTDIR)$(OPENTYPE_DIR)/
54+
install -m644 *.otb $(DESTDIR)$(OPENTYPE_DIR)/
55+
mkdir -p $(DESTDIR)$(X11_DIR)/
56+
install -m644 *.pcf.gz $(DESTDIR)$(X11_DIR)/
57+
58+
install-conf:
59+
mkdir -p $(DESTDIR)$(FONTS_CONF_DIR)/
60+
install -m644 fc-conf/71-enable-tkw-font.conf $(DESTDIR)$(FONTS_CONF_DIR)/
6461

65-
install: install-fonts $(RULE_INDEX)
62+
install: install-fonts install-conf $(INDEX)
6663

67-
.PHONY: all all-fonts install install-fonts index noindex rehash clean default otb pcf pcf.gz
64+
.PHONY: all all-fonts install install-fonts install-conf index noindex rehash clean default otb pcf pcf.gz

README.md

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,98 @@
11
# tkw-font
22

3-
Tiny kakwa font, a really small 7 pixels monospace bitmap font.
3+
Tiny kakwa font: a really small 7 pixels monospace bitmap font.
44

55
![tkw-font Screenshot](https://raw.githubusercontent.com/kakwa/tkw-font/refs/heads/main/misc/screenshot.png)
66

7-
# Generate & Install
7+
# Generate font files & Installation
88

99
## Prerequisites
1010

11-
### macOS
11+
### MacOS
12+
1213
```sh
1314
brew install fontforge font-util
1415
```
1516

1617
### Debian/Ubuntu
18+
1719
```sh
1820
sudo apt install fontforge xfonts-utils
1921
```
2022

2123
## Targets
2224

2325
### Build Targets
24-
- `all-fonts` - Generate all formats `PCF.GZ`, `PCF`, and `OTB` formats.
26+
27+
- `all-fonts` - Generate all formats `PCF.GZ`, `PCF`, and `OTB` formats (default).
2528
- `pcf` - Generate `PCF`
2629
- `pcf.gz` - Generate `PCF.GZ`
2730
- `otb` - Generate OpenType Bitmap (`OTB`).
2831

2932
### Utility Targets
33+
3034
- `clean` - Removes generated font files.
31-
- `index` - Creates an X11 font index in the font directory.
32-
- `rehash` - Refreshes the X11 font cache.
33-
- `noindex` - No-op target used in conditional rules.
3435

3536
## Installation
3637

37-
### System-wide Installation
38+
### Installation Targets
3839

39-
As Root:
40-
```sh
41-
make install PREFIX=/usr
42-
```
43-
This installs fonts to `/usr/local/share/fonts/`.
40+
- `index` - Creates an X11 font index in the font directory.
41+
- `rehash` - Refreshes the X11 and fontconfig font cache.
42+
- `install-fonts` - Install only the fonts
43+
- `install-conf` - Install only the fc configuration
4444

4545
### User Installation (Non-root)
4646

4747
As User:
4848
```sh
49-
make install INSTALL_USER=true
49+
make install INSTALL_USER=true -j
50+
```
51+
52+
This installs fonts to `~/.fonts/` and the config to `~/.fonts.conf.d/`.
53+
It also refresh `fc-cache` and X11 font cache.
54+
55+
### System-wide Installation
56+
57+
As Root:
58+
```sh
59+
make install -j
5060
```
51-
This installs fonts to `~/.fonts/`.
5261

53-
## Fontconfig
62+
This installs fonts to:
63+
* `otb` - `/usr/share/fonts/opentype/tkw-font/`
64+
* `pcf.gz` - `/usr/share/fonts/X11/misc/`
65+
66+
And the config to `/etc/fonts/conf.d/`.
67+
68+
To tweak this install, use the usual variables (`PREFIX`, `SYSCONFDIR`, `DESTDIR`) or manually copy the fonts in the appropriate directories of your system.
69+
70+
## Fontconfig & X11 indexation
5471

5572
You can test the availability of the font with the following commands:
5673

74+
X11:
5775
```sh
76+
# Check font path:
77+
xset q
5878
# Check presence in X11
5979
xlsfonts | grep tkw
6080
```
6181

82+
Fontconfig:
6283
```sh
6384
# Check Presence in Wayland/fontconfig
6485
fc-list | grep tkw
6586
```
6687

67-
If you encounter issues, install `misc/71-enable-tkw-font.conf` in the appropriate directory (`/etc/fonts/conf.d` on Debian).
68-
69-
And then, rescan the fonts `fc-cache -fvr`.
88+
# Trying tkw-font
7089

71-
# Using
72-
73-
## XTerm
90+
Here is a quick way to try tkw-font:
7491

7592
```sh
76-
xterm -bg black -fg white -fn -tkw-tkw-r-normal--7-70-72-72-c-40-iso8859-1 -fb -tkw-tkw-r-normal--7-70-72-72-c-40-iso8859-1
77-
```
93+
# With Xterm
94+
xterm -bg black -fg white -fn -tkw-tkw-r-normal--7-70-72-72-c-40-iso8859-1 -xrm "XTerm.vt100.allowBoldFonts: false"
7895

79-
## Foot
80-
```sh
96+
# With foot
8197
foot --font tkw:size=5
8298
```
File renamed without changes.

0 commit comments

Comments
 (0)