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 commit 33f944705c6c42e1b52f6ec62131d31f737c638f
Author: Peter Hutterer <peter.hutterer@who-t.net> Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Dec 16 15:14:11 2020 +1000 Date: Wed Dec 16 15:14:11 2020 +1000

View File

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

View File

@ -1,6 +1,6 @@
dnl Copyright 2005 Red Hat, Inc. dnl Copyright 2005 Red Hat, Inc.
dnl dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its 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 documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both 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 # Initialize Autoconf
AC_PREREQ([2.60]) 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_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])

View File

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