bdf2sfd

BDF to SFD converter, allowing to vectorize bitmap fonts
Log | Files | Refs | README | LICENSE

README.md (2891B)


      1 # bdf2sfd
      2 
      3 bdf2sfd is a [BDF][1] to [SFD][2] converter, allowing to vectorize bitmap
      4 fonts. It works by converting each pixel of a glyph to a polygon, which
      5 produces large and unoptimized SFD files that should be post-processed
      6 using [FontForge][3].
      7 
      8 There are several reasons why it might be desirable to convert bitmap
      9 fonts to OpenType or TrueType versions. This allow for example to use them
     10 as Web fonts, or simply to keep using them in some terminal emulators,
     11 since Pango 1.44 dropped support for bitmap fonts.
     12 
     13 It was originally created to generate OpenType versions of [Spleen][4], and
     14 is released in the hope it can be useful to convert other fonts as well.
     15 Please be aware that it works best on fonts proportional to 8x16. Other
     16 sizes will work but the aspect ratio will not be preserved. There is
     17 currently little interest in addressing the issue.
     18 
     19 ## Dependencies
     20 
     21 bdf2sfd uses the `CMake` build system and does not requires any external
     22 dependencies.
     23 
     24 	mkdir build
     25 	cd build
     26 	cmake ..
     27 	make
     28 
     29 bdf2sfd has been successfully built and tested on OpenBSD, NetBSD, FreeBSD,
     30 and Linux with both Clang and GCC.
     31 
     32 ## Packages
     33 
     34 Packages are available for the following operating systems:
     35 
     36 - [OpenBSD][5]
     37 - [NetBSD][6]
     38 - [Void Linux][7]
     39 - [Debian][8]
     40 - [Ubuntu][9]
     41 
     42 ## Usage
     43 
     44 	bdf2sfd [-hv] [-f name] [-p name] file
     45 
     46 If file is a single dash (`-'), bdf2sfd reads from the standard input.
     47 
     48 The options are as follows:
     49 
     50 	-f name	Specify font name.
     51 	-p name	Specify PostScript font name.
     52 	-h	Display usage.
     53 	-v	Display version.
     54 
     55 bdf2sfd outputs SFD data to **stdout**.
     56 
     57 ### Post-processing
     58 
     59 The SFD files created by bdf2sfd should be post-processed with FontForge
     60 in order to remove overlap and simplify shapes.
     61 
     62 This can be done as follow:
     63 
     64 ```
     65 fontforge -lang ff -c 'Open("spleen.sfd"); SelectAll(); RemoveOverlap(); Simplify(-1, 1); Save("spleen.sfd")'
     66 ```
     67 
     68 ### Producing OTF and TTF fonts
     69 
     70 After post-processing, OpenType and/or TrueType fonts can be produced as follow:
     71 
     72 For OTF fonts:
     73 
     74 ```
     75 fontforge -lang ff -c 'Open("spleen.sfd"); Generate("spleen.otf")'
     76 ```
     77 
     78 For TTF fonts:
     79 
     80 ```
     81 fontforge -lang ff -c 'Open("spleen.sfd"); Generate("spleen.ttf")'
     82 ```
     83 
     84 ## License
     85 
     86 bdf2sfd is released under the BSD 2-Clause license. See `LICENSE` file for
     87 details.
     88 
     89 ## Author
     90 
     91 bdf2sfd is developed by Frederic Cambus.
     92 
     93 - Site: https://www.cambus.net
     94 
     95 ## Resources
     96 
     97 GitHub: https://github.com/fcambus/bdf2sfd
     98 
     99 [1]: https://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format
    100 [2]: https://fontforge.org/en-US/documentation/developers/sfdformat/
    101 [3]: https://fontforge.org
    102 [4]: https://github.com/fcambus/spleen
    103 [5]: https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/converters/bdf2sfd
    104 [6]: https://pkgsrc.se/converters/bdf2sfd
    105 [7]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/bdf2sfd
    106 [8]: https://packages.debian.org/search?keywords=bdf2sfd
    107 [9]: https://packages.ubuntu.com/bdf2sfd