2018-03-29 14:04:20 +11:00
|
|
|
#ifndef _SWAY_PANGO_H
|
|
|
|
#define _SWAY_PANGO_H
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
2021-05-08 06:57:51 +10:00
|
|
|
#include <cairo.h>
|
2018-03-29 14:04:20 +11:00
|
|
|
#include <pango/pangocairo.h>
|
|
|
|
|
2018-09-21 21:27:36 +10:00
|
|
|
/**
|
|
|
|
* Utility function which escape characters a & < > ' ".
|
2018-05-08 02:30:45 +10:00
|
|
|
*
|
2018-09-21 21:27:36 +10:00
|
|
|
* The function returns the length of the escaped string, optionally writing the
|
|
|
|
* escaped string to dest if provided.
|
2018-05-08 02:30:45 +10:00
|
|
|
*/
|
2018-09-21 21:27:36 +10:00
|
|
|
size_t escape_markup_text(const char *src, char *dest);
|
2018-03-29 14:04:20 +11:00
|
|
|
PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
|
2018-05-17 02:01:04 +10:00
|
|
|
const char *text, double scale, bool markup);
|
2018-03-29 14:04:20 +11:00
|
|
|
void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
|
2018-09-08 16:19:31 +10:00
|
|
|
int *baseline, double scale, bool markup, const char *fmt, ...);
|
2021-08-19 07:27:01 +10:00
|
|
|
void get_text_metrics(const char *font, int *height, int *baseline);
|
2018-03-29 14:04:20 +11:00
|
|
|
void pango_printf(cairo_t *cairo, const char *font,
|
2018-05-17 02:01:04 +10:00
|
|
|
double scale, bool markup, const char *fmt, ...);
|
2018-03-29 14:04:20 +11:00
|
|
|
|
|
|
|
#endif
|