/* ExportUtils.c generated by valac 0.56.17, the Vala compiler
 * generated from ExportUtils.vala, do not modify */

/*
Copyright (C) 2012 2014 Johan Mattsson

This library is free software; you can redistribute it and/or modify 
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation; either version 3 of the 
License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
Lesser General Public License for more details.
*/

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <stdio.h>
#include "birdfont.h"
#include <gio/gio.h>

#define BIRD_FONT_VERSION "2.33.6"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

VALA_EXTERN void bird_font_print_export_help (gchar** arg,
                                  gint arg_length1);
VALA_EXTERN void bird_font_init_logfile (void);
VALA_EXTERN void bird_font_bird_font_fatal_warning (const gchar* log_domain,
                                        GLogLevelFlags log_levels,
                                        const gchar* message);
static void _bird_font_bird_font_fatal_warning_glog_func (const gchar* log_domain,
                                                   GLogLevelFlags log_levels,
                                                   const gchar* message,
                                                   gpointer self);
VALA_EXTERN gchar* bird_font_build_absoulute_path (const gchar* file_name);

void
bird_font_print_export_help (gchar** arg,
                             gint arg_length1)
{
	FILE* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	FILE* _tmp3_;
	const gchar* _tmp4_;
	FILE* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	FILE* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	FILE* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	FILE* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	FILE* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	FILE* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	FILE* _tmp53_;
	_tmp0_ = stdout;
	_tmp1_ = bird_font_t_ ("Usage:");
	_tmp2_ = _tmp1_;
	fprintf (_tmp0_, "%s", _tmp2_);
	_g_free0 (_tmp2_);
	_tmp3_ = stdout;
	_tmp4_ = arg[0];
	fprintf (_tmp3_, "%s", _tmp4_);
	_tmp5_ = stdout;
	_tmp6_ = bird_font_t_ ("OPTION");
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strconcat (" [", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strconcat (_tmp9_, "...] ", NULL);
	_tmp11_ = _tmp10_;
	_tmp12_ = bird_font_t_ ("FILE");
	_tmp13_ = _tmp12_;
	_tmp14_ = g_strconcat (_tmp11_, _tmp13_, NULL);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_strconcat (_tmp15_, "\n", NULL);
	_tmp17_ = _tmp16_;
	fprintf (_tmp5_, "%s", _tmp17_);
	_g_free0 (_tmp17_);
	_g_free0 (_tmp15_);
	_g_free0 (_tmp13_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_tmp18_ = stdout;
	_tmp19_ = bird_font_t_ ("include only these characters");
	_tmp20_ = _tmp19_;
	_tmp21_ = g_strconcat ("    --filter [CHARACTERS]       ", _tmp20_, NULL);
	_tmp22_ = _tmp21_;
	_tmp23_ = g_strconcat (_tmp22_, "\n", NULL);
	_tmp24_ = _tmp23_;
	fprintf (_tmp18_, "%s", _tmp24_);
	_g_free0 (_tmp24_);
	_g_free0 (_tmp22_);
	_g_free0 (_tmp20_);
	_tmp25_ = stdout;
	_tmp26_ = bird_font_t_ ("print this message");
	_tmp27_ = _tmp26_;
	_tmp28_ = g_strconcat ("-h, --help                      ", _tmp27_, NULL);
	_tmp29_ = _tmp28_;
	_tmp30_ = g_strconcat (_tmp29_, "\n", NULL);
	_tmp31_ = _tmp30_;
	fprintf (_tmp25_, "%s", _tmp31_);
	_g_free0 (_tmp31_);
	_g_free0 (_tmp29_);
	_g_free0 (_tmp27_);
	_tmp32_ = stdout;
	_tmp33_ = bird_font_t_ ("write files to this directory");
	_tmp34_ = _tmp33_;
	_tmp35_ = g_strconcat ("-o, --output [DIRECTORY]        ", _tmp34_, NULL);
	_tmp36_ = _tmp35_;
	_tmp37_ = g_strconcat (_tmp36_, "\n", NULL);
	_tmp38_ = _tmp37_;
	fprintf (_tmp32_, "%s", _tmp38_);
	_g_free0 (_tmp38_);
	_g_free0 (_tmp36_);
	_g_free0 (_tmp34_);
	_tmp39_ = stdout;
	_tmp40_ = bird_font_t_ ("write svg file");
	_tmp41_ = _tmp40_;
	_tmp42_ = g_strconcat ("-s, --svg                       ", _tmp41_, NULL);
	_tmp43_ = _tmp42_;
	_tmp44_ = g_strconcat (_tmp43_, "\n", NULL);
	_tmp45_ = _tmp44_;
	fprintf (_tmp39_, "%s", _tmp45_);
	_g_free0 (_tmp45_);
	_g_free0 (_tmp43_);
	_g_free0 (_tmp41_);
	_tmp46_ = stdout;
	_tmp47_ = bird_font_t_ ("write ttf and eot file");
	_tmp48_ = _tmp47_;
	_tmp49_ = g_strconcat ("-t, --ttf                       ", _tmp48_, NULL);
	_tmp50_ = _tmp49_;
	_tmp51_ = g_strconcat (_tmp50_, "\n", NULL);
	_tmp52_ = _tmp51_;
	fprintf (_tmp46_, "%s", _tmp52_);
	_g_free0 (_tmp52_);
	_g_free0 (_tmp50_);
	_g_free0 (_tmp48_);
	_tmp53_ = stdout;
	fprintf (_tmp53_, "\n");
}

static void
_bird_font_bird_font_fatal_warning_glog_func (const gchar* log_domain,
                                              GLogLevelFlags log_levels,
                                              const gchar* message,
                                              gpointer self)
{
	bird_font_bird_font_fatal_warning (log_domain, log_levels, message);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gunichar
string_get_char (const gchar* self,
                 glong index)
{
	gunichar result;
	g_return_val_if_fail (self != NULL, 0U);
	result = g_utf8_get_char (((gchar*) self) + index);
	return result;
}

static gint
string_index_of_nth_char (const gchar* self,
                          glong c)
{
	gchar* _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = g_utf8_offset_to_pointer (self, c);
	result = (gint) (_tmp0_ - ((gchar*) self));
	return result;
}

gint
bird_font_run_export (gchar** arg,
                      gint arg_length1)
{
	gchar* output_directory = NULL;
	gchar* _tmp0_;
	gchar* file_name = NULL;
	gchar* _tmp1_;
	gchar* filter_characters = NULL;
	gchar* _tmp2_;
	gboolean specific_formats = FALSE;
	gboolean write_ttf = FALSE;
	gboolean write_svg = FALSE;
	GFile* directory = NULL;
	BirdFontFont* font = NULL;
	BirdFontMainWindow* main_window = NULL;
	FILE* _tmp3_;
	BirdFontFont* _tmp4_;
	BirdFontGlyphCollection* _tmp5_;
	BirdFontMainWindow* _tmp6_;
	BirdFontArgument* _tmp37_;
	BirdFontGlyphCollection* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	BirdFontFont* _tmp41_;
	BirdFontFont* _tmp42_;
	const gchar* _tmp43_;
	BirdFontFont* _tmp44_;
	const gchar* _tmp50_;
	const gchar* _tmp58_;
	GFile* _tmp59_;
	GFile* _tmp60_;
	gboolean _tmp72_ = FALSE;
	gboolean _tmp84_ = FALSE;
	gint result;
	_tmp0_ = g_strdup (".");
	output_directory = _tmp0_;
	_tmp1_ = g_strdup ("");
	file_name = _tmp1_;
	_tmp2_ = g_strdup ("");
	filter_characters = _tmp2_;
	specific_formats = FALSE;
	write_ttf = FALSE;
	write_svg = FALSE;
	_tmp3_ = stdout;
	fprintf (_tmp3_, "birdfont-export version %s\n", BIRD_FONT_VERSION);
	if (arg_length1 < 2) {
		bird_font_print_export_help (arg, (gint) arg_length1);
		result = -1;
		_g_object_unref0 (main_window);
		_g_object_unref0 (font);
		_g_object_unref0 (directory);
		_g_free0 (filter_characters);
		_g_free0 (file_name);
		_g_free0 (output_directory);
		return result;
	}
	bird_font_theme_set_default_colors ();
	_tmp4_ = bird_font_bird_font_new_font ();
	_g_object_unref0 (bird_font_bird_font_current_font);
	bird_font_bird_font_current_font = _tmp4_;
	_tmp5_ = bird_font_glyph_collection_new_with_glyph ((gunichar) '\0', "null");
	_g_object_unref0 (bird_font_bird_font_current_glyph_collection);
	bird_font_bird_font_current_glyph_collection = _tmp5_;
	_tmp6_ = bird_font_main_window_new ();
	_g_object_unref0 (main_window);
	main_window = _tmp6_;
	if (bird_font_bird_font_has_logging ()) {
		bird_font_init_logfile ();
	}
	{
		gint i = 0;
		i = 1;
		{
			gboolean _tmp7_ = FALSE;
			_tmp7_ = TRUE;
			while (TRUE) {
				gboolean _tmp9_ = FALSE;
				const gchar* _tmp10_;
				gboolean _tmp12_ = FALSE;
				const gchar* _tmp13_;
				gboolean _tmp15_ = FALSE;
				gboolean _tmp16_ = FALSE;
				const gchar* _tmp17_;
				gboolean _tmp22_ = FALSE;
				const gchar* _tmp23_;
				gboolean _tmp25_ = FALSE;
				const gchar* _tmp26_;
				gboolean _tmp28_ = FALSE;
				const gchar* _tmp29_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				if (!_tmp7_) {
					gint _tmp8_;
					_tmp8_ = i;
					i = _tmp8_ + 1;
				}
				_tmp7_ = FALSE;
				if (!(i < arg_length1)) {
					break;
				}
				_tmp10_ = arg[i];
				if (g_strcmp0 (_tmp10_, "-f") == 0) {
					_tmp9_ = TRUE;
				} else {
					const gchar* _tmp11_;
					_tmp11_ = arg[i];
					_tmp9_ = g_strcmp0 (_tmp11_, "--fatal-warnings") == 0;
				}
				if (_tmp9_) {
					bird_font_bird_font_fatal_wanings = TRUE;
					result = 0;
					_g_object_unref0 (main_window);
					_g_object_unref0 (font);
					_g_object_unref0 (directory);
					_g_free0 (filter_characters);
					_g_free0 (file_name);
					_g_free0 (output_directory);
					return result;
				}
				_tmp13_ = arg[i];
				if (g_strcmp0 (_tmp13_, "-h") == 0) {
					_tmp12_ = TRUE;
				} else {
					const gchar* _tmp14_;
					_tmp14_ = arg[i];
					_tmp12_ = g_strcmp0 (_tmp14_, "--help") == 0;
				}
				if (_tmp12_) {
					bird_font_print_export_help (arg, (gint) arg_length1);
					result = 0;
					_g_object_unref0 (main_window);
					_g_object_unref0 (font);
					_g_object_unref0 (directory);
					_g_free0 (filter_characters);
					_g_free0 (file_name);
					_g_free0 (output_directory);
					return result;
				}
				_tmp17_ = arg[i];
				if (g_strcmp0 (_tmp17_, "-o") == 0) {
					_tmp16_ = TRUE;
				} else {
					const gchar* _tmp18_;
					_tmp18_ = arg[i];
					_tmp16_ = g_strcmp0 (_tmp18_, "--output") == 0;
				}
				if (_tmp16_) {
					_tmp15_ = (i + 1) < arg_length1;
				} else {
					_tmp15_ = FALSE;
				}
				if (_tmp15_) {
					const gchar* _tmp19_;
					gchar* _tmp20_;
					gint _tmp21_;
					_tmp19_ = arg[i + 1];
					_tmp20_ = g_strdup (_tmp19_);
					_g_free0 (output_directory);
					output_directory = _tmp20_;
					_tmp21_ = i;
					i = _tmp21_ + 1;
					continue;
				}
				_tmp23_ = arg[i];
				if (g_strcmp0 (_tmp23_, "-s") == 0) {
					_tmp22_ = TRUE;
				} else {
					const gchar* _tmp24_;
					_tmp24_ = arg[i];
					_tmp22_ = g_strcmp0 (_tmp24_, "--svg") == 0;
				}
				if (_tmp22_) {
					write_svg = TRUE;
					specific_formats = TRUE;
					continue;
				}
				_tmp26_ = arg[i];
				if (g_strcmp0 (_tmp26_, "-t") == 0) {
					_tmp25_ = TRUE;
				} else {
					const gchar* _tmp27_;
					_tmp27_ = arg[i];
					_tmp25_ = g_strcmp0 (_tmp27_, "--ttf") == 0;
				}
				if (_tmp25_) {
					write_ttf = TRUE;
					specific_formats = TRUE;
					continue;
				}
				_tmp29_ = arg[i];
				if (g_strcmp0 (_tmp29_, "--filter") == 0) {
					_tmp28_ = (i + 1) < arg_length1;
				} else {
					_tmp28_ = FALSE;
				}
				if (_tmp28_) {
					const gchar* _tmp30_;
					gchar* _tmp31_;
					gint _tmp32_;
					_tmp30_ = arg[i + 1];
					_tmp31_ = g_strdup (_tmp30_);
					_g_free0 (filter_characters);
					filter_characters = _tmp31_;
					_tmp32_ = i;
					i = _tmp32_ + 1;
					continue;
				}
				_tmp33_ = arg[i];
				if (g_str_has_prefix (_tmp33_, "-")) {
					bird_font_print_export_help (arg, (gint) arg_length1);
					result = 1;
					_g_object_unref0 (main_window);
					_g_object_unref0 (font);
					_g_object_unref0 (directory);
					_g_free0 (filter_characters);
					_g_free0 (file_name);
					_g_free0 (output_directory);
					return result;
				}
				_tmp34_ = arg[i];
				if (!g_str_has_prefix (_tmp34_, "-")) {
					const gchar* _tmp35_;
					gchar* _tmp36_;
					_tmp35_ = arg[i];
					_tmp36_ = g_strdup (_tmp35_);
					_g_free0 (file_name);
					file_name = _tmp36_;
					if (i != (arg_length1 - 1)) {
						bird_font_print_export_help (arg, (gint) arg_length1);
						result = 1;
						_g_object_unref0 (main_window);
						_g_object_unref0 (font);
						_g_object_unref0 (directory);
						_g_free0 (filter_characters);
						_g_free0 (file_name);
						_g_free0 (output_directory);
						return result;
					}
					break;
				}
			}
		}
	}
	if (bird_font_bird_font_fatal_wanings) {
		GLogLevelFlags levels = 0U;
		levels = (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL) | G_LOG_LEVEL_WARNING;
		g_log_set_handler (NULL, levels, _bird_font_bird_font_fatal_warning_glog_func, NULL);
	}
	bird_font_preferences_load ();
	_tmp37_ = bird_font_argument_new ("");
	_g_object_unref0 (bird_font_bird_font_args);
	bird_font_bird_font_args = _tmp37_;
	_tmp38_ = bird_font_glyph_collection_new_with_glyph ((gunichar) '\0', "");
	_g_object_unref0 (bird_font_bird_font_current_glyph_collection);
	bird_font_bird_font_current_glyph_collection = _tmp38_;
	_tmp39_ = file_name;
	_tmp40_ = bird_font_build_absoulute_path (_tmp39_);
	_g_free0 (file_name);
	file_name = _tmp40_;
	_tmp41_ = bird_font_bird_font_get_current_font ();
	_g_object_unref0 (font);
	font = _tmp41_;
	_tmp42_ = font;
	_tmp43_ = file_name;
	bird_font_font_set_file (_tmp42_, _tmp43_);
	_tmp44_ = font;
	if (!bird_font_font_load (_tmp44_)) {
		const gchar* _tmp45_;
		const gchar* _tmp46_;
		gchar* _tmp47_;
		gchar* _tmp48_;
		const gchar* _tmp49_;
		_tmp45_ = file_name;
		_tmp46_ = string_to_string (_tmp45_);
		_tmp47_ = g_strconcat ("Failed to load font ", _tmp46_, ".\n", NULL);
		_tmp48_ = _tmp47_;
		g_warning ("ExportUtils.vala:126: %s", _tmp48_);
		_g_free0 (_tmp48_);
		_tmp49_ = file_name;
		if (!g_str_has_suffix (_tmp49_, ".bf")) {
			g_warning ("ExportUtils.vala:129: %s", "Is it a .bf file?\n");
		}
		result = 1;
		_g_object_unref0 (main_window);
		_g_object_unref0 (font);
		_g_object_unref0 (directory);
		_g_free0 (filter_characters);
		_g_free0 (file_name);
		_g_free0 (output_directory);
		return result;
	}
	_tmp50_ = filter_characters;
	if (g_strcmp0 (_tmp50_, "") != 0) {
		FILE* _tmp51_;
		const gchar* _tmp52_;
		gint characters_count = 0;
		const gchar* _tmp53_;
		_tmp51_ = stdout;
		_tmp52_ = filter_characters;
		fprintf (_tmp51_, "Exporting only  %s\n", _tmp52_);
		_tmp53_ = filter_characters;
		characters_count = g_utf8_strlen (_tmp53_, (gssize) -1);
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp54_ = FALSE;
				_tmp54_ = TRUE;
				while (TRUE) {
					const gchar* _tmp56_;
					const gchar* _tmp57_;
					if (!_tmp54_) {
						gint _tmp55_;
						_tmp55_ = i;
						i = _tmp55_ + 1;
					}
					_tmp54_ = FALSE;
					if (!(i < characters_count)) {
						break;
					}
					_tmp56_ = filter_characters;
					_tmp57_ = filter_characters;
					string_get_char (_tmp56_, (glong) string_index_of_nth_char (_tmp57_, (glong) i));
				}
			}
		}
	}
	_tmp58_ = output_directory;
	_tmp59_ = g_file_new_for_path (_tmp58_);
	_g_object_unref0 (directory);
	directory = _tmp59_;
	_tmp60_ = directory;
	if (!g_file_query_exists (_tmp60_, NULL)) {
		FILE* _tmp61_;
		gchar* _tmp62_;
		gchar* _tmp63_;
		GFile* _tmp64_;
		gchar* _tmp65_;
		gchar* _tmp66_;
		const gchar* _tmp67_;
		gchar* _tmp68_;
		gchar* _tmp69_;
		gchar* _tmp70_;
		gchar* _tmp71_;
		_tmp61_ = stderr;
		_tmp62_ = bird_font_t_ ("Can't find output directory");
		_tmp63_ = _tmp62_;
		_tmp64_ = directory;
		_tmp65_ = g_file_get_path (_tmp64_);
		_tmp66_ = (gchar*) _tmp65_;
		_tmp67_ = string_to_string (_tmp66_);
		_tmp68_ = g_strconcat (_tmp67_, "\n", NULL);
		_tmp69_ = _tmp68_;
		_tmp70_ = g_strconcat (_tmp63_, _tmp69_, NULL);
		_tmp71_ = _tmp70_;
		fprintf (_tmp61_, "%s", _tmp71_);
		_g_free0 (_tmp71_);
		_g_free0 (_tmp69_);
		_g_free0 (_tmp66_);
		_g_free0 (_tmp63_);
		result = 1;
		_g_object_unref0 (main_window);
		_g_object_unref0 (font);
		_g_object_unref0 (directory);
		_g_free0 (filter_characters);
		_g_free0 (file_name);
		_g_free0 (output_directory);
		return result;
	}
	if (!specific_formats) {
		_tmp72_ = TRUE;
	} else {
		_tmp72_ = write_svg;
	}
	if (_tmp72_) {
		BirdFontFont* _tmp73_;
		gchar* _tmp74_;
		gchar* _tmp75_;
		const gchar* _tmp76_;
		const gchar* _tmp77_;
		const gchar* _tmp78_;
		gchar* _tmp79_;
		gchar* _tmp80_;
		const gchar* _tmp81_;
		GFile* _tmp82_;
		GFile* _tmp83_;
		_tmp73_ = font;
		_tmp74_ = bird_font_export_settings_get_file_name (_tmp73_);
		_tmp75_ = _tmp74_;
		_tmp76_ = string_to_string (_tmp75_);
		_tmp77_ = output_directory;
		_tmp78_ = string_to_string (_tmp77_);
		_tmp79_ = g_strconcat ("Writing ", _tmp76_, ".svg to ", _tmp78_, "\n", NULL);
		_tmp80_ = _tmp79_;
		g_print ("%s", _tmp80_);
		_g_free0 (_tmp80_);
		_g_free0 (_tmp75_);
		_tmp81_ = output_directory;
		_tmp82_ = g_file_new_for_path (_tmp81_);
		_tmp83_ = _tmp82_;
		bird_font_export_tool_export_svg_font_path (_tmp83_);
		_g_object_unref0 (_tmp83_);
	}
	if (!specific_formats) {
		_tmp84_ = TRUE;
	} else {
		_tmp84_ = write_ttf;
	}
	if (_tmp84_) {
		BirdFontFont* _tmp85_;
		gchar* _tmp86_;
		gchar* _tmp87_;
		const gchar* _tmp88_;
		const gchar* _tmp89_;
		const gchar* _tmp90_;
		gchar* _tmp91_;
		gchar* _tmp92_;
		const gchar* _tmp93_;
		GFile* _tmp94_;
		GFile* _tmp95_;
		_tmp85_ = font;
		_tmp86_ = bird_font_export_settings_get_file_name (_tmp85_);
		_tmp87_ = _tmp86_;
		_tmp88_ = string_to_string (_tmp87_);
		_tmp89_ = output_directory;
		_tmp90_ = string_to_string (_tmp89_);
		_tmp91_ = g_strconcat ("Writing ", _tmp88_, ".ttf to ", _tmp90_, "\n", NULL);
		_tmp92_ = _tmp91_;
		g_print ("%s", _tmp92_);
		_g_free0 (_tmp92_);
		_g_free0 (_tmp87_);
		_tmp93_ = output_directory;
		_tmp94_ = g_file_new_for_path (_tmp93_);
		_tmp95_ = _tmp94_;
		bird_font_export_tool_export_ttf_font_path (_tmp95_, TRUE);
		_g_object_unref0 (_tmp95_);
	}
	result = 0;
	_g_object_unref0 (main_window);
	_g_object_unref0 (font);
	_g_object_unref0 (directory);
	_g_free0 (filter_characters);
	_g_free0 (file_name);
	_g_free0 (output_directory);
	return result;
}

