Update to fonttosfnt 1.2.2

pull/1/head
matthieu 2021-08-29 17:39:13 +00:00
parent 04380bf421
commit d691d86121
4 changed files with 53 additions and 28 deletions

View File

@ -1,3 +1,25 @@
commit 2726947ea34653a90f89163849887c11179b2d6d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jun 15 10:33:54 2021 +1000
Bump to 1.2.2
commit 9ea3677ba344c7ebd47f8078d11f69d117b9541e
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Mon Oct 26 12:17:45 2020 +0100
1em is font size, not height
commit 49524b5db4867b5e896ed299fd66b390e68f1ffc
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue May 25 09:50:45 2021 +1000
Fail if ftell fails
Fixes a coverity warning: ftell may return -1 on error which we then pass into
fseek later. We properly fail there anyway, so this change is unlikely to have
any real effect.
commit 33f944705c6c42e1b52f6ec62131d31f737c638f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Dec 16 15:14:11 2020 +1000

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for fonttosfnt 1.2.1.
# Generated by GNU Autoconf 2.69 for fonttosfnt 1.2.2.
#
# Report bugs to <https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues>.
#
@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='fonttosfnt'
PACKAGE_TARNAME='fonttosfnt'
PACKAGE_VERSION='1.2.1'
PACKAGE_STRING='fonttosfnt 1.2.1'
PACKAGE_VERSION='1.2.2'
PACKAGE_STRING='fonttosfnt 1.2.2'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues'
PACKAGE_URL=''
@ -1324,7 +1324,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures fonttosfnt 1.2.1 to adapt to many kinds of systems.
\`configure' configures fonttosfnt 1.2.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1395,7 +1395,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of fonttosfnt 1.2.1:";;
short | recursive ) echo "Configuration of fonttosfnt 1.2.2:";;
esac
cat <<\_ACEOF
@ -1504,7 +1504,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
fonttosfnt configure 1.2.1
fonttosfnt configure 1.2.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1828,7 +1828,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by fonttosfnt $as_me 1.2.1, which was
It was created by fonttosfnt $as_me 1.2.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -2657,7 +2657,7 @@ fi
# Define the identity of the package.
PACKAGE='fonttosfnt'
VERSION='1.2.1'
VERSION='1.2.2'
cat >>confdefs.h <<_ACEOF
@ -11156,7 +11156,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by fonttosfnt $as_me 1.2.1, which was
This file was extended by fonttosfnt $as_me 1.2.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -11222,7 +11222,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
fonttosfnt config.status 1.2.1
fonttosfnt config.status 1.2.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -1,6 +1,6 @@
dnl Copyright 2005 Red Hat, Inc.
dnl
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT(fonttosfnt,[1.2.1], [https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues],fonttosfnt)
AC_INIT(fonttosfnt,[1.2.2], [https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues],fonttosfnt)
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])

View File

@ -238,66 +238,65 @@ fontMetrics(FontPtr font)
if (count) font->metrics.awidth = sumAwidth / count;
font->metrics.height = TWO_SIXTEENTH;
font->metrics.size = TWO_SIXTEENTH;
if(font->pxMetrics.size == UNDEF) {
font->pxMetrics.size = font->pxMetrics.height;
font->metrics.size = font->metrics.height;
}
font->metrics.size = font->pxMetrics.size
* TWO_SIXTEENTH / font->pxMetrics.height;
font->metrics.height = font->pxMetrics.height
* font->metrics.size / font->pxMetrics.size;
if(font->pxMetrics.ascent == UNDEF) {
font->metrics.ascent = font->metrics.maxY;
font->pxMetrics.ascent =
font->metrics.ascent
* font->pxMetrics.height / TWO_SIXTEENTH;
* font->pxMetrics.size / font->metrics.size;
}
else
font->metrics.ascent =
font->pxMetrics.ascent
* TWO_SIXTEENTH / font->pxMetrics.height;
* font->metrics.size / font->pxMetrics.size;
if(font->pxMetrics.descent == UNDEF) {
font->metrics.descent = - font->metrics.minY;
font->pxMetrics.descent =
font->metrics.descent
* font->pxMetrics.height / TWO_SIXTEENTH;
* font->pxMetrics.size / font->metrics.size;
}
else
font->metrics.descent =
font->pxMetrics.descent
* TWO_SIXTEENTH / font->pxMetrics.height;
* font->metrics.size / font->pxMetrics.size;
if(font->pxMetrics.capHeight == UNDEF) {
if(glyphMetrics(font, 'X', NULL, NULL, NULL, NULL, &font->metrics.capHeight) != 1)
font->metrics.capHeight = font->metrics.ascent;
font->pxMetrics.capHeight =
font->metrics.capHeight * font->pxMetrics.height / TWO_SIXTEENTH;
font->metrics.capHeight * font->pxMetrics.size / font->metrics.size;
}
else
font->metrics.capHeight =
font->pxMetrics.capHeight
* TWO_SIXTEENTH / font->pxMetrics.height;
* font->metrics.size / font->pxMetrics.size;
if(font->pxMetrics.xHeight == UNDEF) {
if(glyphMetrics(font, 'x', NULL, NULL, NULL, NULL, &font->metrics.xHeight) != 1)
font->metrics.xHeight = font->metrics.capHeight * 2 / 3;
font->pxMetrics.xHeight =
font->metrics.xHeight * font->pxMetrics.height / TWO_SIXTEENTH;
font->metrics.xHeight * font->pxMetrics.size / font->metrics.size;
}
else
font->metrics.xHeight =
font->pxMetrics.xHeight
* TWO_SIXTEENTH / font->pxMetrics.height;
* font->metrics.size / font->pxMetrics.size;
if(font->pxMetrics.underlinePosition == UNDEF)
font->metrics.underlinePosition = - font->metrics.descent * 2;
else {
font->metrics.underlinePosition =
font->pxMetrics.underlinePosition
* TWO_SIXTEENTH / font->pxMetrics.height;
* font->metrics.size / font->pxMetrics.size;
}
if(font->pxMetrics.underlineThickness == UNDEF)
@ -306,12 +305,12 @@ fontMetrics(FontPtr font)
* X Logical Font Description Conventions (xlfd.txt)
* by also considering the font weight. */
font->metrics.underlineThickness =
TWO_SIXTEENTH
/ (font->pxMetrics.height < 9 ? font->pxMetrics.height : 9);
font->metrics.size
/ (font->pxMetrics.size < 9 ? font->pxMetrics.size : 9);
else
font->metrics.underlineThickness =
font->pxMetrics.underlineThickness
* TWO_SIXTEENTH / font->pxMetrics.height;
* font->metrics.size / font->pxMetrics.size;
}
int
@ -758,6 +757,10 @@ writeEBLC(FILE* out, FontPtr font)
int offset;
location = ftell(out);
if (location == -1) {
perror("Couldn't ftell");
return -1;
}
rc = fseek(out, table->location + 4, SEEK_SET);
if(rc != 0) {
perror("Couldn't seek");