Skip to content

Commit 8d2d94e

Browse files
author
jm
committed
fixes some of the windows issue with text2image, see #380
1 parent 2bc4f94 commit 8d2d94e

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

training/pango_font_info.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,19 @@
3232
// needed for strcasestr in string.h
3333
#define _GNU_SOURCE
3434
#endif
35+
36+
#elif defined(_MSC_VER)
37+
#include "strcasestr.h"
38+
#define strncasecmp _strnicmp
39+
#define strcasecmp _stricmp
3540
#endif
3641

3742
#include <stdlib.h>
3843
#include <stdio.h>
3944
#include <string.h>
45+
#ifndef _MSC_VER
4046
#include <sys/param.h>
47+
#endif
4148
#include <algorithm>
4249

4350
#include "pango_font_info.h"
@@ -425,8 +432,12 @@ bool PangoFontInfo::CanRenderString(const char* utf8_word, int len,
425432
}
426433
PangoGlyph dotted_circle_glyph;
427434
PangoFont* font = run->item->analysis.font;
428-
dotted_circle_glyph = pango_fc_font_get_glyph(
429-
reinterpret_cast<PangoFcFont*>(font), kDottedCircleGlyph);
435+
436+
PangoGlyphString * glyphs = pango_glyph_string_new();
437+
char s[] = "\xc2\xa7";
438+
pango_shape(s, sizeof(s), &(run->item->analysis), glyphs);
439+
dotted_circle_glyph = glyphs->glyphs[0].glyph;
440+
430441
if (TLOG_IS_ON(2)) {
431442
PangoFontDescription* desc = pango_font_describe(font);
432443
char* desc_str = pango_font_description_to_string(desc);

training/tlog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ DECLARE_INT_PARAM_FLAG(tlog_level);
3838

3939
#define TLOG_IS_ON(level) (FLAGS_tlog_level >= level)
4040

41-
#define TLOG_FATAL(msg...) \
41+
#define TLOG_FATAL(msg, ...) \
4242
{ \
4343
tprintf(msg); \
4444
ASSERT_FAILED.error("", ABORT, "in file %s, line %d", \

0 commit comments

Comments
 (0)