Commit 95cc600
committed
Port font editor to SDL2
Replace X11 with SDL2 to improve the portability and cross-platform support
Migrated window creation from X11's `XCreateWindow` to `SDL_CreateWindow`.
Replaced X11 event handling with SDL2’s event loop (`SDL_PollEvent`)
to capture input events such as keyboard and mouse interactions.
Updated rendering to use `SDL_Renderer` and `SDL_Surface`,
replacing X11's rendering functions.
* Modified some key event logic:
1. SDLK_ESCAPE: ESC now exits the program.
2. SDL_QUIT: Clicking the "X" on the window exits the program.
* Unchanged key event logic:
1. SDLK_q: Switches to the next font.
* Rename delete function:
1. Rename delete() to delete_char() to avoid `clang-format` misinterpreting
`delete()` as the C++ the keyword, which cauese an extra space to be
added when running `clang-format`, turning `delete()` to `delete ()`.
* Add operation instructions in the READMD.
1. Add a quick guide
2. Add demo GIF of font editor1 parent 35ddf50 commit 95cc600
File tree
5 files changed
+214
-144
lines changed- tools/font-edit
- figs
5 files changed
+214
-144
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | | - | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
16 | 50 | | |
17 | | - | |
| 51 | + | |
| 52 | + | |
Loading
0 commit comments