ii8 / havoc

minimal terminal emulator for wayland
Other
102 stars 17 forks source link

Font features: OpenType support, multiple styles #17

Open Seirdy opened 4 years ago

Seirdy commented 4 years ago

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.

ii8 commented 4 years ago

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.)