sway/include/pango.h
Jarkko Oranen 0e866013b6 Don't use title content in size calculations
Make height configurable instead

This prevents distracting screen flashing and seems to work fine
for larger glyphs as well (Tested with Japanese).

squashed: Free layout and buffer
squashed: pass in markup information
2020-11-13 18:24:35 +02:00

25 lines
916 B
C

#ifndef _SWAY_PANGO_H
#define _SWAY_PANGO_H
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <cairo/cairo.h>
#include <pango/pangocairo.h>
/**
* Utility function which escape characters a & < > ' ".
*
* The function returns the length of the escaped string, optionally writing the
* escaped string to dest if provided.
*/
size_t escape_markup_text(const char *src, char *dest);
PangoLayout *get_pango_layout(cairo_t *cairo, const char *font,
const char *text, double scale, bool markup);
void get_text_physical_size(cairo_t *cairo, const char *font, int *ascent, int* descent,
int *ink_size, bool markup, const char *fmt, ...);
void get_text_size(cairo_t *cairo, const char *font, int *width, int *height,
int *baseline, double scale, bool markup, const char *fmt, ...);
void pango_printf(cairo_t *cairo, const char *font,
double scale, bool markup, const char *fmt, ...);
#endif