fixes some of the windows issue with text2image, see #380

This commit is contained in:
jm 2016-08-05 19:52:39 +02:00
parent 2bc4f94b71
commit 8d2d94e4ed
2 changed files with 14 additions and 3 deletions

View File

@ -32,12 +32,19 @@
// needed for strcasestr in string.h // needed for strcasestr in string.h
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#elif defined(_MSC_VER)
#include "strcasestr.h"
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifndef _MSC_VER
#include <sys/param.h> #include <sys/param.h>
#endif
#include <algorithm> #include <algorithm>
#include "pango_font_info.h" #include "pango_font_info.h"
@ -425,8 +432,12 @@ bool PangoFontInfo::CanRenderString(const char* utf8_word, int len,
} }
PangoGlyph dotted_circle_glyph; PangoGlyph dotted_circle_glyph;
PangoFont* font = run->item->analysis.font; PangoFont* font = run->item->analysis.font;
dotted_circle_glyph = pango_fc_font_get_glyph(
reinterpret_cast<PangoFcFont*>(font), kDottedCircleGlyph); PangoGlyphString * glyphs = pango_glyph_string_new();
char s[] = "\xc2\xa7";
pango_shape(s, sizeof(s), &(run->item->analysis), glyphs);
dotted_circle_glyph = glyphs->glyphs[0].glyph;
if (TLOG_IS_ON(2)) { if (TLOG_IS_ON(2)) {
PangoFontDescription* desc = pango_font_describe(font); PangoFontDescription* desc = pango_font_describe(font);
char* desc_str = pango_font_description_to_string(desc); char* desc_str = pango_font_description_to_string(desc);

View File

@ -38,7 +38,7 @@ DECLARE_INT_PARAM_FLAG(tlog_level);
#define TLOG_IS_ON(level) (FLAGS_tlog_level >= level) #define TLOG_IS_ON(level) (FLAGS_tlog_level >= level)
#define TLOG_FATAL(msg...) \ #define TLOG_FATAL(msg, ...) \
{ \ { \
tprintf(msg); \ tprintf(msg); \
ASSERT_FAILED.error("", ABORT, "in file %s, line %d", \ ASSERT_FAILED.error("", ABORT, "in file %s, line %d", \