Update to mkfontscale 1.1.0

This commit is contained in:
matthieu 2012-02-18 09:05:24 +00:00
parent ecc5f838aa
commit 34ff5946f0
14 changed files with 8929 additions and 265 deletions

View File

@ -1,3 +1,86 @@
commit 4c3f72f9e3385d9c855416b6498ced067a97c712
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Feb 10 20:19:37 2012 -0800
mkfontscale 1.1.0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit bf7d4fd83c896b70f68d59de756a3847417d9add
Author: Maxim Iorsh <iorsh@users.sourceforge.net>
Date: Thu Oct 20 08:08:47 2011 +0200
mkfontscale: fix Culmus entries to precede URW
Culmus must precede URW and Bitstream in notice list, since its fonts are
based on URW/Bitstream sometimes.
Signed-off-by: Maxim Iorsh <iorsh@users.sourceforge.net>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit cd8182e74636ffd9b140603fc61502b42a9d6f2b
Author: Maxim Iorsh <iorsh@users.sourceforge.net>
Date: Tue Oct 18 22:07:45 2011 -0700
Add Culmus foundry to the vendor list for TrueType & Type1 fonts
Maps fonts produced by the Culmus project <http://culmus.sourceforge.net>
to the XLFD foundry name "culmus"
For TrueType fonts, maps the vendor code "CLM" from the TrueType vendor
id field.
For Type1 fonts, which use heuristics to guess mappings to XLFD foundries
from words in the copyright notice, add the names of the main contributors
to the Culmus product to recognize the fonts under their copyright.
Signed-off-by: Maxim Iorsh <iorsh@users.sourceforge.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit a39deac00add15532b15827c80601f87738cb405
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Oct 4 21:03:13 2011 -0700
Strip trailing whitespace
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
git diff -w & git diff -b show no diffs from this change
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit b2d0f04a50f1444f9d62d11636a28c89951f0f40
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Oct 4 21:00:11 2011 -0700
Add const attributes to fix gcc -Wwrite-strings warnings
Does not fix all of them since some lists contain constant strings and
some contain dynamically allocated strings that need to be freed later.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0f4f6462597841e5f8470571d56cfda61144ee8f
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Mon Sep 26 15:55:12 2011 -0700
Mark format string argument to dsprintf as const char *
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 8ee3b3f73a6c14c4326435fea7136c09fe2822d1
Author: Maxim Iorsh <iorsh@users.sourceforge.net>
Date: Mon Oct 3 21:52:15 2011 +0200
mkfontscale: Support FontForge weight designations.
Fontforge uses 'ExtraLight' and 'Heavy' weights in Type 1 fonts, which
should be understood by mkfontscale. Other FontForge designations are
already addressed.
Signed-off-by: Maxim Iorsh <iorsh@users.sourceforge.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
commit d429321888c335042332d991480095f67c85bb64
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Wed Jun 29 20:25:37 2011 -0700

View File

@ -1,6 +1,6 @@
#
#
# Copyright 2005 Red Hat, Inc.
#
#
# Permission to use, copy, modify, distribute, and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and that
@ -10,7 +10,7 @@
# without specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any
# purpose. It is provided "as is" without express or implied warranty.
#
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View File

@ -14,9 +14,9 @@
@SET_MAKE@
#
#
# Copyright 2005 Red Hat, Inc.
#
#
# Permission to use, copy, modify, distribute, and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and that
@ -26,7 +26,7 @@
# without specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any
# purpose. It is provided "as is" without express or implied warranty.
#
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -121,6 +121,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@ -177,6 +178,7 @@ PKG_CONFIG = @PKG_CONFIG@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
X11_CFLAGS = @X11_CFLAGS@

View File

