Skip to content

Commit

Permalink
Force fontconfig pangocairo backend for pango_font_info_test
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Dec 22, 2020
1 parent cc133aa commit 00a09c2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions unittest/pango_font_info_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ const char* kBadlyFormedHinWords[] = {
"प्रंात", nullptr
};

static PangoFontMap* font_map;

class PangoFontInfoTest : public ::testing::Test {
protected:
void SetUp() override {
static std::locale system_locale("");
std::locale::global(system_locale);
if (!font_map) {
font_map = pango_cairo_font_map_new_for_font_type(CAIRO_FONT_TYPE_FT);
}
pango_cairo_font_map_set_default(PANGO_CAIRO_FONT_MAP(font_map));
}

// Creates a fake fonts.conf file that points to the testdata fonts for
Expand Down Expand Up @@ -187,6 +193,10 @@ class FontUtilsTest : public ::testing::Test {
static void SetUpTestCase() {
FLAGS_fonts_dir = TESTING_DIR;
FLAGS_fontconfig_tmpdir = FLAGS_test_tmpdir;
if (!font_map) {
font_map = pango_cairo_font_map_new_for_font_type(CAIRO_FONT_TYPE_FT);
}
pango_cairo_font_map_set_default(PANGO_CAIRO_FONT_MAP(font_map));
}

#ifdef INCLUDE_TENSORFLOW
Expand Down

0 comments on commit 00a09c2

Please sign in to comment.