psfedit banner

psfedit

17 devlogs
53h 33m 50s

A CLI/TUI editor and viewer for PSF fonts

Demo Repository

Loading README...

antkru

Shipped this project!

I released an update for my PSF2 font editor! I completely reworked the actual editor part with ncurses. The most difficult part was that this was my first time using ncurses in a real project (I played a little bit around with it some years ago, but not much). I know that it might not look that good depending on your terminal theme, but I do not have the time to implement a custom theming system. But I am proud that it worked in the end, it also has mouse support!

antkru

I have released the new version!
There are some changes:

  • It is possible to move faster when moving around with the navigation keys: Use shift for 5x and ctrl for 10x more speed
  • I also added the option to draw circles, which the cli version didn’t even have
  • markers are now placed by , and . instead of space so that it is possible to choose which marker you want to place
  • General improvements on markers and cursor
  • The add command allows to add multiple glyphs at once
Attachment
Attachment
0
antkru

The new editor is almost ready! What has changed:

  • It has now mouse support for placing markers and moving the cursor. Scrolling is also available in all views
  • It is possible to zoom in and out on the overview
  • The modified glyph can now be saved -> unsaved indicator in status line
  • Merged fixes from main for better testing (And to avoid having to deal with merge conflicts later)
Attachment
Attachment
0
antkru

I have implemented the editor! It is a much better editing experience, but I will try to polish it more. I also have to prepare it for larger fonts. Ncurses still confuses me sometimes, for example the menu seems to be always exactly 16 lines high (I did not realize it before because I had less items in the menu). Now I made the menu’s window 17 lines high, so that it looks consistent.

Attachment
Attachment
0
antkru

I have released the announced v1.0.2, I hope it is more usable now. The first screenshot shows the new UI. I have also been working on the new editor. I added an overview, which is like the viewer, but you can toggle it with o and move around, which should be great for small screens + high resolution fonts.

But I have big difficulties with ncurses: While it works perfectly fine on Arch, it produces garbage output when compiled on my Debian machine.

My Plan is now to improve the overview by adding a second zoom level and to fix it on Debian

Attachment
Attachment
0
antkru

It is my first devlog since I shipped this project! I have read the feedback: A more usable editor is on its way! Sadly, it does not have a GUI, but at least a TUI built with ncurses. It is my first time building something with ncurses (apart from some failed tries, some time ago) so it is difficult. I had to rewrite the new editor multiple times, but now I have a basic plan how it should work.
So this are my changes:

  • Removed old editor
  • Added placeholder default view
  • Added help window

If everything goes well, I will release the new editor in v1.1.0 before flavortown ends, but I might address some smaller feedback in a v1.0.2 release.

Attachment
0
antkru

Shipped this project!

Hours: 29.44
Cookies: 🍪 646
Multiplier: 21.93 cookies/hr

I am shipping my first project, a PSF2 editor! It doesn’t have many features or the most beautiful UI, but it is simple if you just want to view glyphs, show information about a font or create your own one. It was difficult because I have not created similar software before, but I think the result is relatively bug-free and usable.

antkru

I have prepared the first release:

  • --version: prints the version
  • Version is detected from git
  • Improved unsaved changes indicator
  • Bug fixes
Attachment
0
antkru
  • improvements for interactive commands:
    • q(uit) replaces e(xit) to be more consistent with other software
    • new command (wq): faster saving + exiting
    • unsaved indicator in main menu
  • options:
    • --help : finally, I added a help option!
    • --create : creates new font files, also useful for debugging
  • bug fixes
Attachment
0
antkru

I have reworked the access to glyphs by using UTF-8 strings instead of UTF-16 codes, so I do not have to do any conversion. This is possible by using a map to look up the glyph pointers corresponding to a UTF-8 string.
Visible improvements are:

  • glyphs are selected by entering the character directly, instead of using codes
  • new command (list/ls): lists all the characters included in the font
    I think the current implementation still has some bugs, which I will hopefully fix soon
Attachment
0
antkru

Just a few improvements:

  • eraser mode in the editor: fill, line and clear commands are inverted
  • possibility to add more glyphs to files without a unicode table: the plan is to have not only the option to modify existing fonts, but also to create new ones.
Attachment
0
antkru

I have done many usability improvements:

  • prompt:
    • different text color (better distinguishable from output)
    • completion for editing mode
    • unsaved changes indicator in editing mode (after editing the character, you still have to save from the menu)
  • new editing mode:
    • commands for editing instead of manually setting each line
    • ability to undo (but not to redo)
  • viewer:
    • coordinates around the glyph
    • more compact default view, instead of compact mode with reduced resolution
  • new command, which shows the PSF header
Attachment
0
antkru

Today I improved the maintainability by using a custom type for glyphs instead of vector<vector<bool>> . I also added completion with the help of readline.

Attachment
0
antkru

Improvements:

  • added new mode if the font width is higher than 32 bits, which uses 1 * 0.5 instead of 2 * 1 character, at the cost of resolution
  • used GNU readline to add support for arrow keys and history
Attachment
0
antkru

Today I added support for PSF files with unicode tables. It turned out to be more difficult than I thought, because the osdev wiki article is written for C and kernel development, but now I have a (hopefully) working implementation. I am not sure if I tested all cases, because I am not used to working with character encodings, so I will probably continue learning more about that topic.

Attachment
0
antkru

Today I added the editing mode, so I can actually call it an editor.
I hope it works more or less intuitive. You can edit the character line by line, like shown in the screenshot.
You edit the line by entering “x” to set a bit or anything else to unset it. The equal signs can help, as they are inverted if the bit is set.

Now I will try to focus on polishing the user experience.

Attachment
0
antkru

I have been working on some minor improvements with the viewer, like increasing the pixel size to two characters and using · for making pixels more distinguishable from the terminal background.
I also got rid of the segmentation fault that occurred when trying to read a character not included in the font file.

Finally, I also started working on the editor.

Attachment
0
antkru

I have started this as my first public project ever, so please be kind :-)
In the end, this will be a (hopefully)working PSF file editor, but I still have a long way to go…
Until now I have implemented:

  • Error messages if you try to open an invalid file
  • An interactive mode with a few commands: h for help and s for showing glyphs
  • The viewer (s command)
Attachment
0