@ -1022,7 +1022,7 @@ dnl DEALINGS IN THE SOFTWARE.
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.13.0])
m4_define([vers_have], [1.16.0])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1049,7 +1049,7 @@ AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
# which is not the best choice for supporting other OS'es, but covers most
# of the ones we need for now.
AC_MSG_CHECKING([if $RAWCPP requires -undef])
AC_LANG_CONFTEST([Does cpp redefine unix ?])
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
AC_MSG_RESULT([no])
else
@ -1067,7 +1067,7 @@ fi
rm -f conftest.$ac_ext
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
AC_MSG_RESULT([no])
else
@ -1442,6 +1442,8 @@ AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
#
AC_DEFUN([XORG_WITH_XSLTPROC],[
AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
# Preserves the interface, should it be implemented later
m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(xsltproc,
AS_HELP_STRING([--with-xsltproc],
@ -1472,13 +1474,65 @@ else
AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
fi
# Checking for minimum version is not implemented
# but we want to keep the interface consistent with other commands
m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)])
AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
]) # XORG_WITH_XSLTPROC
# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
# ----------------------------------------
# Minimum version: 1.15.0
#
# PERL (Practical Extraction and Report Language) is a language optimized for
# scanning arbitrary text files, extracting information from those text files,
# and printing reports based on that information.
#
# When DEFAULT is not specified, --with-perl assumes 'auto'.
#
# Interface to module:
# HAVE_PERL: used in makefiles to conditionally scan text files
# PERL: returns the path of the perl program found
# returns the path set by the user in the environment
# --with-perl: 'yes' user instructs the module to use perl
# 'no' user instructs the module not to use perl
# have_perl: returns yes if perl found in PATH or no
#
# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
#
AC_DEFUN([XORG_WITH_PERL],[
AC_ARG_VAR([PERL], [Path to perl command])
# Preserves the interface, should it be implemented later
m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(perl,
AS_HELP_STRING([--with-perl],
[Use perl for extracting information from files (default: ]_defopt[)]),
[use_perl=$withval], [use_perl=]_defopt)
m4_undefine([_defopt])
if test "x$use_perl" = x"auto"; then
AC_PATH_PROG([PERL], [perl])
if test "x$PERL" = "x"; then
AC_MSG_WARN([perl not found - cannot extract information and report])
have_perl=no
else
have_perl=yes
fi
elif test "x$use_perl" = x"yes" ; then
AC_PATH_PROG([PERL], [perl])
if test "x$PERL" = "x"; then
AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
fi
have_perl=yes
elif test "x$use_perl" = x"no" ; then
if test "x$PERL" != "x"; then
AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
fi
have_perl=no
else
AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
fi
AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
]) # XORG_WITH_PERL
# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
# ----------------
@ -1725,10 +1779,11 @@ AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
]) # XORG_WITH_GROFF
# XORG_WITH_FOP([DEFAULT])
# ----------------
# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
# ---------------------------------------
# Minimum version: 1.6.0
# Minimum version for optional DEFAULT argument: 1.11.0
# Minimum version for optional MIN-VERSION argument: 1.15.0
#
# Documentation tools are not always available on all platforms and sometimes
# not at the appropriate level. This macro enables a module to test for the
@ -1748,7 +1803,7 @@ AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
#
AC_DEFUN([XORG_WITH_FOP],[
AC_ARG_VAR([FOP], [Path to fop command])
m4_define([_defopt], m4_default([$1], [auto]))
m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(fop,
AS_HELP_STRING([--with-fop],
[Use fop to regenerate documentation (default: ]_defopt[)]),
@ -1777,6 +1832,22 @@ elif test "x$use_fop" = x"no" ; then
else
AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
fi
# Test for a minimum version of fop, if provided.
m4_ifval([$1],
[if test "$have_fop" = yes; then
# scrape the fop version
AC_MSG_CHECKING([for fop minimum version])
fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
AC_MSG_RESULT([$fop_version])
AS_VERSION_COMPARE([$fop_version], [$1],
[if test "x$use_fop" = xauto; then
AC_MSG_WARN([fop version $fop_version found, but $1 needed])
have_fop=no
else
AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
fi])
fi])
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
]) # XORG_WITH_FOP
@ -1959,6 +2030,7 @@ AC_MSG_RESULT([$build_specs])
AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
AC_BEFORE([$0], [XORG_WITH_GLIB])
AC_BEFORE([$0], [XORG_LD_WRAP])
AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
m4_define([_defopt], m4_default([$1], [auto]))
AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
[Enable building unit test cases (default: ]_defopt[)]),
@ -2030,8 +2102,8 @@ fi
AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
]) # XORG_WITH_GLIB
# XORG_LD_WRAP
# ------------
# XORG_LD_WRAP([required|optional])
# ---------------------------------
# Minimum version: 1.13.0
#
# Check if linker supports -wrap, passed via compiler flags
@ -2039,10 +2111,18 @@ AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
# Otherwise the value of $enable_unit_tests is blank.
#
# Argument added in 1.16.0 - default is "required", to match existing behavior
# of returning an error if enable_unit_tests is yes, and ld -wrap is not
# available, an argument of "optional" allows use when some unit tests require
# ld -wrap and others do not.
#
AC_DEFUN([XORG_LD_WRAP],[
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
[AC_LANG_PROGRAM([#include <stdlib.h>
void __wrap_exit(int status) { return; }],
[exit(0);])])
# Not having ld wrap when unit testing has been explicitly requested is an error
if test "x$enable_unit_tests" = x"yes"; then
if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
if test "x$have_ld_wrap" = x"no"; then
AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
fi
@ -2055,7 +2135,7 @@ AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
# -----------------------
# SYNOPSIS
#
# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
#
# DESCRIPTION
#
@ -2065,6 +2145,8 @@ AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# PROGRAM-SOURCE is the program source to link with, if needed
#
# NOTE: Based on AX_CHECK_COMPILER_FLAGS.
#
# LICENSE
@ -2105,7 +2187,7 @@ AS_LITERAL_IF([$1],
[AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
ax_save_FLAGS=$LDFLAGS
LDFLAGS="$1"
AC_LINK_IFELSE([AC_LANG_PROGRAM()],
AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
LDFLAGS=$ax_save_FLAGS])],
@ -2124,6 +2206,52 @@ else
fi
]) # XORG_CHECK_LINKER_FLAGS
# XORG_MEMORY_CHECK_FLAGS
# -----------------------
# Minimum version: 1.16.0
#
# This macro attempts to find appropriate memory checking functionality
# for various platforms which unit testing code may use to catch various
# forms of memory allocation and access errors in testing.
#
# Interface to module:
# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
# Usually added to TESTS_ENVIRONMENT in Makefile.am
#
# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
#
AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
[Environment variables to enable memory checking in tests])
# Check for different types of support on different platforms
case $host_os in
solaris*)
AC_CHECK_LIB([umem], [umem_alloc],
[malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
;;
*-gnu*) # GNU libc - Value is used as a single byte bit pattern,
# both directly and inverted, so should not be 0 or 255.
malloc_debug_env='MALLOC_PERTURB_=15'
;;
darwin*)
malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
;;
*bsd*)
malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
;;
esac
# User supplied flags override default flags
if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
fi
AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
]) # XORG_WITH_LINT
# XORG_CHECK_MALLOC_ZERO
# ----------------------
# Minimum version: 1.0.0
@ -2275,28 +2403,204 @@ AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
]) # XORG_LINT_LIBRARY
# XORG_COMPILER_BRAND
# -------------------
# Minimum version: 1.14.0
#
# Checks for various brands of compilers and sets flags as appropriate:
# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
# clang compiler - sets CLANGCC to "yes"
# Intel compiler - sets INTELCC to "yes"
# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
#
AC_DEFUN([XORG_COMPILER_BRAND], [
AC_REQUIRE([AC_PROG_CC_C99])
AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
]) # XORG_COMPILER_BRAND
# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
# ---------------
# Minimum version: 1.16.0
#
# Test if the compiler works when passed the given flag as a command line argument.
# If it succeeds, the flag is appeneded to the given variable. If not, it tries the
# next flag in the list until there are no more options.
#
# Note that this does not guarantee that the compiler supports the flag as some
# compilers will simply ignore arguments that they do not understand, but we do
# attempt to weed out false positives by using -Werror=unknown-warning-option and
# -Werror=unused-command-line-argument
#
AC_DEFUN([XORG_TESTSET_CFLAG], [
AC_REQUIRE([AC_PROG_CC_C99])
m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
xorg_testset_save_CFLAGS="$CFLAGS"
if test "x$xorg_testset_unknown_warning_option" = "x" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
AC_MSG_CHECKING([if $CC supports -Werror=unknown-warning-option])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
[xorg_testset_unknown_warning_option=yes],
[xorg_testset_unknown_warning_option=no])
AC_MSG_RESULT([$xorg_testset_unknown_warning_option])
CFLAGS="$xorg_testset_save_CFLAGS"
fi
if test "x$xorg_testset_unused_command_line_argument" = "x" ; then
if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
AC_MSG_CHECKING([if $CC supports -Werror=unused-command-line-argument])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
[xorg_testset_unused_command_line_argument=yes],
[xorg_testset_unused_command_line_argument=no])
AC_MSG_RESULT([$xorg_testset_unused_command_line_argument])
CFLAGS="$xorg_testset_save_CFLAGS"
fi
found="no"
m4_foreach([flag], m4_cdr($@), [
if test $found = "no" ; then
if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
fi
CFLAGS="$CFLAGS ]flag["
AC_MSG_CHECKING([if $CC supports ]flag[])
AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
[supported=yes], [supported=no])
AC_MSG_RESULT([$supported])
CFLAGS="$xorg_testset_save_CFLAGS"
if test "$supported" = "yes" ; then
$1="$$1 ]flag["
found="yes"
fi
fi
])
]) # XORG_TESTSET_CFLAG
# XORG_COMPILER_FLAGS
# ---------------
# Minimum version: 1.16.0
#
# Defines BASE_CFLAGS to contain a set of command line arguments supported
# by the selected compiler which do NOT alter the generated code. These
# arguments will cause the compiler to print various warnings during
# compilation AND turn a conservative set of warnings into errors.
#
# The set of flags supported by BASE_CFLAGS will grow in future
# versions of util-macros as options are added to new compilers.
#
AC_DEFUN([XORG_COMPILER_FLAGS], [
AC_REQUIRE([XORG_COMPILER_BRAND])
AC_ARG_ENABLE(selective-werror,
AS_HELP_STRING([--disable-selective-werror],
[Turn off selective compiler errors. (default: enabled)]),
[SELECTIVE_WERROR=$enableval],
[SELECTIVE_WERROR=yes])
# -v is too short to test reliably with XORG_TESTSET_CFLAG
if test "x$SUNCC" = "xyes"; then
BASE_CFLAGS="-v"
else
BASE_CFLAGS=""
fi
# This chunk of warnings were those that existed in the legacy CWARNFLAGS
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wall])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-arith])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wstrict-prototypes])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-prototypes])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-declarations])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnested-externs])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wbad-function-cast])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wformat=2], [-Wformat])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wold-style-definition])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdeclaration-after-statement])
# This chunk adds additional warnings that could catch undesired effects.
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wunused])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wuninitialized])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wshadow])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-qual])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-noreturn])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-format-attribute])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wredundant-decls])
# These are currently disabled because they are noisy. They will be enabled
# in the future once the codebase is sufficiently modernized to silence
# them. For now, I don't want them to drown out the other warnings.
# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wlogical-op])
# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wparentheses])
# XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wcast-align])
# Turn some warnings into errors, so we don't accidently get successful builds
# when there are problems that should be fixed.
if test "x$SELECTIVE_WERROR" = "xyes" ; then
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=nonnull])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=init-self])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=main])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=missing-braces])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=sequence-point])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=trigraphs])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=array-bounds])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=write-strings])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=address])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
else
AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wimplicit])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wnonnull])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Winit-self])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmain])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wmissing-braces])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wsequence-point])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wreturn-type])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wtrigraphs])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Warray-bounds])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wwrite-strings])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Waddress])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wint-to-pointer-cast])
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wpointer-to-int-cast])
fi
AC_SUBST([BASE_CFLAGS])
]) # XORG_COMPILER_FLAGS
# XORG_CWARNFLAGS
# ---------------
# Minimum version: 1.2.0
# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
#
# Defines CWARNFLAGS to enable C compiler warnings.
#
# This function is deprecated because it defines -fno-strict-aliasing
# which alters the code generated by the compiler. If -fno-strict-aliasing
# is needed, then it should be added explicitly in the module when
# it is updated to use BASE_CFLAGS.
#
AC_DEFUN([XORG_CWARNFLAGS], [
AC_REQUIRE([AC_PROG_CC_C99])
AC_REQUIRE([XORG_COMPILER_FLAGS])
AC_REQUIRE([XORG_COMPILER_BRAND])
CWARNFLAGS="$BASE_CFLAGS"
if test "x$GCC" = xyes ; then
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
-Wbad-function-cast -Wformat=2"
case `$CC -dumpversion` in
3.4.* | 4.*)
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
;;
esac
else
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
if test "x$SUNCC" = "xyes"; then
CWARNFLAGS="-v"
fi
CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
fi
AC_SUBST(CWARNFLAGS)
]) # XORG_CWARNFLAGS
@ -2305,28 +2609,36 @@ AC_SUBST(CWARNFLAGS)
# -----------------------
# Minimum version: 1.3.0
#
# Add configure option to enable strict compilation
# Add configure option to enable strict compilation flags, such as treating
# warnings as fatal errors.
# If --enable-strict-compilation is passed to configure, adds strict flags to
# $BASE_CFLAGS and the deprecated $CWARNFLAGS.
#
# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
# when strict compilation is unconditionally desired.
AC_DEFUN([XORG_STRICT_OPTION], [
# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
AC_REQUIRE([AC_PROG_CC_C99])
AC_REQUIRE([XORG_CWARNFLAGS])
AC_REQUIRE([XORG_COMPILER_FLAGS])
AC_ARG_ENABLE(strict-compilation,
AS_HELP_STRING([--enable-strict-compilation],
[Enable all warnings from compiler and make them errors (default: disabled)]),
[STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
STRICT_CFLAGS=""
XORG_TESTSET_CFLAG([STRICT_CFLAGS], [-pedantic])
XORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror], [-errwarn])
# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
# activate it with -Werror, so we add it here explicitly.
XORG_TESTSET_CFLAG([STRICT_CFLAGS], [-Werror=attributes])
if test "x$STRICT_COMPILE" = "xyes"; then
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
if test "x$GCC" = xyes ; then
STRICT_CFLAGS="-pedantic -Werror"
elif test "x$SUNCC" = "xyes"; then
STRICT_CFLAGS="-errwarn"
elif test "x$INTELCC" = "xyes"; then
STRICT_CFLAGS="-Werror"
fi
BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS"
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
fi
CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
AC_SUBST([STRICT_CFLAGS])
AC_SUBST([BASE_CFLAGS])
AC_SUBST([CWARNFLAGS])
]) # XORG_STRICT_OPTION
@ -2338,6 +2650,7 @@ AC_SUBST([CWARNFLAGS])
#
AC_DEFUN([XORG_DEFAULT_OPTIONS], [
AC_REQUIRE([AC_PROG_INSTALL])
XORG_COMPILER_FLAGS
XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_RELEASE_VERSION

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
dnl Copyright 2005 Red Hat, Inc.
dnl
dnl
dnl Permission to use, copy, modify, distribute, and sell this software
dnl and its documentation for any purpose is hereby granted without fee,
dnl provided that the above copyright notice appear in all copies and
@ -9,7 +9,7 @@ dnl advertising or publicity pertaining to distribution of the software
dnl without specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any
dnl purpose. It is provided "as is" without express or implied warranty.
dnl
dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
dnl NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([mkfontscale], [1.0.9],
AC_INIT([mkfontscale], [1.1.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[mkfontscale])
AC_CONFIG_SRCDIR([Makefile.am])
@ -38,11 +38,11 @@ m4_ifndef([XORG_MACROS_VERSION],
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_CHECK_LIB(z, gzopen, [],
AC_CHECK_LIB(z, gzopen, [],
[AC_MSG_ERROR([zlib is required, but was not found.])])
AC_ARG_WITH(bzip2,
AS_HELP_STRING([--with-bzip2],
AC_ARG_WITH(bzip2,
AS_HELP_STRING([--with-bzip2],
[Support bzip2 compressed bitmap fonts]),
[], [with_bzip2=no])
if test "x$with_bzip2" = xyes; then

View File

@ -26,8 +26,10 @@
/* Order is significant. For example, some B&H fonts are hinted by
URW++, and both strings appear in the notice. */
static char *notice_foundries[][2] =
{{"Bigelow", "b&h"},
static const char *notice_foundries[][2] =
{{"Iorsh", "culmus"},
{"Gnat", "culmus"},
{"Bigelow", "b&h"},
{"Adobe", "adobe"},
{"Bitstream", "bitstream"},
{"Monotype", "monotype"},
@ -49,7 +51,7 @@ static char *notice_foundries[][2] =
/* It should not contain useless entries (such as UNKN) nor duplicate
entries for padding both with spaces and NULs. */
static char *vendor_foundries[][2] =
static const char *vendor_foundries[][2] =
{{"ADBE", "adobe"},
{"AGFA", "agfa"},
{"ALTS", "altsys"},
@ -59,6 +61,7 @@ static char *vendor_foundries[][2] =
{"B&H", "b&h"},
{"BITS", "bitstream"},
{"CANO", "cannon"},
{"CLM", "culmus"},
{"DYNA", "dynalab"},
{"EPSN", "epson"},
{"FJ", "fujitsu"},

View File

@ -31,7 +31,7 @@
#define NUMBUCKETS (1 << LOG2_NUMBUCKETS)
static unsigned
hash(char *string)
hash(const char *string)
{
int i;
unsigned u = 0;
@ -41,7 +41,7 @@ hash(char *string)
}
static void
strcpy_lwr(char *dst, char *src)
strcpy_lwr(char *dst, const char *src)
{
while(1) {
*dst = tolower(*src);
@ -77,7 +77,7 @@ destroyHashTable(HashTablePtr table)
}
char *
getHash(HashTablePtr table, char *key)
getHash(HashTablePtr table, const char *key)
{
int i = hash(key);
HashBucketPtr bp;
@ -173,7 +173,7 @@ hashArray(HashTablePtr table, int value_first)
{
int i, j, n;
HashBucketPtr *dst;
n = hashElements(table);
dst = malloc((n + 1) * sizeof(HashBucketPtr));
if(dst == NULL)

View File

@ -34,7 +34,7 @@ typedef HashBucketPtr* HashTablePtr;
HashTablePtr makeHashTable(void);
void destroyHashTable(HashTablePtr table);
char *getHash(HashTablePtr table, char *key);
char *getHash(HashTablePtr table, const char *key);
int putHash(HashTablePtr table, char *key, char *value, int prio);
int hashElements(HashTablePtr table);
HashBucketPtr *hashArray(HashTablePtr table, int value_first);

View File

@ -142,8 +142,8 @@ fontFileSeek(fontFile *ff, z_off_t offset, int whence)
break;
default:
return -1;
}
}
while (n > BUFSIZ) {
if (BZ2_bzread(ff->f.bz2, buf, BUFSIZ) != BUFSIZ)
return -1;
@ -221,7 +221,7 @@ getInt32(fontFile *f, int format)
}
}
int
int
bitmapIdentify(const char *filename, char **name)
{
fontFile ff;
@ -270,7 +270,7 @@ pcfIdentify(fontFile *f, char **name)
rc = fontFileSeek(f, prop_position, SEEK_SET);
if(rc < 0)
goto fail;
format = getLSB32(f);
if((format & 0xFFFFFF00) != 0)
goto fail;
@ -428,7 +428,7 @@ bdfIdentify(fontFile *f, char **name)
while(1) {
if(!eol) {
rc = bdfskip(f);
if(rc < 0)
if(rc < 0)
goto fail;
}
k = getKeyword(f, &eol);

View File

@ -27,7 +27,7 @@
#include "list.h"
int
listMember(char *elt, ListPtr list)
listMember(const char *elt, ListPtr list)
{
while(list != NULL) {
if(strcmp(elt, list->value) == 0)
@ -59,7 +59,7 @@ listAdjoin(char *car, ListPtr cdr)
}
char *
dsprintf(char *f, ...)
dsprintf(const char *f, ...)
{
va_list args;
char *string;
@ -84,10 +84,10 @@ dsprintf(char *f, ...)
}
}
}
ListPtr
listConsF(ListPtr cdr, char *f, ...)
listConsF(ListPtr cdr, const char *f, ...)
{
va_list args;
char *string;
@ -114,7 +114,7 @@ listConsF(ListPtr cdr, char *f, ...)
}
ListPtr
listAdjoinF(ListPtr cdr, char *f, ...)
listAdjoinF(ListPtr cdr, const char *f, ...)
{
va_list args;
char *string;
@ -151,7 +151,7 @@ listLength(ListPtr list)
return n;
}
ListPtr
ListPtr
appendList(ListPtr first, ListPtr second)
{
ListPtr current;

View File

@ -25,18 +25,18 @@
#include <X11/Xfuncproto.h> /* for _X_ATTRIBUTE_PRINTF */
char *dsprintf(char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
char *dsprintf(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
typedef struct _List {
char *value;
struct _List *next;
} ListRec, *ListPtr;
int listMember(char *elt, ListPtr list);
int listMember(const char *elt, ListPtr list);
ListPtr listCons(char *car, ListPtr cdr);
ListPtr listAdjoin(char *car, ListPtr cdr);
ListPtr listConsF(ListPtr cdr, char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
ListPtr listAdjoinF(ListPtr cdr, char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
ListPtr listConsF(ListPtr cdr, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
ListPtr listAdjoinF(ListPtr cdr, const char *f, ...) _X_ATTRIBUTE_PRINTF(2,3);
int listLength(ListPtr list);
ListPtr appendList(ListPtr first, ListPtr second);
ListPtr makeList(char **a, int n, ListPtr old, int begin);

View File

@ -70,6 +70,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@ -126,6 +127,7 @@ PKG_CONFIG = @PKG_CONFIG@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
X11_CFLAGS = @X11_CFLAGS@

View File

@ -60,7 +60,7 @@
#define QUOTE(x) #x
#define STRINGIFY(x) QUOTE(x)
static char *encodings_array[] =
static const char *encodings_array[] =
{ "ascii-0",
"iso8859-1", "iso8859-2", "iso8859-3", "iso8859-4", "iso8859-5",
"iso8859-6", "iso8859-6.8", "iso8859-6.8x", "iso8859-6.16",
@ -79,20 +79,20 @@ static char *encodings_array[] =
"gb2312.1980-0", "gb18030.2000-0", "gb18030.2000-1",
"ksc5601.1987-0", "ksc5601.1992-3"};
static char *extra_encodings_array[] =
static const char *extra_encodings_array[] =
{ "iso10646-1", "adobe-fontspecific", "microsoft-symbol" };
static ListPtr encodings, extra_encodings;
static char *outfilename;
static const char *outfilename;
#define countof(_a) (sizeof(_a)/sizeof((_a)[0]))
static int doDirectory(char*, int, ListPtr);
static int doDirectory(const char*, int, ListPtr);
static int checkEncoding(FT_Face face, char *encoding_name);
static int checkExtraEncoding(FT_Face face, char *encoding_name, int found);
static int find_cmap(int type, int pid, int eid, FT_Face face);
static char* notice_foundry(char *notice);
static char* vendor_foundry(signed char *vendor);
static const char* notice_foundry(const char *notice);
static const char* vendor_foundry(const signed char *vendor);
static int readFontScale(HashTablePtr entries, char *dirname);
ListPtr makeXLFD(char *filename, FT_Face face, int);
static int readEncodings(ListPtr encodings, char *dirname);
@ -113,7 +113,7 @@ static char *exclusionSuffix;
static void
usage(void)
{
fprintf(stderr,
fprintf(stderr,
"mkfontscale [ -b ] [ -s ] [ -o filename ] [-x suffix ]\n"
" [ -a encoding ] [ -f fuzz ] [ -l ] "
" [ -e directory ] [ -p prefix ] [ -n ] [ -r ] \n"
@ -143,7 +143,7 @@ main(int argc, char **argv)
encodings = makeList(encodings_array, countof(encodings_array), NULL, 0);
extra_encodings = makeList(extra_encodings_array,
extra_encodings = makeList(extra_encodings_array,
countof(extra_encodings_array),
NULL, 0);
doBitmaps = 0;
@ -204,7 +204,7 @@ main(int argc, char **argv)
argn++;
} else if(strcmp(argv[argn], "-U") == 0) {
doISO10646_1_encoding = 1;
argn++;
argn++;
} else if(strcmp(argv[argn], "-s") == 0) {
doScalable = 0;
argn++;
@ -244,7 +244,7 @@ main(int argc, char **argv)
if(outfilename == NULL) {
if(doBitmaps)
outfilename = "fonts.dir";
else
else
outfilename = "fonts.scale";
}
@ -313,9 +313,9 @@ getName(FT_Face face, int nid)
char *string;
int i;
if(getNameHelper(face, nid,
if(getNameHelper(face, nid,
TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, &name) ||
getNameHelper(face, nid,
getNameHelper(face, nid,
TT_PLATFORM_APPLE_UNICODE, -1, &name)) {
string = malloc(name.string_len / 2 + 1);
if(string == NULL) {
@ -348,7 +348,7 @@ getName(FT_Face face, int nid)
return NULL;
}
static char*
static const char*
os2Weight(int weight)
{
if(weight < 150)
@ -367,11 +367,11 @@ os2Weight(int weight)
return "bold";
else if(weight < 850)
return "extrabold";
else
else
return "black";
}
static char*
static const char*
os2Width(int width)
{
if(width <= 1)
@ -394,15 +394,15 @@ os2Width(int width)
return "ultraexpanded";
}
static char *widths[] = {
static const char *widths[] = {
"ultracondensed", "extracondensed", "condensed", "semicondensed",
"normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded"
"normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded"
};
#define NUMWIDTHS (sizeof(widths) / sizeof(widths[0]))
static char*
nameWidth(char *name)
static const char*
nameWidth(const char *name)
{
char buf[500];
int i;
@ -419,13 +419,15 @@ nameWidth(char *name)
return NULL;
}
static char*
t1Weight(char *weight)
static const char*
t1Weight(const char *weight)
{
if(!weight)
return NULL;
if(strcmp(weight, "Thin") == 0)
return "thin";
if(strcmp(weight, "ExtraLight") == 0) /* FontForge uses this for 200*/
return "extralight";
if(strcmp(weight, "Light") == 0)
return "light";
if(strcmp(weight, "Regular") == 0)
@ -446,6 +448,8 @@ t1Weight(char *weight)
return "semibold";
else if(strcmp(weight, "Bold") == 0)
return "bold";
else if(strcmp(weight, "Heavy") == 0) /* FontForge uses this for 800*/
return "extrabold";
else if(strcmp(weight, "Black") == 0)
return "black";
else {
@ -457,13 +461,13 @@ t1Weight(char *weight)
static int
unsafe(char c)
{
return
return
c < 0x20 || c > 0x7E ||
c == '[' || c == ']' || c == '(' || c == ')' || c == '\\' || c == '-';
}
static char *
safe(char* s)
static const char *
safe(const char* s)
{
int i, len, safe_flag = 1;
char *t;
@ -498,7 +502,7 @@ ListPtr
makeXLFD(char *filename, FT_Face face, int isBitmap)
{
ListPtr xlfd = NULL;
char *foundry, *family, *weight, *slant, *sWidth, *adstyle,
const char *foundry, *family, *weight, *slant, *sWidth, *adstyle,
*spacing, *full_name;
TT_Header *head;
TT_HoriHeader *hhea;
@ -526,7 +530,7 @@ makeXLFD(char *filename, FT_Face face, int isBitmap)
t1info = &t1info_rec;
else
t1info = NULL;
if(!family)
family = getName(face, TT_NAME_ID_FONT_FAMILY);
if(!family)
@ -564,7 +568,7 @@ makeXLFD(char *filename, FT_Face face, int isBitmap)
}
}
}
if(t1info) {
if(!family)
family = t1info->family_name;
@ -750,7 +754,7 @@ filePrio(char *filename)
}
static int
doDirectory(char *dirname_given, int numEncodings, ListPtr encodingsToDo)
doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
{
char *dirname, *fontscale_name, *filename, *encdir;
FILE *fontscale, *encfile;
@ -780,9 +784,9 @@ doDirectory(char *dirname_given, int numEncodings, ListPtr encodingsToDo)
exit(1);
}
if (onlyEncodings)
if (onlyEncodings)
goto encodings;
entries = makeHashTable();
if(doBitmaps && !doScalable) {
readFontScale(entries, dirname);
@ -858,7 +862,7 @@ doDirectory(char *dirname_given, int numEncodings, ListPtr encodingsToDo)
isBitmap = 1;
}
}
if(isBitmap) {
if(!doBitmaps)
goto done;
@ -929,7 +933,7 @@ doDirectory(char *dirname_given, int numEncodings, ListPtr encodingsToDo)
putHash(entries, buf, entry->d_name, filePrio(entry->d_name));
}
}
for(encoding = extra_encodings; encoding;
for(encoding = extra_encodings; encoding;
encoding = encoding->next) {
if(checkExtraEncoding(face, encoding->value, found)) {
/* Do not set found! */
@ -990,7 +994,7 @@ doDirectory(char *dirname_given, int numEncodings, ListPtr encodingsToDo)
#define CODE_IGNORED(c) ((c) < 0x20 || \
((c) >= 0x7F && (c) <= 0xA0) || \
(c) == 0xAD || (c) == 0xF71B)
static int
checkEncoding(FT_Face face, char *encoding_name)
{
@ -1006,7 +1010,7 @@ checkEncoding(FT_Face face, char *encoding_name)
/* An encoding is ``small'' if one of the following is true:
- it is linear and has no more than 256 codepoints; or
- it is a matrix encoding and has no more than one column.
For small encodings using Unicode indices, we require perfect
coverage except for CODE_IGNORED and KOI-8 IBM-PC compatibility.
@ -1021,8 +1025,8 @@ checkEncoding(FT_Face face, char *encoding_name)
if(mapping->type == FONT_ENCODING_POSTSCRIPT) {
if(encoding->row_size > 0) {
for(i = encoding->first; i < encoding->size; i++) {
for(j = encoding->first_col;
j < encoding->row_size;
for(j = encoding->first_col;
j < encoding->row_size;
j++) {
n = FontEncName((i<<8) | j, mapping);
if(n && FT_Get_Name_Index(face, n) == 0) {
@ -1048,12 +1052,12 @@ checkEncoding(FT_Face face, char *encoding_name)
if(find_cmap(mapping->type, mapping->pid, mapping->eid, face)) {
int total = 0, failed = 0;
if(encoding->row_size > 0) {
int estimate =
int estimate =
(encoding->size - encoding->first) *
(encoding->row_size - encoding->first_col);
for(i = encoding->first; i < encoding->size; i++) {
for(j = encoding->first_col;
j < encoding->row_size;
for(j = encoding->first_col;
j < encoding->row_size;
j++) {
c = FontEncRecode((i<<8) | j, mapping);
if(CODE_IGNORED(c)) {
@ -1108,7 +1112,7 @@ checkEncoding(FT_Face face, char *encoding_name)
return 0;
}
static int
static int
find_cmap(int type, int pid, int eid, FT_Face face)
{
int i, n, rc;
@ -1131,7 +1135,7 @@ find_cmap(int type, int pid, int eid, FT_Face face)
/* prefer Microsoft Unicode */
for(i=0; i<n; i++) {
cmap = face->charmaps[i];
if(cmap->platform_id == TT_PLATFORM_MICROSOFT &&
if(cmap->platform_id == TT_PLATFORM_MICROSOFT &&
cmap->encoding_id == TT_MS_ID_UNICODE_CS) {
rc = FT_Set_Charmap(face, cmap);
if(rc == 0)
@ -1205,8 +1209,8 @@ checkExtraEncoding(FT_Face face, char *encoding_name, int found)
}
}
static char*
notice_foundry(char *notice)
static const char*
notice_foundry(const char *notice)
{
int i;
for(i = 0; i < countof(notice_foundries); i++)
@ -1216,7 +1220,7 @@ notice_foundry(char *notice)
}
static int
vendor_match(signed char *vendor, char *vendor_string)
vendor_match(const signed char *vendor, const char *vendor_string)
{
/* vendor is not necessarily NUL-terminated. */
int i, len;
@ -1229,8 +1233,8 @@ vendor_match(signed char *vendor, char *vendor_string)
return 1;
}
static char*
vendor_foundry(signed char *vendor)
static const char*
vendor_foundry(const signed char *vendor)
{
int i;
for(i = 0; i < countof(vendor_foundries); i++)
@ -1263,7 +1267,7 @@ readEncodings(ListPtr encodings, char *dirname)
closedir(dirp);
return -1;
}
names = FontEncIdentify(fullname);
if(!names)
continue;
@ -1280,7 +1284,7 @@ readEncodings(ListPtr encodings, char *dirname)
encodingsToDo = listConsF(encodingsToDo, "%s %s", *name, n);
free(n);
} else {
encodingsToDo =
encodingsToDo =
listConsF(encodingsToDo, "%s %s", *name, fullname);
}
if(encodingsToDo == NULL) {