The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
context.c File Reference

idunn: the fonts, text faces and icons of a theme. More...

#include "idunn_internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Functions

idunn_context_t * idunn_context_new (const idunn_theme_t *theme, const char *font_dir, const char *icon_pack)
 fonts and icons for a theme.
void idunn_context_free (idunn_context_t *ctx)
void idunn_context_set_theme (idunn_context_t *ctx, const idunn_theme_t *theme)
bragi_face_t * idunn_face (idunn_context_t *ctx, idunn_text_t style)
const icon_t * idunn_icon (idunn_context_t *ctx, const char *name, int32_t size)
const icon_t * idunn_picture (idunn_context_t *ctx, const char *name, int32_t size)
 a colour icon of the Tela set (files, folders, apps), cached
void idunn_draw_text (idunn_context_t *ctx, gfx_buffer_t *buf, idunn_text_t style, int32_t x, int32_t y, int32_t max_width, const char *text, gfx_color_t color)
 a line of text in a style with the top of its line box at y; it ends with "..." if it is wider than max_width (0: any width).
int32_t idunn_overdraw (const idunn_theme_t *theme)
 how far drawing goes out of a widget's rect (rings and shadows)
void idunn_draw_ring (const idunn_widget_t *w, gfx_buffer_t *buf, gfx_rect_t box, int32_t radius)
 the 3 px focus ring around a round box

Detailed Description

idunn: the fonts, text faces and icons of a theme.

Function Documentation

◆ idunn_context_new()

idunn_context_t * idunn_context_new ( const idunn_theme_t * theme,
const char * font_dir,
const char * icon_pack )

fonts and icons for a theme.

Parameters
font_dirthe directory with inter/ and jetbrains-mono/.
icon_packthe Lucide pack, or NULL (no icons).
Returns
the context, or NULL (no fonts).

◆ idunn_context_free()

void idunn_context_free ( idunn_context_t * ctx)

◆ idunn_context_set_theme()

void idunn_context_set_theme ( idunn_context_t * ctx,
const idunn_theme_t * theme )

◆ idunn_face()

bragi_face_t * idunn_face ( idunn_context_t * ctx,
idunn_text_t style )

◆ idunn_icon()

const icon_t * idunn_icon ( idunn_context_t * ctx,
const char * name,
int32_t size )

◆ idunn_picture()

const icon_t * idunn_picture ( idunn_context_t * ctx,
const char * name,
int32_t size )

a colour icon of the Tela set (files, folders, apps), cached

◆ idunn_draw_text()

void idunn_draw_text ( idunn_context_t * ctx,
gfx_buffer_t * buf,
idunn_text_t style,
int32_t x,
int32_t y,
int32_t max_width,
const char * text,
gfx_color_t color )

a line of text in a style with the top of its line box at y; it ends with "..." if it is wider than max_width (0: any width).

◆ idunn_overdraw()

int32_t idunn_overdraw ( const idunn_theme_t * theme)

how far drawing goes out of a widget's rect (rings and shadows)

◆ idunn_draw_ring()

void idunn_draw_ring ( const idunn_widget_t * w,
gfx_buffer_t * buf,
gfx_rect_t box,
int32_t radius )

the 3 px focus ring around a round box