havoc icon indicating copy to clipboard operation
havoc copied to clipboard

Font features: OpenType support, multiple styles

Open Seirdy opened this issue 4 years ago • 1 comments

Currently, only a single path to a TrueType font is supported. Supporting multiple fonts for bold/italic styles would be appreciated.

Many fonts (inc. Nerd Fonts) are only available as .otf files, and need to be converted to TrueType fonts for use in Havoc. Support for OpenType fonts would make it easier to use these fonts.

Seirdy avatar Jan 19 '20 18:01 Seirdy

Supporting multiple styles should be fairly easy, some small modifications to glyph.c so multiple font objects can be created (I was lazy so it just uses static memory atm.) And then just using a different font object in the draw_cell function depending on the attributes. That would do it for bold, some extra stuff might have to be figured out for italic.

To support OpenType would probably mean to start depending on FreeType or something similar. FreeType would give support for all sorts of font formats but also a lot of features we really don't need or care about in monospaced termnials. So originally I didn't use it because of lofty minimalism goals(few dependencies, small static binary etc.)

ii8 avatar Jan 20 '20 12:01 ii8