summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-09-25 19:22:18 -0400
committerJune McEnroe <june@causal.agency>2018-09-25 19:22:18 -0400
commit041d12fc7f7fca7f28ccc94708b740cbe84dfacb (patch)
tree018a792f5ec714390eb62c9b8365def17b69f4d5
parentAdd psfed, a PSF2 font editor (diff)
downloadsrc-041d12fc7f7fca7f28ccc94708b740cbe84dfacb.tar.gz
src-041d12fc7f7fca7f28ccc94708b740cbe84dfacb.zip
Add r to psfed for invert
Diffstat (limited to '')
-rw-r--r--bin/man/psfed.13
-rw-r--r--bin/psfed.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/bin/man/psfed.1 b/bin/man/psfed.1
index 227bf6b5..a0e07c75 100644
--- a/bin/man/psfed.1
+++ b/bin/man/psfed.1
@@ -95,6 +95,9 @@ Select previous/next bit in column.
 .It Ic SPACE
 Flip selected bit.
 .
+.It Ic r
+Invert glyph.
+.
 .It Ic u
 Revert glyph to initial state.
 .El
diff --git a/bin/psfed.c b/bin/psfed.c
index 9db35cf3..e3584744 100644
--- a/bin/psfed.c
+++ b/bin/psfed.c
@@ -337,6 +337,13 @@ static void inputEdit(char ch) {
 		break; case 'k': if (edit.y) edit.y--;
 		break; case 'j': if (edit.y + 1 < header.glyph.height) edit.y++;
 		break; case ' ': bitFlip(edit.index, edit.x, edit.y);
+		break; case 'r': {
+			for (uint32_t y = 0; y < header.glyph.height; ++y) {
+				for (uint32_t x = 0; x < header.glyph.width; ++x) {
+					bitFlip(edit.index, x, y);
+				}
+			}
+		}
 		break; case 'u': {
 			memcpy(glyph(edit.index), edit.undo, header.glyph.size);
 		}