yambar/font.h
Daniel Eklöf f6977417e0 font: use font-config to load font
This allows us to a) move away from cairo's "toy" API, and b) let the
user specify font options in a single font "name" string:

  Serif:size=10:weight=bold:slant=italic

This also allows us to simplify the font code significantly (except
for the fontconfig parts...); the font no longer sets itself in a
cairo surface - font users do that; the font simply returns a
cairo_scaled_font_t.

Furthermore, font_clone() has now been simplified to basically just
refcount the scaled font. I.e. there's no need to run the full
constructor and lookup and instantiate the cairo scaled font again.
2019-01-09 18:50:16 +01:00

15 lines
331 B
C

#pragma once
#include <stdbool.h>
#include <cairo.h>
#include "color.h"
struct font;
struct font *font_new(const char *name);
struct font *font_clone(const struct font *font);
void font_destroy(struct font *font);
const char *font_face(const struct font *font);
cairo_scaled_font_t *font_scaled_font(const struct font *font);