Skip to content

Commit

Permalink
libcairodriver: enable Cairo with Fontconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Jul 1, 2021
1 parent 0ed5a63 commit 9f4d83e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/cairodriver/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
#include <grass/glocale.h>
#include "cairodriver.h"

#if CAIRO_HAS_FT_FONT
#if defined(CAIRO_HAS_FT_FONT)
#include <cairo-ft.h>
#elif defined(CAIRO_HAS_FC_FONT)
#include <fontconfig/fontconfig.h>
#endif

Expand Down Expand Up @@ -170,7 +171,7 @@ static void set_font_toy(const char *name)
G_free(font);
}

#if CAIRO_HAS_FT_FONT
#if defined(CAIRO_HAS_FT_FONT) || defined(CAIRO_HAS_FC_FONT)

static void fc_init(void)
{
Expand Down Expand Up @@ -281,7 +282,7 @@ static int is_toy_font(const char *name)
*/
void Cairo_set_font(const char *name)
{
#if CAIRO_HAS_FT_FONT
#if defined(CAIRO_HAS_FT_FONT) || defined(CAIRO_HAS_FC_FONT)
if (is_toy_font(name))
set_font_toy(name);
else
Expand Down Expand Up @@ -322,7 +323,7 @@ static void font_list_toy(char ***list, int *count, int verbose)
void Cairo_font_list(char ***list, int *count)
{
font_list_toy(list, count, 0);
#if CAIRO_HAS_FT_FONT
#if defined(CAIRO_HAS_FT_FONT) || defined(CAIRO_HAS_FC_FONT)
font_list_fc(list, count, 0);
#endif
}
Expand All @@ -336,7 +337,7 @@ void Cairo_font_list(char ***list, int *count)
void Cairo_font_info(char ***list, int *count)
{
font_list_toy(list, count, 1);
#if CAIRO_HAS_FT_FONT
#if defined(CAIRO_HAS_FT_FONT) || defined(CAIRO_HAS_FC_FONT)
font_list_fc(list, count, 1);
#endif
}

0 comments on commit 9f4d83e

Please sign in to comment.