bzt fa73c3b58d Read glyphs from a sample file 9 月之前
..
misc 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
Makefile 0f5aa706b6 Precompiled packages 4 年之前
README.md 64283860d7 Precompiled packages 4 年之前
copypaste.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
g_color.c 5e5a4ed4bd sfnedit is feature complete 4 年之前
g_coords.c 76c2c45d81 Bbox, advance rounding and psf2 fixes 3 年之前
g_kern.c 5e5a4ed4bd sfnedit is feature complete 4 年之前
g_layers.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
help.c ba146ab623 Aestethic fixes in built-in help 1 年之前
hist.c b98cefe2dc More sfnedit 4 年之前
hist.h b98cefe2dc More sfnedit 4 年之前
icon.h 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
lang.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
lang.h 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
m_about.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
m_fileops.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
m_glyphs.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
m_props.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
m_ranges.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
m_test.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
main.c 5e5a4ed4bd sfnedit is feature complete 4 年之前
sdlconf.sh 0f5aa706b6 Precompiled packages 4 年之前
ui.c fa73c3b58d Read glyphs from a sample file 9 月之前
ui.h 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
ui_dummy.c 5e5a4ed4bd sfnedit is feature complete 4 年之前
ui_osZ.c dd34edb16c Initial commit 4 年之前
ui_sdl.c a0f7d1fa68 Minor fixes and recompiled binaries 3 年之前
ui_x11.c 5e5a4ed4bd sfnedit is feature complete 4 年之前
uiglyph.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前
uiwgt.c 05834c4ce9 Font preview, BMF and YAFF format support 9 月之前

README.md

Scalable Screen Font 2.0 Editor

This is a GUI font editor. For further details, read the documentation.

Compilation

Naturally depends on libsfn. Compile that first, then to compile sfnedit, use

$ make

If despite SDL2 is detected, but you want to use X11, then

$ USE_X11=yes make

Dependencies

For portability, it uses SDL2 (or X11 as fallback on platforms that has X11). By default, the installed library is detected and sfnedit is linked against that dynamically. Experts might compile and link SDL statically info sfnedit, see below.

Under Linux, BSD and all other POSIX systems

Standard GNU toolchain, "gcc" and "make".

You'll need the development version of SDL2, which can be installed by your distro's standard package management software ("apt-get install", "emerge", "pacman", "port", "brew", "pkg" etc.). It is usually called "libsdl-dev" or something similar.

Under MacOSX

  1. in a Terminal, run xcode-select --install and in the pop-up window click on "Install", this will give you "gcc" and "make" under MacOSX
  2. download SDL2-X.dmg under the section Development Libraries
  3. open it with Finder, and drag'n'drop SDL2.framework to "/Library/Frameworks" (Finder might ask for your password)

Under Windows

  1. install MinGW, this will give you "gcc" and "make" under Windows
  2. download SDL2-devel-X-mingw.tar.gz under the section Development Libraries
  3. extract SDL2 into a directory under MinGW's home directory
  4. open Makefile in Notepad, and edit MINGWSDL to the path where you've extracted the tarball, add the last SDL2-X part too

Linking minimalistic SDL statically

On all platforms, you can also statically link SDL with sfnedit. For that, here are the required steps:

  1. download SDL2 source
  2. unpack source repo to a directory
  3. copy sdlconf.sh into that directory and in a terminal, run it (under Windows in MSYS terminal)
  4. run make there, should create a (relatively) small libSDL.a with only the SDL_video subsystem
  5. here, in this sfnedit folder, open the Makefile and depending on your OS, set LINUXSDL, MINGWSDL or MACOSXSDL to that directory
  6. running sfnedit's make here will use that static version

Porting to other OSes

This is pretty straight forward. You'll need to compile libsfn. As it contains all its dependencies, all you need for that is an ANSI C compiler and a minimal libc. For sfnedit, you have three options (in descending order of complexity):

  1. if you have already ported X11, then simply compile with USE_X11=yes make (porting X11 is hard).
  2. if you have ported SDL, then simply link statically with that ported library (porting SDL is not easy, but not particularly hard either).
  3. create a driver for your OS' native user interface (the simplest choice).

As for the latter, the required steps:

  1. copy ui_dummy.c to ui_X.c, and implement the functions in the copy (not much, only 11 straightforward functions)
  2. edit Makefile, and modify "DUMMY driver" block to use your ui_X.c and to include your OS header and ui library.

The code is written in a way that the user interface is completely separated, so all you need to do is provide wrappers in your ui_X.c for manipulationg windows and getting events. Your windows should have a 32 bit ARGB pixel buffer. That's all.