config: add font-style configurations

This commit is contained in:
Mitchell Hashimoto
2023-09-24 09:12:25 -07:00
parent 16cecc082a
commit 52591161bc
2 changed files with 12 additions and 0 deletions

View File

@ -238,6 +238,7 @@ pub fn init(
if (config.@"font-family") |family| {
var disco_it = try disco.discover(.{
.family = family,
.style = config.@"font-style",
.size = font_size.points,
.variations = config.@"font-variation".list.items,
});
@ -250,6 +251,7 @@ pub fn init(
if (config.@"font-family-bold") |family| {
var disco_it = try disco.discover(.{
.family = family,
.style = config.@"font-style-bold",
.size = font_size.points,
.bold = true,
.variations = config.@"font-variation-bold".list.items,
@ -263,6 +265,7 @@ pub fn init(
if (config.@"font-family-italic") |family| {
var disco_it = try disco.discover(.{
.family = family,
.style = config.@"font-style-italic",
.size = font_size.points,
.italic = true,
.variations = config.@"font-variation-italic".list.items,
@ -276,6 +279,7 @@ pub fn init(
if (config.@"font-family-bold-italic") |family| {
var disco_it = try disco.discover(.{
.family = family,
.style = config.@"font-style-bold-italic",
.size = font_size.points,
.bold = true,
.italic = true,

View File

@ -29,6 +29,14 @@ const c = @cImport({
@"font-family-italic": ?[:0]const u8 = null,
@"font-family-bold-italic": ?[:0]const u8 = null,
/// The named font style to use for each of the requested terminal font
/// styles. This looks up the style based on the font style string advertised
/// by the font itself. For example, "Iosevka Heavy" has a style of "Heavy".
@"font-style": ?[:0]const u8 = null,
@"font-style-bold": ?[:0]const u8 = null,
@"font-style-italic": ?[:0]const u8 = null,
@"font-style-bold-italic": ?[:0]const u8 = null,
/// Apply a font feature. This can be repeated multiple times to enable
/// multiple font features. You can NOT set multiple font features with
/// a single value (yet).