Compare commits

...
Author SHA1 Message Date
Luk Claes d3acb4307b Import Debian changes 1.3.0~svn316-2.2
libg15render (1.3.0~svn316-2.2) unstable; urgency=low

  * Non-maintainer upload.
  * Remove references to other libraries from dependency_libs field
    (Closes: #620567).
2019-11-19 01:49:56 +03:00
gregor herrmann 3f74c6c562 Import Debian changes 1.3.0~svn316-2.1
libg15render (1.3.0~svn316-2.1) unstable; urgency=low

  * Non-maintainer upload.
  * Fix "fails to install, trying to overwrite other packages files"
    by adding a Replaces (closes: #543360).
  * debian/rules: s/rf/rm/.
2019-11-19 01:49:56 +03:00
Giacomo Catenazzi 08907ba493 Import Debian changes 1.3.0~svn316-2
libg15render (1.3.0~svn316-2) unstable; urgency=low

  * install also the fonts (Closes: #541048)
2019-11-19 01:49:55 +03:00
Giacomo Catenazzi 7e36e8d306 Import Debian changes 1.3.0~svn316-1
libg15render (1.3.0~svn316-1) unstable; urgency=low

  * updated upstream (still from development repository)
  * debian/control: new policy, add ${misc:Depends}, add Homepage

libg15render (1.2.0.svn250-3) unstable; urgency=low

  * move manpage to the -dev package
2019-11-19 01:49:55 +03:00
Giacomo Catenazzi e486e338d3 Import Debian changes 1.2.0.svn250-2
libg15render (1.2.0.svn250-2) unstable; urgency=low

  * And correct the libg15render.h, not requiring -I includes
2019-11-19 01:49:55 +03:00
Alexander Ponyatykh f836fd86a6 Import Upstream version 1.3.0~svn316 2019-11-19 01:49:55 +03:00
Giacomo Catenazzi e5d3cb843c Import Debian changes 1.2.0.svn250-1
libg15render (1.2.0.svn250-1) unstable; urgency=low

  * New upstream (from svn)
2019-11-19 01:49:55 +03:00
Alexander Ponyatykh 0f94383c26 Import Upstream version 1.2.0.svn250 2019-11-19 01:49:55 +03:00
73 changed files with 1507 additions and 46779 deletions

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
1.3
* Add our own bitmap font support. FreeType compatible fonts can be
converted with g15fontconvert.
1.2
* Add WBMP loading and drawing routines
* Add drawBigNum routine
+2 -2
View File
@@ -450,7 +450,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT =
INPUT = src
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -693,7 +693,7 @@ BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
TOC_EXPAND = YES
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
+16 -8
View File
@@ -1,14 +1,22 @@
LLIBDIR=@LIBDIR@
AM_CFLAGS=@CFLAGS@
lib_LTLIBRARIES = libg15render.la
libg15render_la_SOURCES = libg15render.h text.c pixel.c screen.c font_6x4.c font_7x5.c font_8x8.c
libg15render_la_LIBADD = @FTLIB@
libg15render_la_LDFLAGS = -version-info 2:0:1
include_HEADERS= libg15render.h
EXTRA_DIST = debian Doxyfile libg15render.3
## Process this file with automake to produce Makefile.in
SUBDIRS = src
EXTRA_DIST = debian Doxyfile libg15render.3 fonts
MAINTAINERCLEANFILES = \
configure \
Makefile.in \
config.h.in \
aclocal.m4 \
config/*
man3_MANS = $(top_srcdir)/libg15render.3
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
doc_DATA = AUTHORS ChangeLog COPYING NEWS README
fontdir = $(prefix)/share/g15tools/fonts/G15
font_DATA = fonts/*
dist-hook:
rm -rf `find $(distdir)/debian -name .svn`
-713
View File
@@ -1,713 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
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@
DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/config.h.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL NEWS config/config.guess config/config.sub \
config/depcomp config/install-sh config/ltmain.sh \
config/missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = 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)$(libdir)" "$(DESTDIR)$(man3dir)" \
"$(DESTDIR)$(docdir)" "$(DESTDIR)$(includedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libg15render_la_DEPENDENCIES =
am_libg15render_la_OBJECTS = text.lo pixel.lo screen.lo font_6x4.lo \
font_7x5.lo font_8x8.lo
libg15render_la_OBJECTS = $(am_libg15render_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libg15render_la_SOURCES)
DIST_SOURCES = $(libg15render_la_SOURCES)
man3dir = $(mandir)/man3
NROFF = nroff
MANS = $(man3_MANS)
docDATA_INSTALL = $(INSTALL_DATA)
DATA = $(doc_DATA)
includeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FTLIB = @FTLIB@
GREP = @GREP@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
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@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
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@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
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@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
LLIBDIR = @LIBDIR@
AM_CFLAGS = @CFLAGS@
lib_LTLIBRARIES = libg15render.la
libg15render_la_SOURCES = libg15render.h text.c pixel.c screen.c font_6x4.c font_7x5.c font_8x8.c
libg15render_la_LIBADD = @FTLIB@
libg15render_la_LDFLAGS = -version-info 2:0:1
include_HEADERS = libg15render.h
EXTRA_DIST = debian Doxyfile libg15render.3
man3_MANS = $(top_srcdir)/libg15render.3
doc_DATA = AUTHORS ChangeLog COPYING NEWS README
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
$(MAKE) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_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
libg15render.la: $(libg15render_la_OBJECTS) $(libg15render_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libg15render_la_LDFLAGS) $(libg15render_la_OBJECTS) $(libg15render_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/font_6x4.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/font_7x5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/font_8x8.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/screen.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@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@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@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@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@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
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-man3: $(man3_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man3dir)" || $(mkdir_p) "$(DESTDIR)$(man3dir)"
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.3*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
3*) ;; \
*) ext='3' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \
done
uninstall-man3:
@$(NORMAL_UNINSTALL)
@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.3*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
3*) ;; \
*) ext='3' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man3dir)/$$inst"; \
done
install-docDATA: $(doc_DATA)
@$(NORMAL_INSTALL)
test -z "$(docdir)" || $(mkdir_p) "$(DESTDIR)$(docdir)"
@list='$(doc_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \
$(docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \
done
uninstall-docDATA:
@$(NORMAL_UNINSTALL)
@list='$(doc_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \
rm -f "$(DESTDIR)$(docdir)/$$f"; \
done
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
$(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
rm -f "$(DESTDIR)$(includedir)/$$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; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(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; } \
END { 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) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(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; } \
END { 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)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/config
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
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
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(MANS) $(DATA) $(HEADERS) config.h
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(includedir)"; 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-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-docDATA install-includeHEADERS install-man
install-exec-am: install-libLTLIBRARIES
install-info: install-info-am
install-man: install-man3
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-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-docDATA uninstall-includeHEADERS \
uninstall-info-am uninstall-libLTLIBRARIES uninstall-man
uninstall-man: uninstall-man3
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
clean-generic clean-libLTLIBRARIES clean-libtool ctags dist \
dist-all dist-bzip2 dist-gzip dist-hook dist-shar dist-tarZ \
dist-zip distcheck distclean distclean-compile \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-docDATA install-exec \
install-exec-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man \
install-man3 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-docDATA uninstall-includeHEADERS \
uninstall-info-am uninstall-libLTLIBRARIES uninstall-man \
uninstall-man3
dist-hook:
rm -rf `find $(distdir)/debian -name .svn`
# 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:
Vendored
-7307
View File
File diff suppressed because it is too large. Load diff
Executable
+8
View File
@@ -0,0 +1,8 @@
#! /bin/sh
set -x
aclocal -I config
libtoolize --force --copy
autoheader
automake --add-missing --copy
autoconf
-73
View File
@@ -1,73 +0,0 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <ft2build.h> header file. */
#undef HAVE_FT2BUILD_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `g15' library (-lg15). */
#undef HAVE_LIBG15
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 to enable FreeType2 support */
#undef TTF_SUPPORT
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-1519
View File
File diff suppressed because it is too large. Load diff
-1626
View File
File diff suppressed because it is too large. Load diff
-530
View File
@@ -1,530 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2005-07-09.11
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test -f "$tmpdepfile"; then :
else
stripped=`echo "$stripped" | sed 's,^.*/,,'`
tmpdepfile="$stripped.u"
fi
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mecanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
-323
View File
@@ -1,323 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
chmodcmd="$chmodprog 0755"
chowncmd=
chgrpcmd=
stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=
dst=
dir_arg=
dstarg=
no_target_directory=
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
-c (ignored)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
while test -n "$1"; do
case $1 in
-c) shift
continue;;
-d) dir_arg=true
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
--help) echo "$usage"; exit $?;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t) dstarg=$2
shift
shift
continue;;
-T) no_target_directory=true
shift
continue;;
--version) echo "$0 $scriptversion"; exit $?;;
*) # When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
test -n "$dir_arg$dstarg" && break
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dstarg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dstarg"
shift # fnord
fi
shift # arg
dstarg=$arg
done
break;;
esac
done
if test -z "$1"; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src ;;
esac
if test -n "$dir_arg"; then
dst=$src
src=
if test -d "$dst"; then
mkdircmd=:
chmodcmd=
else
mkdircmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dstarg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dstarg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst ;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dstarg: Is a directory" >&2
exit 1
fi
dst=$dst/`basename "$src"`
fi
fi
# This sed command emulates the dirname command.
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# Skip lots of stat calls in the usual case.
if test ! -d "$dstdir"; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
shift
IFS=$oIFS
pathcomp=
while test $# -ne 0 ; do
pathcomp=$pathcomp$1
shift
if test ! -d "$pathcomp"; then
$mkdirprog "$pathcomp"
# mkdir can fail with a `File exist' error in case several
# install-sh are creating the directory concurrently. This
# is OK.
test -d "$pathcomp" || exit
fi
pathcomp=$pathcomp/
done
fi
if test -n "$dir_arg"; then
$doit $mkdircmd "$dst" \
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
else
dstfile=`basename "$dst"`
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
trap '(exit $?); exit' 1 2 13 15
# Copy the file name to the temp name.
$doit $cpprog "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
# Now rename the file to the real destination.
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|| {
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
if test -f "$dstdir/$dstfile"; then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|| {
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit 1
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
}
}
fi || { (exit 1); exit 1; }
done
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit 0
}
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
-6971
View File
File diff suppressed because it is too large. Load diff
-360
View File
@@ -1,360 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2005-06-08.21
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program 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 General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
Vendored
-22268
View File
File diff suppressed because it is too large. Load diff
+9 -4
View File
@@ -2,10 +2,10 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(libg15render, 1.2, mirabeaj@gmail.com)
AC_INIT(libg15render, 1.3, mirabeaj@gmail.com)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR([libg15render.h])
AC_CONFIG_SRCDIR([src/libg15render.h])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
@@ -28,9 +28,10 @@ AC_ARG_ENABLE(ttf, [ --enable-ttf enable FreeType2 support],
AC_MSG_RESULT($ttf_support)
# Checks for libraries.
AC_CHECK_LIB([g15], [writePixmapToLCD], ,AC_MSG_ERROR(["libg15 not found. please install it"]))
AC_CHECK_LIB([m], [ceil], ,AC_MSG_ERROR(["libm not found. Please install it"]))
AC_DEFINE_UNQUOTED([G15FONT_DIR],"${prefix}/share/g15tools/fonts",[Location of G15 fonts])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -43,5 +44,9 @@ AC_HEADER_STDC
AC_CHECK_FUNCS([memset])
AC_SUBST(FTLIB)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT
+48
View File
@@ -1,3 +1,51 @@
libg15render (1.3.0~svn316-2.2) unstable; urgency=low
* Non-maintainer upload.
* Remove references to other libraries from dependency_libs field
(Closes: #620567).
-- Luk Claes <luk@debian.org> Mon, 30 May 2011 19:19:54 +0200
libg15render (1.3.0~svn316-2.1) unstable; urgency=low
* Non-maintainer upload.
* Fix "fails to install, trying to overwrite other packages files"
by adding a Replaces (closes: #543360).
* debian/rules: s/rf/rm/.
-- gregor herrmann <gregoa@debian.org> Sat, 28 Nov 2009 20:34:18 +0100
libg15render (1.3.0~svn316-2) unstable; urgency=low
* install also the fonts (Closes: #541048)
-- Giacomo Catenazzi <cate@debian.org> Tue, 11 Aug 2009 19:56:12 +0200
libg15render (1.3.0~svn316-1) unstable; urgency=low
* updated upstream (still from development repository)
* debian/control: new policy, add ${misc:Depends}, add Homepage
-- Giacomo Catenazzi <cate@debian.org> Fri, 07 Aug 2009 07:59:49 +0200
libg15render (1.2.0.svn250-3) unstable; urgency=low
* move manpage to the -dev package
-- Giacomo Catenazzi <cate@debian.org> Mon, 04 Aug 2008 11:03:40 +0200
libg15render (1.2.0.svn250-2) unstable; urgency=low
* And correct the libg15render.h, not requiring -I includes
-- Giacomo Catenazzi <cate@debian.org> Tue, 18 Sep 2007 21:25:32 +0200
libg15render (1.2.0.svn250-1) unstable; urgency=low
* New upstream (from svn)
-- Giacomo Catenazzi <cate@debian.org> Tue, 18 Sep 2007 20:51:36 +0200
libg15render (1.2-4) unstable; urgency=low
* Don't use ' include "config" ' in usr/include header
+7 -4
View File
@@ -2,13 +2,15 @@ Source: libg15render
Section: libs
Priority: optional
Maintainer: Giacomo Catenazzi <cate@debian.org>
Build-Depends: cdbs, debhelper (>= 5), autotools-dev, libg15-dev, libusb-dev, libfreetype6-dev
Standards-Version: 3.7.2
Build-Depends: cdbs, debhelper (>= 5), autotools-dev, libtool, automake1.9,
libg15-dev, libusb-dev, libfreetype6-dev
Standards-Version: 3.8.2
Homepage: http://www.g15tools.com
Package: libg15render1
Section: libs
Architecture: any
Depends: ${shlibs:Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Library for interfacing with the Logitech G15 keyboards
libg15 provides an API for low level control of the LCD display and
the extra keys on some Logitech keyboards (G11, G15)
@@ -19,7 +21,8 @@ Description: Library for interfacing with the Logitech G15 keyboards
Package: libg15render-dev
Section: libdevel
Architecture: any
Depends: libg15render1 (= ${binary:Version})
Depends: libg15render1 (= ${binary:Version}), ${misc:Depends}
Replaces: libg15render1 (<< ${source:Version})
Description: Library for interfacing with the Logitech G15 keyboards
libg15 provides an API for low level control of the LCD display and
the extra keys on some Logitech keyboards (G11, G15)
Vendored
-2
View File
@@ -1,2 +0,0 @@
usr/bin
usr/sbin
File renamed without changes.
-1
View File
@@ -1 +0,0 @@
usr/lib/libg15*.so.*
+1
View File
@@ -1 +1,2 @@
debian/tmp/usr/lib/lib*.so.* usr/lib/
debian/tmp/usr/share/g15tools/fonts/G15/* usr/share/g15tools/fonts/G15/
+22
View File
@@ -1,6 +1,28 @@
#!/usr/bin/make -f
AUTOMAKE_REMOVE := Makefile Makefile.in configure aclocal.m4
AUTOMAKE_REMOVE += src/*.lo src/*.o src/*.la src/Makefile src/Makefile.in
AUTOMAKE_REMOVE += config.status config.log config.h config.h.in config/*
AUTOMAKE_REMOVE += libtool stamp-h1 .libs src/.libs
UPSTREAM_DEBIANDIR_REMOVE := debian/dirs
clean::
-rm -Rf $(AUTOMAKE_REMOVE)
-rm -f $(UPSTREAM_DEBIANDIR_REMOVE)
makebuilddir:: Makefile
Makefile:: Makefile.am bootstrap
./bootstrap
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
DEB_CONFIGURE_EXTRA_FLAGS = --enable-ttf
common-install-arch::
for file in debian/tmp/usr/lib/*.la; do \
sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
done
-20
View File
@@ -1,20 +0,0 @@
/*
This file is part of g15lcd.
g15lcd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
g15lcd 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with g15lcd; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* This font was provided by Sebastian XXX (sorry bastl, i still cant spell your last name ) */
unsigned char fontdata_6x4[] = {0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,Line truncated
-2066
View File
File diff suppressed because it is too large. Load diff
-2591
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+422 -66
View File
@@ -1,4 +1,4 @@
.TH "libg15render" 3 "16 Nov 2006" "libg15render" \" -*- nroff -*-
.TH "libg15render.h" 3 "21 Apr 2009" "libg15render" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -19,6 +19,14 @@ or
.RI "struct \fBg15canvas\fP"
.br
.RI "\fIThis structure holds the data need to render objects to the LCD screen. \fP"
.ti -1c
.RI "struct \fBg15font\fP"
.br
.RI "\fIStructure holding a single font. \fP"
.ti -1c
.RI "struct \fBg15glyph\fP"
.br
.RI "\fIStructure holding glyph data for g15render font types. \fP"
.in -1c
.SS "Defines"
@@ -30,12 +38,18 @@ or
.RI "#define \fBG15_BUFFER_LEN\fP 1048"
.br
.ti -1c
.RI "#define \fBG15_CHAR_HEADER_SIZE\fP 4"
.br
.ti -1c
.RI "#define \fBG15_COLOR_BLACK\fP 1"
.br
.ti -1c
.RI "#define \fBG15_COLOR_WHITE\fP 0"
.br
.ti -1c
.RI "#define \fBG15_FONT_HEADER_SIZE\fP 15"
.br
.ti -1c
.RI "#define \fBG15_LCD_HEIGHT\fP 43"
.br
.ti -1c
@@ -48,12 +62,18 @@ or
.RI "#define \fBG15_MAX_FACE\fP 5"
.br
.ti -1c
.RI "#define \fBG15_MAX_GLYPH\fP 256"
.br
.ti -1c
.RI "#define \fBG15_PIXEL_FILL\fP 1"
.br
.ti -1c
.RI "#define \fBG15_PIXEL_NOFILL\fP 0"
.br
.ti -1c
.RI "#define \fBG15_TEXT_HUGE\fP 3"
.br
.ti -1c
.RI "#define \fBG15_TEXT_LARGE\fP 2"
.br
.ti -1c
@@ -62,6 +82,9 @@ or
.ti -1c
.RI "#define \fBG15_TEXT_SMALL\fP 0"
.br
.ti -1c
.RI "#define \fBG15R_FONT_SUPPORT\fP 1"
.br
.in -1c
.SS "Functions"
@@ -71,11 +94,15 @@ or
.br
.RI "\fIFills the screen with pixels of color. \fP"
.ti -1c
.RI "void \fBg15r_deleteG15Font\fP (\fBg15font\fP *font)"
.br
.RI "\fIDe-allocate memory associated with font. \fP"
.ti -1c
.RI "void \fBg15r_drawBar\fP (\fBg15canvas\fP *canvas, int x1, int y1, int x2, int y2, int color, int num, int max, int type)"
.br
.RI "\fIDraws a completion bar. \fP"
.ti -1c
.RI "void \fBg15r_drawBigNum\fP (\fBg15canvas\fP *canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)"
.RI "void \fBg15r_drawBigNum\fP (\fBg15canvas\fP *canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)"
.br
.RI "\fIDraw a large number. \fP"
.ti -1c
@@ -99,6 +126,18 @@ or
.br
.RI "\fIDraw a sprite to the screen from a wbmp buffer. \fP"
.ti -1c
.RI "void \fBg15r_drawXBM\fP (\fBg15canvas\fP *canvas, unsigned char *data, int width, int height, int pos_x, int pos_y)"
.br
.RI "\fIDraw an XBM image. \fP"
.ti -1c
.RI "void \fBg15r_G15FontRenderString\fP (\fBg15canvas\fP *canvas, \fBg15font\fP *font, char *string, int row, unsigned int sx, unsigned int sy, int colour, int paint_bg)"
.br
.RI "\fIRender a string in font 'font' to canvas. \fP"
.ti -1c
.RI "void \fBg15r_G15FPrint\fP (\fBg15canvas\fP *canvas, char *string, int x, int y, int size, int center, int colour, int row)"
.br
.RI "\fIPrint a string using the G15 default font at size 'size'. \fP"
.ti -1c
.RI "int \fBg15r_getPixel\fP (\fBg15canvas\fP *canvas, unsigned int x, unsigned int y)"
.br
.RI "\fIGets the value of the pixel at (x, y). \fP"
@@ -107,11 +146,15 @@ or
.br
.RI "\fIClears the canvas and resets the mode switches. \fP"
.ti -1c
.RI "\fBg15font\fP * \fBg15r_loadG15Font\fP (char *filename)"
.br
.RI "\fILoad G15 font and return it in \fBg15font\fP struct. \fP"
.ti -1c
.RI "int \fBg15r_loadWbmpSplash\fP (\fBg15canvas\fP *canvas, char *filename)"
.br
.RI "\fIDraw a splash screen from 160x43 wbmp file. \fP"
.ti -1c
.RI "int \fBg15r_loadWbmpToBuf\fP (char *buf, char *filename, int *img_width, int *img_height, int maxlen)"
.RI "char * \fBg15r_loadWbmpToBuf\fP (char *filename, int *img_width, int *img_height)"
.br
.RI "\fILoad a wbmp file into a buffer. \fP"
.ti -1c
@@ -139,14 +182,26 @@ or
.br
.RI "\fIRenders a character in the small font at (x, y). \fP"
.ti -1c
.RI "int \fBg15r_renderG15Glyph\fP (\fBg15canvas\fP *canvas, \fBg15font\fP *font, unsigned char character, int top_left_pixel_x, int top_left_pixel_y, int colour, int paint_bg)"
.br
.RI "\fIrender glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph \fP"
.ti -1c
.RI "void \fBg15r_renderString\fP (\fBg15canvas\fP *canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy)"
.br
.RI "\fIRenders a string with font size in row. \fP"
.ti -1c
.RI "int \fBg15r_saveG15Font\fP (char *oFilename, \fBg15font\fP *font)"
.br
.RI "\fISave font in font struct to given file, return 0 on success. \fP"
.ti -1c
.RI "void \fBg15r_setPixel\fP (\fBg15canvas\fP *canvas, unsigned int x, unsigned int y, int val)"
.br
.RI "\fISets the value of the pixel at (x, y). \fP"
.ti -1c
.RI "int \fBg15r_testG15FontWidth\fP (\fBg15font\fP *font, char *string)"
.br
.RI "\fIReturns length (in pixels) of string if rendered in font 'font'. \fP"
.ti -1c
.RI "void \fBg15r_ttfLoad\fP (\fBg15canvas\fP *canvas, char *fontname, int fontsize, int face_num)"
.br
.RI "\fILoads a font through the FreeType2 library. \fP"
@@ -175,63 +230,84 @@ or
.PP
.SS "#define BYTE_SIZE 8"
.PP
Definition at line 21 of file libg15render.h.
Definition at line 23 of file libg15render.h.
.PP
Referenced by g15r_drawIcon(), g15r_drawSprite(), g15r_getPixel(), g15r_loadWbmpToBuf(), and g15r_setPixel().
.SS "#define G15_BUFFER_LEN 1048"
.PP
Definition at line 22 of file libg15render.h.
Definition at line 24 of file libg15render.h.
.PP
Referenced by g15r_clearScreen(), g15r_initCanvas(), and g15r_loadWbmpSplash().
.SS "#define G15_CHAR_HEADER_SIZE 4"
.PP
Definition at line 38 of file libg15render.h.
.PP
Referenced by g15r_loadG15Font(), and g15r_saveG15Font().
.SS "#define G15_COLOR_BLACK 1"
.PP
Definition at line 27 of file libg15render.h.
Definition at line 29 of file libg15render.h.
.PP
Referenced by g15r_drawBigNum(), g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
Referenced by g15r_drawRoundBox(), g15r_drawXBM(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), g15r_renderCharacterSmall(), and g15r_renderString().
.SS "#define G15_COLOR_WHITE 0"
.PP
Definition at line 26 of file libg15render.h.
Definition at line 28 of file libg15render.h.
.PP
Referenced by g15r_drawBigNum(), g15r_drawRoundBox(), g15r_pixelOverlay(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
Referenced by g15r_drawRoundBox(), and g15r_pixelOverlay().
.SS "#define G15_FONT_HEADER_SIZE 15"
.PP
Definition at line 37 of file libg15render.h.
.PP
Referenced by g15r_loadG15Font(), and g15r_saveG15Font().
.SS "#define G15_LCD_HEIGHT 43"
.PP
Definition at line 24 of file libg15render.h.
Definition at line 26 of file libg15render.h.
.PP
Referenced by g15r_getPixel(), and g15r_setPixel().
.SS "#define G15_LCD_OFFSET 32"
.PP
Definition at line 23 of file libg15render.h.
Definition at line 25 of file libg15render.h.
.SS "#define G15_LCD_WIDTH 160"
.PP
Definition at line 25 of file libg15render.h.
Definition at line 27 of file libg15render.h.
.PP
Referenced by g15r_getPixel(), and g15r_setPixel().
.SS "#define G15_MAX_FACE 5"
.PP
Definition at line 33 of file libg15render.h.
Definition at line 36 of file libg15render.h.
.PP
Referenced by g15r_ttfLoad().
.SS "#define G15_MAX_GLYPH 256"
.PP
Definition at line 39 of file libg15render.h.
.PP
Referenced by g15r_saveG15Font().
.SS "#define G15_PIXEL_FILL 1"
.PP
Definition at line 32 of file libg15render.h.
Definition at line 35 of file libg15render.h.
.SS "#define G15_PIXEL_NOFILL 0"
.PP
Definition at line 31 of file libg15render.h.
Definition at line 34 of file libg15render.h.
.SS "#define G15_TEXT_HUGE 3"
.PP
Definition at line 33 of file libg15render.h.
.SS "#define G15_TEXT_LARGE 2"
.PP
Definition at line 32 of file libg15render.h.
.PP
Referenced by g15r_renderCharacterLarge().
.SS "#define G15_TEXT_MED 1"
.PP
Definition at line 31 of file libg15render.h.
.PP
Referenced by g15r_renderCharacterMedium().
.SS "#define G15_TEXT_SMALL 0"
.PP
Definition at line 30 of file libg15render.h.
.PP
Referenced by g15r_renderString().
.SS "#define G15_TEXT_MED 1"
Referenced by g15r_renderCharacterSmall().
.SS "#define G15R_FONT_SUPPORT 1"
.PP
Definition at line 29 of file libg15render.h.
.PP
Referenced by g15r_renderString().
.SS "#define G15_TEXT_SMALL 0"
.PP
Definition at line 28 of file libg15render.h.
.PP
Referenced by g15r_renderString().
Definition at line 21 of file libg15render.h.
.SH "Function Documentation"
.PP
.SS "void g15r_clearScreen (\fBg15canvas\fP * canvas, int color)"
@@ -253,6 +329,23 @@ Definition at line 80 of file screen.c.
.PP
References g15canvas::buffer, and G15_BUFFER_LEN.
.PP
.SS "void g15r_deleteG15Font (\fBg15font\fP * font)"
.PP
De-allocate memory associated with font.
.PP
De-allocate memory associated with \fBg15font\fP struct, including glyph buffers
.PP
\fBParameters:\fP
.RS 4
\fIfont\fP \fBg15font\fP structure containing glyphs.
.RE
.PP
.PP
Definition at line 424 of file text.c.
.PP
References g15font::glyph_buffer.
.PP
.SS "void g15r_drawBar (\fBg15canvas\fP * canvas, int x1, int y1, int x2, int y2, int color, int num, int max, int type)"
.PP
Draws a completion bar.
@@ -282,11 +375,11 @@ Given a maximum value, and a value between 0 and that maximum value, calculate a
.PP
.PP
Definition at line 337 of file pixel.c.
Definition at line 340 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_pixelBox().
.PP
.SS "void g15r_drawBigNum (\fBg15canvas\fP * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int num)"
.SS "void g15r_drawBigNum (\fBg15canvas\fP * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)"
.PP
Draw a large number.
.PP
@@ -304,14 +397,16 @@ Draw a large number to a canvas
.br
\fIy2\fP Defines bottommost bound of the number.
.br
\fIcolor\fP The number will be drawn this color.
.br
\fInum\fP The number to be drawn.
.RE
.PP
.PP
Definition at line 542 of file pixel.c.
Definition at line 548 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_pixelBox().
References g15r_pixelBox().
.PP
.SS "void g15r_drawCircle (\fBg15canvas\fP * canvas, int x, int y, int r, int fill, int color)"
.PP
@@ -338,7 +433,7 @@ The circle will be filled if fill != 0.
.PP
.PP
Definition at line 203 of file pixel.c.
Definition at line 206 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_setPixel().
.PP
@@ -365,7 +460,7 @@ Draw an icon to a canvas
.PP
.PP
Definition at line 408 of file pixel.c.
Definition at line 413 of file pixel.c.
.PP
References BYTE_SIZE, and g15r_setPixel().
.PP
@@ -392,7 +487,7 @@ A line of color is drawn from (px1, py1) to (px2, py2).
.PP
.PP
Definition at line 99 of file pixel.c.
Definition at line 102 of file pixel.c.
.PP
References g15r_setPixel(), and swap().
.PP
@@ -425,7 +520,7 @@ The box will be filled if fill != 0.
.PP
.PP
Definition at line 252 of file pixel.c.
Definition at line 255 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, g15r_drawLine(), and g15r_setPixel().
.PP
@@ -458,10 +553,103 @@ Draw a sprite to a canvas
.PP
.PP
Definition at line 440 of file pixel.c.
Definition at line 445 of file pixel.c.
.PP
References BYTE_SIZE, and g15r_setPixel().
.PP
.SS "void g15r_drawXBM (\fBg15canvas\fP * canvas, unsigned char * data, int width, int height, int pos_x, int pos_y)"
.PP
Draw an XBM image.
.PP
Draw an XBM Image to the canvas
.PP
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated in is found.
.br
\fIdata\fP A pointer to the buffer holding the icon to be displayed.
.br
\fIwidth\fP Width of the image in data.
.br
\fIheight\fP Height of the image in data.
.br
\fIpos_x\fP Leftmost boundary of image.
.br
\fIpos_y\fP Topmost boundary of image.
.RE
.PP
.PP
Definition at line 625 of file pixel.c.
.PP
References G15_COLOR_BLACK, and g15r_setPixel().
.PP
.SS "void g15r_G15FontRenderString (\fBg15canvas\fP * canvas, \fBg15font\fP * font, char * string, int row, unsigned int sx, unsigned int sy, int colour, int paint_bg)"
.PP
Render a string in font 'font' to canvas.
.PP
Render a string in given font.
.PP
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIfont\fP Loaded \fBg15font\fP structure as returned by \fBg15r_loadG15Font()\fP
.br
\fIstring\fP Pointer to string to operate on.
.br
\fIrow\fP vertical font-dependent row to start printing on. can usually be left at 0
.br
\fIsx\fP horizontal top-left pixel location.
.br
\fIsy\fP vertical top-left pixel location.
.br
\fIcolour\fP desired colour of character when rendered.
.br
\fIpaint_bg\fP if !0, pixels in the glyph background will also be painted, obstructing any image behind the text.
.RE
.PP
.PP
Definition at line 512 of file text.c.
.PP
References g15font::ascender_height, and g15r_renderG15Glyph().
.PP
Referenced by g15r_G15FPrint().
.PP
.SS "void g15r_G15FPrint (\fBg15canvas\fP * canvas, char * string, int x, int y, int size, int center, int colour, int row)"
.PP
Print a string using the G15 default font at size 'size'.
.PP
Render a string in the default font.
.PP
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIstring\fP Pointer to string to operate on.
.br
\fIx\fP horizontal top-left pixel location.
.br
\fIy\fP vertical top-left pixel location.
.br
\fIsize\fP if size>= 4, denotes height in pixels. if size<4, standard font sizes are used.
.br
\fIcenter\fP Desired text justification. 0==left, 1==centered, 2==right justified.
.br
\fIcolour\fP desired colour of character when rendered.
.br
\fIrow\fP vertical font-dependent row to start printing on. can usually be left at 0
.RE
.PP
.PP
Definition at line 535 of file text.c.
.PP
References g15r_G15FontRenderString(), g15r_loadG15Font(), and g15r_testG15FontWidth().
.PP
Referenced by g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), g15r_renderCharacterSmall(), g15r_renderString(), and g15r_ttfPrint().
.PP
.SS "int g15r_getPixel (\fBg15canvas\fP * canvas, unsigned int x, unsigned int y)"
.PP
Gets the value of the pixel at (x, y).
@@ -502,6 +690,30 @@ Definition at line 91 of file screen.c.
.PP
References g15canvas::buffer, g15canvas::ftLib, G15_BUFFER_LEN, g15canvas::mode_cache, g15canvas::mode_reverse, and g15canvas::mode_xor.
.PP
.SS "\fBg15font\fP* g15r_loadG15Font (char * filename)"
.PP
Load G15 font and return it in \fBg15font\fP struct.
.PP
Load a g15 font from file.
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP string containing full name and location of font to load.
.RE
.PP
\fBReturns:\fP
.RS 4
pointer to completed \fBg15font\fP structure.
.RE
.PP
.PP
Definition at line 286 of file text.c.
.PP
References g15font::ascender_height, g15glyph::buffer, g15font::default_gap, g15font::font_height, G15_CHAR_HEADER_SIZE, G15_FONT_HEADER_SIZE, g15glyph::gap, g15font::glyph, g15font::lineheight, g15font::numchars, and g15glyph::width.
.PP
Referenced by g15r_G15FPrint().
.PP
.SS "int g15r_loadWbmpSplash (\fBg15canvas\fP * canvas, char * filename)"
.PP
Draw a splash screen from 160x43 wbmp file.
@@ -517,32 +729,28 @@ wbmp splash screen loader - assumes image is 160x43
.PP
.PP
Definition at line 385 of file pixel.c.
Definition at line 389 of file pixel.c.
.PP
References g15canvas::buffer, G15_BUFFER_LEN, and g15r_loadWbmpToBuf().
.PP
.SS "int g15r_loadWbmpToBuf (char * buf, char * filename, int * img_width, int * img_height, int maxlen)"
.SS "char* g15r_loadWbmpToBuf (char * filename, int * img_width, int * img_height)"
.PP
Load a wbmp file into a buffer.
.PP
basic wbmp loader - loads wbmp into pre-prepared buf.
basic wbmp loader - loads a wbmp image into a buffer.
.PP
\fBParameters:\fP
.RS 4
\fIbuf\fP A pointer to the buffer into which the wbmp will be loaded.
.br
\fIfilename\fP A string holding the path to the wbmp to be loaded.
.br
\fIimg_width\fP A pointer to an int that will hold the image width on return.
.br
\fIimg_height\fP A pointer to an int that will hold the image height on return.
.br
\fImaxlen\fP The maximum number of bytes that should be read from filename.
.RE
.PP
.PP
Definition at line 468 of file pixel.c.
Definition at line 471 of file pixel.c.
.PP
References BYTE_SIZE.
.PP
@@ -577,7 +785,7 @@ The box will be filled if fill != 0 and the sides will be thick pixels wide.
.PP
.PP
Definition at line 163 of file pixel.c.
Definition at line 166 of file pixel.c.
.PP
References g15r_drawLine(), and g15r_setPixel().
.PP
@@ -606,7 +814,7 @@ A 1-bit bitmap defined in colormap[] is drawn to the canvas with an upper left c
.PP
.PP
Definition at line 74 of file pixel.c.
Definition at line 77 of file pixel.c.
.PP
References G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
.PP
@@ -635,47 +843,172 @@ The area with an upper left corner at (x1, y1) and lower right corner at (x2, y2
.PP
.PP
Definition at line 45 of file pixel.c.
Definition at line 48 of file pixel.c.
.PP
References g15r_getPixel(), and g15r_setPixel().
.PP
.SS "void g15r_renderCharacterLarge (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
.SS "void g15r_renderCharacterLarge (\fBg15canvas\fP * canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the large font at (x, y).
.PP
Definition at line 22 of file text.c.
Render a character in std large font
.PP
References fontdata_8x8, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIcol\fP size-dependent column to start rendering.
.br
\fIrow\fP size-dependent row to start rendering.
.br
\fIcharacter\fP ascii character to render.
.br
\fIsx\fP horizontal top-left pixel location.
.br
\fIsy\fP vertical top-left pixel location.
.RE
.PP
Referenced by g15r_renderString().
.PP
.SS "void g15r_renderCharacterMedium (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
Definition at line 33 of file text.c.
.PP
References G15_COLOR_BLACK, G15_TEXT_LARGE, and g15r_G15FPrint().
.PP
.SS "void g15r_renderCharacterMedium (\fBg15canvas\fP * canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the meduim font at (x, y).
.PP
Definition at line 50 of file text.c.
Render a character in std medium font.
.PP
References fontdata_7x5, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIcol\fP size-dependent column to start rendering.
.br
\fIrow\fP size-dependent row to start rendering.
.br
\fIcharacter\fP ascii character to render.
.br
\fIsx\fP horizontal top-left pixel location.
.br
\fIsy\fP vertical top-left pixel location.
.RE
.PP
Referenced by g15r_renderString().
.PP
.SS "void g15r_renderCharacterSmall (\fBg15canvas\fP * canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)"
Definition at line 52 of file text.c.
.PP
References G15_COLOR_BLACK, G15_TEXT_MED, and g15r_G15FPrint().
.PP
.SS "void g15r_renderCharacterSmall (\fBg15canvas\fP * canvas, int col, int row, unsigned char character, unsigned int sx, unsigned int sy)"
.PP
Renders a character in the small font at (x, y).
.PP
Definition at line 77 of file text.c.
Render a character in std small font.
.PP
References fontdata_6x4, G15_COLOR_BLACK, G15_COLOR_WHITE, and g15r_setPixel().
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIcol\fP size-dependent column to start rendering.
.br
\fIrow\fP size-dependent row to start rendering.
.br
\fIcharacter\fP ascii character to render.
.br
\fIsx\fP horizontal top-left pixel location.
.br
\fIsy\fP vertical top-left pixel location.
.RE
.PP
Referenced by g15r_renderString().
.PP
Definition at line 72 of file text.c.
.PP
References G15_COLOR_BLACK, G15_TEXT_SMALL, and g15r_G15FPrint().
.PP
.SS "int g15r_renderG15Glyph (\fBg15canvas\fP * canvas, \fBg15font\fP * font, unsigned char character, int top_left_pixel_x, int top_left_pixel_y, int colour, int paint_bg)"
.PP
render glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph
.PP
Render a character in given font.
.PP
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIfont\fP Loaded \fBg15font\fP structure as returned by \fBg15r_loadG15Font()\fP
.br
\fIcharacter\fP ascii character to render.
.br
\fItop_left_pixel_x\fP horizontal top-left pixel location.
.br
\fItop_left_pixel_y\fP vertical top-left pixel location.
.br
\fIcolour\fP desired colour of character when rendered.
.br
\fIpaint_bg\fP should the background of the character cell be painted?
.RE
.PP
.PP
Definition at line 461 of file text.c.
.PP
References g15font::ascender_height, g15glyph::buffer, g15font::default_gap, g15font::font_height, g15r_setPixel(), g15font::glyph, and g15glyph::width.
.PP
Referenced by g15r_G15FontRenderString().
.PP
.SS "void g15r_renderString (\fBg15canvas\fP * canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy)"
.PP
Renders a string with font size in row.
.PP
Definition at line 104 of file text.c.
Render a string in the designated size
.PP
References G15_TEXT_LARGE, G15_TEXT_MED, G15_TEXT_SMALL, g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
\fBParameters:\fP
.RS 4
\fIcanvas\fP A pointer to a \fBg15canvas\fP struct in which the buffer to be operated on is found.
.br
\fIstringOut\fP An unsigned char pointer to the string which is to be printed.
.br
\fIrow\fP size-dependent row to start rendering.
.br
\fIsize\fP size of printed string. May be 0-3 for standard sizes, or 5-39 in pixel height.
.br
\fIsx\fP horizontal top-left pixel location.
.br
\fIsy\fP vertical top-left pixel location.
.RE
.PP
.PP
Definition at line 93 of file text.c.
.PP
References G15_COLOR_BLACK, and g15r_G15FPrint().
.PP
.SS "int g15r_saveG15Font (char * oFilename, \fBg15font\fP * font)"
.PP
Save font in font struct to given file, return 0 on success.
.PP
Save \fBg15font\fP struct to given file.
.PP
\fBParameters:\fP
.RS 4
\fIoFilename\fP string containing full name and location of font to save.
.br
\fIfont\fP \fBg15font\fP structure containing glyphs. Glyphs to be saved should have the corresponding active[glyph] set.
.RE
.PP
\fBReturns:\fP
.RS 4
0 on success, -1 on failure.
.RE
.PP
.PP
Definition at line 361 of file text.c.
.PP
References g15font::active, g15font::ascender_height, g15glyph::buffer, g15font::default_gap, g15font::font_height, G15_CHAR_HEADER_SIZE, G15_FONT_HEADER_SIZE, G15_MAX_GLYPH, g15font::glyph, g15font::lineheight, g15font::numchars, and g15glyph::width.
.PP
.SS "void g15r_setPixel (\fBg15canvas\fP * canvas, unsigned int x, unsigned int y, int val)"
.PP
@@ -700,7 +1033,33 @@ Definition at line 50 of file screen.c.
.PP
References g15canvas::buffer, BYTE_SIZE, G15_LCD_HEIGHT, G15_LCD_WIDTH, g15r_getPixel(), g15canvas::mode_reverse, and g15canvas::mode_xor.
.PP
Referenced by draw_ttf_char(), g15r_drawCircle(), g15r_drawIcon(), g15r_drawLine(), g15r_drawRoundBox(), g15r_drawSprite(), g15r_pixelBox(), g15r_pixelOverlay(), g15r_pixelReverseFill(), g15r_renderCharacterLarge(), g15r_renderCharacterMedium(), and g15r_renderCharacterSmall().
Referenced by draw_ttf_char(), g15r_drawCircle(), g15r_drawIcon(), g15r_drawLine(), g15r_drawRoundBox(), g15r_drawSprite(), g15r_drawXBM(), g15r_pixelBox(), g15r_pixelOverlay(), g15r_pixelReverseFill(), and g15r_renderG15Glyph().
.PP
.SS "int g15r_testG15FontWidth (\fBg15font\fP * font, char * string)"
.PP
Returns length (in pixels) of string if rendered in font 'font'.
.PP
Calculate width (in pixels) of given string if rendered in font 'font'.
.PP
\fBParameters:\fP
.RS 4
\fIfont\fP Loaded \fBg15font\fP structure as returned by \fBg15r_loadG15Font()\fP
.br
\fIstring\fP Pointer to string for width calculations.
.RE
.PP
\fBReturns:\fP
.RS 4
total width in pixels of given string.
.RE
.PP
.PP
Definition at line 439 of file text.c.
.PP
References g15font::default_gap, g15glyph::gap, g15font::glyph, and g15glyph::width.
.PP
Referenced by g15r_G15FPrint().
.PP
.SS "void g15r_ttfLoad (\fBg15canvas\fP * canvas, char * fontname, int fontsize, int face_num)"
.PP
@@ -721,7 +1080,7 @@ Load a font for use with FreeType2 font support
.PP
.PP
Definition at line 145 of file text.c.
Definition at line 109 of file text.c.
.PP
References g15canvas::ftLib, G15_MAX_FACE, g15canvas::ttf_face, and g15canvas::ttf_fontsize.
.PP
@@ -752,9 +1111,9 @@ Render a string with a FreeType2 font
.PP
.PP
Definition at line 283 of file text.c.
Definition at line 247 of file text.c.
.PP
References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(), draw_ttf_str(), g15canvas::ttf_face, and g15canvas::ttf_fontsize.
References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(), draw_ttf_str(), g15r_G15FPrint(), g15canvas::ttf_face, and g15canvas::ttf_fontsize.
.PP
.SH "Variable Documentation"
.PP
@@ -762,17 +1121,14 @@ References calc_ttf_centering(), calc_ttf_right_justify(), calc_ttf_true_ypos(),
.PP
Font data for the small (6x4) font.
.PP
Referenced by g15r_renderCharacterSmall().
.SS "unsigned char \fBfontdata_7x5\fP[]"
.PP
Font data for the medium (7x5) font.
.PP
Referenced by g15r_renderCharacterMedium().
.SS "unsigned char \fBfontdata_8x8\fP[]"
.PP
Font data for the large (8x8) font.
.PP
Referenced by g15r_renderCharacterLarge().
.SH "Author"
.PP
Anthony J. Mirabella <mirabeaj@gmail.com>
+14
View File
@@ -0,0 +1,14 @@
LLIBDIR=@LIBDIR@
AM_CFLAGS=@CFLAGS@
DISTCLEANFILES = Makefile.in
lib_LTLIBRARIES = libg15render.la
libg15render_la_SOURCES = libg15render.h text.c pixel.c screen.c
libg15render_la_LIBADD = @FTLIB@
libg15render_la_LDFLAGS = -version-info 2:0:1
include_HEADERS= libg15render.h
bin_PROGRAMS = g15fontconvert
g15fontconvert_SOURCES = g15fontconvert.c
g15fontconvert_LDADD = libg15render.la @FTLIB@
+227
View File
@@ -0,0 +1,227 @@
/*
This file is part of g15tools.
g15tools is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
g15tools 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with libg15render; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "libg15render.h"
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#ifdef TTF_SUPPORT
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_BITMAP_H
#endif
#ifndef TTF_SUPPORT /* No truetype support */
int main(char *argv) {
printf("g15fontconvert - libg15render has no FreeType support compiled in. This is required for the conversion program. Leaving now.\n");
return -1;
}
#else /* TrueType Support */
void packpixel(unsigned char *buffer, int width, int x, int y,int colour) {
if(x<0) x=0;
if(y<0) y=0;
unsigned char c = 0x80 >> (x % 8);
if(colour)
buffer[width * y + (x / 8)] |= c;
}
FT_Library lib;
int convertG15Font(char *inFilename, char *oFilename, int size, int gap){
FT_Face face;
FT_GlyphSlot glyphslot;
g15font *font = NULL;
int i;
int retval;
retval = FT_New_Face(lib, inFilename, 0, &face);
if(retval== FT_Err_Unknown_File_Format){
return -1;
}
else if(retval) {
return -1;
}
glyphslot = face->glyph;
if(FT_IS_SCALABLE(face)) {
FT_Set_Char_Size(face, 0, size << 6, 80, 0);
}else {
printf("Bitmap Font has fixed height, ignoring requested size\n");
}
font = malloc(sizeof(g15font));
font->font_height = (face->size->metrics.ascender >> 6) - (face->size->metrics.descender >> 6);
font->ascender_height = face->size->metrics.ascender >> 6;
font->lineheight = face->size->metrics.height >> 6;
if(gap>-1)
font->default_gap = gap;
else
font->default_gap = 1;
if(font->font_height==0) {
font->font_height = 2+(face->available_sizes->y_ppem>>6); /* */
printf("Font height unknown, guessing %i.\n",font->font_height - 1);
}
if(font->ascender_height==0) {
font->ascender_height = font->font_height;
face->size->metrics.ascender = font->font_height<<6;
printf("modded ascender to %i\n", (int)face->size->metrics.ascender>>6);
}
if(face->size->metrics.descender==0) {
face->size->metrics.descender = (font->font_height<<6) - (face->available_sizes->size) ;
printf("modded descender to %i\n",(int)face->size->metrics.descender>>6);
font->font_height = (face->size->metrics.ascender >> 6) + (face->size->metrics.descender >> 6);
}
if(font->lineheight==0) {
printf("modded lineheight\n");
font->lineheight=font->font_height;
}
printf("Converting\n");
for(i=0;i<256;i++) {
unsigned int glyph_index = FT_Get_Char_Index(face,i);
retval = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT|FT_LOAD_TARGET_MONO|FT_LOAD_NO_BITMAP);
glyphslot = face->glyph;
retval = FT_Render_Glyph(glyphslot, FT_RENDER_MODE_MONO);
if(retval==0) {
if(glyph_index>0)
font->active[i]=1;
else
font->active[i]=0;
int char_x, char_y;
if(glyphslot->bitmap.width==0)
glyphslot->bitmap.width = glyphslot->advance.x >> 6;
font->glyph[i].width = glyphslot->bitmap.width;
font->glyph[i].buffer = malloc(glyphslot->bitmap.width*font->font_height);
memset(font->glyph[i].buffer,0,glyphslot->bitmap.width*font->font_height);
unsigned char * bufPtr = glyphslot->bitmap.buffer;
for ( char_y = 0; char_y < glyphslot->bitmap.rows; char_y++)
{
char y=(face->size->metrics.ascender >> 6) - (face->glyph->metrics.horiBearingY >> 6);
for ( char_x = 0; char_x < glyphslot->bitmap.width; char_x++)
{
if((bufPtr[char_x / 8] >> (7 - char_x % 8)) & 1)
packpixel(font->glyph[i].buffer,(glyphslot->bitmap.width+7)/8, char_x,char_y+y,1);
}
bufPtr += glyphslot->bitmap.pitch;
}
}
}
FT_Done_Face(face);
if(g15r_saveG15Font(oFilename,font)<0) {
printf("Problem saving font\n");
return -1;
}
printf("Font saved to %s\n",oFilename);
g15r_deleteG15Font(font);
return 0;
}
void helptext() {
printf("g15fontconvert - (c) 2008 The G15Tools project\n");
printf(" -h\t--help\t\t\tThis helptext\n");
printf(" -s\t--size [size]\t\tSpecify size in pixels of desired font (default 10pixels high)\n");
printf(" -g\t--gap [gap]\t\tSpecify gap in pixels between characters (default 1pixel)\n");
printf(" -i\t--infile [filename]\tFilename of font to convert\n");
printf(" -o\t--outfile [filename]\tname of file to write (default to [infile].fnt\n");
exit(0);
}
int main(int argc, char **argv) {
int i;
int size = 10;
int gap = -1;
int have_infile=0;
int have_outfile=0;
char infile[128];
char outfile[128];
FT_Init_FreeType(&lib);
if(argc<2)
helptext();
for (i=0;i<argc;i++) {
if(0==strncasecmp((char*)argv[i],"-h",2) || 0==strncasecmp((char*)argv[i],"--help",6)){
helptext();
}
if(0==strncasecmp((char*)argv[i],"-s",2) || 0==strncasecmp((char*)argv[i],"--size",6)){
if(argv[i+1]!=NULL) {
sscanf(argv[++i],"%i",&size);
}
}
if(0==strncasecmp((char*)argv[i],"-g",2) || 0==strncasecmp((char*)argv[i],"--gap",5)){
if(argv[i+1]!=NULL) {
sscanf(argv[++i],"%i",&gap);
}
}
if(0==strncasecmp((char*)argv[i],"-i",2) || 0==strncasecmp((char*)argv[i],"--infile",8)){
if(argv[i+1]!=NULL) {
strncpy(infile,argv[++i],127);
have_infile=1;
}
}
if(0==strncasecmp((char*)argv[i],"-o",2) || 0==strncasecmp((char*)argv[i],"--outfile",9)){
if(argv[i+1]!=NULL) {
strncpy(outfile,argv[++i],127);
have_outfile=1;
}
}
}
if(!have_infile)
helptext();
if(!have_outfile)
snprintf(outfile,128,"%s.fnt",infile);
if(0!=strncasecmp(".fnt",outfile+(strlen(outfile)-4),4))
strncat(outfile,".fnt",128);
if(access(infile,O_RDONLY)!=0) {
printf("g15fontconvert encountered an error:\n");
printf("Unable to open %s. Please check the filename and try again.\n",infile);
exit(1);
}
printf("converting %s\n",infile);
if(convertG15Font(infile, outfile, size,gap)<0)
printf("problem saving font %s..\n",outfile);
else
printf("Done.\n");
FT_Done_FreeType(lib);
return 0;
}
#endif /* Truetype support */
+71 -9
View File
@@ -8,7 +8,9 @@ extern "C"
#include <string.h>
#define TTF_SUPPORT 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef TTF_SUPPORT
#include <ft2build.h>
@@ -16,6 +18,9 @@ extern "C"
#include FT_BITMAP_H
#endif
#define G15R_FONT_SUPPORT 1
#define G15R_FONT_API_V2 1
#define BYTE_SIZE 8
#define G15_BUFFER_LEN 1048
#define G15_LCD_OFFSET 32
@@ -26,10 +31,17 @@ extern "C"
#define G15_TEXT_SMALL 0
#define G15_TEXT_MED 1
#define G15_TEXT_LARGE 2
#define G15_TEXT_HUGE 3
#define G15_PIXEL_NOFILL 0
#define G15_PIXEL_FILL 1
#define G15_MAX_FACE 5
#define G15_FONT_HEADER_SIZE 15
#define G15_CHAR_HEADER_SIZE 4
#define G15_MAX_GLYPH 256
#define G15_JUSTIFY_LEFT 0
#define G15_JUSTIFY_CENTER 1
#define G15_JUSTIFY_RIGHT 2
/** \brief This structure holds the data need to render objects to the LCD screen.*/
typedef struct g15canvas
{
@@ -48,6 +60,36 @@ extern "C"
#endif
} g15canvas;
/** \brief Structure holding glyph data for g15render font types */
typedef struct g15glyph {
/** g15glyph::buffer holds glyph data */
unsigned char *buffer;
/** g15glyph::width - width of the glyph, without padding */
unsigned char width;
/** g15glyph::gap - recommended gap between this character and the next */
unsigned char gap;
}g15glyph;
/** \brief Structure holding a single font. One g15font struct is needed per size. */
typedef struct g15font {
/** g15font::font_height - total max height of font in pixels */
unsigned int font_height;
/** g15font::ascender_height - height in pixels from baseline to the top pixel of an ascender character */
unsigned int ascender_height;
/** g15font::lineheight - height in pixels from decender to ascender */
unsigned int lineheight;
/** g15font::numchars - number of glyphs available in this font */
unsigned int numchars;
/** g15font::glyph - contains all glyphs available in this font */
g15glyph glyph[G15_MAX_GLYPH]; // allow 256 chars.. ought to be enough for our purposes
/** g15font::default_gap - default gap between glyphs (in pixels). */
unsigned int default_gap;
/** g15font::active - each active glyph is set to 1 else 0 */
unsigned char active[G15_MAX_GLYPH];
/** g15font::glyph_buffer memory pool for glyphs */
char *glyph_buffer;
}g15font;
/** \brief Fills an area bounded by (x1, y1) and (x2, y2)*/
void g15r_pixelReverseFill (g15canvas * canvas, int x1, int y1, int x2,
int y2, int fill, int color);
@@ -79,6 +121,9 @@ void g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width
char *g15r_loadWbmpToBuf(char *filename, int *img_width, int *img_height);
/** \brief Draw a large number*/
void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num);
/** \brief Draw an XBM image*/
void
g15r_drawXBM (g15canvas *canvas, unsigned char* data, int width, int height, int pos_x, int pos_y);
/** \brief Gets the value of the pixel at (x, y)*/
int g15r_getPixel (g15canvas * canvas, unsigned int x, unsigned int y);
@@ -90,13 +135,6 @@ void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsi
/** \brief Clears the canvas and resets the mode switches*/
void g15r_initCanvas (g15canvas * canvas);
/** \brief Font data for the large (8x8) font*/
extern unsigned char fontdata_8x8[];
/** \brief Font data for the medium (7x5) font*/
extern unsigned char fontdata_7x5[];
/** \brief Font data for the small (6x4) font*/
extern unsigned char fontdata_6x4[];
/** \brief Renders a character in the large font at (x, y)*/
void g15r_renderCharacterLarge (g15canvas * canvas, int x, int y,
unsigned char character, unsigned int sx,
@@ -114,9 +152,33 @@ void g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsi
int row, int size, unsigned int sx,
unsigned int sy);
/** \brief Load G15 font and return it in g15font struct */
g15font * g15r_loadG15Font(char *filename);
/** \brief Save font in font struct to given file, return 0 on success */
int g15r_saveG15Font(char *oFilename, g15font *font);
/** \brief De-allocate memory associated with font */
void g15r_deleteG15Font(g15font*font);
/** \brief Returns length (in pixels) of string if rendered in font 'font' */
int g15r_testG15FontWidth(g15font *font,char *string);
/** \brief Returns g15font structure containing the default font at requested size if available */
g15font * g15r_requestG15DefaultFont (int size);
/** \brief render glyph 'character' from loaded font struct 'font'. Returns width (in pixels) of rendered glyph */
int g15r_renderG15Glyph(g15canvas *canvas, g15font *font,
unsigned char character,
int top_left_pixel_x, int top_left_pixel_y,
int colour, int paint_bg);
/** \brief Render a string in font 'font' to canvas */
void g15r_G15FontRenderString (g15canvas * canvas, g15font *font,
char *string,
int row, unsigned int sx, unsigned int sy,
int colour, int paint_bg);
/** \brief Print a string using the G15 default font at size 'size' */
void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y,
int size, int center, int colour, int row);
#ifdef TTF_SUPPORT
/** \brief Loads a font through the FreeType2 library*/
void g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize,
int g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize,
int face_num);
/** \brief Prints a string in a given font*/
void g15r_ttfPrint (g15canvas * canvas, int x, int y, int fontsize,
+53 -6
View File
@@ -17,9 +17,9 @@
*/
#include <stdlib.h>
#include <math.h>
#include <fcntl.h>
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
#include "libg15render.h"
void
@@ -341,8 +341,7 @@ g15r_drawBar (g15canvas * canvas, int x1, int y1, int x2, int y2, int color,
int num, int max, int type)
{
float len, length;
int x;
if (max == 0)
if (max <= 0 || num < 0)
return;
if (num > max)
num = max;
@@ -417,8 +416,11 @@ g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int h
unsigned int pixel_offset = 0;
unsigned int byte_offset, bit_offset;
for (y=0; y < height - 1; y++)
for (x=0; x < width - 1; x++)
//TODO:http://www.g15tools.com/forum/viewtopic.php?p=314#p314
// Does his new piece of code work? Is it better than below? If so, replace.
for (y=0; y < height; y++)
{
for (x=0; x < width; x++)
{
pixel_offset = y * width + x;
byte_offset = pixel_offset / BYTE_SIZE;
@@ -427,6 +429,7 @@ g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int h
val = (buf[byte_offset] & (1 << bit_offset)) >> bit_offset;
g15r_setPixel (canvas, x + my_x, y + my_y, val);
}
}
}
/**
@@ -542,6 +545,7 @@ g15r_loadWbmpToBuf(char *filename, int *img_width, int *img_height)
* \param y1 Defines uppermost bound of the number.
* \param x2 Defines rightmost bound of the number.
* \param y2 Defines bottommost bound of the number.
* \param color The number will be drawn this color.
* \param num The number to be drawn.
*/
void
@@ -611,3 +615,46 @@ g15r_drawBigNum (g15canvas * canvas, unsigned int x1, unsigned int y1, unsigned
}
}
/**
* Draw an XBM Image to the canvas
*
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated in is found.
* \param data A pointer to the buffer holding the icon to be displayed.
* \param width Width of the image in data.
* \param height Height of the image in data.
* \param pos_x Leftmost boundary of image.
* \param pos_y Topmost boundary of image.
*/
void
g15r_drawXBM (g15canvas *canvas, unsigned char* data, int width, int height, int pos_x, int pos_y)
{
int y = 0;
int z = 0;
unsigned char byte;
int bytes_per_row = ceil ((double) width / 8);
int bits_left = width;
int current_bit = 0;
for (y = 0; y < height; y++)
{
bits_left = width;
for (z=0; z < bytes_per_row; z++)
{
byte = data[(y * bytes_per_row) + z];
current_bit = 0;
while (current_bit < 8)
{
if (bits_left > 0)
{
if ((byte >> current_bit) & 1)
{
g15r_setPixel(canvas, (current_bit + (z*8) + pos_x),y + pos_y,G15_COLOR_BLACK);
}
bits_left--;
}
current_bit++;
}
}
}
}
View File
File renamed without changes.
+603
View File
@@ -0,0 +1,603 @@
/*
This file is part of g15tools.
g15tools is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
g15tools 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with g15lcd; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libg15render.h"
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
static g15font *defaultfont[40];
/** Render a character in std large font
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param col size-dependent column to start rendering.
* \param row size-dependent row to start rendering.
* \param character ascii character to render.
* \param sx horizontal top-left pixel location.
* \param sy vertical top-left pixel location.
*/
void
g15r_renderCharacterLarge (g15canvas * canvas, int col, int row,
unsigned char character, unsigned int sx,
unsigned int sy)
{
unsigned char buf[2];
buf[0]=character;
buf[1]=0;
g15r_G15FPrint (canvas, (char*)buf, ((col * 8) + sx), sy, G15_TEXT_LARGE, 0, G15_COLOR_BLACK, row);
}
/** Render a character in std medium font.
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param col size-dependent column to start rendering.
* \param row size-dependent row to start rendering.
* \param character ascii character to render.
* \param sx horizontal top-left pixel location.
* \param sy vertical top-left pixel location.
*/
void
g15r_renderCharacterMedium (g15canvas * canvas, int col, int row,
unsigned char character, unsigned int sx,
unsigned int sy)
{
unsigned char buf[2];
buf[0]=character;
buf[1]=0;
g15r_G15FPrint (canvas, (char*)buf, ((col * 5) + sx), sy, G15_TEXT_MED, 0, G15_COLOR_BLACK, row);
}
/** Render a character in std small font.
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param col size-dependent column to start rendering.
* \param row size-dependent row to start rendering.
* \param character ascii character to render.
* \param sx horizontal top-left pixel location.
* \param sy vertical top-left pixel location.
*/
void
g15r_renderCharacterSmall (g15canvas * canvas, int col, int row,
unsigned char character, unsigned int sx,
unsigned int sy)
{
unsigned char buf[2];
buf[0]=character;
buf[1]=0;
g15r_G15FPrint (canvas, (char*)buf, ((col * 4) + sx), sy, G15_TEXT_SMALL, 0, G15_COLOR_BLACK, row);
}
/**
* Render a string in the designated size
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param stringOut An unsigned char pointer to the string which is to be printed.
* \param row size-dependent row to start rendering.
* \param size size of printed string. May be 0-3 for standard sizes, or 5-39 in pixel height.
* \param sx horizontal top-left pixel location.
* \param sy vertical top-left pixel location.
*/
void
g15r_renderString (g15canvas * canvas, unsigned char stringOut[], int row,
int size, unsigned int sx, unsigned int sy)
{
g15r_G15FPrint (canvas, (char*)stringOut, sx, sy, size, 0, G15_COLOR_BLACK, row);
}
#ifdef TTF_SUPPORT
/**
* Load a font for use with FreeType2 font support
*
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param fontname Absolute pathname to font file to be loaded.
* \param fontsize Size in points for font to be loaded.
* \param face_num Slot into which font face will be loaded.
* \return 0 for success or FreeType2 errorcode.
*/
int
g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize, int face_num)
{
int errcode = 0;
if (face_num < 0)
face_num = 0;
if (face_num > G15_MAX_FACE)
face_num = G15_MAX_FACE;
if (canvas->ttf_fontsize[face_num])
FT_Done_Face (canvas->ttf_face[face_num][0]); /* destroy the last face */
if (!canvas->ttf_fontsize[face_num] && !fontsize)
canvas->ttf_fontsize[face_num] = 10;
else
canvas->ttf_fontsize[face_num] = fontsize;
errcode =
FT_New_Face (canvas->ftLib, fontname, 0, &canvas->ttf_face[face_num][0]);
if (errcode)
{
canvas->ttf_fontsize[face_num] = 0;
}
else
{
if (canvas->ttf_fontsize[face_num]
&& FT_IS_SCALABLE (canvas->ttf_face[face_num][0]))
errcode =
FT_Set_Char_Size (canvas->ttf_face[face_num][0], 0,
canvas->ttf_fontsize[face_num] * 64, 90, 0);
}
return errcode;
}
int
calc_ttf_true_ypos (FT_Face face, int y, int ttf_fontsize)
{
if (!FT_IS_SCALABLE (face))
ttf_fontsize = face->available_sizes->height;
y += ttf_fontsize * .75;
return y;
}
int
calc_ttf_totalstringwidth (FT_Face face, char *str)
{
FT_GlyphSlot slot = face->glyph;
FT_UInt glyph_index;
int i, errcode;
unsigned int len = strlen (str);
int width = 0;
for (i = 0; i < len; i++)
{
glyph_index = FT_Get_Char_Index (face, str[i]);
errcode = FT_Load_Glyph (face, glyph_index, 0);
width += slot->advance.x >> 6;
}
return width;
}
int
calc_ttf_centering (FT_Face face, char *str)
{
int leftpos;
leftpos = 80 - (calc_ttf_totalstringwidth (face, str) / 2);
if (leftpos < 1)
leftpos = 1;
return leftpos;
}
int
calc_ttf_right_justify (FT_Face face, char *str)
{
int leftpos;
leftpos = 160 - calc_ttf_totalstringwidth (face, str);
if (leftpos < 1)
leftpos = 1;
return leftpos;
}
void
draw_ttf_char (g15canvas * canvas, FT_Bitmap charbitmap,
unsigned char character, int x, int y, int color)
{
FT_Int char_x, char_y, p, q;
FT_Int x_max = x + charbitmap.width;
FT_Int y_max = y + charbitmap.rows;
static FT_Bitmap tmpbuffer;
/* convert to 8bit format.. */
FT_Bitmap_Convert (canvas->ftLib, &charbitmap, &tmpbuffer, 1);
for (char_y = y, q = 0; char_y < y_max; char_y++, q++)
for (char_x = x, p = 0; char_x < x_max; char_x++, p++)
if (tmpbuffer.buffer[q * tmpbuffer.width + p])
g15r_setPixel (canvas, char_x, char_y, color);
}
void
draw_ttf_str (g15canvas * canvas, char *str, int x, int y, int color,
FT_Face face)
{
FT_GlyphSlot slot = face->glyph;
int i, errcode;
unsigned int len = strlen (str);
for (i = 0; i < len; i++)
{
errcode =
FT_Load_Char (face, str[i],
FT_LOAD_RENDER | FT_LOAD_MONOCHROME |
FT_LOAD_TARGET_MONO);
draw_ttf_char (canvas, slot->bitmap, str[i], x + slot->bitmap_left,
y - slot->bitmap_top, color);
x += slot->advance.x >> 6;
}
}
/**
* Render a string with a FreeType2 font
*
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x initial x position for string.
* \param y initial y position for string.
* \param fontsize Size of string in points.
* \param face_num Font to be used is loaded in this slot.
* \param color Text will be drawn this color.
* \param center Text will be centered if center == 1 and right justified if center == 2.
* \param print_string Pointer to the string to be printed.
*/
void
g15r_ttfPrint (g15canvas * canvas, int x, int y, int fontsize, int face_num,
int color, int center, char *print_string)
{
if (canvas->ttf_fontsize[face_num])
{
if (fontsize > 0 && FT_IS_SCALABLE (canvas->ttf_face[face_num][0]))
{
canvas->ttf_fontsize[face_num] = fontsize;
int errcode =
FT_Set_Pixel_Sizes (canvas->ttf_face[face_num][0], 0,
canvas->ttf_fontsize[face_num]);
if (errcode)
printf ("Trouble setting the Glyph size!\n");
}
y =
calc_ttf_true_ypos (canvas->ttf_face[face_num][0], y,
canvas->ttf_fontsize[face_num]);
if (center == 1)
x = calc_ttf_centering (canvas->ttf_face[face_num][0], print_string);
else if (center == 2)
x = calc_ttf_right_justify (canvas->ttf_face[face_num][0], print_string);
draw_ttf_str (canvas, print_string, x, y, color,
canvas->ttf_face[face_num][0]);
}
else { /* fall back to our default bitmap font */
g15r_G15FPrint (canvas, print_string, x, y, fontsize, center, color, 0);
}
}
#endif /* TTF_SUPPORT */
/* G15Font Support */
/**
* Load a g15 font from file.
* \param filename string containing full name and location of font to load.
* \return pointer to completed g15font structure.
*/
g15font * g15r_loadG15Font(char *filename) {
FILE *file;
g15font *font = calloc(1,sizeof(g15font));
unsigned char buffer[128];
int i;
if(access(filename,F_OK)!=0) {
fprintf(stderr,"loadG15Font: %s doesn't exist or has permissions problem.\n",filename);
return NULL;
}
if(access(filename,R_OK)!=0) {
fprintf(stderr,"loadG15Font: %s exists but cannot be read. Permissions problem?\n",filename);
return NULL;
}
if(!(file=fopen(filename,"rb")))
return NULL;
if(fread(buffer,G15_FONT_HEADER_SIZE,1,file)) {
if(buffer[0] != 'G' ||
buffer[1] != 'F' ||
buffer[2] != 'N' ||
buffer[3] != 'T' )
{
fclose(file);
return NULL;
}
} else
return NULL;
font->font_height = buffer[4] | (buffer[5] << 8);
font->ascender_height = buffer[6] | (buffer[7] << 8);
font->lineheight = buffer[8] | (buffer[9] << 8);
/* any future expansion that require more than one bit to be set should be recorded at the end of the file, */
/* with the extended-feature bit (not defined as yet, probably 1) set here */
/* The first byte of the extended packet should indicate the extension data type (none defined yet) */
/* The second byte should indicate length in bytes of the packet to read, not inclusive of these two bytes */
/* followed by the extended data. This should allow for a degree of backward compatibility between future versions */
/* should they arise. */
/* features = buffer[10] | (buffer[11] << 8) */
font->numchars = buffer[12] | (buffer[13] << 8);
font->default_gap = buffer[14];
unsigned int current_alloc = 2048;
char *glyphBuf = malloc(current_alloc);
char *glyphPtr = glyphBuf;
unsigned int memsize=0;
for (i=0;i <font->numchars; i++) {
unsigned char charheader[G15_CHAR_HEADER_SIZE];
unsigned int character;
fread(charheader, G15_CHAR_HEADER_SIZE, 1, file);
character = charheader[0] | (charheader[1] << 8);
font->glyph[character].width = charheader[2] | (charheader[3] << 8);
memsize+=(font->font_height * ((font->glyph[character].width + 7) / 8));
if(memsize>current_alloc) { /* attempt to semi-coherently allocate additional memory */
current_alloc+=((font->font_height * ((font->glyph[character].width + 7) / 8)*(font->numchars - i)));
glyphBuf = realloc(glyphBuf,(size_t)current_alloc);
}
font->glyph[character].buffer = (unsigned char*)glyphPtr;
font->glyph[character].gap = 0;
fread(font->glyph[character].buffer, font->font_height * ((font->glyph[character].width + 7) / 8), 1, file);
font->active[character] = 1;
glyphPtr+=(font->font_height * ((font->glyph[character].width + 7) / 8));
}
fclose(file);
return (font);
}
/**
* Save g15font struct to given file.
* \param oFilename string containing full name and location of font to save.
* \param font g15font structure containing glyphs. Glyphs to be saved should have the corresponding active[glyph] set.
* \return 0 on success, -1 on failure.
*/
int g15r_saveG15Font(char *oFilename, g15font *font) {
FILE *f;
unsigned int i;
unsigned char fntheader[G15_FONT_HEADER_SIZE];
if(font==NULL)
return -1;
f = fopen(oFilename, "w+b");
if(f==NULL)
return -1;
font->numchars=0;
for(i=0;i<G15_MAX_GLYPH;i++) {
if(font->active[i]) {
font->numchars++;
}
}
fntheader[0] = 'G';
fntheader[1] = 'F';
fntheader[2] = 'N';
fntheader[3] = 'T';
fntheader[4] = (unsigned char)font->font_height;
fntheader[5] = (unsigned char)(font->font_height >> 8);
fntheader[6] = (unsigned char)font->ascender_height;
fntheader[7] = (unsigned char)(font->ascender_height >> 8);
fntheader[8] = (unsigned char)font->lineheight;
fntheader[9] = (unsigned char)(font->lineheight >> 8);
/* any future expansion that require more than one bit to be set should be recorded at the end of the file, */
/* with the extended-feature bit (not defined as yet, probably 1) set here */
/* The first byte of the extended packet should indicate the extension data type (none defined yet) */
/* The second byte should indicate length in bytes of the packet to read, not inclusive of these two bytes */
/* followed by the extended data. This should allow for a degree of backward compatibility between future versions */
/* should they arise. */
fntheader[10] = 0; /* features */
fntheader[11] = 0; /* features >> 8 */
fntheader[12] = (unsigned char)font->numchars;
fntheader[13] = (unsigned char)(font->numchars >> 8);
fntheader[14] = (unsigned char)font->default_gap;
fwrite (fntheader, G15_FONT_HEADER_SIZE, 1, f);
for(i=0;i<G15_MAX_GLYPH;i++) {
if(font->active[i]) {
unsigned char charheader[G15_CHAR_HEADER_SIZE];
charheader[0] = (unsigned char)i;
charheader[1] = (unsigned char)(i >> 8);
charheader[2] = (unsigned char)font->glyph[i].width;
charheader[3] = (unsigned char)(font->glyph[i].width >> 8);
fwrite(charheader,G15_CHAR_HEADER_SIZE,1,f);
fwrite(font->glyph[i].buffer,font->font_height * ((font->glyph[i].width + 7) / 8),1,f);
}
}
fclose(f);
return 0;
}
/**
* De-allocate memory associated with g15font struct, including glyph buffers
* \param font g15font structure containing glyphs.
*/
void g15r_deleteG15Font(g15font*font){
if(font) {
if(font->glyph_buffer!=NULL)
free(font->glyph_buffer);
free(font);
}
}
/**
* Calculate width (in pixels) of given string if rendered in font 'font'.
* \param font Loaded g15font structure as returned by g15r_loadG15Font()
* \param string Pointer to string for width calculations.
* \return total width in pixels of given string.
*/
int g15r_testG15FontWidth(g15font *font,char *string){
int i;
int totalwidth=0;
if(font==NULL) return 0;
font->glyph[32].gap = 0;
for(i=0;i<strlen(string);i++)
totalwidth += font->glyph[(int)string[i]].width + font->glyph[(int)string[i]].gap + font->default_gap;
return totalwidth;
}
/**
* Return g15font structure containing the default font at requested size
* loading the font if needed.
* \param integer pointsize argument in the range of 0-39
* \return pointer to g15font struct containing font at requested size or NULL if not valid.
*/
g15font * g15r_requestG15DefaultFont (int size)
{
char filename[128];
if (size<0) size=0;
if (size>39) size=39;
/* check if previously loaded, otherwise load it now */
if(!defaultfont[size]) {
snprintf(filename,128,"%s/G15/default-%.2i.fnt",G15FONT_DIR,size);
defaultfont[size] = g15r_loadG15Font(filename);
if((defaultfont[size])==NULL) {
fprintf(stderr,"libg15render: Unable to load font \"%s\"\n",filename);
return NULL;
}
}
return defaultfont[size];
}
/** Render a character in given font.
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param font Loaded g15font structure as returned by g15r_loadG15Font()
* \param character ascii character to render.
* \param top_left_pixel_x horizontal top-left pixel location.
* \param top_left_pixel_y vertical top-left pixel location.
* \param colour desired colour of character when rendered.
* \param paint_bg should the background of the character cell be painted?
*/
int g15r_renderG15Glyph(g15canvas *canvas, g15font *font,unsigned char character,int top_left_pixel_x, int top_left_pixel_y, int colour, int paint_bg)
{
int x,y,w,bp;
if(font->glyph[character].buffer==NULL || font->active[character] == 0)
return 0;
unsigned char *buffer = font->glyph[character].buffer;
unsigned int height = font->font_height;
int i = 0;
int bufferlen = height * ((font->glyph[character].width + 7) / 8);
top_left_pixel_y-=font->font_height - font->ascender_height - 1 ;
w = font->glyph[character].width + (7-(font->glyph[character].width % 8 ));
if(font->glyph[character].width%8==0)
w = font->glyph[character].width-1;
x=0;y=0;
if(paint_bg)
g15r_pixelBox (canvas, top_left_pixel_x, top_left_pixel_y-1,
top_left_pixel_x + font->glyph[character].width+font->default_gap,
top_left_pixel_y + font->lineheight, colour^1, 1, 1);
for (bp=0;bp<bufferlen ;bp++){
for (i=0;i<8;i++) {
if( x > w ) {
x=0;y++;
}
x++;
if(x<=font->glyph[character].width) {
if( buffer[bp] & (0x80 >> i))
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,colour);
else
if(paint_bg)
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,colour^1);
}
}
}
if(character!=32)
return font->glyph[character].width + font->default_gap;
else
return font->glyph[character].width;
}
/** Render a string in given font.
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param font Loaded g15font structure as returned by g15r_loadG15Font()
* \param string Pointer to string to operate on.
* \param row vertical font-dependent row to start printing on. can usually be left at 0
* \param sx horizontal top-left pixel location.
* \param sy vertical top-left pixel location.
* \param colour desired colour of character when rendered.
* \param paint_bg if !0, pixels in the glyph background will also be painted, obstructing any image behind the text.
*/
void g15r_G15FontRenderString (g15canvas * canvas, g15font *font, char *string, int row, unsigned int sx, unsigned int sy, int colour, int paint_bg)
{
int i=0;
int prevwidth=0;
if(font==NULL)
return;
sy += ( font->lineheight * row );
for(i=0;i<strlen(string);i++){
prevwidth = g15r_renderG15Glyph (canvas, font,string[i], sx += prevwidth, sy, colour, paint_bg);
}
}
/** Render a string in the default font.
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param string Pointer to string to operate on.
* \param x horizontal top-left pixel location.
* \param y vertical top-left pixel location.
* \param size if size>= 4, denotes height in pixels. if size<4, standard font sizes are used.
* \param center Desired text justification. 0==left, 1==centered, 2==right justified.
* \param colour desired colour of character when rendered.
* \param row vertical font-dependent row to start printing on. can usually be left at 0
*/
/* print string with the default G15Font, with on-demand loading of required sized bitmaps */
void g15r_G15FPrint (g15canvas *canvas, char *string, int x, int y, int size, int center, int colour, int row) {
int xc, paint_bg;
/* check if previously loaded, otherwise load it now */
if(g15r_requestG15DefaultFont(size)==NULL)
return;
if(size<3)
{
paint_bg=1;
x-=1;
y-=1;
}
else
{
paint_bg=0;
}
switch(center) {
case 0:
g15r_G15FontRenderString (canvas, defaultfont[size], string, row, x, y, colour, paint_bg);
break;
case 1:
xc = g15r_testG15FontWidth(defaultfont[size],string);
g15r_G15FontRenderString (canvas, defaultfont[size], string, row, 80-(xc/2),y, colour, paint_bg);
break;
case 2:
xc = g15r_testG15FontWidth(defaultfont[size],string);
g15r_G15FontRenderString (canvas, defaultfont[size], string, row, 160-xc,y, colour, paint_bg);
break;
}
}
-310
View File
@@ -1,310 +0,0 @@
/*
This file is part of g15tools.
g15tools is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
g15tools 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with g15lcd; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libg15render.h"
void
g15r_renderCharacterLarge (g15canvas * canvas, int col, int row,
unsigned char character, unsigned int sx,
unsigned int sy)
{
int helper = character * 8; /* for our font which is 8x8 */
int top_left_pixel_x = sx + col * (8); /* 1 pixel spacing */
int top_left_pixel_y = sy + row * (8); /* once again 1 pixel spacing */
int x, y;
for (y = 0; y < 8; ++y)
{
for (x = 0; x < 8; ++x)
{
char font_entry = fontdata_8x8[helper + y];
if (font_entry & 1 << (7 - x))
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
G15_COLOR_BLACK);
else
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
G15_COLOR_WHITE);
}
}
}
void
g15r_renderCharacterMedium (g15canvas * canvas, int col, int row,
unsigned char character, unsigned int sx,
unsigned int sy)
{
int helper = character * 7 * 5; /* for our font which is 6x4 */
int top_left_pixel_x = sx + col * (5); /* 1 pixel spacing */
int top_left_pixel_y = sy + row * (7); /* once again 1 pixel spacing */
int x, y;
for (y = 0; y < 7; ++y)
{
for (x = 0; x < 5; ++x)
{
char font_entry = fontdata_7x5[helper + y * 5 + x];
if (font_entry)
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
G15_COLOR_BLACK);
else
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
G15_COLOR_WHITE);
}
}
}
void
g15r_renderCharacterSmall (g15canvas * canvas, int col, int row,
unsigned char character, unsigned int sx,
unsigned int sy)
{
int helper = character * 6 * 4; /* for our font which is 6x4 */
int top_left_pixel_x = sx + col * (4); /* 1 pixel spacing */
int top_left_pixel_y = sy + row * (6); /* once again 1 pixel spacing */
int x, y;
for (y = 0; y < 6; ++y)
{
for (x = 0; x < 4; ++x)
{
char font_entry = fontdata_6x4[helper + y * 4 + x];
if (font_entry)
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
G15_COLOR_BLACK);
else
g15r_setPixel (canvas, top_left_pixel_x + x, top_left_pixel_y + y,
G15_COLOR_WHITE);
}
}
}
void
g15r_renderString (g15canvas * canvas, unsigned char stringOut[], int row,
int size, unsigned int sx, unsigned int sy)
{
int i = 0;
for (i; stringOut[i] != 0; ++i)
{
switch (size)
{
case G15_TEXT_SMALL:
{
g15r_renderCharacterSmall (canvas, i, row, stringOut[i], sx, sy);
break;
}
case G15_TEXT_MED:
{
g15r_renderCharacterMedium (canvas, i, row, stringOut[i], sx, sy);
break;
}
case G15_TEXT_LARGE:
{
g15r_renderCharacterLarge (canvas, i, row, stringOut[i], sx, sy);
break;
}
default:
break;
}
}
}
#ifdef TTF_SUPPORT
/**
* Load a font for use with FreeType2 font support
*
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param fontname Absolute pathname to font file to be loaded.
* \param fontsize Size in points for font to be loaded.
* \param face_num Slot into which font face will be loaded.
*/
void
g15r_ttfLoad (g15canvas * canvas, char *fontname, int fontsize, int face_num)
{
int errcode = 0;
if (face_num < 0)
face_num = 0;
if (face_num > G15_MAX_FACE)
face_num = G15_MAX_FACE;
if (canvas->ttf_fontsize[face_num])
FT_Done_Face (canvas->ttf_face[face_num][0]); /* destroy the last face */
if (!canvas->ttf_fontsize[face_num] && !fontsize)
canvas->ttf_fontsize[face_num] = 10;
else
canvas->ttf_fontsize[face_num] = fontsize;
errcode =
FT_New_Face (canvas->ftLib, fontname, 0, &canvas->ttf_face[face_num][0]);
if (errcode)
{
canvas->ttf_fontsize[face_num] = 0;
}
else
{
if (canvas->ttf_fontsize[face_num]
&& FT_IS_SCALABLE (canvas->ttf_face[face_num][0]))
errcode =
FT_Set_Char_Size (canvas->ttf_face[face_num][0], 0,
canvas->ttf_fontsize[face_num] * 64, 90, 0);
}
}
int
calc_ttf_true_ypos (FT_Face face, int y, int ttf_fontsize)
{
if (!FT_IS_SCALABLE (face))
ttf_fontsize = face->available_sizes->height;
y += ttf_fontsize * .75;
return y;
}
int
calc_ttf_totalstringwidth (FT_Face face, char *str)
{
FT_GlyphSlot slot = face->glyph;
FT_UInt glyph_index;
int i, errcode;
unsigned int len = strlen (str);
int width = 0;
for (i = 0; i < len; i++)
{
glyph_index = FT_Get_Char_Index (face, str[i]);
errcode = FT_Load_Glyph (face, glyph_index, 0);
width += slot->advance.x >> 6;
}
return width;
}
int
calc_ttf_centering (FT_Face face, char *str)
{
int leftpos;
leftpos = 80 - (calc_ttf_totalstringwidth (face, str) / 2);
if (leftpos < 1)
leftpos = 1;
return leftpos;
}
int
calc_ttf_right_justify (FT_Face face, char *str)
{
int leftpos;
leftpos = 160 - calc_ttf_totalstringwidth (face, str);
if (leftpos < 1)
leftpos = 1;
return leftpos;
}
void
draw_ttf_char (g15canvas * canvas, FT_Bitmap charbitmap,
unsigned char character, int x, int y, int color)
{
FT_Int char_x, char_y, p, q;
FT_Int x_max = x + charbitmap.width;
FT_Int y_max = y + charbitmap.rows;
static FT_Bitmap tmpbuffer;
/* convert to 8bit format.. */
FT_Bitmap_Convert (canvas->ftLib, &charbitmap, &tmpbuffer, 1);
for (char_y = y, q = 0; char_y < y_max; char_y++, q++)
for (char_x = x, p = 0; char_x < x_max; char_x++, p++)
if (tmpbuffer.buffer[q * tmpbuffer.width + p])
g15r_setPixel (canvas, char_x, char_y, color);
}
void
draw_ttf_str (g15canvas * canvas, char *str, int x, int y, int color,
FT_Face face)
{
FT_GlyphSlot slot = face->glyph;
int i, errcode;
unsigned int len = strlen (str);
for (i = 0; i < len; i++)
{
errcode =
FT_Load_Char (face, str[i],
FT_LOAD_RENDER | FT_LOAD_MONOCHROME |
FT_LOAD_TARGET_MONO);
draw_ttf_char (canvas, slot->bitmap, str[i], x + slot->bitmap_left,
y - slot->bitmap_top, color);
x += slot->advance.x >> 6;
}
}
/**
* Render a string with a FreeType2 font
*
* \param canvas A pointer to a g15canvas struct in which the buffer to be operated on is found.
* \param x initial x position for string.
* \param y initial y position for string.
* \param fontsize Size of string in points.
* \param face_num Font to be used is loaded in this slot.
* \param color Text will be drawn this color.
* \param center Text will be centered if center == 1 and right justified if center == 2.
* \param print_string Pointer to the string to be printed.
*/
void
g15r_ttfPrint (g15canvas * canvas, int x, int y, int fontsize, int face_num,
int color, int center, char *print_string)
{
int errcode = 0;
if (canvas->ttf_fontsize[face_num])
{
if (fontsize > 0 && FT_IS_SCALABLE (canvas->ttf_face[face_num][0]))
{
canvas->ttf_fontsize[face_num] = fontsize;
int errcode =
FT_Set_Pixel_Sizes (canvas->ttf_face[face_num][0], 0,
canvas->ttf_fontsize[face_num]);
if (errcode)
printf ("Trouble setting the Glyph size!\n");
}
y =
calc_ttf_true_ypos (canvas->ttf_face[face_num][0], y,
canvas->ttf_fontsize[face_num]);
if (center == 1)
x = calc_ttf_centering (canvas->ttf_face[face_num][0], print_string);
else if (center == 2)
x = calc_ttf_right_justify (canvas->ttf_face[face_num][0], print_string);
draw_ttf_str (canvas, print_string, x, y, color,
canvas->ttf_face[face_num][0]);
}
}
#endif /* TTF_SUPPORT */