diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-01-06 18:24:56 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-01-06 18:24:56 +0000 |
commit | 37d2c89adc7982937f0425edfd82d485172a48e9 (patch) | |
tree | 689d81e07426edd5bb84b4d75144c683ea0234ca | |
parent | 3f9049391c10c1df8de52571d3705431aceb4dd1 (diff) | |
download | navit-37d2c89adc7982937f0425edfd82d485172a48e9.tar.gz |
Fix:Core:Check for fontconfig and provide own fonts if not present
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1906 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | configure.in | 19 | ||||
-rw-r--r-- | navit/font/freetype/font_freetype.c | 19 | ||||
-rw-r--r-- | navit/fonts/LiberationMono-Bold.ttf | bin | 0 -> 104980 bytes | |||
-rw-r--r-- | navit/fonts/LiberationMono-BoldItalic.ttf | bin | 0 -> 117192 bytes | |||
-rw-r--r-- | navit/fonts/LiberationMono-Italic.ttf | bin | 0 -> 123228 bytes | |||
-rw-r--r-- | navit/fonts/LiberationMono-Regular.ttf | bin | 0 -> 107920 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSans-Bold.ttf | bin | 0 -> 133000 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSans-BoldItalic.ttf | bin | 0 -> 128828 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSans-Italic.ttf | bin | 0 -> 155304 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSans-Regular.ttf | bin | 0 -> 133088 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSerif-Bold.ttf | bin | 0 -> 141132 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSerif-BoldItalic.ttf | bin | 0 -> 144184 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSerif-Italic.ttf | bin | 0 -> 138328 bytes | |||
-rw-r--r-- | navit/fonts/LiberationSerif-Regular.ttf | bin | 0 -> 146036 bytes | |||
-rw-r--r-- | navit/fonts/License.txt | 19 | ||||
-rw-r--r-- | navit/fonts/Makefile.am | 15 | ||||
-rw-r--r-- | navit/fonts/README | 68 |
17 files changed, 130 insertions, 10 deletions
diff --git a/configure.in b/configure.in index 12784a904..689c5449b 100644 --- a/configure.in +++ b/configure.in @@ -37,6 +37,7 @@ postgresql=yes; postgresql_reason=default samplemap=yes; samplemap_reason=default binding_dbus=yes; binding_dbus_reason=default binding_python=yes; binding_python_reason=default +font_freetype=yes; font_freetype_reason=default gui_gtk=no; gui_gtk_reason=default gui_win32=no; gui_win32_reason=default gui_internal=yes; gui_internal_reason=default @@ -280,14 +281,15 @@ if test "x${postgresql}" = "xyes" ; then fi fi AM_CONDITIONAL(HAVE_POSTGRESQL, test "x${postgresql}" = "xyes") - -PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no]) -if test "x$freetype2_pkgconfig" = "xyes"; then - AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have freetype2]) +# font +# freetype +AC_ARG_ENABLE(font-freetype, [ --disable-font-freetype don't add freetype support], font_freetype=$enableval;font_freetype_reason="configure parameter") +if test "x${font_freetype}" = "xyes" -a "x${FREETYPE2_CFLAGS}" = "x" -a "x${FREETYPE2_LIBS}" = "x"; then + PKG_CHECK_MODULES(FREETYPE2, [freetype2], , [font_freetype=no;font_freetype_reason="Package freetype2 missing"]) fi AC_SUBST(FREETYPE2_CFLAGS) AC_SUBST(FREETYPE2_LIBS) -AM_CONDITIONAL(FONT_FREETYPE, test "x${freetype2_pkgconfig}" = "xyes") +AM_CONDITIONAL(FONT_FREETYPE, test "x${font_freetype}" = "xyes") PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [fontconfig_pkgconfig=yes], [fontconfig_pkgconfig=no]) if test "x$fontconfig_pkgconfig" = "xyes"; then @@ -296,6 +298,8 @@ fi AC_SUBST(FONTCONFIG_CFLAGS) AC_SUBST(FONTCONFIG_LIBS) +AM_CONDITIONAL(FONTS, test "x${font_freetype}" = "xyes" -a "x$fontconfig_pkgconfig" != "xyes") + PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no]) if test "x$imlib2_pkgconfig" = "xyes"; then AC_DEFINE(HAVE_IMLIB2, 1, [Define to 1 if you have imlib2]) @@ -820,6 +824,7 @@ navit/map/poi_geodownload/libmdb/include/Makefile navit/fib-1.1/Makefile navit/font/Makefile navit/font/freetype/Makefile +navit/fonts/Makefile navit/graphics/Makefile navit/graphics/gd/Makefile navit/graphics/gtk_drawing_area/Makefile @@ -934,7 +939,9 @@ fi echo "Plugins: $plugins ($plugins_reason)" echo "Postgresql: $postgresql ($postgresql_reason)" echo "Samplemap: $samplemap ($samplemap_reason)" -echo "NLS Support: $enable_nls($nls_libs)" +echo "NLS Support: $enable_nls ($nls_libs)" +echo "Font renderers:" +echo " freetype: $font_freetype ($font_freetype_reason)" echo "Graphics types:" echo " gtk_drawing_area: $graphics_gtk_drawing_area ($graphics_gtk_drawing_area_reason)" echo " qt_qpainter: $graphics_qt_qpainter ($graphics_qt_qpainter_reason)" diff --git a/navit/font/freetype/font_freetype.c b/navit/font/freetype/font_freetype.c index 86363ba94..4eb7d21cf 100644 --- a/navit/font/freetype/font_freetype.c +++ b/navit/font/freetype/font_freetype.c @@ -1,4 +1,7 @@ +#include "config.h" +#ifdef HAVE_FONTCONFIG #include <fontconfig/fontconfig.h> +#endif #include <ft2build.h> #include <glib.h> #include FT_FREETYPE_H @@ -7,7 +10,6 @@ #include FT_CACHE_H #endif #include <freetype/ftglyph.h> -#include "config.h" #include "point.h" #include "graphics.h" #include "debug.h" @@ -324,7 +326,8 @@ font_freetype_font_new(struct graphics_priv *gr, g_new(struct font_freetype_font, 1); *meth = font_methods; - int exact, found; + int exact, found=0; + char *name; char **family; #ifdef USE_CACHING char *idstr; @@ -341,7 +344,7 @@ font_freetype_font_new(struct graphics_priv *gr, #endif library_init = 1; } - found = 0; +#ifdef HAVE_FONTCONFIG font->size=size; dbg(2, " about to search for fonts, prefered = %s\n", fontfamily); for (exact = 1; !found && exact >= 0; exact--) { @@ -428,8 +431,14 @@ font_freetype_font_new(struct graphics_priv *gr, family++; } } +#else + name=g_strdup_printf("%s/fonts/%s-%s.ttf",getenv("NAVIT_SHAREDIR"),"LiberationSans",flags ? "Bold":"Regular"); + if (!FT_New_Face(library, name, 0, &font->face)) + found=1; + g_free(name); +#endif if (!found) { - g_warning("Failed to load font, no labelling"); + dbg(0,"Failed to load font, no labelling\n"); g_free(font); return NULL; } @@ -636,5 +645,7 @@ void plugin_init(void) { plugin_register_font_type("freetype", font_freetype_new); +#ifdef HAVE_FONTCONFIG FcInit(); +#endif } diff --git a/navit/fonts/LiberationMono-Bold.ttf b/navit/fonts/LiberationMono-Bold.ttf Binary files differnew file mode 100644 index 000000000..95de75300 --- /dev/null +++ b/navit/fonts/LiberationMono-Bold.ttf diff --git a/navit/fonts/LiberationMono-BoldItalic.ttf b/navit/fonts/LiberationMono-BoldItalic.ttf Binary files differnew file mode 100644 index 000000000..11ec3e779 --- /dev/null +++ b/navit/fonts/LiberationMono-BoldItalic.ttf diff --git a/navit/fonts/LiberationMono-Italic.ttf b/navit/fonts/LiberationMono-Italic.ttf Binary files differnew file mode 100644 index 000000000..08f55d636 --- /dev/null +++ b/navit/fonts/LiberationMono-Italic.ttf diff --git a/navit/fonts/LiberationMono-Regular.ttf b/navit/fonts/LiberationMono-Regular.ttf Binary files differnew file mode 100644 index 000000000..e3024a09d --- /dev/null +++ b/navit/fonts/LiberationMono-Regular.ttf diff --git a/navit/fonts/LiberationSans-Bold.ttf b/navit/fonts/LiberationSans-Bold.ttf Binary files differnew file mode 100644 index 000000000..53200d956 --- /dev/null +++ b/navit/fonts/LiberationSans-Bold.ttf diff --git a/navit/fonts/LiberationSans-BoldItalic.ttf b/navit/fonts/LiberationSans-BoldItalic.ttf Binary files differnew file mode 100644 index 000000000..d06deca60 --- /dev/null +++ b/navit/fonts/LiberationSans-BoldItalic.ttf diff --git a/navit/fonts/LiberationSans-Italic.ttf b/navit/fonts/LiberationSans-Italic.ttf Binary files differnew file mode 100644 index 000000000..07275adf6 --- /dev/null +++ b/navit/fonts/LiberationSans-Italic.ttf diff --git a/navit/fonts/LiberationSans-Regular.ttf b/navit/fonts/LiberationSans-Regular.ttf Binary files differnew file mode 100644 index 000000000..09fac2ff9 --- /dev/null +++ b/navit/fonts/LiberationSans-Regular.ttf diff --git a/navit/fonts/LiberationSerif-Bold.ttf b/navit/fonts/LiberationSerif-Bold.ttf Binary files differnew file mode 100644 index 000000000..3a4ab92ac --- /dev/null +++ b/navit/fonts/LiberationSerif-Bold.ttf diff --git a/navit/fonts/LiberationSerif-BoldItalic.ttf b/navit/fonts/LiberationSerif-BoldItalic.ttf Binary files differnew file mode 100644 index 000000000..dc75de89c --- /dev/null +++ b/navit/fonts/LiberationSerif-BoldItalic.ttf diff --git a/navit/fonts/LiberationSerif-Italic.ttf b/navit/fonts/LiberationSerif-Italic.ttf Binary files differnew file mode 100644 index 000000000..d92b5e392 --- /dev/null +++ b/navit/fonts/LiberationSerif-Italic.ttf diff --git a/navit/fonts/LiberationSerif-Regular.ttf b/navit/fonts/LiberationSerif-Regular.ttf Binary files differnew file mode 100644 index 000000000..d100691a2 --- /dev/null +++ b/navit/fonts/LiberationSerif-Regular.ttf diff --git a/navit/fonts/License.txt b/navit/fonts/License.txt new file mode 100644 index 000000000..f1787287c --- /dev/null +++ b/navit/fonts/License.txt @@ -0,0 +1,19 @@ +LICENSE AGREEMENT AND LIMITED PRODUCT WARRANTY +LIBERATION FONT SOFTWARE + +This agreement governs the use of the Software and any updates to the Software, regardless of the delivery mechanism. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to the user ("Client") a license to this work pursuant to the GNU General Public License v.2 with the exceptions set forth below and such other terms as are set forth in this End User License Agreement. + + 1. The Software and License Exception. LIBERATION font software (the "Software") consists of TrueType-OpenType formatted font software for rendering LIBERATION typefaces in sans-serif, serif, and monospaced character styles. You are licensed to use, modify, copy, and distribute the Software pursuant to the GNU General Public License v.2 with the following exceptions: + + (a) As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. + + (b) As a further exception, any distribution of the object code of the Software in a physical product must provide you the right to access and modify the source code for the Software and to reinstall that modified version of the Software in object code form on the same physical product on which you received it. + + 2. Intellectual Property Rights. The Software and each of its components, including the source code, documentation, appearance, structure and organization are owned by Red Hat and others and are protected under copyright and other laws. Title to the Software and any component, or to any copy, modification, or merged portion shall remain with the aforementioned, subject to the applicable license. The "LIBERATION" trademark is a trademark of Red Hat, Inc. in the U.S. and other countries. This agreement does not permit Client to distribute modified versions of the Software using Red Hat's trademarks. If Client makes a redistribution of a modified version of the Software, then Client must modify the files names to remove any reference to the Red Hat trademarks and must not use the Red Hat trademarks in any way to reference or promote the modified Software. + + 3. Limited Warranty. To the maximum extent permitted under applicable law, the Software is provided and licensed "as is" without warranty of any kind, expressed or implied, including the implied warranties of merchantability, non-infringement or fitness for a particular purpose. Red Hat does not warrant that the functions contained in the Software will meet Client's requirements or that the operation of the Software will be entirely error free or appear precisely as described in the accompanying documentation. + + 4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential damages, including lost profits or lost savings arising out of the use or inability to use the Software, even if Red Hat or such dealer has been advised of the possibility of such damages. + + 5. General. If any provision of this agreement is held to be unenforceable, that shall not affect the enforceability of the remaining provisions. This agreement shall be governed by the laws of the State of North Carolina and of the United States, without regard to any conflict of laws provisions, except that the United Nations Convention on the International Sale of Goods shall not apply. +Copyright © 2007 Red Hat, Inc. All rights reserved. LIBERATION is a trademark of Red Hat, Inc. diff --git a/navit/fonts/Makefile.am b/navit/fonts/Makefile.am new file mode 100644 index 000000000..d8ea2633b --- /dev/null +++ b/navit/fonts/Makefile.am @@ -0,0 +1,15 @@ +include $(top_srcdir)/Makefile.inc + +fonts_DATA = +fonts_DATA += LiberationMono-Bold.ttf +fonts_DATA += LiberationMono-BoldItalic.ttf +fonts_DATA += LiberationMono-Italic.ttf +fonts_DATA += LiberationMono-Regular.ttf +fonts_DATA += LiberationSans-Bold.ttf +fonts_DATA += LiberationSans-BoldItalic.ttf +fonts_DATA += LiberationSans-Italic.ttf +fonts_DATA += LiberationSans-Regular.ttf +fonts_DATA += LiberationSerif-Bold.ttf +fonts_DATA += LiberationSerif-BoldItalic.ttf +fonts_DATA += LiberationSerif-Italic.ttf +fonts_DATA += LiberationSerif-Regular.ttf diff --git a/navit/fonts/README b/navit/fonts/README new file mode 100644 index 000000000..51a5329cd --- /dev/null +++ b/navit/fonts/README @@ -0,0 +1,68 @@ +1. What's this? +=============== + +The Liberation Fonts are intended to be open font replacements for the three +most commonly used fonts on Microsoft systems: Times New Roman, Arial, and +Courier New. + + +2. Requirements +=============== + + * fontforge. + - http://fontforge.sourceforge.net + + +3. Install +========== + +3.1 Decompress tarball + + You can extract the files by following command: + + $ tar zxvf liberation-fonts-[VERSION].tar.gz + +3.2 Build from the source + + Change into directory liberation-fonts-[VERSION]/ and build from sources by + following commands: + + $ cd liberation-fonts-[VERSION] + $ make + + The built font files will be available in 'build' directory. + +3.3 Install to system + + You can manually install the fonts by copying them to ~/.fonts for a + particular user, or to /usr/share/fonts/truetype/liberation for system-wide + availability + + +4. Usage +======== + +The fonts should be installed and detected by the system after installation. + + +5. License +========== + +Read the GPL v2 file 'COPYING' and the Liberation Fonts EULA file 'License.txt' +for more information. + +6. Credits +========== + +Special thanks to all liberation-fonts developers and users! + + * Caius Chance <cchance at redhat.com> + - Current project maintainer. + + * Mark Webbink <mwebbink at redhat.com> + - Coordinator. + + * Steve Matteson + - Ascender Corporation <http://www.ascendercorp.com> + + * And, all other contributors. |