Update a bit for the changes in FreeType 2.7.1

Our test case relies on the outcome of the family property from freetype though,
it was changed in 2.7.1:

  - PCF family names are made more `colourful'; they now include the
    foundry  and information  whether they contain  wide characters.
    For example,  you no longer get `Fixed' but  rather `Sony Fixed'
    or `Misc Fixed Wide'.

https://bugs.freedesktop.org/show_bug.cgi?id=47704
This commit is contained in:
Akira TAGOH 2017-03-21 12:25:45 +09:00
parent abdb6d658e
commit 5ca2b1e6dc
5 changed files with 48 additions and 2 deletions

View File

@ -301,6 +301,15 @@ AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.])
PKG_CHECK_MODULES(FREETYPE, freetype2) PKG_CHECK_MODULES(FREETYPE, freetype2)
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES freetype2" PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES freetype2"
dnl See http://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/VERSIONS.TXT for versioning in freetype
dnl
dnl The outcome of the family property has been changed in freetype-2.7.1.
dnl Our test cases relies on it and need to update the dependency to get it success.
dnl However it isn't exactly required to run fontconfig itself.
dnl so adding another test here for compatibility. it might be simplified in the future.
PKG_CHECK_EXISTS([freetype2 >= 19.0.13], [have_freetype_2_7_1=yes], [have_freetype_2_7_1=no])
AM_CONDITIONAL(FREETYPE_2_7_1, test "x$have_freetype_2_7_1" = xyes)
AC_SUBST(FREETYPE_LIBS) AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS) AC_SUBST(FREETYPE_CFLAGS)

View File

@ -10,7 +10,11 @@ AM_TESTS_ENVIRONMENT= \
SH_LOG_COMPILER = sh SH_LOG_COMPILER = sh
if FREETYPE_2_7_1
TESTS=run-test271.sh
else
TESTS=run-test.sh TESTS=run-test.sh
endif
TESTDATA=4x6.pcf 8x16.pcf out.expected fonts.conf.in TESTDATA=4x6.pcf 8x16.pcf out.expected fonts.conf.in

8
test/out271.expected Normal file
View File

@ -0,0 +1,8 @@
Misc Fixed:pixelsize=6
Sony Fixed:pixelsize=16
=
Misc Fixed:pixelsize=6
Sony Fixed:pixelsize=16
=
Misc Fixed:pixelsize=6
Sony Fixed:pixelsize=16

View File

@ -29,6 +29,7 @@ TESTDIR=${srcdir-"$MyPWD"}
FONTDIR="$MyPWD"/fonts FONTDIR="$MyPWD"/fonts
CACHEDIR="$MyPWD"/cache.dir CACHEDIR="$MyPWD"/cache.dir
EXPECTED=${EXPECTED-"out.expected"}
ECHO=true ECHO=true
@ -45,9 +46,9 @@ check () {
echo "=" >> out echo "=" >> out
$FCLIST - family pixelsize | sort >> out $FCLIST - family pixelsize | sort >> out
tr -d '\015' <out >out.tmp; mv out.tmp out tr -d '\015' <out >out.tmp; mv out.tmp out
if cmp out $TESTDIR/out.expected > /dev/null ; then : ; else if cmp out $TESTDIR/$EXPECTED > /dev/null ; then : ; else
echo "*** Test failed: $TEST" echo "*** Test failed: $TEST"
echo "*** output is in 'out', expected output in 'out.expected'" echo "*** output is in 'out', expected output in '$EXPECTED'"
exit 1 exit 1
fi fi
rm out rm out

24
test/run-test271.sh Normal file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# fontconfig/test/run-test271.sh
#
# Copyright © 2000 Keith Packard
#
# 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 both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of the author(s) not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. The authors make no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
EXPECTED=out271.expected sh `dirname $0`/run-test.sh