From 7fe60435bce6595a9c58a9bfd8244d74b5320e96 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 15 Jan 2013 08:46:13 +0100 Subject: Import DirectFB141_2k11R3_beta5 --- .../DirectFB/interfaces/IDirectFBFont/Makefile.am | 77 ++ .../DirectFB/interfaces/IDirectFBFont/Makefile.in | 648 ++++++++++ .../interfaces/IDirectFBFont/default_font.h | 623 +++++++++ .../IDirectFBFont/idirectfbfont_default.c | 322 +++++ .../interfaces/IDirectFBFont/idirectfbfont_dgiff.c | 364 ++++++ .../interfaces/IDirectFBFont/idirectfbfont_ft2.c | 949 ++++++++++++++ .../interfaces/IDirectFBFont/idirectfbfont_lino.c | 1324 ++++++++++++++++++++ 7 files changed, 4307 insertions(+) create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/Makefile.am create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/Makefile.in create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/default_font.h create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_default.c create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_dgiff.c create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_ft2.c create mode 100755 Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_lino.c (limited to 'Source/DirectFB/interfaces/IDirectFBFont') diff --git a/Source/DirectFB/interfaces/IDirectFBFont/Makefile.am b/Source/DirectFB/interfaces/IDirectFBFont/Makefile.am new file mode 100755 index 0000000..c133da5 --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/Makefile.am @@ -0,0 +1,77 @@ +## Makefile.am for DirectFB/interfaces/IDirectFBFont + +idirectfbfontdir = $(MODULEDIR)/interfaces/IDirectFBFont + +if FREETYPE_PROVIDER +FREETYPE_PROVIDER_LTLIB = libidirectfbfont_ft2.la +else +FREETYPE_PROVIDER_LTLIB = +endif + +if LINOTYPE_PROVIDER +LINOTYPE_PROVIDER_LTLIB = libidirectfbfont_lino.la +else +LINOTYPE_PROVIDER_LTLIB = +endif + +INCLUDES = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src \ + -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" + +AM_CFLAGS = $(FREETYPE_CFLAGS) $(LINOTYPE_CFLAGS) + +idirectfbfont_LTLIBRARIES = \ + libidirectfbfont_default.la \ + $(FREETYPE_PROVIDER_LTLIB) \ + $(LINOTYPE_PROVIDER_LTLIB) \ + libidirectfbfont_dgiff.la + +if BUILD_STATIC +idirectfbfont_DATA = $(idirectfbfont_LTLIBRARIES:.la=.o) +endif + + +libidirectfbfont_default_la_SOURCES = idirectfbfont_default.c default_font.h + +libidirectfbfont_default_la_LDFLAGS = -avoid-version -module + +libidirectfbfont_default_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la + + +libidirectfbfont_dgiff_la_SOURCES = idirectfbfont_dgiff.c + +libidirectfbfont_dgiff_la_LDFLAGS = -avoid-version -module + +libidirectfbfont_dgiff_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/lib/fusion/libfusion.la \ + $(top_builddir)/src/libdirectfb.la + + +libidirectfbfont_ft2_la_SOURCES = idirectfbfont_ft2.c + +libidirectfbfont_ft2_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la \ + $(FREETYPE_LIBS) + +libidirectfbfont_ft2_la_LDFLAGS = -avoid-version -module + + +libidirectfbfont_lino_la_SOURCES = idirectfbfont_lino.c + +libidirectfbfont_lino_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la \ + $(LINOTYPE_LIBS) + +libidirectfbfont_lino_la_LDFLAGS = -avoid-version -module + + +include $(top_srcdir)/rules/libobject.make diff --git a/Source/DirectFB/interfaces/IDirectFBFont/Makefile.in b/Source/DirectFB/interfaces/IDirectFBFont/Makefile.in new file mode 100755 index 0000000..a124d84 --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/Makefile.in @@ -0,0 +1,648 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/rules/libobject.make +subdir = interfaces/IDirectFBFont +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(idirectfbfontdir)" \ + "$(DESTDIR)$(idirectfbfontdir)" +idirectfbfontLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(idirectfbfont_LTLIBRARIES) +libidirectfbfont_default_la_DEPENDENCIES = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la +am_libidirectfbfont_default_la_OBJECTS = idirectfbfont_default.lo +libidirectfbfont_default_la_OBJECTS = \ + $(am_libidirectfbfont_default_la_OBJECTS) +libidirectfbfont_default_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libidirectfbfont_default_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +libidirectfbfont_dgiff_la_DEPENDENCIES = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/lib/fusion/libfusion.la \ + $(top_builddir)/src/libdirectfb.la +am_libidirectfbfont_dgiff_la_OBJECTS = idirectfbfont_dgiff.lo +libidirectfbfont_dgiff_la_OBJECTS = \ + $(am_libidirectfbfont_dgiff_la_OBJECTS) +libidirectfbfont_dgiff_la_LINK = $(LIBTOOL) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libidirectfbfont_dgiff_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +am__DEPENDENCIES_1 = +libidirectfbfont_ft2_la_DEPENDENCIES = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la $(am__DEPENDENCIES_1) +am_libidirectfbfont_ft2_la_OBJECTS = idirectfbfont_ft2.lo +libidirectfbfont_ft2_la_OBJECTS = \ + $(am_libidirectfbfont_ft2_la_OBJECTS) +libidirectfbfont_ft2_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libidirectfbfont_ft2_la_LDFLAGS) $(LDFLAGS) -o $@ +@FREETYPE_PROVIDER_TRUE@am_libidirectfbfont_ft2_la_rpath = -rpath \ +@FREETYPE_PROVIDER_TRUE@ $(idirectfbfontdir) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libidirectfbfont_default_la_SOURCES) \ + $(libidirectfbfont_dgiff_la_SOURCES) \ + $(libidirectfbfont_ft2_la_SOURCES) +DIST_SOURCES = $(libidirectfbfont_default_la_SOURCES) \ + $(libidirectfbfont_dgiff_la_SOURCES) \ + $(libidirectfbfont_ft2_la_SOURCES) +idirectfbfontDATA_INSTALL = $(INSTALL_DATA) +DATA = $(idirectfbfont_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +ASFLAGS = @ASFLAGS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DFB_CFLAGS_OMIT_FRAME_POINTER = @DFB_CFLAGS_OMIT_FRAME_POINTER@ +DFB_INTERNAL_CFLAGS = @DFB_INTERNAL_CFLAGS@ +DFB_LDFLAGS = @DFB_LDFLAGS@ +DFB_SMOOTH_SCALING = @DFB_SMOOTH_SCALING@ +DIRECTFB_BINARY_AGE = @DIRECTFB_BINARY_AGE@ +DIRECTFB_CSOURCE = @DIRECTFB_CSOURCE@ +DIRECTFB_INTERFACE_AGE = @DIRECTFB_INTERFACE_AGE@ +DIRECTFB_MAJOR_VERSION = @DIRECTFB_MAJOR_VERSION@ +DIRECTFB_MICRO_VERSION = @DIRECTFB_MICRO_VERSION@ +DIRECTFB_MINOR_VERSION = @DIRECTFB_MINOR_VERSION@ +DIRECTFB_VERSION = @DIRECTFB_VERSION@ +DIRECT_BUILD_DEBUG = @DIRECT_BUILD_DEBUG@ +DIRECT_BUILD_DEBUGS = @DIRECT_BUILD_DEBUGS@ +DIRECT_BUILD_GETTID = @DIRECT_BUILD_GETTID@ +DIRECT_BUILD_NETWORK = @DIRECT_BUILD_NETWORK@ +DIRECT_BUILD_STDBOOL = @DIRECT_BUILD_STDBOOL@ +DIRECT_BUILD_TEXT = @DIRECT_BUILD_TEXT@ +DIRECT_BUILD_TRACE = @DIRECT_BUILD_TRACE@ +DSYMUTIL = @DSYMUTIL@ +DYNLIB = @DYNLIB@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FREETYPE_PROVIDER = @FREETYPE_PROVIDER@ +FUSION_BUILD_KERNEL = @FUSION_BUILD_KERNEL@ +FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@ +FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@ +GIF_PROVIDER = @GIF_PROVIDER@ +GREP = @GREP@ +HAVE_LINUX = @HAVE_LINUX@ +INCLUDEDIR = @INCLUDEDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ +JPEG_PROVIDER = @JPEG_PROVIDER@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBJPEG = @LIBJPEG@ +LIBOBJS = @LIBOBJS@ +LIBPNG = @LIBPNG@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_BINARY = @LT_BINARY@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MAN2HTML = @MAN2HTML@ +MKDIR_P = @MKDIR_P@ +MODULEDIR = @MODULEDIR@ +MODULEDIRNAME = @MODULEDIRNAME@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +OSX_LIBS = @OSX_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PNG_PROVIDER = @PNG_PROVIDER@ +RANLIB = @RANLIB@ +RUNTIME_SYSROOT = @RUNTIME_SYSROOT@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOPATH = @SOPATH@ +STRIP = @STRIP@ +SYSCONFDIR = @SYSCONFDIR@ +SYSFS_LIBS = @SYSFS_LIBS@ +THREADFLAGS = @THREADFLAGS@ +THREADLIB = @THREADLIB@ +TSLIB_CFLAGS = @TSLIB_CFLAGS@ +TSLIB_LIBS = @TSLIB_LIBS@ +VERSION = @VERSION@ +VNC_CFLAGS = @VNC_CFLAGS@ +VNC_CONFIG = @VNC_CONFIG@ +VNC_LIBS = @VNC_LIBS@ +X11_CFLAGS = @X11_CFLAGS@ +X11_LIBS = @X11_LIBS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +idirectfbfontdir = $(MODULEDIR)/interfaces/IDirectFBFont +@FREETYPE_PROVIDER_FALSE@FREETYPE_PROVIDER_LTLIB = +@FREETYPE_PROVIDER_TRUE@FREETYPE_PROVIDER_LTLIB = libidirectfbfont_ft2.la +INCLUDES = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/lib \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/src \ + -DDATADIR=\"${RUNTIME_SYSROOT}@DATADIR@\" + +AM_CFLAGS = $(FREETYPE_CFLAGS) +idirectfbfont_LTLIBRARIES = \ + libidirectfbfont_default.la \ + $(FREETYPE_PROVIDER_LTLIB) \ + libidirectfbfont_dgiff.la + +@BUILD_STATIC_TRUE@idirectfbfont_DATA = $(idirectfbfont_LTLIBRARIES:.la=.o) +libidirectfbfont_default_la_SOURCES = idirectfbfont_default.c default_font.h +libidirectfbfont_default_la_LDFLAGS = -avoid-version -module +libidirectfbfont_default_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la + +libidirectfbfont_dgiff_la_SOURCES = idirectfbfont_dgiff.c +libidirectfbfont_dgiff_la_LDFLAGS = -avoid-version -module +libidirectfbfont_dgiff_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/lib/fusion/libfusion.la \ + $(top_builddir)/src/libdirectfb.la + +libidirectfbfont_ft2_la_SOURCES = idirectfbfont_ft2.c +libidirectfbfont_ft2_la_LIBADD = \ + $(top_builddir)/lib/direct/libdirect.la \ + $(top_builddir)/src/libdirectfb.la \ + $(FREETYPE_LIBS) + +libidirectfbfont_ft2_la_LDFLAGS = -avoid-version -module +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/rules/libobject.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu interfaces/IDirectFBFont/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu interfaces/IDirectFBFont/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-idirectfbfontLTLIBRARIES: $(idirectfbfont_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" + @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(idirectfbfontLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ + else :; fi; \ + done + +uninstall-idirectfbfontLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idirectfbfontdir)/$$p'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idirectfbfontdir)/$$p"; \ + done + +clean-idirectfbfontLTLIBRARIES: + -test -z "$(idirectfbfont_LTLIBRARIES)" || rm -f $(idirectfbfont_LTLIBRARIES) + @list='$(idirectfbfont_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libidirectfbfont_default.la: $(libidirectfbfont_default_la_OBJECTS) $(libidirectfbfont_default_la_DEPENDENCIES) + $(libidirectfbfont_default_la_LINK) -rpath $(idirectfbfontdir) $(libidirectfbfont_default_la_OBJECTS) $(libidirectfbfont_default_la_LIBADD) $(LIBS) +libidirectfbfont_dgiff.la: $(libidirectfbfont_dgiff_la_OBJECTS) $(libidirectfbfont_dgiff_la_DEPENDENCIES) + $(libidirectfbfont_dgiff_la_LINK) -rpath $(idirectfbfontdir) $(libidirectfbfont_dgiff_la_OBJECTS) $(libidirectfbfont_dgiff_la_LIBADD) $(LIBS) +libidirectfbfont_ft2.la: $(libidirectfbfont_ft2_la_OBJECTS) $(libidirectfbfont_ft2_la_DEPENDENCIES) + $(libidirectfbfont_ft2_la_LINK) $(am_libidirectfbfont_ft2_la_rpath) $(libidirectfbfont_ft2_la_OBJECTS) $(libidirectfbfont_ft2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_default.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_dgiff.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idirectfbfont_ft2.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-idirectfbfontDATA: $(idirectfbfont_DATA) + @$(NORMAL_INSTALL) + test -z "$(idirectfbfontdir)" || $(MKDIR_P) "$(DESTDIR)$(idirectfbfontdir)" + @list='$(idirectfbfont_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(idirectfbfontDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ + $(idirectfbfontDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ + done + +uninstall-idirectfbfontDATA: + @$(NORMAL_UNINSTALL) + @list='$(idirectfbfont_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(idirectfbfontdir)/$$f'"; \ + rm -f "$(DESTDIR)$(idirectfbfontdir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(idirectfbfontdir)" "$(DESTDIR)$(idirectfbfontdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-idirectfbfontLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-idirectfbfontDATA \ + install-idirectfbfontLTLIBRARIES + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-idirectfbfontDATA \ + uninstall-idirectfbfontLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-idirectfbfontLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-idirectfbfontDATA \ + install-idirectfbfontLTLIBRARIES install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-idirectfbfontDATA \ + uninstall-idirectfbfontLTLIBRARIES + +%.o: .libs/%.a %.la + rm -f $<.tmp/*.o + if test -d $<.tmp; then rmdir $<.tmp; fi + mkdir $<.tmp + (cd $<.tmp && $(AR) x ../../$<) + $(LD) -o $@ -r $<.tmp/*.o + rm -f $<.tmp/*.o && rmdir $<.tmp + +.PHONY: $(LTLIBRARIES:%.la=.libs/%.a) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/Source/DirectFB/interfaces/IDirectFBFont/default_font.h b/Source/DirectFB/interfaces/IDirectFBFont/default_font.h new file mode 100755 index 0000000..a0c953d --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/default_font.h @@ -0,0 +1,623 @@ +/* DirectFB surface dump created by directfb-csource 0.9.17 */ + +static unsigned char font_data[] = + "\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377" + "\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0" + "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\377\0\0\0\0\0\377" + "\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0" + "\0\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0" + "\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0" + "\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0" + "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0" + "\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377" + "\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\377" + "\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377" + "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\377\0" + "\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0" + "\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0" + "\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0" + "\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377" + "\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0" + "\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\377" + "\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\377\0\0\0\0\0\0" + "\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377\0\0\0\0\377\0" + "\0\0\0\377\0\0\377\0\0\0\0\377\0\0\0\377\0\0\0\0\377\0\0\0\0\0\0\0\0" + "\0\0\377\0\0\0\0\0\0\377\0\0\0\0\377\0\0\0\0\377\0\0\0\0\0\0\377\0\0" + "\0\0\0\0\377\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\377" + "\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\377\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8U8\0\34UUU\34\34" + "UUU\34""8U\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0""8U\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0UU\0\0\0\0" + "\0\0\0\0\0\0\0\0""8U8\0\0\0\0\0\0\0\0\0\0""8U\34\0\0\0\0\0\0\0""88\0" + "\0\0\34U\0\0\0UU\0\0\0\0\0\0\34U8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\34U8\0UU\0\0\0\0\0\0\377\252\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34U\34\0\0qU\0\0" + "\215U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34U8\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377\377\252\0U" + "\377\377\377UU\377\377\377U\252\377\3778\0\0\0""8U\0\0\0\0\0\0\2158\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\34U8\0\0\0\0""8\252\2528\0\0\0\0\0q\252\252\252" + "\252\2528\0\0\0\0\0\0""8\215\252\252U\0\0""8\252\252\252\252\2158\0\0" + "\0\0""8\252\252\252\252\252\252q\0\0q\252\252\252\252\252\252\0\0\0\0" + "8\215\252\252q\34\0\0\0\252\252\0\0\0\0q\2528\0\0""8\252q\0\0\0\252\252" + "\0\0\0q\2528\0\0\34\252\2528\0q\2528\0\0\0\0\0\0\252\252q\0\0\0\0q\252" + "\252\0\0\0""8\252\252U\0\0\0""8\252q\0\0\0\0U\252\252\2158\0\0\0\0""8" + "\252\252\252\252\215\34\0\0\0\0\0U\252\252\2158\0\0\0\0""8\252\252\252" + "\252\252U\0\0\0\0\0\34\215\252\252q\34\0q\252\252\252\252\252\252\252" + "\252\0q\2528\0\0\0\0\252\252\0\0\252\2528\0\0\0\0""8\252q\0\252\2528" + "\0\0\0\252\252\215\0\0\0U\252q\0\252\252U\0\0\0\0\215\25288\252\252\34" + "\0\0\0""8\252\252\0q\252\252\252\252\252\252q\0\0\0\0\0\0\0\0\0\0\0\252" + "\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\215\377\377\377U\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0""8\377\377" + "8\0\0\342\377\215\0\0\377\377\0\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0UU\34\0\0\0\0\0\0\0\0\0\0\0\0\34UU\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0U\377\252\0\0U\377\252\0\377\377\0\0\0\0\0\34\377" + "\306\34\0\0\0\0\0\0UU\0\0\0\0\0\342\252\0\0\0\0\0\0\0\0\0U\252\252q\0" + "\0\0\0\0\0\0\0\0q\3778\0\34\377\252\0\0\342\306\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\34\215\342\377\342U\0\0\0\0\0\0\306\377\342\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377U8\0U\377\215U\34\34" + "U\215\377U8q\377\252\0\0\0\252\377\34\0\0\0\0""8\377\377\215\34\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\252\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\252U\0\34\2528\0\0U\377\252\0\0\0\0\252\377\377\252\0\0\0\0\0\252\377" + "\377\377\377\377\377\252\0\0\0\0\252\377\377\377\377\377\34\0U\377\377" + "\377\377\377\377\252\0\0\0U\377\377\377\377\377\377\252\0\0\252\377\377" + "\377\377\377\377\0\0\0\252\377\377\377\377\377\377\0\0\0\377\377\0\0" + "\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377U\0\0\306\377\306" + "\0\0\252\377U\0\0\0\0\0\0\377\377\342\0\0\0\0\342\377\377\0\0\0U\377" + "\377\342\0\0\0U\377\252\0\0\0\252\377\377\377\377\377U\0\0\0U\377\377" + "\377\377\377\377U\0\0\0\252\377\377\377\377\377U\0\0\0U\377\377\377\377" + "\377\377\342\0\0\0U\377\377\377\377\377\215\0\252\377\377\377\377\377" + "\377\377\377\0\252\377U\0\0\0\0\377\377\0\0\306\377\215\0\0\0\0\215\377" + "\252\0\342\377U\0\0""8\377\377\377\0\0\0\252\377q\0q\377\377\34\0\0q" + "\377\342\0\0\342\377\215\0\0\0\252\377\252\0\252\377\377\377\377\377" + "\377\252\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\377\377q\215\34\0\0\0\0\0\0\0" + "\0\0\252\377U\0\0\0\0\0\0""8\377\3778\0\0\342\377\215\0\0\377\377\0\0" + "\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0U\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\377\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\215\377\377\377\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0U\377\252\0\0""8\377\252\0\377\342\0\0\0\34\306\377\377\377\377\342" + "\0\0\0\34\342\377\377\342\34\0\0""8\377\215\0\0\0\0\0\0\0\0\252\377\377" + "\377\377\252\0\0\0\0\0\0\0\0\306\377\0\0\215\377U\0\0\215\3778\0\0\0" + "\0\0\0\0\0\0\0\0\0\0""8\377\342\252\377\3778\0\0\0\0""8\377\342\377q" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0" + "\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0U\377q\0\0\0\0\0U\306\377\342" + "8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0U\377q\0U\377U\0\0""8\377\252\0\0\0\0\377\342\377\377\0\0\0\0\0\252" + "\377U\0\0U\377\377\34\0\0\215\377\3068\0""8q\0\0U\377\252\0\0""8\342" + "\377q\0\0U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\215\377\3068\0" + "\34qq\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0" + "\252\377U\0q\377\342\34\0\0\252\377U\0\0\0\0\0\34\377\377\377\34\0\0" + "\34\377\377\3778\0\0U\377\342\377U\0\0U\377\252\0\0q\377\252\34\0U\377" + "\377\34\0\0U\377\252\0\0U\377\377\0\0q\377\252\34\0U\377\377\34\0\0U" + "\377\252\0\0\34\342\377q\0\34\377\3778\0\34q8\0\0\0\0U\377\252\0\0\0" + "\0\252\377U\0\0\0\0\377\377\0\0q\377\306\0\0\0\0\306\377U\0\252\377\252" + "\0\0U\377\306\3778\0\0\306\377U\0\0\342\377\215\0\0\342\3778\0\0q\377" + "\342\0\0\0\377\3778\0\0\0\0\0\0q\377U\0\0\0\0\0\0\0\0\0\0\0\252\377U" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0""88\0\0\0\34" + "U\0\0\0\377\377\0\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8U8\0\0\0\0\0\0\0""8\0\0\0\0""8U8\0" + "\0\0\0\0""8UU\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\342" + "qq\215\0\0\0\0\0\0\0\0\0\0q\377\342Uq\377\377\34\0\0\0\0UU\34\0\0\0\0" + "\0\0UU\34\0\0\0\0U\377\252\0\0\0\377\252\0\377\252\0\0\0\342\377\306" + "\377\342\252\377\0\0\0\215\377qq\377\252\0\0\215\3778\0\0\0\0\0\0\0""8" + "\377\342\34\34\342\3778\0\0\0\0\0\0\0\377\252\0\0\342\377\0\0\0U\377" + "\215\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\34\0q\377\252\0\0\0\0\306\3778\377" + "\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252" + "\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0\377\252\0\0\0\0\0\0\0" + "8\252\0\0\0\0\0\0\0\0\0\0\0\0\215\342\215\306\377\215\342\215\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0U\377U\0U\377\34\0\0\0\377\252\0\0\0""8\377\252\252" + "\377U\0\0\0\0\252\377U\0\0\0\252\377U\0\34\377\377\34\0\0\0\0\0\0U\377" + "\252\0\0\0""8\377\342\0\0U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\34" + "\377\377\34\0\0\0\0\0\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0" + "\0\377\377\0\0\0\252\377U\34\342\377U\0\0\0\252\377U\0\0\0\0\0U\377\306" + "\377U\0\0U\377\342\377U\0\0U\377\252\377\306\0\0U\377\252\0\0\342\377" + "\34\0\0\0q\377\215\0\0U\377\252\0\0\0\306\377U\0\342\377\34\0\0\0q\377" + "\215\0\0U\377\252\0\0\0U\377\252\0U\377\252\0\0\0\0\0\0\0\0\0U\377\252" + "\0\0\0\0\252\377U\0\0\0\0\377\377\0\0""8\377\377\0\0\0\0\377\377\0\0" + "\215\377\252\0\0\252\377q\377U\0\0\377\377\34\0\0U\377\377\34q\377\306" + "\0\0\0\34\377\3778\0q\377\306\0\0\0\0\0\0\34\377\306\0\0\0\0\0\0\0\0" + "\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377\377\377\306\34\0" + "\0\34q\342\252\0\0U\342\377\377\377\306\34\0""8\342\377\377\377\342U" + "\0\0\0\0""8\377\252\0\0\0\0U\377\377\377\377\377\252\0\0\0\342\377\34" + "\0\0\0\0U\377\377\377\377\377\377\3778\252\377U\0\0\306\377U\0\0U\377" + "\377\377\377\215\0\0\0\34\342\377\377\377\215\0\0\0U\377\252\0\0\0\377" + "\252\0\377\252\0\0U\377\306\0\377\252\0\0\0\0\0\377\306\0\0\306\377\0" + "\0\306\377\0\0\0\0\0\0\0\0U\377\252\0\0\252\377U\0\0\0\0\0\0U\377U\0" + "\34\377\252\0\0\0\0\377\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377\252" + "\0\0\0""8\377\215\0\215\377q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0" + "\306\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\215\342\377\377" + "\306q\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\215\3778\0\252\377\0\0\0\0\377\252" + "\0\0\0\215\377Uq\377\215\0\0\0\0\252\377U\0\0\0\252\3778\0U\377\252\0" + "\0\0\0\0\0\0U\377\252\0\0\0\0\377\377\34\0U\377\252\0\0\0\0\0\0\0\252" + "\377U\0\0\0\0\0U\377\252\0\0\0\0\0\0\0\0\0\377\377\0\0\0\0\252\377U\0" + "\0U\377\252\0\0\0\377\377\0\0\0\252\377U\252\377\252\0\0\0\0\252\377" + "U\0\0\0\0\0U\377\252\377\252\0\0\252\377\252\377U\0\0U\377\252\306\377" + "\34\0U\377\252\0\34\377\342\0\0\0\0""8\377\306\0\0U\377\252\0\0\0\252" + "\377U\34\377\342\0\0\0\0""8\377\306\0\0U\377\252\0\0\0q\377\215\0U\377" + "\342\34\0\0\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0\0\0\0\377\377\0\0" + "\0\342\377U\0\0U\377\306\0\0U\377\342\0\0\306\3778\377\215\0\0\377\377" + "\0\0\0\0\306\377\215\342\377\34\0\0\0\0\215\377\252\0\306\3778\0\0\0" + "\0\0\0\306\3778\0\0\0""8\306\377\377\342U\0\0\0\252\377q\306\377\306" + "8\0\0\0\34\252\377\377\306\0\0\34\252\377\342U\377\377\0\0\0q\342\377" + "\342U\0U\377\377\377\377\377\0\0q\342\377\377\377\377\215\0\252\377q" + "\215\377\377U\0\0\0\377\377\0\0\0\252\377U\0\0\377\377\0\0\342\377\215" + "\0U\377\252\0\0U\377Uq\377\377\215\34\306\377\342U\0\0U\377Uq\342\377" + "\252\0\0\0\0q\342\377\342q\0\0\0\252\377\34\306\377\342U\0\0\0U\342\377" + "\306\34\377\252\0\0\377\252U\342\3778\0\215\377\377\342qU\377\377\377" + "\377\252\0U\377\252\0\0U\377\252\0\252\377\215\0\0\34\377\377U\377\342" + "\0\0""8\377\377U\0\0\252\377U\215\377\306\0\0U\377\342\0\377\3778\0\0" + "8\377\306\0\377\377\377\377\377\377\0\0\215\377\306U\252\377\215\0q\377" + "\377\377\252\0\0q\377\215U\306\377\215\0\34\377\215U\215\377\342\0\0" + "\0\0\215\3778\0\0\0\0U\377\306\252\252\252q\0\0""8\377\252\0\0\0\0\0" + "8\252\252\252\252\252\377\377\0\252\377q\0\0\306\377U\0\34\377\377qU" + "\342\3778\0\0\342\377\215U\342\3778\0\0""8\377\252\0\0\0\0\0\0\0\0\0" + "\0U\377\252\0\377\252\0\0\0\0\0\377\252\0\0\252\377\0\34\377\252\0\0" + "\0\0\0\0\0\0""8\377\342\0\0\342\377\34\0\0\0\0\0\0\252\377\34\0U\377" + "\252\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\342\377q\0\0\0" + "\306\377\34\0\34\377\342\0\0\0\0\0\0\0\0""8\252\252\0U\3068\0\0\0\0\0" + "\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0" + "q\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\34U\34\0\0\0\0\0\0q\377\377U\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\252\377\377\377\377\377\377\377\377\377\0\0\0\0" + "\0\0\0\306\37788\377\342\0\0\0\0\252\377U\0\0U\377\252\0\0\252\377U\0" + "\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0U\377\306UUUU\0\0\0\252\377U" + "\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\377\377UUUU\306\377U\0\0U\377\252" + "\0\0\0\377\377\0\0\0\252\377\252\377\342\34\0\0\0\0\252\377U\0\0\0\0" + "\0U\377\252\306\342\0\0\342\342\252\377U\0\0U\377\252U\377\215\0U\377" + "\252\0U\377\252\0\0\0\0\0\377\377\0\0U\377\252\0\0\0\342\3778U\377\252" + "\0\0\0\0\0\377\377\0\0U\377\252\0\0""8\342\3778\0\0\342\377\342q\0\0" + "\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0\0\0\0\377\377\0\0\0\252\377\215" + "\0\0\215\377q\0\0""8\377\377\0\0\377\252\0\377\252\0U\377\252\0\0\0\0" + "8\377\377\377\215\0\0\0\0\0\34\377\377\34\377\306\0\0\0\0\0\0U\377\215" + "\0\0\0\0q\377\252\252\377\3778\0\0\252\377\377\306\306\377\342\0\0\34" + "\342\377\306\306\342\0\0\215\377\342\252\377\377\377\0\0q\377\342\252" + "\377\37788\252\377\377\252\252\0q\377\342\252\306\377\342U\0\252\377" + "\377\306\252\377\3778\0\0\377\377\0\0\0\252\377U\0\0\377\377\0q\377\306" + "\0\0U\377\252\0\0U\377\377\342\252\377\377\342\306\306\377\342\0\0U\377" + "\377\342\252\342\377\215\0\0q\377\342\252\342\377\215\0\0\252\377\377" + "\306\306\377\342\34\0\34\342\377\306\306\377\377\252\0\0\377\377\342" + "\306\377\34q\377\342\252\342\2158\252\377\377\252q\0U\377\252\0\0U\377" + "\252\0U\377\306\0\0U\377\252\0\377\377\0\0q\377\377\215\0\0\377\377\0" + "\34\342\3778\0\342\3778\0\252\377q\0\0q\377\215\0\252\252\252\252\377" + "\377\0\0\377\377\34\0\34\377\377\0q\342\252\377\252\0\0\0""8\0\0\34\377" + "\377\0\0\34\0\0\0\306\377U\0\0\0\377\306\0\0\0\0\0U\377U\0\0\0\0\0\0" + "q\377\215\306\377\342U\0\0\0\0\0\0U\377\252\0""8\377\342\34U\377\342" + "\0\0\215\377\215\0\0U\377\252\0U\377\306\0\0q\377\252\0\0\0\377\252\0" + "\0\0\0\0\0\0\0\0\0\34\377\377q\377\252\0\0\0\0\0\377\252\0\0\252\377" + "\0U\377U\0\34UU\0\0\0\0\0\252\377\252\252\377\252\0\0\0\0\0\0\0\342\306" + "\0\0\215\377U\0\0\0\0\252\377U\0""8\252\252\252\252\252\252\252\252\252" + "\0\0\0\0q\377\342\34\0\0""8\377\215\0\0\0\215\377q\0\0\0\0\0""8\306\377" + "\377q\0""8\342\377\342q\0\0\0\0\0U\377U\0\0\0\0\0\0\252\377U\0\0\0\0" + "\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\377\252\0\0\0U\377" + "U\0\0\0\0U\377U\0\0\377\342\0\0\0\0""8\377\215\0\0\0\0\0\0\0\0\0\0\0" + "\0\0U\377U\0\0\0\0\0""8\377q\215\377\34\0\0\0\0\0\0\0\0\0\0\0\0\0q\252" + "\377\377\252\252\377\342\252q\0\0\0\0\0\0\34\377\377\0\0\377\3778\0\0" + "\0\252\377\377\377\377\377\306\0\0\0\252\377U\0\0\0\0\0\0\0U\377\252" + "\0\0\0\0\252\377U\0U\377\377\377\377\377\377U\0\0\252\377\377\377\377" + "\377\252\0\252\377U\0U\377\377\377\377\0\0\0\377\377\377\377\377\377" + "\377\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377\377\377\215\0\0\0" + "\0\0\252\377U\0\0\0\0\0q\377\215\215\377\34\34\377\252\215\377q\0\0U" + "\377\252\0\342\342\0U\377\252\0U\377\252\0\0\0\0\0\377\377\0\0U\377\306" + "UU\306\377\306\0U\377\252\0\0\0\0\0\377\377\0\0U\377\377\377\377\377" + "\3068\0\0\0U\342\377\377\342q\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0\0" + "\0\0\377\377\0\0\0U\377\306\0\0\306\3778\0\0\0\377\377\34""8\377\215" + "\0\306\377\0U\377\252\0\0\0\0\0\252\377\377\34\0\0\0\0\0\0\215\377\252" + "\3778\0\0\0\0\0\0\342\377\34\0\0\0\0\0\0\0\0q\377\252\0\0\252\377\306" + "\0\0\306\377U\0\215\377\215\0\0\0\0\0\377\377\34\0q\377\377\0\0\377\377" + "\34\0q\377\252\0\0\377\377\0\0\0\342\377\34\0\0\342\377\34\0\252\377" + "\306\0\0\252\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\34\377\377\34" + "\0\0U\377\252\0\0U\377\306\0\0\252\377\306\0\0\377\377\0\0U\377\377\34" + "\0U\377\252\0\0\377\377\34\0\34\377\377\0\0\252\377\306\0\0\306\377U" + "\0U\377\306\0\0\306\377\252\0\0\377\377U\0U\0\252\377U\0\0\0\0\0\377" + "\377\0\0\0U\377\252\0\0U\377\252\0\0\377\377\0\0\252\377q\0\342\3778" + "\0\252\377\342\306\0\0\377\306\0\0U\377\306q\377\215\0\0U\377\306\0\0" + "\252\377U\0\0\0\0q\377\215\0""8\377\306\0\0\0\306\377U\0\0U\377\252\0" + "\0\0\0\0\0\0\377\377\0\0\0\0\0\0\306\377U\0\0q\377q\0\0\0\0\0\252\377" + "U\0\0\0\0\0\0\252\377\377\306\306\377\342\34\0\0\0\0\0\252\377U\0\0U" + "\377\377\377\342\34\0\0\252\377U\0\0\0\377\342\0\215\377q\0\0\34\377" + "\377\0\0\0\377\252\0\0\0\0\0\0\0\0\0\0\0U\377\377\377\342q\0\0\0\0\252" + "\377\34\34\377\306\0\252\377\34U\377\377\377\342\34\0\0\0""8\377\377" + "\377\215\0\0\0\0\0\0\0""8\377\215\0\0\252\377U\0\0\0\0\252\377U\0U\377" + "\377\377\377\377\377\377\377\377\0\0\0\34\342\377U\0\0\0\306\377\34\0" + "\0\0\0\342\342\0\0\0""8\306\377\342q\34\0\0\0\0q\306\377\342q\0\0\0U" + "\377U\0\0\0\0\0\0\377\377\252\0\0\0\0\0\377\377\252\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0""8\342\3778\0\0\0U\377U\0\0\0\0U\377U\0\0q\377\3068" + "\0\0\0\342\342\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0U\306\0\0\306" + "8\0\0\0""8\252\2158\0\0\0""8\0\0\0\0\377\252\0\0\377\252\0\0\0\0\0\0" + "\0\0U\377\252\0\0\252\377q\0\0\0\252\377\306\252\252\342\377\342\34\0" + "\252\377U\0\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0U\377\306UUUU\0\0" + "\0\252\377\306\252\252\252q\0\252\377U\0""8\252\252\377\377\0\0\0\377" + "\377UUUU\306\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377\215\377\377" + "\34\0\0\0\0\252\377U\0\0\0\0\0\252\377UU\377UU\377UU\377\252\0\0U\377" + "\252\0q\377UU\377\252\0U\377\252\0\0\0\0\0\377\377\0\0U\377\377\377\377" + "\377\306\34\0U\377\252\0\0\0\0\0\377\377\0\0U\377\342\252\342\377\252" + "\0\0\0\0\0\34\215\342\377\377\252\0\0\0\0U\377\252\0\0\0\0\252\377U\0" + "\0\0\0\377\377\0\0\0\0\377\377\0\0\377\342\0\0\0\0\342\377UU\377U\0\252" + "\377\34\215\377U\0\0\0\0\0\342\377\377q\0\0\0\0\0\0\34\377\377\306\0" + "\0\0\0\0\0q\377q\0\0\0\0\0\0\0""8U\215\377\252\0\0\252\377q\0\0q\377" + "\252\0\342\377\34\0\0\0\0U\377\306\0\0\34\377\377\0U\377\252\0\0\0\377" + "\342\0\0\377\377\0\0\0\377\377\0\0\0\252\377U\0\252\377U\0\0\252\377" + "U\0\0\377\377\0\0\0\252\377U\0\0\377\377\252\377U\0\0\0U\377\252\0\0" + "U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0U\377\306" + "\0\0\0\306\377U\0\252\377U\0\0q\377\252\0\252\377U\0\0q\377\252\0\0\377" + "\377\0\0\0\0\215\377\3428\0\0\0\0\377\377\0\0\0U\377\252\0\0U\377\252" + "\0\0\306\377U\0\306\377\34\0\252\377U\0\342\306\252\377\0U\377\252\0" + "\0\0\306\377\342\342\0\0\0\0\377\377\0\0\377\377\0\0\0\0\34\377\342\0" + "\0U\377\252\0\0\0\252\377U\0\0U\377\252\0\0\0\0\0\0q\377\306\0\0\0\0" + "\34q\377\342\0\0\0\306\377\0""8\3778\0\0\252\377\215\252\252q\0\0\0\252" + "\377\306\0\0\306\377q\0\0\0\0\34\377\377\0\0\34\342\377\306\342\377\252" + "\0\0\252\377U\0\0\0\377\377\0\252\377U\0\0\0\377\377\0\0\0\377\252\0" + "\0\0\0\0\0\0\0\0\0\0\0""8\252\377\377\377\342\34\0\0""8\377\377\377\377" + "8\0\377\306\0\342\342Uq\377\252\0\0\34\342\377\377\377\34\0U\377U\0\0" + "\0q\3778\0\0\252\377U\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377" + "\306\0\0\0""8\377\215\0\0\0\0\0q\377U\0\215\377\306U\0\0\0\0\0\0\0\0" + "\0""8\252\377\342\0\0U\377U\0\0\0\0\0\0U\252\34\0\0\0\0\0U\252\34\0""8" + "UUU8\0\0\0\0\0\0\0\0\0\0\0\252\377\306\0\0\0\0U\377U\0\0\0\0U\377U\0" + "\0\34\306\377\252\0\0\0\215\377\34\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\215\377\377\377\377\306U\252\377\0\0\0\0\377\252" + "\0""8\377q\0\0\0\0\0\0\0\0\252\377\252UU\252\377\306\0\0\0\252\377U\0" + "\0\0\215\377\306\0\252\377U\0\0\0\0\0\0\0U\377\252\0\0\0\0\252\377U\0" + "U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\252\377U\0\0\0\0\377\377\0" + "\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377" + "U\306\377\306\0\0\0\0\252\377U\0\0\0\0\0\252\377U\0\377\252\252\377\34" + "U\377\252\0\0U\377\252\0\34\377\306U\377\252\0U\377\252\0\0\0\0\0\377" + "\377\0\0U\377\306UU8\0\0\0U\377\252\0\0\0\0\0\377\377\0\0U\377\252\0" + "\34\342\377\215\0\0\0\0\0\0\0\252\377\377\34\0\0\0U\377\252\0\0\0\0\252" + "\377U\0\0\0\0\377\377\0\0\0\0\306\377UU\377\252\0\0\0\0\252\377U\252" + "\377\34\0U\377U\252\377U\0\0\0\0\215\377\306\377\377\34\0\0\0\0\0\0\306" + "\377U\0\0\0\0\0\34\377\342\0\0\0\0\0\0U\377\377\377\377\377\252\0\0\252" + "\377U\0\0U\377\252\0\377\377\0\0\0\0\0U\377\252\0\0\0\377\377\0U\377" + "\377\377\377\377\377\377\0\0\377\377\0\0\0\342\3778\0\0\342\3778\0\252" + "\377U\0\0\252\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\377\377\34" + "\0\0\0U\377\252\0\0U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U" + "\377\252\0U\377\252\0\0\0\252\377U\0\252\377U\0\0U\377\252\0\252\377" + "U\0\0U\377\252\0\0\377\377\0\0\0\0\0\252\377\377\252\34\0\0\377\377\0" + "\0\0U\377\252\0\0U\377\252\0\0q\377q\0\377\342\0\0U\377\252\34\377\252" + "\215\3778q\377U\0\0\0""8\377\377q\0\0\0\0\306\377U8\377\306\0\0\0\0\252" + "\3778\0\0U\377\252\0\0\0\252\377U\0\0U\377\252\0\0\0\0\0\34\342\377q" + "\0\0\0\252\377\377\342\34\0\0\34\377\252\0U\377U\0\0\252\377\377\377" + "\377\377\215\0\0\252\377U\0\0U\377\252\0\0\0\0q\377\252\0\0\252\377q" + "\0\34\342\377q\0\215\377\252\0\0""8\377\377\0\252\377U\0\0\0\377\377" + "\0\0\0\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\306\342\377\252\0\0\0" + "8\252\2528\0""8\377\215U\377q\0\0\306\377\0\0\215\377\252U\377\342\34" + "U\377U\0\0\0\306\377\0\0\0\252\377U\0\0\0\0\252\377U\0\34UUUUUUUUU\0" + "\0\0\252\377U\0\0\0\0""8\34\0\0\0\0\0\0U\0\0q\377\377\306U\0\0\0\0\0" + "\0\0""8\215\342\377\306\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\252\377\377\377\252\0\0\0\0\0\0\0\0\0\0\0\0\252\377q\0\0\0U\377U\0\0" + "\0\0U\377U\0\0\306\377q\0\0\0\0U\377q\0\0\0\0\0\0\0\0\0\252\377\377\377" + "\377\377\377\377\252\0\0\0\0\0\0\0\0\0\0Uq\0""8\306\377\377\377U\0""8" + "\377\377\377\377\377\377\377\377\377U\0\0\0\0\0\0\377\377\377\377\377" + "\377\377\377\34\0\0\252\377U\0\0\0\0\377\377\0U\377\252\0\0\0\0\0\0\0" + "U\377\252\0\0\0\0\342\377\34\0U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0" + "\0\0q\377\252\0\0\0\0\377\377\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377" + "\252\0\0\0\377\377\0\0\0\252\377U\34\377\377q\0\0\0\252\377U\0\0\0\0" + "\0\252\377U\0\306\342\306\306\0U\377\252\0\0U\377\252\0\0\252\377q\377" + "\252\0\34\377\342\0\0\0\0""8\377\306\0\0U\377\252\0\0\0\0\0\0\34\377" + "\342\0\0\0\0""8\377\306\0\0U\377\252\0\0""8\377\377\34\0\0\0\0\0\0\0" + "\306\377U\0\0\0U\377\252\0\0\0\0\252\377U\0\0\0\0\377\377\0\0\0\0q\377" + "\215\215\377U\0\0\0\0q\377\252\306\377\0\0""8\377q\342\377\0\0\0\0\34" + "\377\377\34\306\377\252\0\0\0\0\0\0\252\377U\0\0\0\0\0\252\3778\0\0\0" + "\0\0\34\377\377\215U\215\377\252\0\0\252\377U\0\0U\377\252\0\377\377" + "\0\0\0\0\0U\377\252\0\0\0\377\377\0U\377\342\252\252\252\252\252\0\0" + "\377\377\0\0\0q\377\342\252\306\377\306\0\0\252\377U\0\0\252\377U\0\0" + "\377\377\0\0\0\252\377U\0\0\377\377\215\377\306\0\0\0U\377\252\0\0U\377" + "U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0U\377\252\0\0\0" + "\252\377U\0\252\377U\0\0U\377\252\0\252\377U\0\0U\377\252\0\0\377\377" + "\0\0\0\0\0\0""8\342\377\342\0\0\377\377\0\0\0U\377\252\0\0U\377\252\0" + "\0""8\377\252U\377\215\0\0\34\377\252U\377UU\377q\252\3778\0\0\0\215" + "\377\377\342\0\0\0\0q\377\215q\377\215\0\0\0U\377\252\0\0\0U\377\252" + "\0\0\0\252\377U\0\0U\377\252\0\0\0\0\34\342\377\252\0\0\0\0q\252\377" + "\377\252\0\0\215\3778\0\215\377U\0\0U\377\215\0""8\377\377\34\0\252\377" + "U\0\0U\377\252\0\0\0\0\306\377U\0\0\377\377\0\0\0U\377\252\0""8\377\377" + "qU\342\377\377\0\252\377U\0\0\0\377\377\0\0\0\215U\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\252\34\377\377\0\0\0\0\0\0\0\0\215\3778U\377U\0\0\252" + "\377\0\0\377\377\0\0U\377\342\342\377\34\0\0\0\377\252\0\0\0\252\377" + "U\0\0\0\0\252\377U\0U\377\377\377\377\377\377\377\377\377\0\0\0U\252" + "8\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34q\342\377\377\2528\0\34\215\342\377" + "\377\2158\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8UUU8\0\0" + "\0\0\0\0\0\0\0\0\0\0\34\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\306" + "\0\0\0\0\0\0\377\306\0\0\0\0\0\0\0\0\0q\252\252\306\377\306\252\252q" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34U\34\0\0""8\252\306\377\306\252\342" + "\377\252\252\34\0\0\0\0\0""8\377\377UUUU\342\377q\0\0\252\377U\0\0\0" + "\34\377\377\0\34\377\377\34\0\0\0\0\0\0U\377\252\0\0\0""8\377\342\0\0" + "U\377\252\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\34\377\377\34\0\0\0\377\377" + "\0\0\0\377\377\0\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252" + "\377U\0\215\377\342\34\0\0\252\377U\0\0\0\0\0\252\377U\0\215\377\377" + "\215\0U\377\252\0\0U\377\252\0\0""8\377\306\377\252\0\0\342\377\34\0" + "\0\0q\377\215\0\0U\377\252\0\0\0\0\0\0\0\342\377\34\0\0\0q\377\215\0" + "\0U\377\252\0\0\0\306\377q\0\0\0\0\0\0\0\252\377U\0\0\0U\377\252\0\0" + "\0\0\252\377q\0\0\0\34\377\377\0\0\0\0\34\377\252\252\377\0\0\0\0\0U" + "\377\252\377\252\0\0\0\377\252\377\377\0\0\0\0\306\377\215\0""8\377\377" + "8\0\0\0\0\0\252\377U\0\0\0\0""8\377\306\0\0\0\0\0\0U\377\252\0\0U\377" + "\252\0\0\252\377q\0\0q\377\215\0\306\3778\0\0\0\0""8\377\306\0\0\34\377" + "\377\0\34\377\306\0\0\0\0\0\0\0\377\377\0\0\0\0\342\377\377\377\215\34" + "\0\0\252\377U\0\0\252\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\0\342" + "\377q\0\0U\377\252\0\0U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0" + "\0U\377\252\0\34\377\342\0\0\0\342\377\34\0\252\377\215\0\0q\377\215" + "\0\215\377q\0\0\215\377\252\0\0\377\377\0\0\0\0\0\0\0\0\306\377U\0\377" + "\377\0\0\0U\377\252\0\0q\377\252\0\0\0\342\377q\377U\0\0\0\342\377\215" + "\377\34\0\377\252\306\377\0\0\0""8\377\306\306\377\215\0\0\0\34\377\306" + "\252\3778\0\0\0\342\342\34\0\0\0\34\377\377\0\0\0\377\377\0\0\0U\377" + "\252\0\0\0\34\342\377\252\0\0\0\0\0\0\0\34\342\377q\0\342\342\0\0\252" + "\377U\0\0\0\0\0\0\0\252\377U\0q\377q\0\0q\377\215\0\0\0\34\377\377\0" + "\0\0\377\377\0\0\0U\377\252\0\0U\377\377\377\252\377\377\0q\377\252\0" + "\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\377\377\0" + "\0\0\0\0\0\0\0\306\342\0U\377U\0\0\252\377\0\0\377\377\0\0\0U\377\377" + "\306\0\0\0U\377U\0\0\0U\377\252\0\0\0\0\342\377\0\0\34UUUUUUUUU\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\252\377\252\0U\377\306" + "q\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252" + "\0\0\0\0\0\0\252\377\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\215\377\34\0\252\377\0\0\0\0\0\0\0\0" + "\215\377\252\0\0\0\0\252\377\252\0\0\252\377U\0\0\34\252\377\306\0\0" + "\215\377\3068\0\34U\0\0U\377\252\0\0""8\342\377q\0\0U\377\252\0\0\0\0" + "\0\0\0\252\377U\0\0\0\0\0\0\252\377\3068\0\0\377\377\0\0\0\377\377\0" + "\0\0\0\252\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377U\0\34\342\377" + "\215\0\0\252\377U\0\0\0\0\0\377\377\0\0U\377\377U\0\0\377\377\0\0U\377" + "\252\0\0\0\342\342\377\252\0\0q\377\342\34\0U\377\377\34\0\0U\377\252" + "\0\0\0\0\0\0\0q\377\342\34\0U\377\377\34\0\0U\377\252\0\0\0q\377\342" + "\0\0\252U\0\0q\377\342\0\0\0\0U\377\252\0\0\0\0U\377\3428\0\34\252\377" + "\215\0\0\0\0\0\342\377\377\306\0\0\0\0\0\34\377\252\377\215\0\0\0\306" + "\252\377\252\0\0\0""8\377\342\34\0\0\306\377\306\0\0\0\0\0\252\377U\0" + "\0\0\0\306\3778\0\0\0\0\0\0U\377\306\0\34\342\377\252\0\0\252\377\342" + "\34\34\342\377U\0q\377\306\34\0\34\0\0\377\377U\0\252\377\377\0\0\342" + "\377q\0\0U\34\0\0\377\377\0\0\0""8\377q\0\0\0\0\0\0\252\377U\0\0\252" + "\377U\0\0\377\377\0\0\0\252\377U\0\0\377\377\0q\377\342\34\0U\377\252" + "\0\0U\377U\0\0\252\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0\0\306" + "\377U\0U\377\342\0\0\252\377\342\34\34\342\377U\0U\377\342\34\34\342" + "\377\252\0\0\377\377\0\0\0\0UU\0\0\306\377U\0\377\377\34\0\0U\377\306" + "\0\34\342\377\252\0\0\0\252\377\252\377\0\0\0\0\252\377\252\377\0\0\306" + "\306\377\252\0\0\0\342\3778\34\377\377\34\0\0\0\306\377\342\377\0\0\0" + "\215\377q\0\0\0\0\0\306\377q\0\215\377\306\0\0\0U\377\252\0\0U\377\377" + "\252\0\0\0\0\0\0\0\0\0U\377\252U\377\342\252\252\342\377\306q\0\0\0\0" + "\0\0\252\377U\0\34\377\342\34\34\342\3778\0\0\0q\377\252\0\0\0\306\377" + "\215\0\34\306\377q\0\0\0\34U8\34\377\306\0\34\377\377\34\34\306\377q" + "\0\0U\377\252\0\0\0\0\0\0\0\0\0\0\0\215U\0\377\306\252\377\252\0\0\0" + "\0\0\0\0\34\377\252\0\0\377\306\0\34\377\306\0\0\306\377\252\34\0U\342" + "\377\252\0\0\0\252\377\34\0\0\0""8\377\252\0\0\0\0\377\342\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\34""8\0\34\34\0\0\0\0\0\0\0\0U\377U\0\34\342\342\34\0\252\377U\34" + "\342\342\34\0\252\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252" + "\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0\0\0q\377U\0\0\0\0\0\0" + "\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252" + "\377\0\0\306\342\0\0\0\0\0\0\0\0\306\377U\0\0\0\0U\377\377\0\0\252\377" + "\377\377\377\377\377\342\34\0\0\0\252\377\377\377\377\377\34\0U\377\377" + "\377\377\377\377\252\0\0\0U\377\377\377\377\377\377\342\0\0\252\377U" + "\0\0\0\0\0\0\34\306\377\377\377\377\377\377\0\0\0\377\377\0\0\0\0\252" + "\377U\0\0U\377\252\0\0\0\377\377\0\0\0\252\377U\0\0q\377\3778\0\252\377" + "\377\377\377\377\377\0\377\377\0\0\0UU\0\0\0\377\377\0\0U\377\252\0\0" + "\0q\377\377\252\0\0\0\252\377\377\377\377\377U\0\0\0U\377\252\0\0\0\0" + "\0\0\0\0\252\377\377\377\377\377\3428\0\0U\377\252\0\0\0""8\377\3778" + "U\377\377\377\377\377\377U\0\0\0\0U\377\252\0\0\0\0\0\252\377\377\377" + "\377\377\342\34\0\0\0\0\0\215\377\377q\0\0\0\0\0\0\377\377\377U\0\0\0" + "\252\377\377\252\0\0\0\342\377q\0\0\0\34\377\377q\0\0\0\0\252\377U\0" + "\0\0\0\377\377\377\377\377\377\377\377\0\0\342\377\377\377\342\377\252" + "\0\0\252\377\306\377\377\377\342\0\0\0\342\377\377\377\377\34\0\215\377" + "\377\377\342\342\377\0\0""8\377\377\377\377\377\215\0\0\377\377\0\0\0" + "8\377\377\377\377\377\306\34\0\252\377U\0\0\252\377U\0\0\377\377\0\0" + "\0\252\377U\0\0\377\377\0\0\306\377\252\0""8\377\377\377UU\377U\0\0\252" + "\377U\0\0\377\377\0\0U\377\252\0\0U\377\252\0\0""8\377\377\377\377\377" + "8\0\0\252\377\377\377\377\377\306\0\0\0\306\377\377\377\377\377\252\0" + "\0\377\377\0\0\0\0\377\377\377\377\377\306\0\0\342\377\377\342\0\34\377" + "\377\377\377\306\377\252\0\0\0U\377\377\252\0\0\0\0q\377\342\252\0\0" + "\252\377\377\215\0\0q\377\252\0\0\215\377\306\0\0\0q\377\377\252\0\0" + "\0\377\377\377\377\377\377U\0""8\377\377\377\377\342\34\0U\377\377\377" + "\377\377\0\252\377\377\377\377\377\377U\0\0\0\0\0U\377\252U\377\377\377" + "\377\377\377\377\252\0\0\0\0\0\0\306\3778\0\0\215\377\377\377\377\252" + "\0\0\0\0\306\377U\0\0\0""8\342\377\377\377\377\342\0\0\0\0\0\0\0q\377" + "\215\0\0\215\377\377\377\377\252\0\0\0\252\377\377\0\0\0\0\0\0\0\0\0" + "\0U\377\377\377\377\377\377\342\34\0\0\0\0\0\0\0U\377U\0\0\215\377\377" + "\377\3778\0\0\34\342\377\377\377\377\377\306\377\252\0\0\342\306\0\0" + "\0\0\0\377\377\0\0\0""8\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0U\377U\0U\377\377U\0\377\377\252U\377\377U\0\377\377\252\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0\0U\377U\0\0\0\0U\377U\0\0" + "\377\252\0\0\0\0\0\0\34\377\252\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\306\342\0\0\377\252\0\0\0\0" + "\0\0\0\0\252\252\34\0\0\0\0\0\252\252\34\0q\252\252\252\252\252q\34\0" + "\0\0\0\0""8\252\252\252U\0\0""8\252\252\252\252\2528\0\0\0\0""8\252\252" + "\252\252\252\252\215\0\0U\252\34\0\0\0\0\0\0\0\0U\252\252\252q\34\0\0" + "\0\252\252\0\0\0\0q\2528\0\0""8\252q\0\0\0\377\377\0\0\0q\2528\0\0\0" + "\215\252q\0q\252\252\252\252\252\252\0\252\252\0\0\0\0\0\0\0\0\252\252" + "\0\0""8\252q\0\0\0\34\252\252q\0\0\0\0U\252\252\2158\0\0\0\0""8\252q" + "\0\0\0\0\0\0\0\0\0U\252\252\215q\377\377\252\0""8\252q\0\0\0\0\215\252" + "8\0U\215\252\252\215\34\0\0\0\0\0""8\252q\0\0\0\0\0\0U\252\252\252q\0" + "\0\0\0\0\0\0""8\252\252\34\0\0\0\0\0\0\215\252\252\34\0\0\0U\252\252" + "8\0\0""8\252\252\0\0\0\0\0q\252q\0\0\0\0q\2528\0\0\0\0\252\252\252\252" + "\252\252\252\252\0\0\34\215\252q\34\252\252\0\0q\252\0\215\252\215\34" + "\0\0\0\0q\252\252\215\34\0\0q\252\252\34q\252\0\0\0\34\215\252\252q\34" + "\0\0\252\252\0\0\0\0q\252\252\252\306\377\306\0q\2528\0\0q\2528\0\0\252" + "\252\0\0\0\252\377U\0\0\252\252\0\0""8\252\252\0\0q\252\252\34""8\252" + "8\0\0q\2528\0\0\252\252\0\0""8\252q\0\0""8\252q\0\0\0\34\215\252\215" + "\34\0\0\0\252\377U\215\252\215\34\0\0\0\34\215\252\215U\377\252\0\0\252" + "\252\0\0\0\0""8\215\252\252q\0\0\0\34\252\252\215\0\0""8\252\252U\0\252" + "q\0\0\0\0\252\252U\0\0\0\0\34\252\252U\0\0""8\252\2528\0\0\252\252\34" + "\0\0\34\252\252\34\0\0\0q\377q\0\0\0\252\252\252\252\252\2528\0\0\34" + "\215\252\215\34\0\0""8\252\252\252\252\252\0q\252\252\252\252\252\252" + "8\0\0\0\0\0\306\377q\0\0\0\0\0\252\377U\0\0\0\0\0\0""8\377\342\0\0\0" + "\0U\252\252q\0\0\0\0\34\377\377\0\0\0\0\0\34\215\252\252q\0\0\0\0\0\0" + "\0\0\342\3778\0\0\0""8\252\252q\0\0\0\0\34\252U\0\0\0\0\0\0\0\0\0\0\0" + "U\252\252\377\342q\0\0\0\0\0\0\0\0\0\252\377\0\0\0\0q\252\2528\0\0\0" + "\0\34q\252\252q\34\0\342\215\0""8\377\215\0\0\0\0\0\252\3778\0\0q\377" + "U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\252\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\306\3778\0q\377\215" + "\0\215\215\0\0U\252\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252" + "\0\0\0U\377U\0\0\0\0U\377U\0\0\377\252\0\0\0\0\0\0\0\342\342\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\252q\0\0\252U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\252" + "\0\0\0\0\306\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0U\377\252\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\306\3778\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\306\377" + "\342\0\0\0\0\0\0\252\377U\0\0\0\0\34q\377\377U\0\0\0\0\0\0\0\0\0\0\0" + "\0q\377\306\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\342\377\252\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\252\0\0\0\0\0\0\0" + "\0\0\0\252\215\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\3778\0\0" + "\0\0\0""8\377\215\0\0\306\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377" + "U\0\34\377\252\0\0\306\342\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\342\0\0\0U\377U\0\0\0\0U\377U\0""8\377\252\0\0\0\0" + "\0\0\0\215\3778\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0q\377\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34""8\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\342\377\215\0\0""8\342\342\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34" + "\342\3778\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0U" + "\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377" + "\306\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0U\377\377\377\377\306\34\0\0\0\0\0\0\252\377U\0\0\252\377\377\377" + "\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\252\377q\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\252\377\377\377\252\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\252q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0q\252\0\0\0\0\0\0\0\252\215\0\0\342q\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0U\377U\0\34\215\0\0\0\215\34\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0U\377\377\377\377\377\377\377\377\377U\0\0\252\377\377\252" + "\0U\377\377\377UU\377\377\377U\252\377\377q\0\0\0\0\0\0\0""8\2528\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0""8\377\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377\377" + "\377\377\377\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\342\377\252\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\252\377U\0\0\0\0\0\0\0\0\0\0\0U\377\252\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\377\3778\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\34\252\252" + "q8\0\0\0\0\0\0\0\0""8U\34\0\0U\252\252U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\252q8\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\34UUUUUUUUU\34\0\0\34\215\252q\0""8\252\252\252" + "88\252\252\2528q\252\215\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2158\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0""8\215\252\252q\34\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0Uq\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q\2528\0\0\0" + "\0\0\0\0\0\0\0\0""8\252q\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\34\252\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0U\377U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; + +static DFBSurfaceDescription font_desc = { + flags : DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT | + DSDESC_PREALLOCATED, + width : 824, + height : 21, + pixelformat : DSPF_A8, + preallocated : {{ data : (void *) font_data, + pitch : 824 }} +}; + diff --git a/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_default.c b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_default.c new file mode 100755 index 0000000..323d61a --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_default.c @@ -0,0 +1,322 @@ +/* + (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org) + (c) Copyright 2000-2004 Convergence (integrated media) GmbH + + All rights reserved. + + Written by Denis Oliver Kropp , + Andreas Hundt , + Sven Neumann , + Ville Syrjälä and + Claudio Ciccani . + + 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 2 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. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +#include "default_font.h" + +#define DEFAULT_FONT_HEIGHT 24 +#define DEFAULT_FONT_ASCENDER 16 +#define DEFAULT_FONT_DESCENDER -4 + + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ); + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ); + +#include + +DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, Default ) + + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ) +{ + /* default font is created with a NULL filename */ + if (ctx->filename) + return DFB_UNSUPPORTED; + + return DFB_OK; +} + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ) +{ + DFBResult ret; + CoreFont *font; + CoreSurface *surface; + CoreFontCacheRow *row; + u8 *pixels; + int i; + + CoreSurfaceConfig config; + + D_DEBUG( "DirectFB/FontDefault: Construct default font"); + + if (desc->flags & DFDESC_ROTATION) { + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_UNSUPPORTED; + } + + ret = dfb_font_create( core, desc, "", &font ); + if (ret) { + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return ret; + } + + D_ASSERT( font->pixel_format == DSPF_ARGB || + font->pixel_format == DSPF_AiRGB || + font->pixel_format == DSPF_ARGB4444 || + font->pixel_format == DSPF_RGBA4444 || + font->pixel_format == DSPF_ARGB2554 || + font->pixel_format == DSPF_ARGB1555 || + font->pixel_format == DSPF_A8 || + font->pixel_format == DSPF_A4 || + font->pixel_format == DSPF_A1 ); + + font->height = DEFAULT_FONT_HEIGHT; + font->ascender = DEFAULT_FONT_ASCENDER; + font->descender = DEFAULT_FONT_DESCENDER; + font->up_unit_x = 0.0; + font->up_unit_y = -1.0; + + row = D_CALLOC( 1, sizeof(CoreFontCacheRow) ); + if (!row) { + D_OOM(); + dfb_font_destroy( font ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_NOSYSTEMMEMORY; + } + + config.flags = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_CAPS; + config.size.w = font_desc.width; + config.size.h = font_desc.height; + config.format = font->pixel_format; + config.caps = font->surface_caps; + + ret = dfb_surface_create( core, &config, CSTF_FONT, 0, NULL, &surface ); + if (ret) { + dfb_font_destroy( font ); + return ret; + } + + font->num_rows = 1; + font->row_width = font_desc.width; + font->rows = D_MALLOC(sizeof (void *)); + font->rows[0] = row; + + row->surface = surface; + + D_MAGIC_SET( row, CoreFontCacheRow ); + + pixels = font_data; + + { + CoreGlyphData *data; + int use_unicode; + int start = 0; + int index = 0; + int key; + const char *glyphs = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "01234567890!\"$%&/()=?^<>" // FIXME: '0' is repeated! + "|,;.:-_{[]}\\`+*~#'"; + + if (desc && (desc->flags & DFDESC_ATTRIBUTES) && + (desc->attributes & DFFA_NOCHARMAP)) + use_unicode = 0; + else + use_unicode = 1; + + for (i = 0; i < font_desc.width; i++) { + if (pixels[i] == 0xFF) { + if (use_unicode) + key = glyphs[index]; + else + key = index; + + if (!direct_hash_lookup( font->layers[0].glyph_hash, key )) { + data = D_CALLOC( 1, sizeof(CoreGlyphData) ); + data->surface = surface; + data->start = start; + data->width = i - start + 1; + data->height = font_desc.height - 1; + data->left = 0; + data->top = 0; + data->xadvance = ((desc && (desc->flags & + DFDESC_FIXEDADVANCE)) ? + desc->fixed_advance : + data->width + 1); + data->yadvance = 0; + + D_DEBUG( "DirectFB/core/fonts: " + "glyph '%c' at %d, width %d\n", + glyphs[index], start, i-start ); + + D_MAGIC_SET( data, CoreGlyphData ); + + if (font->maxadvance < data->xadvance) + font->maxadvance = data->xadvance; + + direct_hash_insert( font->layers[0].glyph_hash, key, data ); + } + + start = i + 1; + index++; + } + if (glyphs[index] == '\0') + break; + } + + /* space */ + data = D_CALLOC( 1, sizeof(CoreGlyphData) ); + data->xadvance = 5; + data->yadvance = 0; + + D_MAGIC_SET( data, CoreGlyphData ); + + if (use_unicode) + key = 32; + else + key = index; + + direct_hash_insert( font->layers[0].glyph_hash, key, data ); + } + + { + CoreSurfaceBufferLock lock; + + ret = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAID_CPU, CSAF_WRITE, &lock ); + if (ret) { + D_DERROR( ret, "IDirectFBFont_Default: Could not lock surface buffer!\n" ); + } + else { + for (i = 1; i < font_desc.height; i++) { + int i, j, n; + u8 *dst8 = lock.addr; + u16 *dst16 = lock.addr; + u32 *dst32 = lock.addr; + + pixels += font_desc.preallocated[0].pitch; + switch (surface->config.format) { + case DSPF_ARGB: + if (surface->config.caps & DSCAPS_PREMULTIPLIED) { + for (i=0; iconfig.caps & DSCAPS_PREMULTIPLIED) { + for (i=0; i> 4) * 0x1111; + } + else { + if( surface->config.format == DSPF_ARGB4444 ) { + for (i=0; i> 4) | 0xFFF0; + } + } + break; + case DSPF_ARGB2554: + for (i=0; i> 4); + break; + case DSPF_A1: + for (i=0, j=0; i < font_desc.width; ++j) { + register u8 p = 0; + + for (n=0; n<8 && i> n; + + dst8[j] = p; + } + break; + case DSPF_LUT2: + for (i=0, j=0; i < font_desc.width; ++j) { + register u8 p = 0; + + for (n=0; n<8 && i> n; + + dst8[j] = p; + } + break; + default: + D_UNIMPLEMENTED(); + break; + } + + lock.addr += lock.pitch; + } + + dfb_surface_unlock_buffer( surface, &lock ); + } + } + + return IDirectFBFont_Construct (thiz, font); +} diff --git a/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_dgiff.c b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_dgiff.c new file mode 100755 index 0000000..5e1977c --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_dgiff.c @@ -0,0 +1,364 @@ +/* + (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org) + (c) Copyright 2000-2004 Convergence (integrated media) GmbH + + All rights reserved. + + Written by Denis Oliver Kropp , + Andreas Hundt , + Sven Neumann , + Ville Syrjälä and + Claudio Ciccani . + + 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 2 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. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +#include +#include +#include +#include + +#include + +/**********************************************************************************************************************/ + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ); + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ); + +/**********************************************************************************************************************/ + +#include + +DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, DGIFF ) + +/**********************************************************************************************************************/ + +typedef struct { + void *map; /* Memory map of the file. */ + int size; /* Size of the memory map. */ +} DGIFFImplData; + +/**********************************************************************************************************************/ + +static void +IDirectFBFont_DGIFF_Destruct( IDirectFBFont *thiz ) +{ + IDirectFBFont_data *data = thiz->priv; + CoreFont *font = data->font; + DGIFFImplData *impl = font->impl_data; + + munmap( impl->map, impl->size ); + + D_FREE( impl ); + + IDirectFBFont_Destruct( thiz ); +} + + +static DirectResult +IDirectFBFont_DGIFF_Release( IDirectFBFont *thiz ) +{ + DIRECT_INTERFACE_GET_DATA(IDirectFBFont) + + if (--data->ref == 0) { + IDirectFBFont_DGIFF_Destruct( thiz ); + } + + return DFB_OK; +} + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ) +{ + DFBResult ret = DFB_OK; + int fd; + DGIFFHeader header; + + if (!ctx->filename) + return DFB_UNSUPPORTED; + + /* Open the file. */ + fd = open( ctx->filename, O_RDONLY ); + if (fd < 0) { + ret = errno2result( errno ); + D_PERROR( "Font/DGIFF: Failure during open() of '%s'!\n", ctx->filename ); + goto out; + } + + /* Read the header. */ + if (read( fd, &header, sizeof(header) ) != sizeof(header)) { + ret = errno2result( errno ); + D_PERROR( "Font/DGIFF: Failure reading %zu bytes from '%s'!\n", sizeof(header), ctx->filename ); + goto out; + } + + /* Check the magic. */ + if (strncmp( (char*) header.magic, "DGIFF", 5 )) + ret = DFB_UNSUPPORTED; + +out: + if (fd >= 0) + close( fd ); + + return ret; +} + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ) +{ + DFBResult ret; + int i; + int fd; + struct stat stat; + void *ptr = MAP_FAILED; + CoreFont *font = NULL; + DGIFFHeader *header; + DGIFFFaceHeader *face; + DGIFFGlyphInfo *glyphs; + DGIFFGlyphRow *row; + DGIFFImplData *data; + char *filename; + CoreSurfaceConfig config; + +// if (desc->flags & (DFDESC_WIDTH | DFDESC_ATTRIBUTES | DFDESC_FIXEDADVANCE)) + // return DFB_UNSUPPORTED; + /* use the filename for backwards compatibility */ + filename = ctx->filename; + + if (desc->flags & DFDESC_ROTATION) + return DFB_UNSUPPORTED; + + /* Open the file. */ + fd = open( filename, O_RDONLY ); + if (fd < 0) { + ret = errno2result( errno ); + D_PERROR( "Font/DGIFF: Failure during open() of '%s'!\n", filename ); + return ret; + } + + /* Query file size etc. */ + if (fstat( fd, &stat ) < 0) { + ret = errno2result( errno ); + D_PERROR( "Font/DGIFF: Failure during fstat() of '%s'!\n", filename ); + goto error; + } + + /* Memory map the file. */ + ptr = mmap( NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0 ); + if (ptr == MAP_FAILED) { + ret = errno2result( errno ); + D_PERROR( "Font/DGIFF: Failure during mmap() of '%s'!\n", filename ); + goto error; + } + + /* Keep entry pointers for main header and face. */ + header = ptr; + face = ptr + sizeof(DGIFFHeader); + + /* Lookup requested face, otherwise use first if nothing requested or show error if not found. */ + if (desc->flags & DFDESC_HEIGHT) { + for (i=0; inum_faces; i++) { + if (face->size == desc->height) + break; + + face = ((void*) face) + face->next_face; + } + + if (i == header->num_faces) { + ret = DFB_UNSUPPORTED; + D_ERROR( "Font/DGIFF: Requested size %d not found in '%s'!\n", desc->height, filename ); + goto error; + } + } + + glyphs = (void*)(face + 1); + row = (void*)(glyphs + face->num_glyphs); + + /* Create the core object. */ + ret = dfb_font_create( core, desc, filename, &font ); + if (ret) + goto error; + + /* Fill font information. */ + font->ascender = face->ascender; + font->descender = face->descender; + font->height = face->height; + font->up_unit_x = 0.0; + font->up_unit_y = -1.0; + + font->maxadvance = face->max_advance; + font->pixel_format = face->pixelformat; + font->surface_caps = DSCAPS_NONE; + + font->num_rows = face->num_rows; + + if (face->blittingflags) + font->blittingflags = face->blittingflags; + + /* Allocate array for glyph cache rows. */ + font->rows = D_CALLOC( face->num_rows, sizeof(void*) ); + if (!font->rows) { + ret = D_OOM(); + goto error; + } + + /* Build glyph cache rows. */ + + config.flags = CSCONF_SIZE | CSCONF_FORMAT | CSCONF_PREALLOCATED; + config.format = face->pixelformat; + config.preallocated[1].addr = NULL; + config.preallocated[1].pitch = 0; + + for (i=0; inum_rows; i++) { + font->rows[i] = D_CALLOC( 1, sizeof(CoreFontCacheRow) ); + if (!font->rows[i]) { + ret = D_OOM(); + goto error; + } + + config.size.w = row->width; + config.size.h = row->height; + config.preallocated[0].addr = (void*)(row+1); + config.preallocated[0].pitch = row->pitch; + + ret = dfb_surface_create( core, &config, CSTF_PREALLOCATED, 0, NULL, + &font->rows[i]->surface ); + + if (ret) { + D_DERROR( ret, "DGIFF/Font: Could not create preallocated %s %dx%d glyph row surface!\n", + dfb_pixelformat_name(face->pixelformat), row->width, row->height ); + goto error; + } + + D_MAGIC_SET( font->rows[i], CoreFontCacheRow ); + + /* Jump to next row. */ + row = (void*)(row + 1) + row->pitch * row->height; + } + + /* Build glyph infos. */ + for (i=0; inum_glyphs; i++) { + CoreGlyphData *data; + DGIFFGlyphInfo *glyph = &glyphs[i]; + + data = D_CALLOC( 1, sizeof(CoreGlyphData) ); + if (!data) { + ret = D_OOM(); + goto error; + } + + data->surface = font->rows[glyph->row]->surface; + + data->start = glyph->offset; + data->width = glyph->width; + data->height = glyph->height; + data->left = glyph->left; + data->top = glyph->top; + data->xadvance = glyph->advance; + data->yadvance = 0; + + D_MAGIC_SET( data, CoreGlyphData ); + + direct_hash_insert( font->layers[0].glyph_hash, glyph->unicode, data ); + + if (glyph->unicode < 128) + font->layers[0].glyph_data[glyph->unicode] = data; + } + + + data = D_CALLOC( 1, sizeof(DGIFFImplData) ); + if (!data) { + ret = D_OOM(); + goto error; + } + + data->map = ptr; + data->size = stat.st_size; + + font->impl_data = data; + + /* Already close, we still have the map. */ + close( fd ); + + ret = IDirectFBFont_Construct( thiz, font ); + D_ASSERT( ret == DFB_OK ); + + thiz->Release = IDirectFBFont_DGIFF_Release; + + return DFB_OK; + + +error: + if (font) { + if (font->rows) { + for (i=0; inum_rows; i++) { + if (font->rows[i]) { + if (font->rows[i]->surface) + dfb_surface_unref( font->rows[i]->surface ); + + D_FREE( font->rows[i] ); + } + } + + D_FREE( font->rows ); + + font->rows = NULL; + } + + dfb_font_destroy( font ); + } + + if (ptr != MAP_FAILED) + munmap( ptr, stat.st_size ); + + close( fd ); + + DIRECT_DEALLOCATE_INTERFACE( thiz ); + + return ret; +} + diff --git a/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_ft2.c b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_ft2.c new file mode 100755 index 0000000..b5dc666 --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_ft2.c @@ -0,0 +1,949 @@ +/* + (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org) + (c) Copyright 2000-2004 Convergence (integrated media) GmbH + + All rights reserved. + + Written by Denis Oliver Kropp , + Andreas Hundt , + Sven Neumann , + Ville Syrjälä and + Claudio Ciccani . + + 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 2 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. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#undef SIZEOF_LONG +#include +#include FT_GLYPH_H + +#ifndef FT_LOAD_TARGET_MONO + /* FT_LOAD_TARGET_MONO was added in FreeType-2.1.3, we have to use (less good) + FT_LOAD_MONOCHROME with older versions. Make it an alias for code simplicity. */ + #define FT_LOAD_TARGET_MONO FT_LOAD_MONOCHROME +#endif + + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ); + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ); + +#include + +DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, FT2 ) + +static FT_Library library = NULL; +static int library_ref_count = 0; +static pthread_mutex_t library_mutex = PTHREAD_MUTEX_INITIALIZER; + +#define KERNING_CACHE_MIN 0 +#define KERNING_CACHE_MAX 127 +#define KERNING_CACHE_SIZE (KERNING_CACHE_MAX - KERNING_CACHE_MIN + 1) + +#define KERNING_DO_CACHE(a,b) ((a) >= KERNING_CACHE_MIN && \ + (a) <= KERNING_CACHE_MAX && \ + (b) >= KERNING_CACHE_MIN && \ + (b) <= KERNING_CACHE_MAX) + +#define KERNING_CACHE_ENTRY(a,b) \ + (data->kerning[(a)-KERNING_CACHE_MIN][(b)-KERNING_CACHE_MIN]) + +#define CHAR_INDEX(c) (((c) < 256) ? data->indices[c] : FT_Get_Char_Index( data->face, c )) + +typedef struct { + FT_Face face; + int disable_charmap; + int fixed_advance; + bool fixed_clip; + unsigned int indices[256]; +} FT2ImplData; + +typedef struct { + signed char x; + signed char y; +} KerningCacheEntry; + +typedef struct { + FT2ImplData base; + + KerningCacheEntry kerning[KERNING_CACHE_SIZE][KERNING_CACHE_SIZE]; +} FT2ImplKerningData; + +/**********************************************************************************************************************/ + +static DFBResult +ft2UTF8GetCharacterIndex( CoreFont *thiz, + unsigned int character, + unsigned int *ret_index ) +{ + FT2ImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + + if (data->disable_charmap) + *ret_index = character; + else { + pthread_mutex_lock ( &library_mutex ); + + *ret_index = CHAR_INDEX( character ); + + pthread_mutex_unlock ( &library_mutex ); + } + + return DFB_OK; +} + +static DFBResult +ft2UTF8DecodeText( CoreFont *thiz, + const void *text, + int length, + unsigned int *ret_indices, + int *ret_num ) +{ + int pos = 0, num = 0; + const u8 *bytes = text; + FT2ImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + D_ASSERT( text != NULL ); + D_ASSERT( length >= 0 ); + D_ASSERT( ret_indices != NULL ); + D_ASSERT( ret_num != NULL ); + + pthread_mutex_lock ( &library_mutex ); + + while (pos < length) { + unsigned int c; + + if (bytes[pos] < 128) + c = bytes[pos++]; + else { + c = DIRECT_UTF8_GET_CHAR( &bytes[pos] ); + pos += DIRECT_UTF8_SKIP(bytes[pos]); + } + + if (data->disable_charmap) + ret_indices[num++] = c; + else + ret_indices[num++] = CHAR_INDEX( c ); + } + + pthread_mutex_unlock ( &library_mutex ); + + *ret_num = num; + + return DFB_OK; +} + +static const CoreFontEncodingFuncs ft2UTF8Funcs = { + .GetCharacterIndex = ft2UTF8GetCharacterIndex, + .DecodeText = ft2UTF8DecodeText, +}; + +/**********************************************************************************************************************/ + +static DFBResult +ft2Latin1GetCharacterIndex( CoreFont *thiz, + unsigned int character, + unsigned int *ret_index ) +{ + FT2ImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + + if (data->disable_charmap) + *ret_index = character; + else + *ret_index = data->indices[character]; + + return DFB_OK; +} + +static DFBResult +ft2Latin1DecodeText( CoreFont *thiz, + const void *text, + int length, + unsigned int *ret_indices, + int *ret_num ) +{ + int i; + const u8 *bytes = text; + FT2ImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + D_ASSERT( text != NULL ); + D_ASSERT( length >= 0 ); + D_ASSERT( ret_indices != NULL ); + D_ASSERT( ret_num != NULL ); + + if (data->disable_charmap) { + for (i=0; iindices[bytes[i]]; + } + + *ret_num = length; + + return DFB_OK; +} + +static const CoreFontEncodingFuncs ft2Latin1Funcs = { + .GetCharacterIndex = ft2Latin1GetCharacterIndex, + .DecodeText = ft2Latin1DecodeText, +}; + +/**********************************************************************************************************************/ + +static DFBResult +render_glyph( CoreFont *thiz, + unsigned int index, + CoreGlyphData *info ) +{ + FT_Error err; + FT_Face face; + FT_Int load_flags; + u8 *src; + int y; + FT2ImplData *data = thiz->impl_data; + CoreSurface *surface = info->surface; + CoreSurfaceBufferLock lock; + + pthread_mutex_lock ( &library_mutex ); + + face = data->face; + + load_flags = (unsigned long) face->generic.data; + load_flags |= FT_LOAD_RENDER; + + if ((err = FT_Load_Glyph( face, index, load_flags ))) { + D_DEBUG( "DirectFB/FontFT2: Could not render glyph for character index #%d!\n", index ); + pthread_mutex_unlock ( &library_mutex ); + return DFB_FAILURE; + } + + pthread_mutex_unlock ( &library_mutex ); + + err = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAID_CPU, CSAF_WRITE, &lock ); + if (err) { + D_DERROR( err, "DirectFB/FontFT2: Unable to lock surface!\n" ); + return err; + } + + info->width = face->glyph->bitmap.width; + if (info->width + info->start > surface->config.size.w) + info->width = surface->config.size.w - info->start; + + info->height = face->glyph->bitmap.rows; + if (info->height > surface->config.size.h) + info->height = surface->config.size.h; + + /* bitmap_left and bitmap_top are relative to the glyph's origin on the + baseline. info->left and info->top are relative to the top-left of the + character cell. */ + info->left = face->glyph->bitmap_left - thiz->ascender*thiz->up_unit_x; + info->top = - face->glyph->bitmap_top - thiz->ascender*thiz->up_unit_y; + + if (data->fixed_clip) { + while (info->left + info->width > data->fixed_advance) + info->left--; + + if (info->left < 0) + info->left = 0; + + if (info->width > data->fixed_advance) + info->width = data->fixed_advance; + } + + src = face->glyph->bitmap.buffer; + lock.addr += DFB_BYTES_PER_LINE(surface->config.format, info->start); + + for (y=0; y < info->height; y++) { + int i, j, n; + u8 *dst8 = lock.addr; + u16 *dst16 = lock.addr; + u32 *dst32 = lock.addr; + + switch (face->glyph->bitmap.pixel_mode) { + case ft_pixel_mode_grays: + switch (surface->config.format) { + case DSPF_ARGB: + if (thiz->surface_caps & DSCAPS_PREMULTIPLIED) { + for (i=0; iwidth; i++) + dst32[i] = src[i] * 0x01010101; + } + else + for (i=0; iwidth; i++) + dst32[i] = (src[i] << 24) | 0xFFFFFF; + break; + case DSPF_AiRGB: + for (i=0; iwidth; i++) + dst32[i] = ((src[i] ^ 0xFF) << 24) | 0xFFFFFF; + break; + case DSPF_ARGB4444: + case DSPF_RGBA4444: + if (thiz->surface_caps & DSCAPS_PREMULTIPLIED) { + for (i=0; iwidth; i++) + dst16[i] = (src[i] >> 4) * 0x1111; + } + else { + if( surface->config.format == DSPF_ARGB4444 ) { + for (i=0; iwidth; i++) + dst16[i] = (src[i] << 8) | 0x0FFF; + } else { + for (i=0; iwidth; i++) + dst16[i] = (src[i] >> 4) | 0xFFF0; + } + } + break; + case DSPF_ARGB2554: + for (i=0; iwidth; i++) + dst16[i] = (src[i] << 8) | 0x3FFF; + break; + case DSPF_ARGB1555: + for (i=0; iwidth; i++) + dst16[i] = (src[i] << 8) | 0x7FFF; + break; + case DSPF_A8: + direct_memcpy( lock.addr, src, info->width ); + break; + case DSPF_A4: + for (i=0, j=0; iwidth; i+=2, j++) + dst8[j] = (src[i] & 0xF0) | (src[i+1] >> 4); + break; + case DSPF_A1: + for (i=0, j=0; i < info->width; ++j) { + register u8 p = 0; + + for (n=0; n<8 && iwidth; ++i, ++n) + p |= (src[i] & 0x80) >> n; + + dst8[j] = p; + } + break; + case DSPF_LUT2: + for (i=0, j=0; i < info->width; ++j) { + register u8 p = 0; + + for (n=0; n<8 && iwidth; ++i, n+=2) + p |= (src[i] & 0xC0) >> n; + + dst8[j] = p; + } + break; + default: + D_UNIMPLEMENTED(); + break; + } + break; + + case ft_pixel_mode_mono: + switch (surface->config.format) { + case DSPF_ARGB: + for (i=0; iwidth; i++) + dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0xFF : 0x00) << 24) | 0xFFFFFF; + break; + case DSPF_AiRGB: + for (i=0; iwidth; i++) + dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0x00 : 0xFF) << 24) | 0xFFFFFF; + break; + case DSPF_ARGB4444: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0xF : 0x0) << 12) | 0xFFF; + break; + case DSPF_RGBA4444: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0xF : 0x0) ) | 0xFFF0; + break; + case DSPF_ARGB2554: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0x3 : 0x0) << 14) | 0x3FFF; + break; + case DSPF_ARGB1555: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0x1 : 0x0) << 15) | 0x7FFF; + break; + case DSPF_A8: + for (i=0; iwidth; i++) + dst8[i] = (src[i>>3] & + (1<<(7-(i%8)))) ? 0xFF : 0x00; + break; + case DSPF_A4: + for (i=0, j=0; iwidth; i+=2, j++) + dst8[j] = ((src[i>>3] & + (1<<(7-(i%8)))) ? 0xF0 : 0x00) | + ((src[(i+1)>>3] & + (1<<(7-((i+1)%8)))) ? 0x0F : 0x00); + break; + case DSPF_A1: + direct_memcpy( lock.addr, src, DFB_BYTES_PER_LINE(DSPF_A1, info->width) ); + break; + default: + D_UNIMPLEMENTED(); + break; + } + break; + + default: + break; + + } + + src += face->glyph->bitmap.pitch; + + lock.addr += lock.pitch; + } + + dfb_surface_unlock_buffer( surface, &lock ); + + return DFB_OK; +} + + +static DFBResult +get_glyph_info( CoreFont *thiz, + unsigned int index, + CoreGlyphData *info ) +{ + FT_Error err; + FT_Face face; + FT_Int load_flags; + FT2ImplData *data = (FT2ImplData*) thiz->impl_data; + + pthread_mutex_lock ( &library_mutex ); + + face = data->face; + + load_flags = (unsigned long) face->generic.data; + + if ((err = FT_Load_Glyph( face, index, load_flags ))) { + D_DEBUG( "DirectFB/FontFT2: Could not load glyph for character index #%d!\n", index ); + + pthread_mutex_unlock ( &library_mutex ); + + return DFB_FAILURE; + } + + if (face->glyph->format != ft_glyph_format_bitmap) { + err = FT_Render_Glyph( face->glyph, + (load_flags & FT_LOAD_TARGET_MONO) ? ft_render_mode_mono : ft_render_mode_normal ); + if (err) { + D_ERROR( "DirectFB/FontFT2: Could not render glyph for character index #%d!\n", index ); + + pthread_mutex_unlock ( &library_mutex ); + + return DFB_FAILURE; + } + } + + pthread_mutex_unlock ( &library_mutex ); + + info->width = face->glyph->bitmap.width; + info->height = face->glyph->bitmap.rows; + + if (data->fixed_advance) { + info->xadvance = - data->fixed_advance * thiz->up_unit_y; + info->yadvance = data->fixed_advance * thiz->up_unit_x; + } + else { + info->xadvance = face->glyph->advance.x >> 6; + info->yadvance = - face->glyph->advance.y >> 6; + } + + if (data->fixed_clip && info->width > data->fixed_advance) + info->width = data->fixed_advance; + + return DFB_OK; +} + + +static DFBResult +get_kerning( CoreFont *thiz, + unsigned int prev, + unsigned int current, + int *kern_x, + int *kern_y) +{ + FT_Vector vector; + + FT2ImplKerningData *data = thiz->impl_data; + KerningCacheEntry *cache = NULL; + + D_ASSUME( (kern_x != NULL) || (kern_y != NULL) ); + + /* + * Use cached values if characters are in the + * cachable range and the cache entry is already filled. + */ + if (KERNING_DO_CACHE (prev, current)) { + cache = &KERNING_CACHE_ENTRY (prev, current); + + if (kern_x) + *kern_x = (int) cache->x; + + if (kern_y) + *kern_y = (int) cache->y; + + return DFB_OK; + } + + pthread_mutex_lock ( &library_mutex ); + + /* Lookup kerning values for the character pair. */ + /* The vector returned by FreeType does not allow for any rotation. */ + FT_Get_Kerning( data->base.face, + prev, current, ft_kerning_default, &vector ); + + pthread_mutex_unlock ( &library_mutex ); + + /* Convert to integer. */ + if (kern_x) + *kern_x = (int)(- vector.x*thiz->up_unit_y + vector.y*thiz->up_unit_x) >> 6; + + if (kern_y) + *kern_y = (int)( vector.y*thiz->up_unit_y + vector.x*thiz->up_unit_x) >> 6; + + return DFB_OK; +} + +static void +init_kerning_cache( FT2ImplKerningData *data, float up_unit_x, float up_unit_y ) +{ + int a, b; + + pthread_mutex_lock ( &library_mutex ); + + for (a=KERNING_CACHE_MIN; a<=KERNING_CACHE_MAX; a++) { + for (b=KERNING_CACHE_MIN; b<=KERNING_CACHE_MAX; b++) { + FT_Vector vector; + KerningCacheEntry *cache = &KERNING_CACHE_ENTRY( a, b ); + + /* Lookup kerning values for the character pair. */ + FT_Get_Kerning( data->base.face, + a, b, ft_kerning_default, &vector ); + + cache->x = (signed char) ((int)(- vector.x*up_unit_y + vector.y*up_unit_x) >> 6); + cache->y = (signed char) ((int)( vector.y*up_unit_y + vector.x*up_unit_x) >> 6); + } + } + + pthread_mutex_unlock ( &library_mutex ); +} + +static DFBResult +init_freetype( void ) +{ + FT_Error err; + + pthread_mutex_lock ( &library_mutex ); + + if (!library) { + D_DEBUG( "DirectFB/FontFT2: Initializing the FreeType2 library.\n" ); + err = FT_Init_FreeType( &library ); + if (err) { + D_ERROR( "DirectFB/FontFT2: " + "Initialization of the FreeType2 library failed!\n" ); + library = NULL; + pthread_mutex_unlock( &library_mutex ); + return DFB_FAILURE; + } + } + + library_ref_count++; + pthread_mutex_unlock( &library_mutex ); + + return DFB_OK; +} + + +static void +release_freetype( void ) +{ + pthread_mutex_lock( &library_mutex ); + + if (library && --library_ref_count == 0) { + D_DEBUG( "DirectFB/FontFT2: Releasing the FreeType2 library.\n" ); + FT_Done_FreeType( library ); + library = NULL; + } + + pthread_mutex_unlock( &library_mutex ); +} + + +static void +IDirectFBFont_FT2_Destruct( IDirectFBFont *thiz ) +{ + IDirectFBFont_data *data = (IDirectFBFont_data*)thiz->priv; + + if (data->font->impl_data) { + FT2ImplData *impl_data = (FT2ImplData*) data->font->impl_data; + + pthread_mutex_lock ( &library_mutex ); + FT_Done_Face( impl_data->face ); + pthread_mutex_unlock ( &library_mutex ); + + D_FREE( impl_data ); + + data->font->impl_data = NULL; + } + + IDirectFBFont_Destruct( thiz ); + + release_freetype(); +} + + +static DirectResult +IDirectFBFont_FT2_Release( IDirectFBFont *thiz ) +{ + DIRECT_INTERFACE_GET_DATA(IDirectFBFont) + + if (--data->ref == 0) { + IDirectFBFont_FT2_Destruct( thiz ); + } + + return DFB_OK; +} + + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ) +{ + FT_Error err; + FT_Face face; + + D_DEBUG( "DirectFB/FontFT2: Probe font `%s'.\n", ctx->filename ); + + if (!ctx->content) + return DFB_UNSUPPORTED; + + if (init_freetype() != DFB_OK) { + return DFB_FAILURE; + } + + pthread_mutex_lock ( &library_mutex ); + + /* + * This should be + * err = FT_New...Face( library, ctx->filename, -1, NULL ); + * but due to freetype bugs it doesn't work. + */ + err = FT_New_Memory_Face( library, ctx->content, ctx->content_size, 0, &face ); + if (!err) + FT_Done_Face( face ); + pthread_mutex_unlock ( &library_mutex ); + + release_freetype(); + + return err ? DFB_UNSUPPORTED : DFB_OK; +} + + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ) +{ + int i; + DFBResult ret; + CoreFont *font; + FT_Face face; + FT_Error err; + FT_Int load_flags = FT_LOAD_DEFAULT; + FT2ImplData *data; + bool disable_charmap = false; + bool disable_kerning = false; + bool load_mono = false; + u32 mask = 0; + unsigned int size = 0, size_read = 0; + char *filename = ctx->filename; /* intended for printf only */ + + float sin_rot = 0.0; + float cos_rot = 1.0; + + D_DEBUG( "DirectFB/FontFT2: " + "Construct font from file `%s' (index %d) at pixel size %d x %d and rotation %d.\n", + filename, + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + (desc->flags & DFDESC_WIDTH) ? desc->width : 0, + (desc->flags & DFDESC_HEIGHT) ? desc->height : 0, + (desc->flags & DFDESC_ROTATION) ? desc->rotation : 0 ); + + if (init_freetype() != DFB_OK) { + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + pthread_mutex_lock ( &library_mutex ); + err = FT_New_Memory_Face( library, ctx->content, ctx->content_size, + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + &face ); + pthread_mutex_unlock ( &library_mutex ); + if (err) { + switch (err) { + case FT_Err_Unknown_File_Format: + D_ERROR( "DirectFB/FontFT2: " + "Unsupported font format in file `%s'!\n", filename ); + break; + default: + D_ERROR( "DirectFB/FontFT2: " + "Failed loading face %d from font file `%s'!\n", + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + filename ); + break; + } + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + if ((desc->flags & DFDESC_ROTATION) && desc->rotation) { + if (!FT_IS_SCALABLE(face)) { + D_ERROR( "DirectFB/FontFT2: " + "Face %d from font file `%s' is not scalable so cannot be rotated\n", + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + filename ); + pthread_mutex_lock ( &library_mutex ); + FT_Done_Face( face ); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_UNSUPPORTED; + } + + float rot_radians = 2.0 * M_PI * desc->rotation / (1<<24); + sin_rot = sin(rot_radians); + cos_rot = cos(rot_radians); + + int sin_rot_fx = (int)(sin_rot*65536.0); + int cos_rot_fx = (int)(cos_rot*65536.0); + FT_Matrix matrix; + matrix.xx = cos_rot_fx; + matrix.xy = -sin_rot_fx; + matrix.yx = sin_rot_fx; + matrix.yy = cos_rot_fx; + + pthread_mutex_lock ( &library_mutex ); + FT_Set_Transform( face, &matrix, NULL ); + /* FreeType docs suggest FT_Set_Transform returns an error code, but it seems + that this is not the case. */ + pthread_mutex_unlock ( &library_mutex ); + } + + if (dfb_config->font_format == DSPF_A1 || dfb_config->font_format == DSPF_ARGB1555) + load_mono = true; + + if (desc->flags & DFDESC_ATTRIBUTES) { + if (desc->attributes & DFFA_NOHINTING) + load_flags |= FT_LOAD_NO_HINTING; + if (desc->attributes & DFFA_NOBITMAP) + load_flags |= FT_LOAD_NO_BITMAP; + if (desc->attributes & DFFA_NOCHARMAP) + disable_charmap = true; + if (desc->attributes & DFFA_NOKERNING) + disable_kerning = true; + if (desc->attributes & DFFA_MONOCHROME) + load_mono = true; + } + + if (load_mono) + load_flags |= FT_LOAD_TARGET_MONO; + + if (!disable_charmap) { + pthread_mutex_lock ( &library_mutex ); + err = FT_Select_Charmap( face, ft_encoding_unicode ); + pthread_mutex_unlock ( &library_mutex ); + +#if FREETYPE_MINOR > 0 + + /* ft_encoding_latin_1 has been introduced in freetype-2.1 */ + if (err) { + D_DEBUG( "DirectFB/FontFT2: " + "Couldn't select Unicode encoding, " + "falling back to Latin1.\n"); + pthread_mutex_lock ( &library_mutex ); + err = FT_Select_Charmap( face, ft_encoding_latin_1 ); + pthread_mutex_unlock ( &library_mutex ); + } +#endif + if (err) { + D_DEBUG( "DirectFB/FontFT2: " + "Couldn't select Unicode/Latin1 encoding, " + "trying Symbol.\n"); + pthread_mutex_lock ( &library_mutex ); + err = FT_Select_Charmap( face, ft_encoding_symbol ); + pthread_mutex_unlock ( &library_mutex ); + + if (!err) + mask = 0xf000; + } + } + +#if 0 + if (err) { + D_ERROR( "DirectFB/FontFT2: " + "Couldn't select a suitable encoding for face %d from font file `%s'!\n", (desc->flags & DFDESC_INDEX) ? desc->index : 0, filename ); + pthread_mutex_lock ( &library_mutex ); + FT_Done_Face( face ); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } +#endif + + if (desc->flags & (DFDESC_HEIGHT | DFDESC_WIDTH | + DFDESC_FRACT_HEIGHT | DFDESC_FRACT_WIDTH)) + { + int fw = 0, fh = 0; + + if (desc->flags & DFDESC_FRACT_HEIGHT) + fh = desc->fract_height; + else if (desc->flags & DFDESC_HEIGHT) + fh = desc->height << 6; + + if (desc->flags & DFDESC_FRACT_WIDTH) + fw = desc->fract_width; + else if (desc->flags & DFDESC_WIDTH) + fw = desc->width << 6; + + pthread_mutex_lock ( &library_mutex ); + err = FT_Set_Char_Size( face, fw, fh, 0, 0 ); + pthread_mutex_unlock ( &library_mutex ); + if (err) { + D_ERROR( "DirectB/FontFT2: " + "Could not set pixel size to %d x %d!\n", + (desc->flags & DFDESC_WIDTH) ? desc->width : 0, + (desc->flags & DFDESC_HEIGHT) ? desc->height : 0 ); + pthread_mutex_lock ( &library_mutex ); + FT_Done_Face( face ); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + } + + face->generic.data = (void *)(unsigned long) load_flags; + face->generic.finalizer = NULL; + + ret = dfb_font_create( core, desc, filename, &font ); + if (ret) { + pthread_mutex_lock ( &library_mutex ); + FT_Done_Face( face ); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return ret; + } + + D_ASSERT( font->pixel_format == DSPF_ARGB || + font->pixel_format == DSPF_AiRGB || + font->pixel_format == DSPF_ARGB4444 || + font->pixel_format == DSPF_RGBA4444 || + font->pixel_format == DSPF_ARGB2554 || + font->pixel_format == DSPF_ARGB1555 || + font->pixel_format == DSPF_A8 || + font->pixel_format == DSPF_A4 || + font->pixel_format == DSPF_A1 ); + + font->ascender = face->size->metrics.ascender >> 6; + font->descender = face->size->metrics.descender >> 6; + font->height = font->ascender + ABS(font->descender) + 1; + font->maxadvance = face->size->metrics.max_advance >> 6; + + font->up_unit_x = -sin_rot; + font->up_unit_y = -cos_rot; + + D_DEBUG( "DirectFB/FontFT2: height = %d, ascender = %d, descender = %d, maxadvance = %d, up unit: %5.2f,%5.2f\n", + font->height, font->ascender, font->descender, font->maxadvance, font->up_unit_x, font->up_unit_y ); + + font->GetGlyphData = get_glyph_info; + font->RenderGlyph = render_glyph; + + if (FT_HAS_KERNING(face) && !disable_kerning) { + font->GetKerning = get_kerning; + data = D_CALLOC( 1, sizeof(FT2ImplKerningData) ); + } + else + data = D_CALLOC( 1, sizeof(FT2ImplData) ); + + data->face = face; + data->disable_charmap = disable_charmap; + + if (FT_HAS_KERNING(face) && !disable_kerning) + init_kerning_cache( (FT2ImplKerningData*) data, font->up_unit_x, font->up_unit_y); + + if (desc->flags & DFDESC_FIXEDADVANCE) { + data->fixed_advance = desc->fixed_advance; + font->maxadvance = desc->fixed_advance; + + if ((desc->flags & DFDESC_ATTRIBUTES) && (desc->attributes & DFFA_FIXEDCLIP)) + data->fixed_clip = true; + } + + for (i=0; i<256; i++) + data->indices[i] = FT_Get_Char_Index( face, i | mask ); + + font->impl_data = data; + + dfb_font_register_encoding( font, "UTF8", &ft2UTF8Funcs, DTEID_UTF8 ); + dfb_font_register_encoding( font, "Latin1", &ft2Latin1Funcs, DTEID_OTHER ); + + IDirectFBFont_Construct( thiz, font ); + + thiz->Release = IDirectFBFont_FT2_Release; + + return DFB_OK; +} diff --git a/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_lino.c b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_lino.c new file mode 100755 index 0000000..4d03e7f --- /dev/null +++ b/Source/DirectFB/interfaces/IDirectFBFont/idirectfbfont_lino.c @@ -0,0 +1,1324 @@ +/* + (c) Copyright 2001-2008 The world wide DirectFB Open Source Community (directfb.org) + (c) Copyright 2000-2004 Convergence (integrated media) GmbH + + All rights reserved. + + Written by Denis Oliver Kropp , + Andreas Hundt , + Sven Neumann , + Ville Syrjälä and + Claudio Ciccani . + + 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 2 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. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#undef SIZEOF_LONG +/* +#include +#include FT_GLYPH_H +*/ +/*#ifndef FT_LOAD_TARGET_MONO DZ*/ +/* FT_LOAD_TARGET_MONO was added in FreeType-2.1.3, we have to use (less good) + FT_LOAD_MONOCHROME with older versions. Make it an alias for code simplicity. */ +/* #define FT_LOAD_TARGET_MONO FT_LOAD_MONOCHROME +#endif +*/ +#include +#include + +#ifdef NOT_BIG_ENOUGH_FOR_GULIM_AC3 +#define THE_HEAP_SIZE 327680 +#else +// Increase the heap size to 1.5MB to avoid the missing character problem (running out of heap) +#define THE_HEAP_SIZE (1*1024*1024 + 512*1024) +#endif +static FS_BOOLEAN state_init = false; +static FS_STATE state_global; +static bool load_mono = false; + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ); + +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ); + +#include + +DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBFont, Lino ) + + +D_DEBUG_DOMAIN( Font_Itype, "Font/Itype", "Itype" ); + +/* +static FT_Library library = NULL; +*/ +static int library_ref_count = 0; +static pthread_mutex_t library_mutex = PTHREAD_MUTEX_INITIALIZER; + +#define KERNING_CACHE_MIN 0 +#define KERNING_CACHE_MAX 127 +#define KERNING_CACHE_SIZE (KERNING_CACHE_MAX - KERNING_CACHE_MIN + 1) + +#define KERNING_DO_CACHE(a,b) ((a) >= KERNING_CACHE_MIN && \ + (a) <= KERNING_CACHE_MAX && \ + (b) >= KERNING_CACHE_MIN && \ + (b) <= KERNING_CACHE_MAX) + +#define KERNING_CACHE_ENTRY(a,b) \ + (data->kerning[(a)-KERNING_CACHE_MIN][(b)-KERNING_CACHE_MIN]) +/* +#define CHAR_INDEX(c) (((c) < 256) ? data->indices[c] : FT_Get_Char_Index( data->face, c )) +*/ +#define CHAR_INDEX(c) (((c) < 256) ? data->indices[c] : FS_map_char( data->state, c )) + +typedef struct { + /*FT_Face face;*/ + FS_STATE *state; + int disable_charmap; + int fixed_advance; + bool fixed_clip; + unsigned int indices[256]; +} ITImplData; + +typedef struct { + signed char x; + signed char y; +} KerningCacheEntry; + +typedef struct { + ITImplData base; + + KerningCacheEntry kerning[KERNING_CACHE_SIZE][KERNING_CACHE_SIZE]; +} ITImplKerningData; + +/**********************************************************************************************************************/ + +static DFBResult +UTF8GetCharacterIndex( CoreFont *thiz, + unsigned int character, + unsigned int *ret_index ) +{ + ITImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + + if (data->disable_charmap) + *ret_index = character; + else { + pthread_mutex_lock ( &library_mutex ); + + *ret_index = CHAR_INDEX( character ); + + pthread_mutex_unlock ( &library_mutex ); + } + + return DFB_OK; +} + +static DFBResult +UTF8DecodeText( CoreFont *thiz, + const void *text, + int length, + unsigned int *ret_indices, + int *ret_num ) +{ + int pos = 0, num = 0; + const u8 *bytes = text; + ITImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + D_ASSERT( text != NULL ); + D_ASSERT( length >= 0 ); + D_ASSERT( ret_indices != NULL ); + D_ASSERT( ret_num != NULL ); + + pthread_mutex_lock ( &library_mutex ); + + while (pos < length) { + unsigned int c; + + if (bytes[pos] < 128) + c = bytes[pos++]; + else { + c = DIRECT_UTF8_GET_CHAR( &bytes[pos] ); + pos += DIRECT_UTF8_SKIP(bytes[pos]); + } + + if (data->disable_charmap) + ret_indices[num++] = c; + else + ret_indices[num++] = CHAR_INDEX( c ); + } + + pthread_mutex_unlock ( &library_mutex ); + + *ret_num = num; + + return DFB_OK; +} + +static const CoreFontEncodingFuncs UTF8Funcs = { + .GetCharacterIndex = UTF8GetCharacterIndex, + .DecodeText = UTF8DecodeText, +}; + +/**********************************************************************************************************************/ + +static DFBResult +UTF16GetCharacterIndex( CoreFont *thiz, + unsigned int character, + unsigned int *ret_index ) +{ + ITImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + + if (data->disable_charmap) + *ret_index = character; + else { + pthread_mutex_lock ( &library_mutex ); + + *ret_index = CHAR_INDEX( character ); + + pthread_mutex_unlock ( &library_mutex ); + } + + return DFB_OK; +} + +#define SURROGATE_VALUE(h,l) (((h) - 0xd800) * 0x400 + (l) - 0xdc00 + 0x10000) + +static DFBResult +UTF16DecodeText( CoreFont *thiz, + const void *text, + int length, + unsigned int *ret_indices, + int *ret_num ) +{ + int pos = 0, num = 0; + unsigned int high_surrogate = 0; + const u16 *shorts = text; + ITImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + D_ASSERT( text != NULL ); + D_ASSERT( length >= 0 ); + D_ASSERT( ret_indices != NULL ); + D_ASSERT( ret_num != NULL ); + + pthread_mutex_lock ( &library_mutex ); + + while (pos < length/2) { + unsigned int c = shorts[pos++]; + + if (c >= 0xdc00 && c < 0xe000) { /* low surrogate */ + c = SURROGATE_VALUE (high_surrogate, c); + high_surrogate = 0; + } + else if (c >= 0xd800 && c < 0xdc00) { /* high surrogate */ + high_surrogate = c; + continue; + } + + if (data->disable_charmap) + ret_indices[num++] = c; + else + ret_indices[num++] = CHAR_INDEX( c ); + } + + pthread_mutex_unlock ( &library_mutex ); + + *ret_num = num; + + return DFB_OK; +} + +static const CoreFontEncodingFuncs UTF16Funcs = { + .GetCharacterIndex = UTF16GetCharacterIndex, + .DecodeText = UTF16DecodeText, +}; + +/**********************************************************************************************************************/ + +static DFBResult +Latin1GetCharacterIndex( CoreFont *thiz, + unsigned int character, + unsigned int *ret_index ) +{ + ITImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + + if (data->disable_charmap) + *ret_index = character; + else + *ret_index = data->indices[character]; + + return DFB_OK; +} + +static DFBResult +Latin1DecodeText( CoreFont *thiz, + const void *text, + int length, + unsigned int *ret_indices, + int *ret_num ) +{ + int i; + const u8 *bytes = text; + ITImplData *data = thiz->impl_data; + + D_MAGIC_ASSERT( thiz, CoreFont ); + D_ASSERT( text != NULL ); + D_ASSERT( length >= 0 ); + D_ASSERT( ret_indices != NULL ); + D_ASSERT( ret_num != NULL ); + + if (data->disable_charmap) { + for (i=0; iindices[bytes[i]]; + } + + *ret_num = length; + + return DFB_OK; +} + +static const CoreFontEncodingFuncs Latin1Funcs = { + .GetCharacterIndex = Latin1GetCharacterIndex, + .DecodeText = Latin1DecodeText, +}; + +/**********************************************************************************************************************/ + +static DFBResult +render_glyph( CoreFont *thiz, + unsigned int index, + CoreGlyphData *info ) +{ + /* FT_Error err; + FT_Face face; + FT_Int load_flags;*/ + u8 *src; + int y; + FS_LONG err; + FS_LONG load_flags; + ITImplData *data = (ITImplData*) thiz->impl_data; + FS_GLYPHMAP *glyph_map; + + CoreSurface *surface = info->surface; + CoreSurfaceBufferLock lock; + + pthread_mutex_lock ( &library_mutex ); + + /* face = data->face; + + load_flags = (unsigned long) face->generic.data; + load_flags |= FT_LOAD_RENDER; + + if ((err = FT_Load_Glyph( face, index, load_flags ))) { + D_DEBUG( "DirectFB/FontFT2: Could not render glyph for character index #%d!\n", index ); + pthread_mutex_unlock ( &library_mutex ); + return DFB_FAILURE; + } + */ + + switch (info->layer) { + case 0: + err = FS_set_flags( data->state, FLAGS_NO_EFFECT ); + if (err) { + D_ERROR( "DirectFB/FontItype: Failed setting FLAGS_NO_EFFECT!\n" ); + + pthread_mutex_unlock ( &library_mutex ); + return DFB_FAILURE; + } + break; + + case 1: + err = FS_set_flags( data->state, FLAGS_OUTLINED_SOFT ); + if (err) { + D_ERROR( "DirectFB/FontItype: Failed setting FLAGS_OUTLINED_SOFT!\n" ); + + pthread_mutex_unlock ( &library_mutex ); + return DFB_FAILURE; + } + break; + + default: + return DFB_UNSUPPORTED; + } + + if (load_mono) + glyph_map = FS_get_glyphmap( data->state, index, FS_MAP_BITMAP ); + else + glyph_map = FS_get_glyphmap( data->state, index, FS_MAP_EDGE_GRAYMAP8 | FS_MAP_GRAYMAP8); + if (!glyph_map) { + /* glyph_map->err = FS_error(&state);*/ + D_DEBUG( "DirectFB/FontItype: Could not load glyph for character index #%d!\n", index ); + + pthread_mutex_unlock ( &library_mutex ); + + return DFB_FAILURE; + } + pthread_mutex_unlock ( &library_mutex ); + + err = dfb_surface_lock_buffer( surface, CSBR_BACK, CSAID_CPU, CSAF_WRITE, &lock ); + if (err) { + D_DERROR( err, "DirectFB/FontItype: Unable to lock surface!\n" ); + return err; + } + + info->width = glyph_map->width; + if (info->width + info->start > surface->config.size.w) + info->width = surface->config.size.w - info->start; + + info->height = glyph_map->height; + if (info->height > surface->config.size.h) + info->height = surface->config.size.h; + + /* bitmap_left and bitmap_top are relative to the glyph's origin on the + baseline. info->left and info->top are relative to the top-left of the + character cell. */ + info->left = glyph_map->lo_x - thiz->ascender*thiz->up_unit_x; + info->top = - glyph_map->hi_y - thiz->ascender*thiz->up_unit_y; + + if (data->fixed_clip) { + while (info->left + info->width > data->fixed_advance) + info->left--; + + if (info->left < 0) + info->left = 0; + + if (info->width > data->fixed_advance) + info->width = data->fixed_advance; + } + + /*src = face->glyph->bitmap.buffer;*/ + src = glyph_map->bits; + lock.addr += DFB_BYTES_PER_LINE(surface->config.format, info->start); + + for (y=0; y < info->height; y++) { + int i, j, n; + u8 *dst8 = lock.addr; + u16 *dst16 = lock.addr; + u32 *dst32 = lock.addr; + + /*switch (face->glyph->bitmap.pixel_mode) {*/ + switch (load_mono) { + /* case ft_pixel_mode_grays:*/ + case false: + switch (surface->config.format) { + case DSPF_ARGB: + if (thiz->surface_caps & DSCAPS_PREMULTIPLIED) { + for (i=0; iwidth; i++) + dst32[i] = src[i] * 0x01010101; + } + else + for (i=0; iwidth; i++) + dst32[i] = (src[i] << 24) | 0xFFFFFF; + break; + case DSPF_AiRGB: + for (i=0; iwidth; i++) + dst32[i] = ((src[i] ^ 0xFF) << 24) | 0xFFFFFF; + break; + case DSPF_ARGB4444: + if (thiz->surface_caps & DSCAPS_PREMULTIPLIED) { + for (i=0; iwidth; i++) + dst16[i] = (src[i] >> 4) * 0x1111; + } + else { + for (i=0; iwidth; i++) + dst16[i] = (src[i] << 8) | 0xFFF; + } + break; + case DSPF_ARGB2554: + for (i=0; iwidth; i++) + dst16[i] = (src[i] << 8) | 0x3FFF; + break; + case DSPF_ARGB1555: + for (i=0; iwidth; i++) + dst16[i] = (src[i] << 8) | 0x7FFF; + break; + case DSPF_A8: + direct_memcpy( lock.addr, src, info->width ); + break; + case DSPF_A4: + for (i=0, j=0; iwidth; i+=2, j++) + dst8[j] = (src[i] & 0xF0) | (src[i+1] >> 4); + break; + case DSPF_A1: + for (i=0, j=0; i < info->width; ++j) { + register u8 p = 0; + + for (n=0; n<8 && iwidth; ++i, ++n) + p |= (src[i] & 0x80) >> n; + + dst8[j] = p; + } + break; + case DSPF_LUT2: + for (i=0, j=0; i < info->width; ++j) { + register u8 p = 0; + + for (n=0; n<8 && iwidth; ++i, n+=2) + p |= (src[i] & 0xC0) >> n; + + dst8[j] = p; + } + break; + default: + D_UNIMPLEMENTED(); + break; + } + break; + + /* case ft_pixel_mode_mono: */ + case true: + switch (surface->config.format) { + case DSPF_ARGB: + for (i=0; iwidth; i++) + dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0xFF : 0x00) << 24) | 0xFFFFFF; + break; + case DSPF_AiRGB: + for (i=0; iwidth; i++) + dst32[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0x00 : 0xFF) << 24) | 0xFFFFFF; + break; + case DSPF_ARGB4444: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0xF : 0x0) << 12) | 0xFFF; + break; + case DSPF_ARGB2554: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0x3 : 0x0) << 14) | 0x3FFF; + break; + case DSPF_ARGB1555: + for (i=0; iwidth; i++) + dst16[i] = (((src[i>>3] & (1<<(7-(i%8)))) ? + 0x1 : 0x0) << 15) | 0x7FFF; + break; + case DSPF_A8: + for (i=0; iwidth; i++) + dst8[i] = (src[i>>3] & + (1<<(7-(i%8)))) ? 0xFF : 0x00; + break; + case DSPF_A4: + for (i=0, j=0; iwidth; i+=2, j++) + dst8[j] = ((src[i>>3] & + (1<<(7-(i%8)))) ? 0xF0 : 0x00) | + ((src[(i+1)>>3] & + (1<<(7-((i+1)%8)))) ? 0x0F : 0x00); + break; + case DSPF_A1: + direct_memcpy( lock.addr, src, DFB_BYTES_PER_LINE(DSPF_A1, info->width) ); + break; + default: + D_UNIMPLEMENTED(); + break; + } + break; + + default: + break; + + } + + /*src += face->glyph->bitmap.pitch; */ + src += glyph_map->bpl; + + lock.addr += lock.pitch; + } + + dfb_surface_unlock_buffer( surface, &lock ); + FS_free_char(data->state,glyph_map); + return DFB_OK; +} + + +static DFBResult +get_glyph_info( CoreFont *thiz, + unsigned int index, + CoreGlyphData *info ) +{ + FS_LONG err; + /* FT_Face face; + FT_Int load_flags;*/ + ITImplData *data = (ITImplData*) thiz->impl_data; + FS_GLYPHMAP *glyph_map; + + pthread_mutex_lock ( &library_mutex ); + + /* face = data->face; + + load_flags = (unsigned long) face->generic.data; + */ + + switch (info->layer) { + case 0: + err = FS_set_flags( data->state, FLAGS_NO_EFFECT ); + if (err) { + D_ERROR( "DirectFB/FontItype: Failed setting FLAGS_NO_EFFECT!\n" ); + + pthread_mutex_unlock ( &library_mutex ); + return DFB_FAILURE; + } + break; + + case 1: + err = FS_set_flags( data->state, FLAGS_OUTLINED_SOFT ); + if (err) { + D_ERROR( "DirectFB/FontItype: Failed setting FLAGS_OUTLINED_SOFT!\n" ); + + pthread_mutex_unlock ( &library_mutex ); + return DFB_FAILURE; + } + break; + + default: + return DFB_UNSUPPORTED; + } + + if (load_mono) + glyph_map = FS_get_glyphmap( data->state, index, FS_MAP_BITMAP ); + else + glyph_map = FS_get_glyphmap( data->state, index, FS_MAP_EDGE_GRAYMAP8 | FS_MAP_GRAYMAP8); + if (!glyph_map) { + /*glyph_map->err = FS_error(&state);*/ + D_DEBUG( "DirectFB/FontItype: Could not load glyph for character index #%d!\n", index ); + + pthread_mutex_unlock ( &library_mutex ); + + return DFB_FAILURE; + } + + /* if ((err = FT_Load_Glyph( face, index, load_flags ))) { + D_DEBUG( "DirectFB/FontFT2: Could not load glyph for character index #%d!\n", index ); + + pthread_mutex_unlock ( &library_mutex ); + + return DFB_FAILURE; + } + + if (face->glyph->format != ft_glyph_format_bitmap) { + err = FT_Render_Glyph( face->glyph, + (load_flags & FT_LOAD_TARGET_MONO) ? ft_render_mode_mono : ft_render_mode_normal ); + if (err) { + D_ERROR( "DirectFB/FontFT2: Could not render glyph for character index #%d!\n", index ); + + pthread_mutex_unlock ( &library_mutex ); + + return DFB_FAILURE; + } + } + */ + pthread_mutex_unlock ( &library_mutex ); + + info->width = glyph_map->width; + info->height = glyph_map->height; +// info->advance = data->fixed_advance ? +// data->fixed_advance : (glyph_map->dx >> 16); + if (data->fixed_advance) { + info->xadvance = - data->fixed_advance * thiz->up_unit_y; + info->yadvance = data->fixed_advance * thiz->up_unit_x; + } + else { + info->xadvance = glyph_map->dx >> 16; + info->yadvance = - glyph_map->dy >> 16; + } + + if (data->fixed_clip && info->width > data->fixed_advance) + info->width = data->fixed_advance; + FS_free_char(data->state,glyph_map); + return DFB_OK; +} + + +static DFBResult +get_kerning( CoreFont *thiz, + unsigned int prev, + unsigned int current, + int *kern_x, + int *kern_y) +{ + /* FT_Vector vector; + + FT2ImplKerningData *data = thiz->impl_data; + KerningCacheEntry *cache = NULL; + + D_ASSUME( (kern_x != NULL) || (kern_y != NULL) ); + */ + /* + * Use cached values if characters are in the + * cachable range and the cache entry is already filled. + */ + /* if (KERNING_DO_CACHE (prev, current)) { + cache = &KERNING_CACHE_ENTRY (prev, current); + + if (kern_x) + *kern_x = (int) cache->x; + + if (kern_y) + *kern_y = (int) cache->y; + + return DFB_OK; + } + + pthread_mutex_lock ( &library_mutex ); + */ + /* Lookup kerning values for the character pair. */ +/* FT_Get_Kerning( data->base.face, + prev, current, ft_kerning_default, &vector ); + + pthread_mutex_unlock ( &library_mutex ); +*/ + /* Convert to integer. */ +/* if (kern_x) + *kern_x = vector.x >> 6; + + if (kern_y) + *kern_y = vector.y >> 6; +*/ + if (kern_x) + *kern_x = 0; + if (kern_y) + *kern_y = 0; + return DFB_OK; +} + +static void +init_kerning_cache( ITImplKerningData *data ) +{ + /* int a, b; + + pthread_mutex_lock ( &library_mutex ); + + for (a=KERNING_CACHE_MIN; a<=KERNING_CACHE_MAX; a++) { + for (b=KERNING_CACHE_MIN; b<=KERNING_CACHE_MAX; b++) { + FT_Vector vector; + KerningCacheEntry *cache = &KERNING_CACHE_ENTRY( a, b ); + */ + /* Lookup kerning values for the character pair. */ +/* FT_Get_Kerning( data->base.face, + a, b, ft_kerning_default, &vector ); + + cache->x = (signed char) (vector.x >> 6); + cache->y = (signed char) (vector.y >> 6); + } + } + + pthread_mutex_unlock ( &library_mutex ); + */ +} + +/*static DFBResult +init_freetype( void ) +{ + FT_Error err; + + pthread_mutex_lock ( &library_mutex ); + + if (!library) { + D_DEBUG( "DirectFB/FontFT2: Initializing the FreeType2 library.\n" ); + err = FT_Init_FreeType( &library ); + if (err) { + D_ERROR( "DirectFB/FontFT2: " + "Initialization of the FreeType2 library failed!\n" ); + library = NULL; + pthread_mutex_unlock( &library_mutex ); + return DFB_FAILURE; + } + } + + library_ref_count++; + pthread_mutex_unlock( &library_mutex ); + + return DFB_OK; +} + + +static void +release_freetype( void ) +{ + pthread_mutex_lock( &library_mutex ); + + if (library && --library_ref_count == 0) { + D_DEBUG( "DirectFB/FontFT2: Releasing the FreeType2 library.\n" ); + FT_Done_FreeType( library ); + library = NULL; + } + + pthread_mutex_unlock( &library_mutex ); +} + +*/ +FS_STATE * +init_itype( ) +{ + FS_LONG err; + FS_STATE *state=NULL; + + pthread_mutex_lock ( &library_mutex ); + if (!state_init) { + D_DEBUG( "DirectFB/FontItype: Initializing the Itype library.\n" ); + memset(&state_global, 0, sizeof(FS_STATE)); + + err = FS_init(&state_global, THE_HEAP_SIZE); + if (err) { + D_ERROR( "DirectFB/FontItype: " + "Initialization of the Itype library failed!\n" ); + pthread_mutex_unlock( &library_mutex ); + return state; + } + state_init = true; + state =&state_global; + } + else { + state=FS_new_client(&state_global,0); + if (state==NULL) { + D_ERROR( "DirectFB/FontItype: " + "Add new client failed!\n" ); + pthread_mutex_unlock( &library_mutex ); + return state; + } + } + library_ref_count++; + pthread_mutex_unlock( &library_mutex ); + + return state; +} + + +static void +release_itype( void ) +{ + pthread_mutex_lock( &library_mutex ); + + if (state_init && --library_ref_count == 0) { + D_DEBUG( "DirectFB/FontItype: Releasing the Itype library.\n" ); + /* FT_Done_FreeType( library ); + library = NULL; + */ + + FS_exit(&state_global); + state_init = false; + } + + pthread_mutex_unlock( &library_mutex ); +} + +static void +IDirectFBFont_IT_Destruct( IDirectFBFont *thiz ) +{ + IDirectFBFont_data *data = (IDirectFBFont_data*)thiz->priv; + + if (data->font->impl_data) { + ITImplData *impl_data = (ITImplData*) data->font->impl_data; + + pthread_mutex_lock ( &library_mutex ); + /* FT_Done_Face( impl_data->face ); */ + if (library_ref_count>1) + FS_end_client(impl_data->state); + pthread_mutex_unlock ( &library_mutex ); + + D_FREE( impl_data ); + + data->font->impl_data = NULL; + } + + IDirectFBFont_Destruct( thiz ); + + release_itype(); +} + + +static DirectResult +IDirectFBFont_IT_Release( IDirectFBFont *thiz ) +{ + DIRECT_INTERFACE_GET_DATA(IDirectFBFont) + + if (--data->ref == 0) { + IDirectFBFont_IT_Destruct( thiz ); + } + + return DFB_OK; +} + + +static DFBResult +Probe( IDirectFBFont_ProbeContext *ctx ) +{ + /* FT_Error err; + FT_Face face; + */ + FS_LONG err; + FILECHAR font_name[MAX_FONT_NAME_LEN]; + FS_STATE *state_tp; + + D_DEBUG_AT( Font_Itype, "Probe font `%s'.\n", ctx->filename ); + + if (!ctx->content) + return DFB_UNSUPPORTED; + + if (ctx->filename && strchr (ctx->filename, '.' ) && + (!strcasecmp ( strchr (ctx->filename, '.' ), ".ttf" ) == 0 && + !strcasecmp ( strchr (ctx->filename, '.' ), ".otf" ) == 0 && + !strcasecmp ( strchr (ctx->filename, '.' ), ".ltt") == 0)) + return DFB_UNSUPPORTED; + + state_tp = init_itype(); + if (state_tp == NULL) + return DFB_FAILURE; + + pthread_mutex_lock ( &library_mutex ); + /* + * This should be + * err = FT_New_Face( library, ctx->filename, -1, NULL ); + * but due to freetype bugs it doesn't work. + */ + /* err = FT_New_Face( library, ctx->filename, 0, &face ); + if (!err) + FT_Done_Face( face ); + */ + if (library_ref_count > 1) + FS_end_client(state_tp); + pthread_mutex_unlock ( &library_mutex ); + + release_itype(); + + return DFB_OK; +} + +static bool disable_kerning = false; +static DFBResult +Construct( IDirectFBFont *thiz, + CoreDFB *core, + IDirectFBFont_ProbeContext *ctx, + DFBFontDescription *desc ) +{ + int i; + DFBResult ret; + CoreFont *font; + /* FT_Face face; + FT_Error err; + FT_Int load_flags = FT_LOAD_DEFAULT; */ + ITImplData *data; + bool disable_charmap = false; + + u32 mask = 0; + FS_ULONG flags; + + FS_LONG err; + + FS_ULONG load_flags; + + + FILECHAR fontName[MAX_FONT_NAME_LEN]; + FS_STATE *state; + float sin_rot = 0.0; + float cos_rot = 1.0; + + D_DEBUG( "DirectFB/FontItype: " + "Construct font from file `%s' (index %d) at pixel size %d x %d.\n", + ctx->filename, + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + (desc->flags & DFDESC_WIDTH) ? desc->width : 0, + (desc->flags & DFDESC_HEIGHT) ? desc->height : 0, + (desc->flags & DFDESC_ROTATION) ? desc->rotation : 0 ); + + state = init_itype(); + if (state == NULL) { + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + pthread_mutex_lock ( &library_mutex ); + err = FS_load_font(state, NULL, ctx->content,0, MAX_FONT_NAME_LEN, fontName); + + if (err) { + D_ERROR( "DirectFB/FontItype: " + "Failed loading face %d from font file `%s' (error %lu)!\n", + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + ctx->filename, state->error ); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + err = FS_set_font(state, fontName); + if (err) { + D_ERROR( "DirectFB/FontItype: " + "Failed seting font `%s'!\n", fontName ); + FS_delete_font(state, fontName); + + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + err = FS_set_cmap(state, 3,1 ); + if (err) { + D_ERROR( "DirectFB/FontItype: " + "Failed seting cmap `%s'!\n", fontName ); + FS_delete_font(state, fontName); + + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + + err = FS_set_flags( state, FLAGS_CMAP_OFF ); + if (err) { + D_ERROR( "DirectFB/FontItype: " + "Failed setting FLAGS_CMAP_OFF for `%s'!\n", fontName ); + FS_delete_font(state, fontName); + + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + if (desc->flags & DFDESC_ATTRIBUTES && desc->attributes & DFFA_OUTLINED) { + if (desc->flags & DFDESC_OUTLINE_WIDTH) + FS_set_outline_width( state, desc->outline_width >> 16 ); + else + FS_set_outline_width( state, 1 ); + + if (desc->flags & DFDESC_OUTLINE_OPACITY) + FS_set_outline_opacity( state, desc->outline_opacity ); + else + FS_set_outline_opacity( state, 0x10000 ); + } + + pthread_mutex_unlock ( &library_mutex ); + /* + if (init_freetype() != DFB_OK) { + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + + pthread_mutex_lock ( &library_mutex ); + err = FT_New_Face( library, filename, + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + &face ); + pthread_mutex_unlock ( &library_mutex ); + if (err) { + switch (err) { + case FT_Err_Unknown_File_Format: + D_ERROR( "DirectFB/FontFT2: " + "Unsupported font format in file `%s'!\n", filename ); + break; + default: + D_ERROR( "DirectFB/FontFT2: " + "Failed loading face %d from font file `%s'!\n", + (desc->flags & DFDESC_INDEX) ? desc->index : 0, + filename ); + break; + } + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } +*/ + if (dfb_config->font_format == DSPF_A1 || dfb_config->font_format == DSPF_ARGB1555) + load_mono = true; + + + + +/* + if (desc->flags & DFDESC_ATTRIBUTES) { + if (desc->attributes & DFFA_NOHINTING) + load_flags |= FT_LOAD_NO_HINTING; + if (desc->attributes & DFFA_NOCHARMAP) + disable_charmap = true; + if (desc->attributes & DFFA_NOKERNING) + disable_kerning = true; + if (desc->attributes & DFFA_MONOCHROME) + load_mono = true; + } +*/ + if (desc->flags & DFDESC_ATTRIBUTES) { + if (desc->attributes & DFFA_NOHINTING) + load_flags |= FLAGS_HINTS_OFF; + if (desc->attributes & DFFA_NOCHARMAP) { + load_flags |= FLAGS_CMAP_OFF ; + disable_charmap = true; + } + if (desc->attributes & DFFA_NOKERNING) + disable_kerning = true; + if (desc->attributes & DFFA_MONOCHROME) + load_mono = true; + } +/* if (load_mono) + load_flags |= FT_LOAD_TARGET_MONO; + + if (!disable_charmap) { + pthread_mutex_lock ( &library_mutex ); + err = FT_Select_Charmap( face, ft_encoding_unicode ); + pthread_mutex_unlock ( &library_mutex ); + */ + if (!disable_charmap) { + pthread_mutex_lock ( &library_mutex ); + err = FS_set_cmap( state, 3,1 ); /* Microsoft platform, Unicode */ + pthread_mutex_unlock ( &library_mutex ); + + +/* #if FREETYPE_MINOR > 0*/ + + /* ft_encoding_latin_1 has been introduced in freetype-2.1 */ + if (err) { + D_DEBUG( "DirectFB/FontItype: " + "Couldn't select Unicode encoding, " + "falling back to Latin1.\n"); + pthread_mutex_lock ( &library_mutex ); + err = FS_set_cmap( state, 3,0 ); + pthread_mutex_unlock ( &library_mutex ); + } +/*#endif */ + /* if (err) { + D_DEBUG( "DirectFB/Itype: " + "Couldn't select Unicode/Latin1 encoding, " + "trying Symbol.\n"); + pthread_mutex_lock ( &library_mutex ); + err = FS_set_cmap( &state, 3,3 ); + pthread_mutex_unlock ( &library_mutex ); + + if (!err) + mask = 0xf000; + } */ + + } + +/*#if 0 */ + if (err) { + D_ERROR( "DirectFB/Itype: " + "Couldn't select a suitable encoding for face %d from font file `%s'!\n", (desc->flags & DFDESC_INDEX) ? desc->index : 0, ctx->filename ); + pthread_mutex_lock ( &library_mutex ); + /*FT_Done_Face( face );*/ + FS_delete_font(state, fontName); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } +/* #endif */ + + if (desc->flags & (DFDESC_HEIGHT | DFDESC_WIDTH | + DFDESC_FRACT_HEIGHT | DFDESC_FRACT_WIDTH)) { + int fw = 0, fh = 0; + + if (desc->flags & DFDESC_FRACT_HEIGHT) + fh = desc->fract_height; + else if (desc->flags & DFDESC_HEIGHT) + fh = desc->height << 16; + + if (desc->flags & DFDESC_FRACT_WIDTH) + fw = desc->fract_width; + else if (desc->flags & DFDESC_WIDTH) + fw = desc->width << 16; + + pthread_mutex_lock ( &library_mutex ); + // CR brg36mgr#105644: [extginga]Lintotype to support new font styles + // Previously the fw and fh were always made equal to each other: + // Now they can be set differently. +/* + if ( fw != fh && fh != 0) + fw=fh; + else + fh=fw;*/ + // Replaced by the following to ensure that fw and fh is different from 0 + // unless they are both 0, then no font will be shown. + if ( fw == 0 ) + { + fw = fh; + } + if ( fh == 0 ) + { + fh = fw; + } + + if ((desc->flags & DFDESC_ROTATION) && desc->rotation) { +//JMH if (!FT_IS_SCALABLE(face)) { +//JMH D_ERROR( "DirectFB/FontFT2: " +//JMH "Face %d from font file `%s' is not scalable so cannot be rotated\n", +//JMH (desc->flags & DFDESC_INDEX) ? desc->index : 0, +//JMH filename ); +//JMH pthread_mutex_lock ( &library_mutex ); +//JMH FT_Done_Face( face ); +//JMH pthread_mutex_unlock ( &library_mutex ); +//JMH DIRECT_DEALLOCATE_INTERFACE( thiz ); +//JMH return DFB_UNSUPPORTED; +//JMH } + float rot_radians = 2.0 * M_PI * desc->rotation / (1<<24); + sin_rot = sin(rot_radians); + cos_rot = cos(rot_radians); + err = FS_set_scale (state, fw*cos_rot, -fh*sin_rot, fw*sin_rot, fh*cos_rot ); + } + else + { + err = FS_set_scale( state, fw, 0, 0, fh); + } + + pthread_mutex_unlock ( &library_mutex ); + if (err) { + D_ERROR( "DirectB/Itype: " + "Could not set pixel size to %d x %d!\n", + (desc->flags & DFDESC_WIDTH) ? desc->width : 0, + (desc->flags & DFDESC_HEIGHT) ? desc->height : 0 ); + pthread_mutex_lock ( &library_mutex ); + /* FT_Done_Face( face ); */ + FS_delete_font(state, fontName); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return DFB_FAILURE; + } + } + + /* face->generic.data = (void *)(unsigned long) load_flags; + face->generic.finalizer = NULL; + */ + ret = dfb_font_create( core, desc, ctx->filename, &font ); + if (ret) { + pthread_mutex_lock ( &library_mutex ); + /* FT_Done_Face( face ); */ + FS_delete_font(state, fontName); + pthread_mutex_unlock ( &library_mutex ); + DIRECT_DEALLOCATE_INTERFACE( thiz ); + return ret; + } + + font->attributes = desc->attributes; + + D_ASSERT( font->pixel_format == DSPF_ARGB || + font->pixel_format == DSPF_AiRGB || + font->pixel_format == DSPF_ARGB4444 || + font->pixel_format == DSPF_ARGB2554 || + font->pixel_format == DSPF_ARGB1555 || + font->pixel_format == DSPF_A8 || + font->pixel_format == DSPF_A4 || + font->pixel_format == DSPF_A1 ); + + /* + font->ascender = face->size->metrics.ascender >> 6; + font->descender = face->size->metrics.descender >> 6; + font->height = font->ascender + ABS(font->descender) + 1; + font->maxadvance = face->size->metrics.max_advance >> 6; + */ + FS_FIXED ascender; + FS_FIXED descender; + FS_FIXED leading; + FsAscDescLeadSource *source; + source = D_CALLOC( 1, sizeof(FsAscDescLeadSource) ); + pthread_mutex_lock ( &library_mutex ); + err = FS_get_ascender_descender_leading(state, &ascender,&descender,&leading,source); + pthread_mutex_unlock ( &library_mutex ); + + font->ascender = (ascender >> 16) + 1; + font->descender = 0 - (descender >> 16) - 1; + font->height = font->ascender + ABS(font->descender) + 1; + font->maxadvance = font->height + (leading >> 16); + + font->up_unit_x = -sin_rot; + font->up_unit_y = -cos_rot; + + D_FREE(source); + D_DEBUG( "DirectFB/Itype: height = %d, ascender = %d, descender = %d, maxadvance = %d, up unit: %5.2f,%5.2f\n", + font->height, font->ascender, font->descender, font->maxadvance, font->up_unit_x, font->up_unit_y ); + + font->GetGlyphData = get_glyph_info; + font->RenderGlyph = render_glyph; +/* + if (FT_HAS_KERNING(face) && !disable_kerning) { + font->GetKerning = get_kerning; + data = D_CALLOC( 1, sizeof(FT2ImplKerningData) ); + } + else + data = D_CALLOC( 1, sizeof(FT2ImplData) ); +*/ + if (!disable_kerning) { + font->GetKerning = get_kerning; + data = D_CALLOC( 1, sizeof(ITImplKerningData) ); + } + else + data = D_CALLOC( 1, sizeof(ITImplData) ); + + data->state = state; + data->disable_charmap = disable_charmap; + + if (/*FT_HAS_KERNING(face) && */!disable_kerning) + init_kerning_cache( (ITImplKerningData*) data ); + + if (desc->flags & DFDESC_FIXEDADVANCE) { + data->fixed_advance = desc->fixed_advance; + font->maxadvance = desc->fixed_advance; + + if ((desc->flags & DFDESC_ATTRIBUTES) && (desc->attributes & DFFA_FIXEDCLIP)) + data->fixed_clip = true; + } + + for (i=0; i<256; i++) + /* data->indices[i] = FT_Get_Char_Index( face, i | mask );*/ + data->indices[i] = FS_map_char( state, i | mask ); + + font->impl_data = data; + + dfb_font_register_encoding( font, "UTF8", &UTF8Funcs, DTEID_UTF8 ); + dfb_font_register_encoding( font, "UTF16", &UTF16Funcs, DTEID_OTHER ); + dfb_font_register_encoding( font, "Latin1", &Latin1Funcs, DTEID_OTHER ); + + IDirectFBFont_Construct( thiz, font ); + + thiz->Release = IDirectFBFont_IT_Release; + + return DFB_OK; +} -- cgit