[Misc] Update version - #760
Conversation
| @@ -1 +1 @@ | |||
| 8.482.8.28.27.01-GA No newline at end of file | |||
| 8.492.8.29.28.01-GA No newline at end of file | |||
There was a problem hiding this comment.
diff --git a/.github/actions/build-serverless-adapter/action.yml b/.github/actions/build-serverless-adapter/action.yml
index 3250d65afe..aa3d9be478 100644
--- a/.github/actions/build-serverless-adapter/action.yml
+++ b/.github/actions/build-serverless-adapter/action.yml
@@ -44,8 +44,8 @@ runs:
id: maven
run: |
mkdir -p /opt/maven
- wget https://dlcdn.apache.org/maven/maven-3/3.9.15/binaries/apache-maven-3.9.15-bin.tar.gz
- tar -xvf apache-maven-3.9.15-bin.tar.gz -C /opt/maven --strip-components=1
+ wget https://dlcdn.apache.org/maven/maven-3/3.8.9/binaries/apache-maven-3.8.9-bin.tar.gz
+ tar -xvf apache-maven-3.8.9-bin.tar.gz -C /opt/maven --strip-components=1
echo "::set-output name=path::/opt/maven"
shell: bash
diff --git a/.jcheck/conf b/.jcheck/conf
index 473b3edec7..a62b379218 100644
--- a/.jcheck/conf
+++ b/.jcheck/conf
@@ -1,7 +1,7 @@
[general]
project=jdk8u
jbs=JDK
-version=openjdk8u492
+version=openjdk8u482
[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README
index d166ad76a8..0ab2a1798f 100644
--- a/THIRD_PARTY_README
+++ b/THIRD_PARTY_README
@@ -1028,12 +1028,12 @@ That's all there is to it!
-------------------------------------------------------------------------------
-%% This notice is provided with respect to Freetype v2.14.2 which may be
+%% This notice is provided with respect to Freetype v2.13.3 which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
-## The FreeType Project: Freetype v2.14.2
+## The FreeType Project: Freetype v2.13.3
### FreeType Notice
@@ -1056,24 +1056,25 @@ which fits your needs best.
### FreeType License
-Copyright (C) 1996-2025 by David Turner, Robert Wilhelm, and Werner Lemberg.
-Copyright (C) 2007-2025 by Dereg Clegg and Michael Toftdal.
-Copyright (C) 1996-2025 by Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
-Copyright (C) 2022-2025 by David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
-Copyright (C) 2004-2025 by Masatake YAMATO and Redhat K.K.
-Copyright (C) 2007-2025 by Derek Clegg and Michael Toftdal.
-Copyright (C) 2003-2025 by Masatake YAMATO, Red Hat K.K.,
-Copyright (C) 1996-2025 by David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
-Copyright (C) 2007-2025 by David Turner.
-Copyright (C) 2022-2025 by David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
-Copyright (C) 2007-2025 by Rahul Bhalerao rahul.bhalerao@redhat.com, b.rahul.pm@gmail.com.
-Copyright (C) 2025 by Behdad Esfahbod.
-Copyright (C) 2008-2025 by David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
-Copyright (C) 2013-2025 by Google, Inc.
-Copyright (C) 2019-2025 by Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
-Copyright (C) 2009-2025 by Oran Agra and Mickey Gabel.
-Copyright (C) 2018-2025 by David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg.
-Copyright (C) 2004-2025 by David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
+Copyright (C) 1996-2024 by David Turner, Robert Wilhelm, and Werner Lemberg.
+Copyright (C) 2007-2024 by Dereg Clegg and Michael Toftdal.
+Copyright (C) 1996-2024 by Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
+Copyright (C) 2022-2024 by David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
+Copyright (C) 2004-2024 by Masatake YAMATO and Redhat K.K.
+Copyright (C) 2007-2024 by Derek Clegg and Michael Toftdal.
+Copyright (C) 2003-2024 by Masatake YAMATO, Red Hat K.K.,
+Copyright (C) 1996-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
+Copyright (C) 2007-2024 by David Turner.
+Copyright (C) 2022-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+Copyright (C) 2007-2024 by Rahul Bhalerao rahul.bhalerao@redhat.com, b.rahul.pm@gmail.com.
+Copyright (C) 2008-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
+Copyright (C) 2013-2024 by Google, Inc.
+Copyright (C) 2019-2024 by Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
+Copyright (C) 2009-2024 by Oran Agra and Mickey Gabel.
+Copyright (C) 2018-2024 by David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg.
+Copyright (C) 2004-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
+
+
The FreeType Project LICENSE
----------------------------
@@ -1241,7 +1242,6 @@ Legal Terms
https://www.freetype.org
### GPL v2
@@ -2131,7 +2131,7 @@ included with JDK 8 and OpenJDK 8 source distributions.
-------------------------------------------------------------------------------
-%% This notice is provided with respect to libpng 1.6.57, which may be
+%% This notice is provided with respect to libpng 1.6.51, which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
@@ -2142,8 +2142,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2
---------------------------------------
-Copyright (C) 1995-2026 The PNG Reference Library Authors.
-Copyright (C) 2018-2026 Cosmin Truta
+Copyright (C) 1995-2025 The PNG Reference Library Authors.
+Copyright (C) 2018-2025 Cosmin Truta
Copyright (C) 1998-2018 Glenn Randers-Pehrson
Copyright (C) 1996-1997 Andreas Dilger
Copyright (C) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -2307,7 +2307,6 @@ This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes.
* Adam Richter
- * Alexander Smorkalov
* Andreas Dilger
* Chris Blume
* Cosmin Truta
@@ -2317,10 +2316,8 @@ Authors, for copyright and licensing purposes.
* Glenn Randers-Pehrson
* Greg Roelofs
* Guy Eric Schalnat
- * Halil Oktay
* James Yu
* John Bowler
- * Joshua Inscoe
* Kevin Bracey
* Lucas Chollet
* Magnus Holmgren
@@ -2329,23 +2326,19 @@ Authors, for copyright and licensing purposes.
* Mans Rullgard
* Matt Sarett
* Mike Klein
- * Mohammad Seet
* Pascal Massimino
* Paul Schmidt
- * Petr Simecek
* Philippe Antoine
* Qiang Zhou
* Sam Bushell
* Samuel Williams
* Simon-Pierre Cadieux
- * Taegu Ha (하태구)
* Tim Wegner
* Tobias Stoeckmann
* Tom Lane
* Tom Tanner
* Vadim Barkov
* Willem van Schaik
- * Yuelin Wang (王跃林)
* Zhijie Liang
* Apple Inc.
- Zixu Wang (王子旭)
@@ -2365,8 +2358,6 @@ Authors, for copyright and licensing purposes.
- ZhangLixia (张利霞)
* Samsung Group
- Filip Wasil
- * SpacemiT Hangzhou Technology, Co.
- - Liang Junzhao (梁俊钊)
The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have
@@ -2381,12 +2372,12 @@ licenses.
-------------------------------------------------------------------------------
-%% This notice is provided with respect to GIFLIB 6.1.2 & libungif 4.1.3,
+%% This notice is provided with respect to GIFLIB 5.2.1 & libungif 4.1.3,
which may be included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
-= MIT LICENSE
+The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -2406,36 +2397,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
----------------------------------
-The below applies to the following file(s):
-giflib/dgif_lib.c
-giflib/gifalloc.c
-giflib/gif_err.c
-giflib/openbsd-reallocarray.c
-
-Copyright (C) 1989 Gershon Elber
-Copyright (C) 2008 Otto Moerbeek <otto@drijf.net>
-Copyright (C) Eric S. Raymond <esr@thyrsus.com>
-
-SPDX-License-Identifier: MIT
-
-== Authors ==
-
-Gershon Elber <gershon[AT]cs.technion.sc.il>
-original giflib code
-
-Toshio Kuratomi <toshio[AT]tiki-lounge.com>
-uncompressed gif writing code
-former maintainer
-
-Eric Raymond <esr[AT]snark.thyrsus.com>
-current as well as long time former maintainer of giflib code
-
--- end of LICENSE ---
-------------------------------------------------------------------------------
-%% This notice is provided with respect to Little CMS 2.15, which may be
+%% This notice is provided with respect to Little CMS 2.14, which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
@@ -2447,7 +2413,7 @@ LittleCMS core is released under MIT License
---------------------------------
Little CMS
-Copyright (c) 1998-2023 Marti Maria Saguer
+Copyright (c) 1998-2022 Marti Maria Saguer
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -2469,6 +2435,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
---------------------------------
+
The below license applies to the following files:
liblcms/cmssm.c
@@ -2480,8 +2447,8 @@ SoftSurfer makes no warranty for this code, and cannot be held
liable for any real or imagined damage resulting from its use.
Users of this code must verify correctness for their application.
-AUTHORS File Information:
+AUTHORS File Information:
Main Author
------------
@@ -2523,15 +2490,11 @@ Mark Allen
Noel Carboni
Sergei Trofimovic
Philipp Knechtges
-Amyspark
-Lovell Fuller
-Eli Schwartz
Special Thanks
--------------
Artifex software
AlienSkin software
-libVIPS
Jan Morovic
Jos Vernon (WebSupergoo)
Harald Schneider (Maxon)
@@ -2540,6 +2503,7 @@ Dimitrios Anastassakis
Lemke Software
Tim Zaman
+
--- end of LICENSE ---
-------------------------------------------------------------------------------
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index 9a41296900..40ac3ddb61 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -124,7 +124,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
# Solaris Studio does not have a concept of sysroot. Instead we must
- # make sure the default include and lib dirs are appended to each
+ # make sure the default include and lib dirs are appended to each
# compile and link command line.
SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
@@ -157,13 +157,29 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
# How to compile shared libraries.
#
- if test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- PICFLAG="-fPIC"
- PIEFLAG="-fPIE"
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ PICFLAG="-fPIC"
+ PIEFLAG="-fPIE"
+ C_FLAG_REORDER=''
+ CXX_FLAG_REORDER=''
+
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ # Linking is different on MacOSX
+ SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
+ SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
+ SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
+ SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
+ SET_SHARED_LIBRARY_MAPFILE=''
else
- PICFLAG=''
+ # Default works for linux, might work on other platforms as well.
+ SHARED_LIBRARY_FLAGS='-shared'
+ SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
+ SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
+ SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
+ SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
fi
+ elif test "x$TOOLCHAIN_TYPE" = xclang; then
+ PICFLAG=''
C_FLAG_REORDER=''
CXX_FLAG_REORDER=''
@@ -350,7 +366,21 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
else
# The remaining toolchains share opt flags between CC and CXX;
# setup for C and duplicate afterwards.
- if test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ # On MacOSX we optimize for size, something
+ # we should do for all platforms?
+ C_O_FLAG_HIGHEST="-Os"
+ C_O_FLAG_HI="-Os"
+ C_O_FLAG_NORM="-Os"
+ C_O_FLAG_NONE=""
+ else
+ C_O_FLAG_HIGHEST="-O3"
+ C_O_FLAG_HI="-O3"
+ C_O_FLAG_NORM="-O2"
+ C_O_FLAG_NONE="-O0"
+ fi
+ elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On MacOSX we optimize for size, something
# we should do for all platforms?
@@ -403,7 +433,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
- elif test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
+ elif test "x$TOOLCHAIN_TYPE" = xgcc; then
LEGACY_HOST_CFLAGS="$LEGACY_HOST_CFLAGS -fstack-protector"
LEGACY_TARGET_CFLAGS="$LEGACY_TARGET_CFLAGS -fstack-protector"
LEGACY_HOST_CXXFLAGS="$LEGACY_HOST_CXXFLAGS -fstack-protector"
@@ -483,10 +513,10 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
FDLIBM_CFLAGS=""
# Setup compiler/platform specific flags to CFLAGS_JDK,
# CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
- if test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
# these options are used for both C and C++ compiles
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
- -pipe -fstack-protector"
+ -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
arm )
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -500,11 +530,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
;;
esac
-
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- TOOLCHAIN_CHECK_COMPILER_VERSION(6, FLAGS_SETUP_GCC6_COMPILER_FLAGS)
- fi
-
+ TOOLCHAIN_CHECK_COMPILER_VERSION(6, FLAGS_SETUP_GCC6_COMPILER_FLAGS)
# Check that the compiler supports -Wformat-overflow flag
# Set USE_FORMAT_OVERFLOW to 1 if it does.
FLAGS_COMPILER_CHECK_ARGUMENTS([-Wformat-overflow -Werror],
@@ -547,7 +573,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
fi
-
+
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
@@ -628,14 +654,14 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
if test "x$OPENJDK_TARGET_CPU" = xppc64le; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DABI_ELFv2"
fi
-
+
# Setup target OS define. Use OS target name but in upper case.
OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
# Setup target CPU
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
-
+
# Setup debug/release defines
if test "x$DEBUG_LEVEL" = xrelease; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
@@ -658,8 +684,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
- elif test "x$OPENJDK_TARGET_OS" = xlinux; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
fi
# Additional macosx handling
@@ -670,7 +694,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
# The expected format is X.Y.Z
MACOSX_VERSION_MIN=11.00.00
AC_SUBST(MACOSX_VERSION_MIN)
-
+
# The macro takes the version with no dots, ex: 1070
# Let the flags variables get resolved in make for easier override on make
# command line.
@@ -804,7 +828,7 @@ AC_DEFUN([FLAGS_C_COMPILER_CHECK_ARGUMENTS],
saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_LANG_PUSH([C])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no])
AC_LANG_POP([C])
CFLAGS="$saved_cflags"
@@ -829,11 +853,11 @@ AC_DEFUN([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS],
saved_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAG $1"
AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no])
AC_LANG_POP([C++])
CXXFLAGS="$saved_cxxflags"
-
+
AC_MSG_RESULT([$supports])
if test "x$supports" = "xyes" ; then
m4_ifval([$2], [$2], [:])
@@ -858,7 +882,7 @@ AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
AC_MSG_CHECKING([if both compilers support "$1"])
supports=no
if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
-
+
AC_MSG_RESULT([$supports])
if test "x$supports" = "xyes" ; then
m4_ifval([$2], [$2], [:])
@@ -905,3 +929,4 @@ AC_DEFUN_ONCE([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
CFLAGS_JDK="${CFLAGS_JDK} ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
AC_SUBST([NO_LIFETIME_DSE_CFLAG])
])
+
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 6c82016119..d794d91ae1 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -2564,7 +2564,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
static int test_array [1 - 2 * !(($2) >= 0)];
test_array [0] = 0;
@@ -2581,7 +2581,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then :
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
test_array [0] = 0;
@@ -2608,7 +2608,7 @@ else
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
static int test_array [1 - 2 * !(($2) < 0)];
test_array [0] = 0;
@@ -2625,7 +2625,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then :
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
test_array [0] = 0;
@@ -2660,7 +2660,7 @@ while test "x$ac_lo" != "x$ac_hi"; do
/* end confdefs.h. */
$4
int
-main ()
+main (void)
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
test_array [0] = 0;
@@ -2685,12 +2685,12 @@ esac
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
+static long int longval (void) { return $2; }
+static unsigned long int ulongval (void) { return $2; }
#include <stdio.h>
#include <stdlib.h>
int
-main ()
+main (void)
{
FILE *f = fopen ("conftest.val", "w");
@@ -2797,7 +2797,7 @@ else
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
+ which can conflict with char $2 (void); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
@@ -2815,7 +2815,7 @@ else
#ifdef __cplusplus
extern "C"
#endif
-char $2 ();
+char $2 (void);
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
@@ -2824,7 +2824,7 @@ choke me
#endif
int
-main ()
+main (void)
{
return $2 ();
;
@@ -3713,7 +3713,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
#
-# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -3799,6 +3799,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4413,7 +4414,7 @@ VS_TOOLSET_SUPPORTED_2022=true
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1767977874
+DATE_WHEN_GENERATED=1716396031
###############################################################################
#
@@ -28956,7 +28957,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -29096,7 +29097,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
-main ()
+main (void)
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
@@ -29160,7 +29161,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -29211,7 +29212,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -29252,7 +29253,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -29267,7 +29268,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -29283,7 +29284,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -29332,9 +29333,7 @@ struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
+static char *e (char **p, int i)
{
return p[i];
}
@@ -29369,7 +29368,7 @@ int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i
int argc;
char **argv;
int
-main ()
+main (void)
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
@@ -30702,7 +30701,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -30743,7 +30742,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -30758,7 +30757,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -30774,7 +30773,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -33287,7 +33286,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
#ifndef __GNUC__
choke me
@@ -33328,7 +33327,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -33343,7 +33342,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -33359,7 +33358,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -41365,19 +41364,6 @@ $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
# This is later checked when setting flags.
fi
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- if test "x$OPENJDK_TARGET_CPU_ARCH" = "xaarch64" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken aarch64 gcc 4.x" >&5
-$as_echo_n "checking for broken aarch64 gcc 4.x... " >&6; }
- COMPILER_VERSION_NUMBER_MAJOR=`$ECHO "$COMPILER_VERSION_NUMBER" | $SED "s/[^0-9].*//"`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $COMPILER_VERSION_NUMBER_MAJOR.x" >&5
-$as_echo "found $COMPILER_VERSION_NUMBER_MAJOR.x" >&6; }
- if test $COMPILER_VERSION_NUMBER_MAJOR -lt 5; then
- as_fn_error $? "GCC < 5 may incorrectly compile HotSpot on aarch64. See JDK-8360869." "$LINENO" 5
- fi
- fi
- fi
-
# Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
# in executable.'
USING_BROKEN_SUSE_LD=no
@@ -41918,7 +41904,7 @@ else
#include <float.h>
int
-main ()
+main (void)
{
;
@@ -41988,7 +41974,7 @@ else
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
-main ()
+main (void)
{
int i;
for (i = 0; i < 256; i++)
@@ -42286,7 +42272,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#include <sys/param.h>
int
-main ()
+main (void)
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
&& defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
@@ -42306,7 +42292,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then :
#include <sys/param.h>
int
-main ()
+main (void)
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
@@ -42332,7 +42318,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#include <limits.h>
int
-main ()
+main (void)
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
bogus endian macros
@@ -42349,7 +42335,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then :
#include <limits.h>
int
-main ()
+main (void)
{
#ifndef _BIG_ENDIAN
not big endian
@@ -42391,7 +42377,7 @@ short int ascii_mm[] =
extern int foo;
int
-main ()
+main (void)
{
return use_ascii (foo) == use_ebcdic (foo);
;
@@ -42417,7 +42403,7 @@ else
/* end confdefs.h. */
$ac_includes_default
int
-main ()
+main (void)
{
/* Are we little or big endian? From Harbison&Steele. */
@@ -42474,13 +42460,29 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
# How to compile shared libraries.
#
- if test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- PICFLAG="-fPIC"
- PIEFLAG="-fPIE"
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ PICFLAG="-fPIC"
+ PIEFLAG="-fPIE"
+ C_FLAG_REORDER=''
+ CXX_FLAG_REORDER=''
+
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ # Linking is different on MacOSX
+ SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
+ SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
+ SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
+ SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
+ SET_SHARED_LIBRARY_MAPFILE=''
else
- PICFLAG=''
+ # Default works for linux, might work on other platforms as well.
+ SHARED_LIBRARY_FLAGS='-shared'
+ SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1'
+ SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
+ SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
+ SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
fi
+ elif test "x$TOOLCHAIN_TYPE" = xclang; then
+ PICFLAG=''
C_FLAG_REORDER=''
CXX_FLAG_REORDER=''
@@ -42634,7 +42636,21 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
else
# The remaining toolchains share opt flags between CC and CXX;
# setup for C and duplicate afterwards.
- if test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
+ # On MacOSX we optimize for size, something
+ # we should do for all platforms?
+ C_O_FLAG_HIGHEST="-Os"
+ C_O_FLAG_HI="-Os"
+ C_O_FLAG_NORM="-Os"
+ C_O_FLAG_NONE=""
+ else
+ C_O_FLAG_HIGHEST="-O3"
+ C_O_FLAG_HI="-O3"
+ C_O_FLAG_NORM="-O2"
+ C_O_FLAG_NONE="-O0"
+ fi
+ elif test "x$TOOLCHAIN_TYPE" = xclang; then
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On MacOSX we optimize for size, something
# we should do for all platforms?
@@ -42685,7 +42701,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
- elif test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
+ elif test "x$TOOLCHAIN_TYPE" = xgcc; then
LEGACY_HOST_CFLAGS="$LEGACY_HOST_CFLAGS -fstack-protector"
LEGACY_TARGET_CFLAGS="$LEGACY_TARGET_CFLAGS -fstack-protector"
LEGACY_HOST_CXXFLAGS="$LEGACY_HOST_CXXFLAGS -fstack-protector"
@@ -42815,10 +42831,10 @@ fi
FDLIBM_CFLAGS=""
# Setup compiler/platform specific flags to CFLAGS_JDK,
# CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
- if test "x$TOOLCHAIN_TYPE" = xgcc -o "x$TOOLCHAIN_TYPE" = xclang; then
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
# these options are used for both C and C++ compiles
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
- -pipe -fstack-protector"
+ -pipe -fstack-protector -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
case $OPENJDK_TARGET_CPU_ARCH in
arm )
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
@@ -42833,8 +42849,6 @@ fi
;;
esac
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
-
REFERENCE_VERSION=6
if [[ "$REFERENCE_VERSION" =~ (.*\.){3} ]] ; then
@@ -43052,8 +43066,6 @@ $as_echo "$supports" >&6; }
:
fi
- fi
-
# Check that the compiler supports -Wformat-overflow flag
# Set USE_FORMAT_OVERFLOW to 1 if it does.
@@ -43409,8 +43421,6 @@ $as_echo "$supports" >&6; }
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
elif test "x$OPENJDK_TARGET_OS" = xbsd; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
- elif test "x$OPENJDK_TARGET_OS" = xlinux; then
- CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
fi
# Additional macosx handling
@@ -44209,7 +44219,7 @@ if test "$ac_x_libraries" = no; then
/* end confdefs.h. */
#include <X11/Xlib.h>
int
-main ()
+main (void)
{
XrmInitialize ()
;
@@ -44295,7 +44305,7 @@ $as_echo_n "checking whether -R must be followed by a space... " >&6; }
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -44312,7 +44322,7 @@ else
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
@@ -44356,9 +44366,9 @@ rm -f core conftest.err conftest.$ac_objext \
#ifdef __cplusplus
extern "C"
#endif
-char XOpenDisplay ();
+char XOpenDisplay (void);
int
-main ()
+main (void)
{
return XOpenDisplay ();
;
@@ -44384,9 +44394,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char dnet_ntoa ();
+char dnet_ntoa (void);
int
-main ()
+main (void)
{
return dnet_ntoa ();
;
@@ -44425,9 +44435,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char dnet_ntoa ();
+char dnet_ntoa (void);
int
-main ()
+main (void)
{
return dnet_ntoa ();
;
@@ -44485,9 +44495,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char gethostbyname (void);
int
-main ()
+main (void)
{
return gethostbyname ();
;
@@ -44526,9 +44536,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char gethostbyname ();
+char gethostbyname (void);
int
-main ()
+main (void)
{
return gethostbyname ();
;
@@ -44582,9 +44592,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char connect ();
+char connect (void);
int
-main ()
+main (void)
{
return connect ();
;
@@ -44631,9 +44641,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char remove ();
+char remove (void);
int
-main ()
+main (void)
{
return remove ();
;
@@ -44680,9 +44690,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char shmat ();
+char shmat (void);
int
-main ()
+main (void)
{
return shmat ();
;
@@ -44732,9 +44742,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char IceConnectionNumber ();
+char IceConnectionNumber (void);
int
-main ()
+main (void)
{
return IceConnectionNumber ();
;
@@ -46318,7 +46328,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
int
-main ()
+main (void)
{
return main ();
;
@@ -46408,9 +46418,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char DGifGetCode ();
+char DGifGetCode (void);
int
-main ()
+main (void)
{
return DGifGetCode ();
;
@@ -46474,9 +46484,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char compress ();
+char compress (void);
int
-main ()
+main (void)
{
return compress ();
;
@@ -46560,7 +46570,7 @@ $as_echo "system not found" >&6; }
/* end confdefs.h. */
#include <time.h>
int
-main ()
+main (void)
{
return (int)altzone;
;
@@ -46601,9 +46611,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char cos ();
+char cos (void);
int
-main ()
+main (void)
{
return cos ();
;
@@ -46660,9 +46670,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char dlopen ();
+char dlopen (void);
int
-main ()
+main (void)
{
return dlopen ();
;
@@ -46730,7 +46740,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
/* end confdefs.h. */
int
-main ()
+main (void)
{
return 0;
;
@@ -46772,7 +46782,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
/* end confdefs.h. */
int
-main ()
+main (void)
{
return 0;
;
@@ -52563,7 +52573,7 @@ $as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6;
/* end confdefs.h. */
int
-main ()
+main (void)
{
;
diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
index 449788025f..3f86751d2b 100644
--- a/common/autoconf/hotspot-spec.gmk.in
+++ b/common/autoconf/hotspot-spec.gmk.in
@@ -99,7 +99,7 @@ endif
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@
# This is used from the libjvm build for C/C++ code.
HOTSPOT_BUILD_JOBS:=$(JOBS)
-# Control whether Hotspot runs Queens test after building
+# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=@TEST_IN_BUILD@
USE_CLANG := @USE_CLANG@
@@ -111,21 +111,17 @@ LD:=@HOTSPOT_LD@
MT:=@HOTSPOT_MT@
RC:=@HOTSPOT_RC@
-NO_DELETE_NULL_POINTER_CHECKS_CFLAG=@NO_DELETE_NULL_POINTER_CHECKS_CFLAG@
-NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
-CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
-
# Retain EXTRA_{CFLAGS,CXXFLAGS,LDFLAGS,ASFLAGS} for the target flags to
# maintain compatibility with the existing Makefiles
-EXTRA_CXXFLAGS=@LEGACY_TARGET_CXXFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
-EXTRA_CFLAGS=@LEGACY_TARGET_CFLAGS@
+EXTRA_CFLAGS=@LEGACY_TARGET_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
+EXTRA_CXXFLAGS=@LEGACY_TARGET_CXXFLAGS@
EXTRA_LDFLAGS=@LEGACY_TARGET_LDFLAGS@
EXTRA_ASFLAGS=@LEGACY_TARGET_ASFLAGS@
# Define an equivalent set for the host flags (i.e. without sysroot options)
-HOST_CXXFLAGS=@LEGACY_HOST_CXXFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
- $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
-HOST_CFLAGS=@LEGACY_HOST_CFLAGS@
+HOST_CFLAGS=@LEGACY_HOST_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \
+ $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG)
+HOST_CXXFLAGS=@LEGACY_HOST_CXXFLAGS@
HOST_LDFLAGS=@LEGACY_HOST_LDFLAGS@
HOST_ASFLAGS=@LEGACY_HOST_ASFLAGS@
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 8d732588f7..410b99a5c0 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -364,6 +364,10 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
+NO_DELETE_NULL_POINTER_CHECKS_CFLAG=@NO_DELETE_NULL_POINTER_CHECKS_CFLAG@
+NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
+CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
+
CXX:=@FIXPATH@ @CCACHE@ @CXX@
#CXXFLAGS:=@CXXFLAGS@
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index f27f21a6c9..ba4798e795 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -846,17 +846,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
# This is later checked when setting flags.
fi
- if test "x$TOOLCHAIN_TYPE" = xgcc; then
- if test "x$OPENJDK_TARGET_CPU_ARCH" = "xaarch64" ; then
- AC_MSG_CHECKING([for broken aarch64 gcc 4.x])
- COMPILER_VERSION_NUMBER_MAJOR=`$ECHO "$COMPILER_VERSION_NUMBER" | $SED "s/@<:@^0-9@:>@.*//"`
- AC_MSG_RESULT([found $COMPILER_VERSION_NUMBER_MAJOR.x])
- if test $COMPILER_VERSION_NUMBER_MAJOR -lt 5; then
- AC_MSG_ERROR([GCC < 5 may incorrectly compile HotSpot on aarch64. See JDK-8360869.])
- fi
- fi
- fi
-
# Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
# in executable.'
USING_BROKEN_SUSE_LD=no
diff --git a/common/autoconf/version-numbers b/common/autoconf/version-numbers
index ceea1bc6ec..b612b4911a 100644
--- a/common/autoconf/version-numbers
+++ b/common/autoconf/version-numbers
@@ -26,7 +26,7 @@
JDK_MAJOR_VERSION=1
JDK_MINOR_VERSION=8
JDK_MICRO_VERSION=0
-JDK_UPDATE_VERSION=492
+JDK_UPDATE_VERSION=482
LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
PRODUCT_SUFFIX="Runtime Environment"
diff --git a/dragonwell_version b/dragonwell_version
index 44afd96682..44d6932ad0 100644
--- a/dragonwell_version
+++ b/dragonwell_version
@@ -19,5 +19,5 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
-DRAGONWELL_VERSION=8.28.27
-DRAGONWELL_JDK_UPDATE_VERSION=482
+DRAGONWELL_VERSION=8.29.28
+DRAGONWELL_JDK_UPDATE_VERSION=492
diff --git a/hotspot/make/aix/makefiles/adlc.make b/hotspot/make/aix/makefiles/adlc.make
index 96606fa0ff..607a8f2b25 100644
--- a/hotspot/make/aix/makefiles/adlc.make
+++ b/hotspot/make/aix/makefiles/adlc.make
@@ -70,8 +70,8 @@ CFLAGS_WARN = -w
CFLAGS += $(CFLAGS_WARN)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(HOST_CXXFLAGS)
-LFLAGS += $(HOST_CXXFLAGS) $(HOST_LDFLAGS)
+CFLAGS += $(HOST_CFLAGS)
+LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS)
ASFLAGS += $(HOST_ASFLAGS)
OBJECTNAMES = \
diff --git a/hotspot/make/aix/makefiles/rules.make b/hotspot/make/aix/makefiles/rules.make
index 11a876bf9d..f41e0b85d6 100644
--- a/hotspot/make/aix/makefiles/rules.make
+++ b/hotspot/make/aix/makefiles/rules.make
@@ -31,7 +31,7 @@ DEMANGLER = c++filt
DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
# $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++).
-CC_COMPILE = $(CC) $(CFLAGS)
+CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS)
CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS)
AS.S = $(AS) $(ASFLAGS)
diff --git a/hotspot/make/aix/makefiles/vm.make b/hotspot/make/aix/makefiles/vm.make
index abf9bcf36b..8278a915d4 100644
--- a/hotspot/make/aix/makefiles/vm.make
+++ b/hotspot/make/aix/makefiles/vm.make
@@ -117,8 +117,8 @@ CFLAGS += $(CFLAGS_WARN/BYFILE)
CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(EXTRA_CXXFLAGS)
-LFLAGS += $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS)
+CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
ASFLAGS += $(EXTRA_ASFLAGS)
# Don't set excutable bit on stack segment
diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make
index cb9cad867e..88f61fbd41 100644
--- a/hotspot/make/bsd/makefiles/adlc.make
+++ b/hotspot/make/bsd/makefiles/adlc.make
@@ -72,8 +72,8 @@ endif
CFLAGS += $(CFLAGS_WARN)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(HOST_CXXFLAGS)
-LFLAGS += $(HOST_CXXFLAGS) $(HOST_LDFLAGS)
+CFLAGS += $(HOST_CFLAGS)
+LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS)
ASFLAGS += $(HOST_ASFLAGS)
OBJECTNAMES = \
diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make
index 7c84ce26de..0e2ca9b3b8 100644
--- a/hotspot/make/bsd/makefiles/gcc.make
+++ b/hotspot/make/bsd/makefiles/gcc.make
@@ -346,10 +346,9 @@ ifeq ($(OS_VENDOR), Darwin)
MACOSX_VERSION_MIN=11.00.00
endif
# The macro takes the version with no dots, ex: 1070
- MAC_FLAGS = -mmacosx-version-min=$(MACOSX_VERSION_MIN)
CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
- $(MAC_FLAGS)
- LFLAGS += $(MAC_FLAGS)
+ -mmacosx-version-min=$(MACOSX_VERSION_MIN)
+ LFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
endif
diff --git a/hotspot/make/bsd/makefiles/jsig.make b/hotspot/make/bsd/makefiles/jsig.make
index 800a04b3a3..5cfb899572 100644
--- a/hotspot/make/bsd/makefiles/jsig.make
+++ b/hotspot/make/bsd/makefiles/jsig.make
@@ -54,9 +54,9 @@ LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
LFLAGS_JSIG += -D_GNU_SOURCE -pthread $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS)
-# bring in minimum version argument or we'll fail on OSX 10.10
ifeq ($(OS_VENDOR), Darwin)
- LFLAGS_JSIG += $(MAC_FLAGS)
+# bring in minimum version argument or we'll fail on OSX 10.10
+LFLAGS_JSIG += $(LFLAGS)
endif
# DEBUG_BINARIES overrides everything, use full -g debug information
diff --git a/hotspot/make/bsd/makefiles/rules.make b/hotspot/make/bsd/makefiles/rules.make
index 977255f47f..31c2e0941c 100644
--- a/hotspot/make/bsd/makefiles/rules.make
+++ b/hotspot/make/bsd/makefiles/rules.make
@@ -31,7 +31,7 @@ DEMANGLER = c++filt
DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
# $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++).
-CC_COMPILE = $(CC) $(CFLAGS)
+CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS)
CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS)
AS.S = $(AS) $(ASFLAGS)
diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make
index 41d062e528..5c837895f6 100644
--- a/hotspot/make/bsd/makefiles/saproc.make
+++ b/hotspot/make/bsd/makefiles/saproc.make
@@ -111,10 +111,10 @@ endif
ifneq ($(OS_VENDOR), Darwin)
- SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
+SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
else
- # bring in minimum version argument or we'll fail on OSX 10.10
- SA_LFLAGS = $(MAC_FLAGS)
+# bring in minimum version argument or we'll fail on OSX 10.10
+SA_LFLAGS = $(LFLAGS)
endif
SA_LFLAGS += $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS)
diff --git a/hotspot/make/bsd/makefiles/vm.make b/hotspot/make/bsd/makefiles/vm.make
index 12cb86c402..e75281d0f5 100644
--- a/hotspot/make/bsd/makefiles/vm.make
+++ b/hotspot/make/bsd/makefiles/vm.make
@@ -119,8 +119,8 @@ CFLAGS += $(CFLAGS_WARN/BYFILE)
CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(EXTRA_CXXFLAGS)
-LFLAGS += $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS)
+CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
ASFLAGS += $(EXTRA_ASFLAGS)
# Don't set excutable bit on stack segment
diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make
index b12462d0b1..a01aa1aaac 100644
--- a/hotspot/make/linux/makefiles/adlc.make
+++ b/hotspot/make/linux/makefiles/adlc.make
@@ -70,8 +70,8 @@ CFLAGS_WARN = $(WARNINGS_ARE_ERRORS)
CFLAGS += $(CFLAGS_WARN)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(HOST_CXXFLAGS)
-LFLAGS += $(HOST_CXXFLAGS) $(HOST_LDFLAGS)
+CFLAGS += $(HOST_CFLAGS)
+LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS)
ASFLAGS += $(HOST_ASFLAGS)
OBJECTNAMES = \
diff --git a/hotspot/make/linux/makefiles/rules.make b/hotspot/make/linux/makefiles/rules.make
index 977255f47f..31c2e0941c 100644
--- a/hotspot/make/linux/makefiles/rules.make
+++ b/hotspot/make/linux/makefiles/rules.make
@@ -31,7 +31,7 @@ DEMANGLER = c++filt
DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
# $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++).
-CC_COMPILE = $(CC) $(CFLAGS)
+CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS)
CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS)
AS.S = $(AS) $(ASFLAGS)
diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make
index 24ed5f0add..f760a48e54 100644
--- a/hotspot/make/linux/makefiles/vm.make
+++ b/hotspot/make/linux/makefiles/vm.make
@@ -122,8 +122,8 @@ CFLAGS += $(CFLAGS_WARN/BYFILE)
CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(EXTRA_CXXFLAGS)
-LFLAGS += $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS)
+CFLAGS += $(EXTRA_CFLAGS)
+LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
ASFLAGS += $(EXTRA_ASFLAGS)
# Don't set excutable bit on stack segment
diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make
index 7085d650b0..9ab746b9c7 100644
--- a/hotspot/make/solaris/makefiles/adlc.make
+++ b/hotspot/make/solaris/makefiles/adlc.make
@@ -84,7 +84,7 @@ endif
CFLAGS += $(CFLAGS_WARN)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(HOST_CXXFLAGS)
+CFLAGS += $(HOST_CFLAGS)
ASFLAGS += $(HOST_ASFLAGS)
ifeq ("${Platform_compiler}", "sparcWorks")
diff --git a/hotspot/make/solaris/makefiles/rules.make b/hotspot/make/solaris/makefiles/rules.make
index 90dd423fdf..5530aaddf7 100644
--- a/hotspot/make/solaris/makefiles/rules.make
+++ b/hotspot/make/solaris/makefiles/rules.make
@@ -31,7 +31,7 @@ DEMANGLER = c++filt
DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
# $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++).
-CC_COMPILE = $(CC) $(CFLAGS)
+CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS)
CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS)
AS.S = $(AS) $(ASFLAGS)
diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make
index 983bb6012e..e9211914ab 100644
--- a/hotspot/make/solaris/makefiles/vm.make
+++ b/hotspot/make/solaris/makefiles/vm.make
@@ -108,7 +108,7 @@ CFLAGS += $(CFLAGS_WARN)
CFLAGS += $(CFLAGS/NOEX)
# Extra flags from gnumake's invocation or environment
-CFLAGS += $(EXTRA_CXXFLAGS)
+CFLAGS += $(EXTRA_CFLAGS)
ASFLAGS += $(EXTRA_ASFLAGS)
# Math Library (libm.so), do not use -lm.
diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad
index 8629a19751..e6ce781b0c 100644
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad
@@ -7527,11 +7527,10 @@ instruct bytes_reverse_unsigned_short(iRegINoSp dst, iRegIorL2I src) %{
match(Set dst (ReverseBytesUS src));
ins_cost(INSN_COST);
- format %{ "rev16w $dst, $src\t# $dst -> unsigned short" %}
+ format %{ "rev16w $dst, $src" %}
ins_encode %{
__ rev16w(as_Register($dst$$reg), as_Register($src$$reg));
- __ narrow_subword_type(as_Register($dst$$reg), T_CHAR);
%}
ins_pipe(ialu_reg);
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
index 75a748b854..1b572118b6 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp
@@ -1845,17 +1845,6 @@ void MacroAssembler::store_sized_value(Address dst, Register src, size_t size_in
}
}
-void MacroAssembler::narrow_subword_type(Register reg, BasicType bt) {
- assert(is_subword_type(bt), "required");
- switch (bt) {
- case T_BOOLEAN: andw(reg, reg, 1); break;
- case T_BYTE: sxtbw(reg, reg); break;
- case T_CHAR: uxthw(reg, reg); break;
- case T_SHORT: sxthw(reg, reg); break;
- default: ShouldNotReachHere();
- }
-}
-
void MacroAssembler::decrementw(Register reg, int value)
{
if (value < 0) { incrementw(reg, -value); return; }
diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
index 149d34b045..d1f65d44e6 100644
--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
+++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp
@@ -28,7 +28,6 @@
#define CPU_AARCH64_VM_MACROASSEMBLER_AARCH64_HPP
#include "asm/assembler.inline.hpp"
-#include "utilities/globalDefinitions.hpp"
// MacroAssembler extends Assembler by frequently used macros.
//
@@ -621,9 +620,6 @@ public:
// Support for sign-extension (hi:lo = extend_sign(lo))
void extend_sign(Register hi, Register lo);
- // Clean up a subword typed value to the representation in compliance with JVMS §2.3
- void narrow_subword_type(Register reg, BasicType bt);
-
// Load and store values by size and signed-ness
void load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed, Register dst2 = noreg);
void store_sized_value(Address dst, Register src, size_t size_in_bytes, Register src2 = noreg);
diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp
index 3daba54934..2df1a223fd 100644
--- a/hotspot/src/os/aix/vm/os_aix.cpp
+++ b/hotspot/src/os/aix/vm/os_aix.cpp
@@ -4200,6 +4200,10 @@ bool os::check_heap(bool force) {
return true;
}
+// int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
+// return ::vsnprintf(buf, count, format, args);
+// }
+
// Is a (classpath) directory empty?
bool os::dir_is_empty(const char* path) {
DIR *dir = NULL;
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index 49ce52b34a..6d1009b84c 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -3993,6 +3993,11 @@ bool os::check_heap(bool force) {
return true;
}
+ATTRIBUTE_PRINTF(3, 0)
+int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
+ return ::vsnprintf(buf, count, format, args);
+}
+
// Is a (classpath) directory empty?
bool os::dir_is_empty(const char* path) {
DIR *dir = NULL;
diff --git a/hotspot/src/os/linux/vm/cgroupSubsystem_linux.hpp b/hotspot/src/os/linux/vm/cgroupSubsystem_linux.hpp
index 0cc0d5b628..63b0c4b815 100644
--- a/hotspot/src/os/linux/vm/cgroupSubsystem_linux.hpp
+++ b/hotspot/src/os/linux/vm/cgroupSubsystem_linux.hpp
@@ -269,15 +269,12 @@ class CgroupSubsystem: public CHeapObj<mtInternal> {
virtual jlong memory_and_swap_limit_in_bytes() = 0;
virtual jlong memory_soft_limit_in_bytes() = 0;
virtual jlong memory_max_usage_in_bytes() = 0;
-
virtual char * cpu_cpuset_cpus() = 0;
virtual char * cpu_cpuset_memory_nodes() = 0;
virtual jlong read_memory_limit_in_bytes() = 0;
virtual const char * container_type() = 0;
virtual CachingCgroupController* memory_controller() = 0;
virtual CachingCgroupController* cpu_controller() = 0;
-
- virtual void print_version_specific_info(outputStream* st) = 0;
};
// Utility class for storing info retrieved from /proc/cgroups,
diff --git a/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.cpp b/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.cpp
index b5c14173f6..bac3edb005 100644
--- a/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.cpp
+++ b/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -201,38 +201,6 @@ jlong CgroupV1Subsystem::memory_max_usage_in_bytes() {
return memmaxusage;
}
-
-jlong CgroupV1Subsystem::kernel_memory_usage_in_bytes() {
- GET_CONTAINER_INFO(jlong, _memory->controller(), "/memory.kmem.usage_in_bytes",
- "Kernel Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, kmem_usage);
- return kmem_usage;
-}
-
-jlong CgroupV1Subsystem::kernel_memory_limit_in_bytes() {
- GET_CONTAINER_INFO(julong, _memory->controller(), "/memory.kmem.limit_in_bytes",
- "Kernel Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, kmem_limit);
- if (kmem_limit >= os::Linux::physical_memory()) {
- return (jlong)-1;
- }
- return (jlong)kmem_limit;
-}
-
-jlong CgroupV1Subsystem::kernel_memory_max_usage_in_bytes() {
- GET_CONTAINER_INFO(jlong, _memory->controller(), "/memory.kmem.max_usage_in_bytes",
- "Maximum Kernel Memory Usage is: " JLONG_FORMAT, JLONG_FORMAT, kmem_max_usage);
- return kmem_max_usage;
-}
-
-void CgroupV1Subsystem::print_version_specific_info(outputStream* st) {
- jlong kmem_usage = kernel_memory_usage_in_bytes();
- jlong kmem_limit = kernel_memory_limit_in_bytes();
- jlong kmem_max_usage = kernel_memory_max_usage_in_bytes();
-
- OSContainer::print_container_helper(st, kmem_usage, "kernel_memory_usage_in_bytes");
- OSContainer::print_container_helper(st, kmem_limit, "kernel_memory_max_usage_in_bytes");
- OSContainer::print_container_helper(st, kmem_max_usage, "kernel_memory_limit_in_bytes");
-}
-
char * CgroupV1Subsystem::cpu_cpuset_cpus() {
GET_CONTAINER_INFO_CPTR(cptr, _cpuset, "/cpuset.cpus",
"cpuset.cpus is: %s", "%1023s", cpus, 1024);
diff --git a/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.hpp b/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.hpp
index bdce7b5631..568268867a 100644
--- a/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.hpp
+++ b/hotspot/src/os/linux/vm/cgroupV1Subsystem_linux.hpp
@@ -79,11 +79,6 @@ class CgroupV1Subsystem: public CgroupSubsystem {
jlong memory_soft_limit_in_bytes();
jlong memory_usage_in_bytes();
jlong memory_max_usage_in_bytes();
-
- jlong kernel_memory_usage_in_bytes();
- jlong kernel_memory_limit_in_bytes();
- jlong kernel_memory_max_usage_in_bytes();
-
char * cpu_cpuset_cpus();
char * cpu_cpuset_memory_nodes();
@@ -92,8 +87,6 @@ class CgroupV1Subsystem: public CgroupSubsystem {
int cpu_shares();
- void print_version_specific_info(outputStream* st);
-
const char * container_type() {
return "cgroupv1";
}
diff --git a/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.cpp b/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.cpp
index 840042b247..2fc555bce8 100644
--- a/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.cpp
+++ b/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.cpp
@@ -194,16 +194,6 @@ char* CgroupV2Subsystem::mem_swp_limit_val() {
return os::strdup(mem_swp_limit_str);
}
-// memory.swap.current : total amount of swap currently used by the cgroup and its descendants
-char* CgroupV2Subsystem::mem_swp_current_val() {
- GET_CONTAINER_INFO_CPTR(cptr, _unified, "/memory.swap.current",
- "Swap currently used is: %s", "%s", mem_swp_current_str, 1024);
- if (mem_swp_current_str == NULL) {
- return NULL;
- }
- return os::strdup(mem_swp_current_str);
-}
-
/* memory_limit_in_bytes
*
* Return the limit of available memory for this process.
@@ -252,17 +242,6 @@ char* CgroupV2Subsystem::mem_limit_val() {
return os::strdup(mem_limit_str);
}
-void CgroupV2Subsystem::print_version_specific_info(outputStream* st) {
- char* mem_swp_current_str = mem_swp_current_val();
- jlong swap_current = limit_from_str(mem_swp_current_str);
-
- char* mem_swp_limit_str = mem_swp_limit_val();
- jlong swap_limit = limit_from_str(mem_swp_limit_str);
-
- OSContainer::print_container_helper(st, swap_current, "memory_swap_current_in_bytes");
- OSContainer::print_container_helper(st, swap_limit, "memory_swap_max_limit_in_bytes");
-}
-
char* CgroupV2Controller::construct_path(char* mount_path, char *cgroup_path) {
char buf[MAXPATHLEN+1];
int buflen;
diff --git a/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.hpp b/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.hpp
index 22199dc29c..84e0615b60 100644
--- a/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.hpp
+++ b/hotspot/src/os/linux/vm/cgroupV2Subsystem_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, 2022, Red Hat Inc.
+ * Copyright (c) 2020, Red Hat Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,6 @@ class CgroupV2Subsystem: public CgroupSubsystem {
char *mem_limit_val();
char *mem_swp_limit_val();
- char *mem_swp_current_val();
char *mem_soft_limit_val();
char *cpu_quota_val();
jlong limit_from_str(char* limit_str);
@@ -78,12 +77,8 @@ class CgroupV2Subsystem: public CgroupSubsystem {
jlong memory_soft_limit_in_bytes();
jlong memory_usage_in_bytes();
jlong memory_max_usage_in_bytes();
-
char * cpu_cpuset_cpus();
char * cpu_cpuset_memory_nodes();
-
- void print_version_specific_info(outputStream* st);
-
const char * container_type() {
return "cgroupv2";
}
diff --git a/hotspot/src/os/linux/vm/osContainer_linux.cpp b/hotspot/src/os/linux/vm/osContainer_linux.cpp
index 33a7442ea8..95c83e49fd 100644
--- a/hotspot/src/os/linux/vm/osContainer_linux.cpp
+++ b/hotspot/src/os/linux/vm/osContainer_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -104,11 +104,6 @@ jlong OSContainer::memory_max_usage_in_bytes() {
return cgroup_subsystem->memory_max_usage_in_bytes();
}
-void OSContainer::print_version_specific_info(outputStream* st) {
- assert(cgroup_subsystem != NULL, "cgroup subsystem not available");
- cgroup_subsystem->print_version_specific_info(st);
-}
-
char * OSContainer::cpu_cpuset_cpus() {
assert(cgroup_subsystem != NULL, "cgroup subsystem not available");
return cgroup_subsystem->cpu_cpuset_cpus();
@@ -138,16 +133,3 @@ int OSContainer::cpu_shares() {
assert(cgroup_subsystem != NULL, "cgroup subsystem not available");
return cgroup_subsystem->cpu_shares();
}
-
-void OSContainer::print_container_helper(outputStream* st, jlong j, const char* metrics) {
- st->print("%s: ", metrics);
- if (j > 0) {
- if (j >= 1024) {
- st->print_cr(UINT64_FORMAT " k", uint64_t(j) / 1024);
- } else {
- st->print_cr(UINT64_FORMAT, uint64_t(j));
- }
- } else {
- st->print_cr("%s", j == OSCONTAINER_ERROR ? "not supported" : "unlimited");
- }
-}
diff --git a/hotspot/src/os/linux/vm/osContainer_linux.hpp b/hotspot/src/os/linux/vm/osContainer_linux.hpp
index eb2f53f2a4..53e792ee0a 100644
--- a/hotspot/src/os/linux/vm/osContainer_linux.hpp
+++ b/hotspot/src/os/linux/vm/osContainer_linux.hpp
@@ -27,7 +27,6 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
-#include "utilities/ostream.hpp"
#include "memory/allocation.hpp"
#define OSCONTAINER_ERROR (-2)
@@ -44,9 +43,6 @@ class OSContainer: AllStatic {
public:
static void init();
- static void print_version_specific_info(outputStream* st);
- static void print_container_helper(outputStream* st, jlong j, const char* metrics);
-
static inline bool is_containerized();
static const char * container_type();
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index 2dbca2a378..ba532afeb5 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -2300,56 +2300,46 @@ void os::Linux::print_container_info(outputStream* st) {
st->print("container (cgroup) information:\n");
const char *p_ct = OSContainer::container_type();
- st->print("container_type: %s\n", p_ct != NULL ? p_ct : "not supported");
+ st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed");
char *p = OSContainer::cpu_cpuset_cpus();
- st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "not supported");
+ st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed");
free(p);
p = OSContainer::cpu_cpuset_memory_nodes();
- st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "not supported");
+ st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "failed");
free(p);
int i = OSContainer::active_processor_count();
- st->print("active_processor_count: ");
if (i > 0) {
- st->print("%d\n", i);
+ st->print("active_processor_count: %d\n", i);
} else {
- st->print("not supported\n");
+ st->print("active_processor_count: failed\n");
}
i = OSContainer::cpu_quota();
- st->print("cpu_quota: ");
- if (i > 0) {
- st->print("%d\n", i);
- } else {
- st->print("%s\n", i == OSCONTAINER_ERROR ? "not supported" : "no quota");
- }
+ st->print("cpu_quota: %d\n", i);
i = OSContainer::cpu_period();
- st->print("cpu_period: ");
- if (i > 0) {
- st->print("%d\n", i);
- } else {
- st->print("%s\n", i == OSCONTAINER_ERROR ? "not supported" : "no period");
- }
+ st->print("cpu_period: %d\n", i);
i = OSContainer::cpu_shares();
- st->print("cpu_shares: ");
- if (i > 0) {
- st->print("%d\n", i);
- } else {
- st->print("%s\n", i == OSCONTAINER_ERROR ? "not supported" : "no shares");
- }
+ st->print("cpu_shares: %d\n", i);
+
+ jlong j = OSContainer::memory_limit_in_bytes();
+ st->print("memory_limit_in_bytes: " JLONG_FORMAT "\n", j);
- OSContainer::print_container_helper(st, OSContainer::memory_limit_in_bytes(), "memory_limit_in_bytes");
- OSContainer::print_container_helper(st, OSContainer::memory_and_swap_limit_in_bytes(), "memory_and_swap_limit_in_bytes");
- OSContainer::print_container_helper(st, OSContainer::memory_soft_limit_in_bytes(), "memory_soft_limit_in_bytes");
- OSContainer::print_container_helper(st, OSContainer::memory_usage_in_bytes(), "memory_usage_in_bytes");
- OSContainer::print_container_helper(st, OSContainer::memory_max_usage_in_bytes(), "memory_max_usage_in_bytes");
+ j = OSContainer::memory_and_swap_limit_in_bytes();
+ st->print("memory_and_swap_limit_in_bytes: " JLONG_FORMAT "\n", j);
- OSContainer::print_version_specific_info(st);
+ j = OSContainer::memory_soft_limit_in_bytes();
+ st->print("memory_soft_limit_in_bytes: " JLONG_FORMAT "\n", j);
+ j = OSContainer::OSContainer::memory_usage_in_bytes();
+ st->print("memory_usage_in_bytes: " JLONG_FORMAT "\n", j);
+
+ j = OSContainer::OSContainer::memory_max_usage_in_bytes();
+ st->print("memory_max_usage_in_bytes: " JLONG_FORMAT "\n", j);
st->cr();
}
@@ -5554,6 +5544,10 @@ bool os::check_heap(bool force) {
return true;
}
+int local_vsnprintf(char* buf, size_t count, const char* format, va_list args) {
+ return ::vsnprintf(buf, count, format, args);
+}
+
// Is a (classpath) directory empty?
bool os::dir_is_empty(const char* path) {
DIR *dir = NULL;
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index 59a1d7701d..9c9de85ad1 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -5178,6 +5178,27 @@ void os::make_polling_page_readable(void) {
bool os::check_heap(bool force) { return true; }
+typedef int (*vsnprintf_t)(char* buf, size_t count, const char* fmt, va_list argptr);
+static vsnprintf_t sol_vsnprintf = NULL;
+
+int local_vsnprintf(char* buf, size_t count, const char* fmt, va_list argptr) {
+ if (!sol_vsnprintf) {
+ //search for the named symbol in the objects that were loaded after libjvm
+ void* where = RTLD_NEXT;
+ if ((sol_vsnprintf = CAST_TO_FN_PTR(vsnprintf_t, dlsym(where, "__vsnprintf"))) == NULL)
+ sol_vsnprintf = CAST_TO_FN_PTR(vsnprintf_t, dlsym(where, "vsnprintf"));
+ if (!sol_vsnprintf){
+ //search for the named symbol in the objects that were loaded before libjvm
+ where = RTLD_DEFAULT;
+ if ((sol_vsnprintf = CAST_TO_FN_PTR(vsnprintf_t, dlsym(where, "__vsnprintf"))) == NULL)
+ sol_vsnprintf = CAST_TO_FN_PTR(vsnprintf_t, dlsym(where, "vsnprintf"));
+ assert(sol_vsnprintf != NULL, "vsnprintf not found");
+ }
+ }
+ return (*sol_vsnprintf)(buf, count, fmt, argptr);
+}
+
+
// Is a (classpath) directory empty?
bool os::dir_is_empty(const char* path) {
DIR *dir = NULL;
diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp
index 60d6d95577..0f10aaad6e 100644
--- a/hotspot/src/share/vm/classfile/classLoader.cpp
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp
@@ -755,9 +755,6 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str
if (throw_exception) {
THROW_MSG_(vmSymbols::java_lang_ClassNotFoundException(), msg, NULL);
} else {
- if (TraceClassLoading || TraceClassPaths) {
- tty->print_cr("[Path failed: %s, err: %s]", path, error_msg);
- }
return NULL;
}
}
diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp
index 2f0f7727cc..c4c99c6c3f 100644
--- a/hotspot/src/share/vm/code/dependencies.hpp
+++ b/hotspot/src/share/vm/code/dependencies.hpp
@@ -166,7 +166,7 @@ class Dependencies: public ResourceObj {
LG2_TYPE_LIMIT = 4, // assert(TYPE_LIMIT <= (1<<LG2_TYPE_LIMIT))
// handy categorizations of dependency types:
- all_types = ((1 << TYPE_LIMIT) - 1) & ((~0u) << FIRST_TYPE),
+ all_types = ((1 << TYPE_LIMIT) - 1) & ((-1) << FIRST_TYPE),
non_klass_types = (1 << call_site_target_value),
klass_types = all_types & ~non_klass_types,
diff --git a/hotspot/src/share/vm/oops/cpCache.hpp b/hotspot/src/share/vm/oops/cpCache.hpp
index e62b757d33..333cf61249 100644
--- a/hotspot/src/share/vm/oops/cpCache.hpp
+++ b/hotspot/src/share/vm/oops/cpCache.hpp
@@ -192,7 +192,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
field_index_mask = right_n_bits(field_index_bits),
parameter_size_bits = 8, // subset of field_index_mask, range is 0..255
parameter_size_mask = right_n_bits(parameter_size_bits),
- option_bits_mask = ~(((~0u) << tos_state_shift) | (field_index_mask | parameter_size_mask))
+ option_bits_mask = ~(((-1) << tos_state_shift) | (field_index_mask | parameter_size_mask))
};
// specific bit definitions for the indices field:
diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp
index 420d4a5b6b..a9cd951305 100644
--- a/hotspot/src/share/vm/prims/unsafe.cpp
+++ b/hotspot/src/share/vm/prims/unsafe.cpp
@@ -1871,27 +1871,29 @@ JNINativeMethod fence_methods[] = {
#define STE "Ljava/lang/StackTraceElement;"
JNINativeMethod coroutine_support_methods[] = {
- {CC"switchTo", CC"("COBA COBA")V", FN_PTR(CoroutineSupport_switchTo)},
- {CC"switchToAndTerminate", CC"("COBA COBA")V", FN_PTR(CoroutineSupport_switchToAndTerminate)},
- {CC"switchToAndExit", CC"("COBA COBA")V", FN_PTR(CoroutineSupport_switchToAndExit)},
- {CC"getNativeThreadCoroutine",CC"()J", FN_PTR(CoroutineSupport_getNativeThreadCoroutine)},
- {CC"createCoroutine", CC"("COBA"J)J", FN_PTR(CoroutineSupport_createCoroutine)},
+ {CC"switchTo", CC"(" COBA COBA ")V", FN_PTR(CoroutineSupport_switchTo)},
+ {CC"switchToAndTerminate", CC"(" COBA COBA ")V", FN_PTR(CoroutineSupport_switchToAndTerminate)},
+ {CC"switchToAndExit", CC"(" COBA COBA ")V", FN_PTR(CoroutineSupport_switchToAndExit)},
+ {CC"getNativeThreadCoroutine",CC"()J", FN_PTR(CoroutineSupport_getNativeThreadCoroutine)},
+ {CC"createCoroutine", CC"(" COBA "J)J", FN_PTR(CoroutineSupport_createCoroutine)},
{CC"testDisposableAndTryReleaseStack",
- CC"(J)Z", FN_PTR(CoroutineSupport_testDisposableAndTryReleaseStack)},
- {CC"cleanupCoroutine", CC"()"COBA, FN_PTR(CoroutineSupport_cleanupCoroutine)},
- {CC"setWispBooted", CC"()V", FN_PTR(CoroutineSupport_setWispBooted)},
- {CC"stealCoroutine", CC"(J)Z", FN_PTR(CoroutineSupport_stealCoroutine)},
- {CC"getNextCoroutine", CC"(J)"COR, FN_PTR(CoroutineSupport_getNextCoroutine)},
- {CC"moveCoroutine", CC"(JJ)V", FN_PTR(CoroutineSupport_moveCoroutine)},
- {CC"markThreadCoroutine", CC"(J"COBA")V", FN_PTR(CoroutineSupport_markThreadCoroutine)},
- {CC"shouldThrowException0", CC"(J)Z", FN_PTR(CoroutineSupport_shouldThrowException0)},
- {CC"getCoroutineStack", CC"(J)["STE, FN_PTR(CoroutineSupport_getCoroutineStack)},
- {CC"shouldThrowException0", CC"(J)Z", FN_PTR(CoroutineSupport_shouldThrowException0)},
+ CC"(J)Z", FN_PTR(CoroutineSupport_testDisposableAndTryReleaseStack)},
+ {CC"cleanupCoroutine", CC"()" COBA, FN_PTR(CoroutineSupport_cleanupCoroutine)},
+ {CC"setWispBooted", CC"()V", FN_PTR(CoroutineSupport_setWispBooted)},
+ {CC"stealCoroutine", CC"(J)Z", FN_PTR(CoroutineSupport_stealCoroutine)},
+ {CC"getNextCoroutine", CC"(J)" COR, FN_PTR(CoroutineSupport_getNextCoroutine)},
+ {CC"moveCoroutine", CC"(JJ)V", FN_PTR(CoroutineSupport_moveCoroutine)},
+ {CC"markThreadCoroutine", CC"(J" COBA ")V", FN_PTR(CoroutineSupport_markThreadCoroutine)},
+ {CC"shouldThrowException0", CC"(J)Z", FN_PTR(CoroutineSupport_shouldThrowException0)},
+ {CC"getCoroutineStack", CC"(J)[" STE, FN_PTR(CoroutineSupport_getCoroutineStack)},
+ {CC"shouldThrowException0", CC"(J)Z", FN_PTR(CoroutineSupport_shouldThrowException0)},
};
#define COMPILE_CORO_METHODS_BEFORE (3)
#undef COBA
+#undef COR
+#undef STE
#undef CC
#undef FN_PTR
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
index 2d7ab2ae9d..2d697e31ba 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp
@@ -79,9 +79,6 @@
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(fmt, vargs)
#endif
-#ifndef ATTRIBUTE_SCANF
-#define ATTRIBUTE_SCANF(fmt, vargs)
-#endif
#include "utilities/macros.hpp"
diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
index 6bc747c0aa..310ec9a0a8 100644
--- a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
@@ -258,6 +258,14 @@ inline int g_isfinite(jdouble f) { return finite(f); }
inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
+
+// Misc
+// NOTE: This one leads to an infinite recursion on Linux
+#ifndef LINUX
+int local_vsnprintf(char* buf, size_t count, const char* fmt, va_list argptr);
+#define vsnprintf local_vsnprintf
+#endif
+
// Portability macros
#define PRAGMA_INTERFACE
#define PRAGMA_IMPLEMENTATION
diff --git a/hotspot/test/ProblemList.txt b/hotspot/test/ProblemList.txt
index 3f0ccd1d18..5c6f5828e2 100644
--- a/hotspot/test/ProblemList.txt
+++ b/hotspot/test/ProblemList.txt
@@ -69,6 +69,7 @@ compiler/rtm/locking/TestUseRTMAfterLockInflation.java 8183263 generic-x64,gener
compiler/rtm/locking/TestUseRTMForInflatedLocks.java 8183263 generic-x64,generic-i586
compiler/rtm/locking/TestUseRTMForStackLocks.java 8183263 generic-x64,generic-i586
compiler/rtm/method_options/TestUseRTMLockElidingOption.java 8183263 generic-x64,generic-i586
+compiler/tiered/LevelTransitionTest.java https://github.com/dragonwell-project/dragonwell8/issues/469 generic-all
# :temporary_disabled
@@ -100,8 +101,3 @@ jwarmup/TestNotifyDeopt.sh generic-all
jwarmup/TestTieredCompilationInRecording.sh generic-all
multi-tenant/TestParGCAllocatorLeak.sh generic-all
multi-tenant/TestTenantJVMOptions.sh generic-all
-
-
-# :hotspot_gc
-
-gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 8177765 generic-all
diff --git a/hotspot/test/compiler/c2/Test7005594.java b/hotspot/test/compiler/5091921/Test7005594.java
similarity index 59%
rename from hotspot/test/compiler/c2/Test7005594.java
rename to hotspot/test/compiler/5091921/Test7005594.java
index 1b2d6d73ca..828339f1b2 100644
--- a/hotspot/test/compiler/c2/Test7005594.java
+++ b/hotspot/test/compiler/5091921/Test7005594.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -19,6 +19,7 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
+ *
*/
/**
@@ -26,28 +27,33 @@
* @bug 7005594
* @summary Array overflow not handled correctly with loop optimzations
*
- * @run main/othervm -Xcomp
- -XX:CompileOnly=compiler.c2.Test7005594::test
- compiler.c2.Test7005594
+ * @run shell Test7005594.sh
*/
-package compiler.c2;
-
public class Test7005594 {
- static int test(byte a[]){
- int result = 0;
- for (int i = 1; i < a.length; i += Integer.MAX_VALUE) {
- result += a[i];
- }
- return result;
- }
- public static void main(String [] args){
- try {
- int result = test(new byte[2]);
- throw new AssertionError("Expected ArrayIndexOutOfBoundsException was not thrown");
- } catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("Expected " + e + " was thrown");
- }
- }
+ static int test(byte a[]){
+ int result=0;
+ for( int i=0; i<a.length; i+=((0x7fffffff>>1)+1) ){
+ result += a[i];
+ }
+ return result;
+ }
+
+ public static void main(String [] args){
+ byte a[]=new byte[(0x7fffffff>>1)+2];
+ int result = 0;
+ try {
+ result = test(a);
+ } catch (ArrayIndexOutOfBoundsException e) {
+ e.printStackTrace(System.out);
+ System.out.println("Passed");
+ System.exit(95);
+ }
+ System.out.println(result);
+ System.out.println("FAILED");
+ System.exit(97);
+ }
+
}
+
diff --git a/hotspot/test/compiler/5091921/Test7005594.sh b/hotspot/test/compiler/5091921/Test7005594.sh
new file mode 100644
index 0000000000..2ca434ae87
--- /dev/null
+++ b/hotspot/test/compiler/5091921/Test7005594.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+#
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+#
+## some tests require path to find test source dir
+if [ "${TESTSRC}" = "" ]
+then
+ TESTSRC=${PWD}
+ echo "TESTSRC not set. Using "${TESTSRC}" as default"
+fi
+echo "TESTSRC=${TESTSRC}"
+## Adding common setup Variables for running shell tests.
+. ${TESTSRC}/../../test_env.sh
+
+# Amount of physical memory in megabytes
+MEM=0
+if [ -f "/proc/meminfo" ]; then
+ # Linux, Windows/Cygwin
+ MEM=`cat /proc/meminfo |grep ^MemTotal: | awk '{print $2}'`
+ MEM="$(($MEM / 1024))"
+elif [ -x "/usr/sbin/prtconf" ]; then
+ # Solaris
+ MEM=`/usr/sbin/prtconf | grep "^Memory size" | awk '{print $3}'`
+elif [ -x "/usr/sbin/system_profiler" ]; then
+ # MacOS
+ MEMo=`/usr/sbin/system_profiler SPHardwareDataType | grep Memory:`
+ MEM=`echo "$MEMo" | awk '{print $2}'`
+ MEMu=`echo "$MEMo" | awk '{print $3}'`
+ case $MEMu in
+ GB)
+ MEM="$(($MEM * 1024))"
+ ;;
+ MB)
+ ;;
+ *)
+ echo "Unknown memory unit in system_profile output: $MEMu"
+ ;;
+ esac
+elif [ -n "$ROOTDIR" -a -x "$ROOTDIR/mksnt/sysinf" ]; then
+ # Windows/MKS
+ MEM=`"$ROOTDIR/mksnt/sysinf" memory -v | grep "Total Physical Memory: " | sed 's/Total Physical Memory: *//g'`
+ MEM="$(($machine_memory / 1024))"
+else
+ echo "Unable to determine amount of physical memory on the machine"
+fi
+
+if [ $MEM -lt 2000 ]; then
+ echo "Test skipped due to low (or unknown) memory on the system: $MEM Mb"
+ exit 0
+fi
+
+echo "MEMORY=$MEM Mb"
+
+set -x
+
+cp ${TESTSRC}/Test7005594.java .
+cp ${TESTSRC}/Test7005594.sh .
+
+${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test7005594.java
+
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Xmx1600m -Xms1600m -XX:+IgnoreUnrecognizedVMOptions -XX:-ZapUnusedHeapArea -Xcomp -XX:CompileOnly=Test7005594.test Test7005594 > test.out 2>&1
+
+result=$?
+
+cat test.out
+
+if [ $result -eq 95 ]
+then
+ echo "Passed"
+ exit 0
+fi
+
+if [ $result -eq 97 ]
+then
+ echo "Failed"
+ exit 1
+fi
+
+# The test should pass when no enough space for object heap
+grep "Could not reserve enough space for .*object heap" test.out
+if [ $? = 0 ]
+then
+ echo "Passed"
+ exit 0
+else
+ echo "Failed"
+ exit 1
+fi
diff --git a/hotspot/test/runtime/containers/docker/TestMisc.java b/hotspot/test/runtime/containers/docker/TestMisc.java
index ead0d781b9..efd52278cb 100644
--- a/hotspot/test/runtime/containers/docker/TestMisc.java
+++ b/hotspot/test/runtime/containers/docker/TestMisc.java
@@ -108,19 +108,6 @@ public class TestMisc {
for (String s : expectedToContain) {
out.shouldContain(s);
}
- String str = out.getOutput();
- if (str.contains("cgroupv1")) {
- out.shouldContain("kernel_memory_usage_in_bytes");
- out.shouldContain("kernel_memory_max_usage_in_bytes");
- out.shouldContain("kernel_memory_limit_in_bytes");
- } else {
- if (str.contains("cgroupv2")) {
- out.shouldContain("memory_swap_current_in_bytes");
- out.shouldContain("memory_swap_max_limit_in_bytes");
- } else {
- throw new RuntimeException("Output has to contain information about cgroupv1 or cgroupv2");
- }
- }
}
}
diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
index 5b511cfd1c..572010c447 100644
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
@@ -25,7 +25,6 @@ import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
import com.sun.org.apache.xalan.internal.res.XSLMessages;
-import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathConstants;
@@ -34,7 +33,6 @@ import javax.xml.xpath.XPathVariableResolver;
import jdk.xml.internal.JdkXmlFeatures;
import jdk.xml.internal.JdkXmlUtils;
-import jdk.xml.internal.XMLSecurityManager;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeIterator;
@@ -62,14 +60,12 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
boolean overrideDefaultParser;
private final JdkXmlFeatures featureManager;
- private final XMLSecurityManager xmlSecMgr;
/** Protected constructor to prevent direct instantiation; use compile()
* from the context.
*/
protected XPathExpressionImpl() {
- this(null, null, null, null, false, new JdkXmlFeatures(true),
- new XMLSecurityManager(true));
+ this(null, null, null, null, false, new JdkXmlFeatures(false));
};
protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
@@ -77,14 +73,13 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
XPathFunctionResolver functionResolver,
XPathVariableResolver variableResolver ) {
this(xpath, prefixResolver, functionResolver, variableResolver,
- false, new JdkXmlFeatures(true),
- new XMLSecurityManager(true));
+ false, new JdkXmlFeatures(false));
};
protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
JAXPPrefixResolver prefixResolver,XPathFunctionResolver functionResolver,
XPathVariableResolver variableResolver, boolean featureSecureProcessing,
- JdkXmlFeatures featureManager, XMLSecurityManager xmlSecMgr) {
+ JdkXmlFeatures featureManager) {
this.xpath = xpath;
this.prefixResolver = prefixResolver;
this.functionResolver = functionResolver;
@@ -93,7 +88,6 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
this.featureManager = featureManager;
this.overrideDefaultParser = featureManager.getFeature(
JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER);
- this.xmlSecMgr = xmlSecMgr;
};
public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) {
@@ -292,10 +286,6 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
if ( dbf == null ) {
dbf = JdkXmlUtils.getDOMFactory(overrideDefaultParser);
}
- if (xmlSecMgr != null && xmlSecMgr.isSecureProcessingSet()) {
- dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING,
- xmlSecMgr.isSecureProcessing());
- }
db = dbf.newDocumentBuilder();
Document document = db.parse( source );
return eval( document, returnType );
diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
index 4240bb0491..cc82576670 100644
--- a/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java
@@ -401,8 +401,7 @@ public class XPathImpl implements javax.xml.xpath.XPath {
// Can have errorListener
XPathExpressionImpl ximpl = new XPathExpressionImpl(xpath,
prefixResolver, functionResolver, variableResolver,
- featureSecureProcessing, featureManager,
- xmlSecMgr);
+ featureSecureProcessing, featureManager );
return ximpl;
} catch ( javax.xml.transform.TransformerException te ) {
throw new XPathExpressionException ( te ) ;
diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION
index a2974d757c..4bd54efbcd 100644
--- a/jdk/make/data/tzdata/VERSION
+++ b/jdk/make/data/tzdata/VERSION
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2026a
+tzdata2025b
diff --git a/jdk/make/data/tzdata/africa b/jdk/make/data/tzdata/africa
index 75ddbe88f7..af92bd5763 100644
--- a/jdk/make/data/tzdata/africa
+++ b/jdk/make/data/tzdata/africa
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2018-05-27):
#
@@ -138,9 +138,8 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia
-1:00 - -01
# Chad
-# Fort-Lamy was renamed to N’Djamena on 1973-04-06.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # Fort-Lamy
+Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # N'Djamena
1:00 - WAT 1979 Oct 14
1:00 1:00 WAST 1980 Mar 8
1:00 - WAT
diff --git a/jdk/make/data/tzdata/antarctica b/jdk/make/data/tzdata/antarctica
index ca6aac61b3..47f64f2cee 100644
--- a/jdk/make/data/tzdata/antarctica
+++ b/jdk/make/data/tzdata/antarctica
@@ -26,10 +26,13 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
-# From Paul Eggert (2025-08-16):
-# To keep things manageable, list only locations occupied year-round; see
-# Antarctic Facilities Information
-# https://www.comnap.aq/antarctic-facilities-information
+# From Paul Eggert (1999-11-15):
+# To keep things manageable, we list only locations occupied year-round; see
+# COMNAP - Stations and Bases
+# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/
+# and
+# Summary of the Peri-Antarctic Islands (1998-07-23)
+# http://www.spri.cam.ac.uk/bob/periant.htm
# for information.
# Unless otherwise specified, we have no time zone information.
@@ -164,7 +167,6 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13
# China - year-round bases
# Great Wall, King George Island, -6213-05858, since 1985-02-20
# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
-# Qinling, Inexpressible I, Terra Nova Bay, -7456+16343, since 2024-02-07
# France - year-round bases (also see "France & Italy")
#
diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia
index cc69802ddc..bfb50ca7a8 100644
--- a/jdk/make/data/tzdata/asia
+++ b/jdk/make/data/tzdata/asia
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2019-07-11):
#
diff --git a/jdk/make/data/tzdata/australasia b/jdk/make/data/tzdata/australasia
index 31a1cef795..3703fc31cb 100644
--- a/jdk/make/data/tzdata/australasia
+++ b/jdk/make/data/tzdata/australasia
@@ -960,9 +960,9 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
# NOTES
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2018-11-18):
#
@@ -2011,7 +2011,6 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
# From Paul Eggert (2018-11-19):
# The 1921-01-15 introduction of standard time is in Shanks; it is also in
# "Standard Time Throughout the World", US National Bureau of Standards (1935),
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular406.pdf
# page 3, which does not give the UT offset. In response to a comment by
# Phake Nick I set the Nauru time of occupation by Japan to
# 1942-08-29/1945-09-08 by using dates from:
@@ -2079,10 +2078,9 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
# https://webspace.science.uu.nl/~gent0113/idl/idl_alaska_samoa.htm
# Although Shanks & Pottenger says they both switched to UT -11:30
-# in 1911, and to -11 in 1950, many earlier sources give -11
+# in 1911, and to -11 in 1950. many earlier sources give -11
# for American Samoa, e.g., the US National Bureau of Standards
# circular "Standard Time Throughout the World", 1932.
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular399.pdf
# Assume American Samoa switched to -11 in 1911, not 1950,
# and that after 1950 they agreed until (western) Samoa skipped a
# day in 2011. Assume also that the Samoas follow the US and New
diff --git a/jdk/make/data/tzdata/etcetera b/jdk/make/data/tzdata/etcetera
index 30542fc811..b767fe871c 100644
--- a/jdk/make/data/tzdata/etcetera
+++ b/jdk/make/data/tzdata/etcetera
@@ -43,8 +43,7 @@
# which load the "UTC" file to handle seconds properly.
Zone Etc/UTC 0 - UTC
-# If leap second support is enabled, functions like gmtime
-# load the "GMT" file to handle leap seconds properly.
+# Functions like gmtime load the "GMT" file to handle leap seconds properly.
# Vanguard section, which works with most .zi parsers.
#Zone GMT 0 - GMT
# Rearguard section, for TZUpdater 2.3.2 and earlier.
diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe
index 62d0c7fdaf..43a9f4e1fe 100644
--- a/jdk/make/data/tzdata/europe
+++ b/jdk/make/data/tzdata/europe
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2017-02-10):
#
@@ -65,7 +65,7 @@
# <https://www.jstor.org/stable/1774359>. He writes:
# "It is requested that corrections and additions to these tables
# may be sent to Mr. John Milne, Royal Geographical Society,
-# Savile Row, London." Nowadays please see the file CONTRIBUTING.
+# Savile Row, London." Nowadays please email them to tz@iana.org.
#
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
# This Russian-language source was consulted by Vladimir Karpinsky; see
@@ -77,7 +77,7 @@
# Десятая гос. тип., 1919.
# http://resolver.gpntb.ru/purl?docushare/dsweb/Get/Resource-2011/Byalokoz__E.L.__Novyy__schet__vremeni__v__techenie__sutok__izd__2(1).pdf
#
-# Brazil's Divisão de Serviços da Hora (DISHO)
+# Brazil's Divisão Serviço da Hora (DSHO),
# History of Summer Time
# <http://pcdsh01.on.br/HISTHV.htm>
# (1998-09-21, in Portuguese)
@@ -937,7 +937,7 @@ Rule Belgium 1922 1927 - Oct Sat>=1 23:00s 0 -
Rule Belgium 1923 only - Apr 21 23:00s 1:00 S
Rule Belgium 1924 only - Mar 29 23:00s 1:00 S
Rule Belgium 1925 only - Apr 4 23:00s 1:00 S
-# DISHO writes that a royal decree of 1926-02-22 specified the Sun following 3rd
+# DSH writes that a royal decree of 1926-02-22 specified the Sun following 3rd
# Sat in Apr (except if it's Easter, in which case it's one Sunday earlier),
# to Sun following 1st Sat in Oct, and that a royal decree of 1928-09-15
# changed the transition times to 02:00 GMT.
@@ -1064,19 +1064,9 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn
# Greenland
#
-# From Paul Eggert (2026-01-22):
-# During World War II, Greenland was effectively independent of Denmark and
-# observed daylight saving time. TIME, volume 37, page 23 (1941-04-21)
-# <https://time.com/archive/6770243/war-peace-greenlands-icy-mountains/> says,
-# "Penfield and West made their way to the U.S.'s most northerly consulate.
-# They were astonished to find that Greenlanders, with almost 24 hours of
-# sunlight a day during the summer, have daylight saving time."
-# As the details are unknown they are omitted from the data for now.
-#
+# From Paul Eggert (2004-10-31):
# During World War II, Germany maintained secret manned weather stations in
# East Greenland and Franz Josef Land, but we don't know their time zones.
-# Also, they're likely out of scope for the database
-# as we lack resources to track every bit of military activity.
# My source for this is Wilhelm Dege's book mentioned under Svalbard.
#
# From Paul Eggert (2017-12-10):
@@ -1343,13 +1333,6 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
# France
# Monaco
-# From Robert H. van Gent (2025-07-21):
-# The most recent issue of the Annuaire [par le Bureau des Longitudes]
-# on Gallica (2021) ... lists information for France
-# https://gallica.bnf.fr/ark:/12148/bpt6k9127672b/f52.item
-# From Paul Eggert (2025-07-21):
-# Go with the 2020 Annuaire (published 2021) except as noted below.
-
# From Ciro Discepolo (2000-12-20):
#
# Henri Le Corre, Régimes horaires pour le monde entier, Éditions
@@ -1411,6 +1394,7 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
# problems in Algiers, Monaco and Tunis.
#
+# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule France 1916 only - Jun 14 23:00s 1:00 S
Rule France 1916 1919 - Oct Sun>=1 23:00s 0 -
@@ -1422,25 +1406,9 @@ Rule France 1920 only - Oct 23 23:00s 0 -
Rule France 1921 only - Mar 14 23:00s 1:00 S
Rule France 1921 only - Oct 25 23:00s 0 -
Rule France 1922 only - Mar 25 23:00s 1:00 S
-# From Robert H. van Gent (2025-07-22):
-# There is a curious history behind the erroneous date for the start of
-# daylight saving in France in 1923 as listed in the current issues of
-# the Annuaire du Bureau des Longitudes. [See:]
-# https://lists.iana.org/hyperkitty/list/tz@iana.org/message/MYQEJMSXO2AIEZ3UIXZKMTTAIPY7KNT2/
-# From Brian Inglis (2025-07-23):
-# Légifrance JORF No. 0073 du 15 mars 1922
-# https://www.legifrance.gouv.fr/jorf/jo/id/JORFCONT000000008324
-# Légifrance JORF No. 0139 du 25 mai 1923
-# https://www.legifrance.gouv.fr/jorf/jo/id/JORFCONT000000008416
-# From Paul Eggert (2025-07-23):
-# The latter specifies March's last Saturday at 23:00 to October's first
-# Saturday at 24:00, except that if neighboring allies agree the dates
-# can be moved to April's third Saturday and September's third Saturday.
-# Apparently spring 1923 was tricky. DISHO writes that in 1930,
-# because of Easter, the transitions were Apr 12 and Oct 5.
-# Use the 2020 Annuaire dates, except for spring 1923 where
-# Shanks & Pottenger's May 26 matches the dates given in the 1924 and
-# 1961-2001 issues of the Annuaire.
+# DSH writes that a law of 1923-05-24 specified 3rd Sat in Apr at 23:00 to 1st
+# Sat in Oct at 24:00; and that in 1930, because of Easter, the transitions
+# were Apr 12 and Oct 5. Go with Shanks & Pottenger.
Rule France 1922 1938 - Oct Sat>=1 23:00s 0 -
Rule France 1923 only - May 26 23:00s 1:00 S
Rule France 1924 only - Mar 29 23:00s 1:00 S
@@ -1990,6 +1958,7 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
# From Stepan Golosunov (2016-03-07):
# the act of the government of the Republic of Moldova Nr. 132 from 1990-05-04
+# http://lex.justice.md/viewdoc.php?action=view&view=doc&id=298782&lang=2
# ... says that since 1990-05-06 on the territory of the Moldavian SSR
# time would be calculated as the standard time of the second time belt
# plus one hour of the "summer" time. To implement that clocks would be
@@ -2044,61 +2013,9 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
# says the 2014-03-30 spring-forward transition was at 02:00 local time.
# Guess that since 1997 Moldova has switched one hour before the EU.
-# From Heitor David Pinto (2026-02-22):
-# Soviet Moldovan resolution 132 of 1990 defined the summer time period from
-# the last Sunday in March at 2:00 to the last Sunday in September at 3:00,
-# matching the dates used in most of Europe at the time:
-# https://web.archive.org/web/20211107050832/http://lex.justice.md/viewdoc.php?action=view&view=doc&id=298782&lang=1
-#
-# It seems that in 1996 Moldova changed the end date to October like most of
-# Europe, but kept the transitions at 2:00 and 3:00 rather than 1:00 UTC,
-# which would have been locally 3:00 and 4:00....
-#
-# The notices in the Moldovan government website and broadcaster showed the
-# transitions at 2:00 and 3:00 until 2021:
-# 2015 https://old.gov.md/en/node/7304
-# 2016 https://old.gov.md/en/node/12587
-# 2017 https://old.gov.md/en/node/20654
-# 2017 https://old.gov.md/en/content/moldova-upholds-winter-time-night-28-29-october
-# 2018 https://old.gov.md/en/content/moldova-switch-summer-time
-# 2018 https://old.gov.md/en/content/cabinet-ministers-informs-about-switch-winter-time-28-october
-# 2019 https://old.gov.md/en/content/moldova-switch-summer-time-31-march
-# 2019 https://old.gov.md/en/node/31122
-# 2020 https://old.gov.md/en/node/32771
-# 2020 https://old.gov.md/en/node/34497
-# 2021 https://trm.md/ro/social/moldova-trece-in-aceasta-noapte-la-ora-de-vara
-# 2021 https://trm.md/en/social/republica-moldova-trece-la-ora-de-iarna1
-#
-# However, since 2022, the notices showed the transitions at 3:00 and 4:00,
-# matching the EU rule at 1:00 UTC:
-# 2022 https://trm.md/en/social/in-acest-weekend-republica-moldova-trece-la-ora-de-vara
-# 2022 https://old.gov.md/en/content/moldova-switch-winter-time
-# 2023 https://moldova1.md/p/6587/ora-de-vara-2023-cum-schimbam-acele-ceasornicelor-si-cand-trecem-la-ora-de-vara
-# 2023 https://old.gov.md/en/node/46662
-# 2024 https://moldova1.md/p/26535/republica-moldova-trece-la-ora-de-vara-in-acest-weekend
-# 2024 https://moldova1.md/p/37768/republica-moldova-trece-in-aceasta-noapte-la-ora-de-iarna
-# 2025 https://moldova1.md/p/46349/republica-moldova-trece-la-ora-de-vara-pe-30-martie-cum-ne-afecteaza-si-ce-recomanda-medicii
-# 2025 https://moldova1.md/p/60469/republica-moldova-trece-la-ora-de-iarna-ceasurile-se-dau-inapoi-cu-o-ora
-#
-# It seems that the changes to the end date and transition times were just
-# done in practice without formally changing the resolution. In late 2025, the
-# government said that the Soviet resolution was still in force, and proposed
-# a new resolution to replace it and formally establish the EU rule:
-# ... based on the notices, it seems that in practice Moldova already
-# uses the EU rule since 2022. This was also the year when Moldova applied to
-# join the EU.
-#
-# From Robert Bastian (2026-02-26):
-# This has been approved and published in the government gazette:
-# https://monitorul.gov.md/ro/monitorul/view/pdf/3234/part/2#page=27
-#
-# From Paul Eggert (2026-02-24):
-# Also see Svetlana Rudenko, "Moldova abandons the 'Soviet era'", Logos Press,
-# 2026-02-21 <https://logos-pres.md/en/news/moldova-abandons-the-soviet-era/>.
-
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Moldova 1997 2021 - Mar lastSun 2:00 1:00 S
-Rule Moldova 1997 2021 - Oct lastSun 3:00 0 -
+Rule Moldova 1997 max - Mar lastSun 2:00 1:00 S
+Rule Moldova 1997 max - Oct lastSun 3:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Chisinau 1:55:20 - LMT 1880
@@ -2111,8 +2028,7 @@ Zone Europe/Chisinau 1:55:20 - LMT 1880
2:00 Russia EE%sT 1992
2:00 E-Eur EE%sT 1997
# See Romania commentary for the guessed 1997 transition to EU rules.
- 2:00 Moldova EE%sT 2022
- 2:00 EU EE%sT
+ 2:00 Moldova EE%sT
# Poland
@@ -2203,10 +2119,12 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
# all clocks therefore having to be advanced or set back correspondingly ...
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-# From Tim Parenti (2024-07-01):
-# Decreto 1469 of 1915-03-30 ... had nothing to do with DST;
-# rather it regulated the sending of time signals.
-# But we do see linkage to Spain in the 1920s below.
+# From Tim Parenti (2024-07-01), per Paul Eggert (1999-01-30):
+# DSH writes in their history that Decreto 1469 of 1915-03-30 established
+# summer time and that, "despite" this, the change to the clocks was not done
+# every year, depending on what Spain did, because of railroad schedules.
+# In fact, that decree had nothing to do with DST; rather, it regulated the
+# sending of time signals. But we do see linkage to Spain in the 1920s below.
# https://dre.pt/dr/detalhe/decreto/1469-1915-285721
# https://dre.pt/application/conteudo/285721
#
@@ -2498,7 +2416,7 @@ Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
# Nine O'clock <http://www.nineoclock.ro/POL/1778pol.html>
# (1998-10-23) reports that the switch occurred at
# 04:00 local time in fall 1998. For lack of better info,
-# assume that Romania switched to EU rules in 1997,
+# assume that Romania and Moldova switched to EU rules in 1997,
# the same year as Bulgaria.
#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
diff --git a/jdk/make/data/tzdata/iso3166.tab b/jdk/make/data/tzdata/iso3166.tab
index ddcc841fe9..7fa350ecbe 100644
--- a/jdk/make/data/tzdata/iso3166.tab
+++ b/jdk/make/data/tzdata/iso3166.tab
@@ -26,22 +26,22 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
-# From Paul Eggert (2025-07-01):
+# From Paul Eggert (2023-09-06):
# This file contains a table of two-letter country codes. Columns are
-# separated by a single tab. Lines beginning with ‘#’ are comments.
+# separated by a single tab. Lines beginning with '#' are comments.
# All text uses UTF-8 encoding. The columns of the table are as follows:
#
# 1. ISO 3166-1 alpha-2 country code, current as of
-# ISO/TC 46 N1127 (2024-02-29). See: ISO/TC 46 Documents
+# ISO/TC 46 N1108 (2023-04-05). See: ISO/TC 46 Documents
# https://www.iso.org/committee/48750.html?view=documents
# 2. The usual English name for the coded region. This sometimes
# departs from ISO-listed names, sometimes so that sorted subsets
-# of names are useful (e.g., “Samoa (American)” and “Samoa
-# (western)” rather than “American Samoa” and “Samoa”),
+# of names are useful (e.g., "Samoa (American)" and "Samoa
+# (western)" rather than "American Samoa" and "Samoa"),
# sometimes to avoid confusion among non-experts (e.g.,
-# “Czech Republic” and “Turkey” rather than “Czechia” and “Türkiye”),
-# and sometimes to omit needless detail or churn (e.g., “Netherlands”
-# rather than “Netherlands (the)” or “Netherlands (Kingdom of the)”).
+# "Czech Republic" and "Turkey" rather than "Czechia" and "Türkiye"),
+# and sometimes to omit needless detail or churn (e.g., "Netherlands"
+# rather than "Netherlands (the)" or "Netherlands (Kingdom of the)").
#
# The table is sorted by country code.
#
@@ -94,7 +94,7 @@ CD Congo (Dem. Rep.)
CF Central African Rep.
CG Congo (Rep.)
CH Switzerland
-CI Côte d’Ivoire
+CI Côte d'Ivoire
CK Cook Islands
CL Chile
CM Cameroon
diff --git a/jdk/make/data/tzdata/leapseconds b/jdk/make/data/tzdata/leapseconds
index d431a7d360..042a32b052 100644
--- a/jdk/make/data/tzdata/leapseconds
+++ b/jdk/make/data/tzdata/leapseconds
@@ -28,8 +28,7 @@
# This file is generated automatically from the data in the public-domain
# NIST/IERS format leap-seconds.list file, which can be copied from
# <https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list>
-# or via a less-secure protocol and with different comments and
-# less volatile last-modified and expiration timestamps, from
+# or, in a variant with different comments, from
# <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
# For more about leap-seconds.list, please see
# The NTP Timescale and Leap Seconds
@@ -93,17 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S
# Any additional leap seconds will come after this.
# This Expires line is commented out for now,
# so that pre-2020a zic implementations do not reject this file.
-#Expires 2026 Dec 28 00:00:00
+#Expires 2025 Dec 28 00:00:00
-# Here are POSIX timestamps for the data in this file.
-# "#updated" gives the last time the leap seconds data changed
-# or, if this file was derived from the IERS leap-seconds.list,
-# the last time that file changed in any way.
-# "#expires" gives the first time this file might be wrong;
-# if this file was derived from the IERS leap-seconds.list,
-# this is typically a bit less than one year after "updated".
-#updated 1767698058 (2026-01-06 11:14:18 UTC)
-#expires 1798416000 (2026-12-28 00:00:00 UTC)
+# POSIX timestamps for the data in this file:
+#updated 1736208000 (2025-01-07 00:00:00 UTC)
+#expires 1766880000 (2025-12-28 00:00:00 UTC)
# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
-# File expires on 28 December 2026
+# File expires on 28 December 2025
diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica
index b85a150a23..b0687f0fce 100644
--- a/jdk/make/data/tzdata/northamerica
+++ b/jdk/make/data/tzdata/northamerica
@@ -29,9 +29,9 @@
# also includes Central America and the Caribbean
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (1999-03-22):
# A reliable and entertaining source about time zones is
@@ -1241,16 +1241,6 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
# Jimmy Skaggs, _The Great Guano Rush_ (1994).
-# From Rob van Gent (2025-07-23):
-# Another useful source for historical time zone information appears to be
-# a series of circulars with the title "Standard Time Throughout the World"
-# issued between 1925 and 1950 by the U.S. Bureau of Standards.
-# I found the following issues online:
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular280.pdf (1925)
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular399.pdf (1932)
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular406.pdf (1935)
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular496.pdf (1950)
-
################################################################################
@@ -2467,35 +2457,12 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# on the same dates or with a difference of one day.
# So it may be easier to implement these changes as DST with rule CA
# during this whole period.
-
-# From Alois Treindl (2025-07-29):
-# I did a quick newspaper archive research on https://hndm.iib.unam.mx/
-# and found that Periódico Oficial del Estado de Baja California Norte
-# (1973-04-20) states clearly that DST was observed from last Sunday
-# in April to last Sunday in October.... I have a few more data from the
-# official bulletin for DST begin or end in Baja California 1964 1967 1969
-# 1972 1973 (already sent) 1974 1975 1976 I do not know whether it is safe to
-# assume that it also applied in the years where I did not yet find proof.
-# The 1974 end of DST contains a reference to an Acuerdo of 1973-dec-20 which
-# I could not find.... One might assume that Baja California, which followed
-# US-CA in all these other yours, did the same.
-#
-# From Paul Eggert (2025-08-04):
-# Assume that Tijuana agreed with San Diego from 1953 through 1996,
-# as this agrees with Alois Treindl's data and with Shanks.
-# For now, keep the slightly-different 1948/1952 history for Baja California,
+#
+# From Paul Eggert (2024-08-18):
+# For now, maintain the slightly-different history for Baja California,
# as we have no information on whether 1948/1952 clocks in Tijuana followed
# the decrees or followed San Diego.
-# From Mark Schapiro, writing in The Nation (2002-10-28):
-# https://www.thenation.com/article/archive/sowing-disaster/
-# When Mexican clocks were turned back for daylight saving time in the spring,
-# the Zapotecs refused to make the adjustment, insisting that they live in
-# "God's time," not in what they derisively call "Fox time," referring to
-# President Vicente Fox in far-off Mexico City.
-# From Paul Eggert (2025-08-04):
-# Unfortunately we have no data to track this informal practice.
-
# From Alan Perry (1996-02-15):
# A guy from our Mexico subsidiary finally found the Presidential Decree
# outlining the timezone changes in Mexico.
@@ -2761,7 +2728,7 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u
# Chihuahua (near US border - western side)
# This includes the municipios of Janos, Ascensión, Juárez, Guadalupe, and
# Práxedis G Guerrero.
-# https://gaceta.diputados.gob.mx/PDF/65/2022/nov/20221124-VII.pdf
+# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
@@ -2776,7 +2743,7 @@ Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
# Chihuahua (near US border - eastern side)
# This includes the municipios of Coyame del Sotol, Ojinaga, and Manuel
# Benavides.
-# https://gaceta.diputados.gob.mx/PDF/65/2022/nov/20221124-VII.pdf
+# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
@@ -2873,7 +2840,9 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 7:00u
-8:00 1:00 PDT 1951 Sep 30 2:00
-8:00 - PST 1952 Apr 27 2:00
-8:00 1:00 PDT 1952 Sep 28 2:00
- -8:00 CA P%sT 1967
+ -8:00 - PST 1954
+ -8:00 CA P%sT 1961
+ -8:00 - PST 1976
-8:00 US P%sT 1996
-8:00 Mexico P%sT 2001
-8:00 US P%sT 2002 Feb 20
diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica
index e36743506c..3b0b65be4a 100644
--- a/jdk/make/data/tzdata/southamerica
+++ b/jdk/make/data/tzdata/southamerica
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2016-12-05):
#
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index dc140de77f..44db18b4a6 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -876,13 +876,6 @@ else
else
LIBFREETYPE_LIBS := -lfreetype
endif
- # on 32b, the old msvsc do not understand inline, unluckily there is
- # wrong detection in freetype 2.14 to use only __inline in such case
- ifeq ($(TOOLCHAIN_TYPE), microsoft)
- ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
- BUILD_LIBFREETYPE_CFLAGS += -Dinline=__inline
- endif
- endif
$(eval $(call SetupNativeCompilation,BUILD_LIBFREETYPE, \
LIBRARY := freetype, \
diff --git a/jdk/src/macosx/bin/java_md_macosx.c b/jdk/src/macosx/bin/java_md_macosx.c
index b2179825b7..6aa0eb588a 100644
--- a/jdk/src/macosx/bin/java_md_macosx.c
+++ b/jdk/src/macosx/bin/java_md_macosx.c
@@ -881,7 +881,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp;
pthread_join(tid, &tmp);
- rslt = (int)(intptr_t)tmp;
+ rslt = (int)tmp;
} else {
/*
* Continue execution in current thread if for some reason (e.g. out of
diff --git a/jdk/src/macosx/native/sun/awt/AWTWindow.m b/jdk/src/macosx/native/sun/awt/AWTWindow.m
index 43b9a201a6..0165750cd8 100644
--- a/jdk/src/macosx/native/sun/awt/AWTWindow.m
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -1495,7 +1495,6 @@ JNF_COCOA_ENTER(env);
int shieldLevel = CGShieldingWindowLevel();
window.preFullScreenLevel = [nsWindow level];
[nsWindow setLevel: shieldLevel];
- [nsWindow makeKeyAndOrderFront: nil];
NSRect screenRect = [[nsWindow screen] frame];
[nsWindow setFrame:screenRect display:YES];
diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c
index a15a174aa0..d74b185deb 100644
--- a/jdk/src/share/bin/java.c
+++ b/jdk/src/share/bin/java.c
@@ -729,7 +729,7 @@ SetJvmEnvironment(int argc, char **argv) {
static int
parse_size(const char *s, jlong *result) {
jlong n = 0;
- int args_read = sscanf(s, JLONG_FORMAT_SPECIFIER, &n);
+ int args_read = sscanf(s, jlong_format_specifier(), &n);
if (args_read != 1) {
return 0;
}
diff --git a/jdk/src/share/bin/java.h b/jdk/src/share/bin/java.h
index ce609f56cf..9dc0e16f6a 100644
--- a/jdk/src/share/bin/java.h
+++ b/jdk/src/share/bin/java.h
@@ -146,6 +146,8 @@ void JLI_ReportMessage(const char * message, ...);
void JLI_ReportExceptionDescription(JNIEnv * env);
void PrintMachineDependentOptions();
+const char *jlong_format_specifier();
+
/*
* Block current thread and continue execution in new thread
*/
diff --git a/jdk/src/share/bin/parse_manifest.c b/jdk/src/share/bin/parse_manifest.c
index 1b8014ec57..4926824e36 100644
--- a/jdk/src/share/bin/parse_manifest.c
+++ b/jdk/src/share/bin/parse_manifest.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -174,7 +174,7 @@ find_end(int fd, Byte *eb)
*/
if ((pos = JLI_Lseek(fd, -ENDHDR, SEEK_END)) < (jlong)0)
return (-1);
- if (read(fd, eb, ENDHDR) < 0)
+ if ((bytes = read(fd, eb, ENDHDR)) < 0)
return (-1);
if (GETSIG(eb) == ENDSIG) {
return haveZIP64(eb) ? find_end64(fd, eb, pos) : pos;
@@ -193,13 +193,7 @@ find_end(int fd, Byte *eb)
return (-1);
if ((buffer = malloc(END_MAXLEN)) == NULL)
return (-1);
-
- /*
- * read() on windows takes an unsigned int for count. Casting len
- * to an unsigned int here is safe since it is guaranteed to be
- * less than END_MAXLEN.
- */
- if ((bytes = read(fd, buffer, (unsigned int)len)) < 0) {
+ if ((bytes = read(fd, buffer, len)) < 0) {
free(buffer);
return (-1);
}
@@ -583,7 +577,7 @@ JLI_ParseManifest(char *jarfile, manifest_info *info)
info->jre_version = NULL;
info->jre_restrict_search = 0;
info->splashscreen_image_file_name = NULL;
- if ((rc = find_file(fd, &entry, manifest_name)) != 0) {
+ if (rc = find_file(fd, &entry, manifest_name) != 0) {
close(fd);
return (-2);
}
@@ -683,7 +677,7 @@ JLI_ManifestIterate(const char *jarfile, attribute_closure ac, void *user_data)
return (-1);
}
- if ((rc = find_file(fd, &entry, manifest_name)) != 0) {
+ if (rc = find_file(fd, &entry, manifest_name) != 0) {
close(fd);
return (-2);
}
diff --git a/jdk/src/share/bin/splashscreen_stubs.c b/jdk/src/share/bin/splashscreen_stubs.c
index f741ccf807..9c1f5148c4 100644
--- a/jdk/src/share/bin/splashscreen_stubs.c
+++ b/jdk/src/share/bin/splashscreen_stubs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,11 +61,11 @@ typedef char* (*SplashGetScaledImageName_t)(const char* fileName,
#define INVOKEV(name) _INVOKE(name, ,;)
int DoSplashLoadMemory(void* pdata, int size) {
- INVOKE(SplashLoadMemory, 0)(pdata, size);
+ INVOKE(SplashLoadMemory, NULL)(pdata, size);
}
int DoSplashLoadFile(const char* filename) {
- INVOKE(SplashLoadFile, 0)(filename);
+ INVOKE(SplashLoadFile, NULL)(filename);
}
void DoSplashInit(void) {
@@ -87,4 +87,4 @@ void DoSplashSetScaleFactor(float scaleFactor) {
char* DoSplashGetScaledImageName(const char* fileName, const char* jarName,
float* scaleFactor) {
INVOKE(SplashGetScaledImageName, NULL)(fileName, jarName, scaleFactor);
-}
+}
\ No newline at end of file
diff --git a/jdk/src/share/bin/wildcard.c b/jdk/src/share/bin/wildcard.c
index d8c9df0210..96dac738aa 100644
--- a/jdk/src/share/bin/wildcard.c
+++ b/jdk/src/share/bin/wildcard.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -274,7 +274,7 @@ FileList_add(FileList fl, char *file)
}
static void
-FileList_addSubstring(FileList fl, const char *beg, size_t len)
+FileList_addSubstring(FileList fl, const char *beg, int len)
{
char *filename = (char *) JLI_MemAlloc(len+1);
memcpy(filename, beg, len);
@@ -310,7 +310,7 @@ static FileList
FileList_split(const char *path, char sep)
{
const char *p, *q;
- size_t len = JLI_StrLen(path);
+ int len = (int)JLI_StrLen(path);
int count;
FileList fl;
for (count = 1, p = path; p < path + len; p++)
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java
index 6ae54f4dad..f634a639c1 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBES1Core.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,39 +48,7 @@ final class PBES1Core {
private int blkSize;
private String algo = null;
private byte[] salt = null;
- // RFC 8018 and NIST SP 800-132 sec 5.2 recommend 1000 as the minimum
- private int iCount = PKCS12PBECipherCore.DEFAULT_COUNT;
-
- // utility method for checking weak salts of PBEWithMD5AndTripleDES cipher
- private static boolean isWeak(byte[] s) {
- // consider salts weak if it met both of the following conditions:
- // 1) s[0...3] == s[4...7]
- for (int i=0; i<4; i++) {
- if (s[i] != s[i+4])
- return false;
- }
- // 2) s[0] == s[3] && s[1] == s[2]
- return (s[0] == s[3]) && (s[1] == s[2]);
- }
-
- // utility method for generating 8-byte salts
- private static byte[] generateSalt(String algo, SecureRandom sr) {
- byte[] salt = new byte[8];
- sr.nextBytes(salt);
- // check and re-generate for DESede if necessary
- if (algo.equals("DESede")) {
- // prevent an infinite-loop in case of a rigged SecureRandom
- int numAttempts = 50;
- while (isWeak(salt)) {
- sr.nextBytes(salt);
- if (numAttempts-- < 0) {
- throw new ProviderException(
- "Unable to find salts after 50 attempts");
- }
- }
- }
- return salt;
- }
+ private int iCount = 10;
/**
* Creates an instance of PBE Cipher using the specified CipherSpi
@@ -196,7 +164,8 @@ final class PBES1Core {
AlgorithmParameters getParameters() {
AlgorithmParameters params = null;
if (salt == null) {
- salt = generateSalt(algo, SunJCE.getRandom());
+ salt = new byte[8];
+ SunJCE.getRandom().nextBytes(salt);
}
PBEParameterSpec pbeSpec = new PBEParameterSpec(salt, iCount);
try {
@@ -259,7 +228,8 @@ final class PBES1Core {
if (params == null) {
// create random salt and use default iteration count
- salt = generateSalt(algo, random);
+ salt = new byte[8];
+ random.nextBytes(salt);
} else {
if (!(params instanceof PBEParameterSpec)) {
throw new InvalidAlgorithmParameterException
@@ -271,15 +241,6 @@ final class PBES1Core {
throw new InvalidAlgorithmParameterException
("Salt must be 8 bytes long");
}
- // for DESede, reject weak salts for encryption
- if (algo.equals("DESede") &&
- (opmode == Cipher.ENCRYPT_MODE ||
- opmode == Cipher.WRAP_MODE) &&
- isWeak(salt)) {
- throw new InvalidAlgorithmParameterException(
- "Weak salts cannot be used for encryption");
- }
-
iCount = ((PBEParameterSpec) params).getIterationCount();
if (iCount <= 0) {
throw new InvalidAlgorithmParameterException
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java
index 77daca68f3..bb0a6074f8 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@ final class PKCS12PBECipherCore {
private int iCount = 0;
private static final int DEFAULT_SALT_LENGTH = 20;
- static final int DEFAULT_COUNT = 1024;
+ private static final int DEFAULT_COUNT = 1024;
static final int CIPHER_KEY = 1;
static final int CIPHER_IV = 2;
diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
index 21615515a6..116642e195 100644
--- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
+++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,7 +59,6 @@ import com.sun.imageio.plugins.common.ReaderUtil;
import com.sun.imageio.plugins.common.SubImageInputStream;
import java.io.ByteArrayOutputStream;
import sun.awt.image.ByteInterleavedRaster;
-import sun.misc.IOUtils;
class PNGImageDataEnumeration implements Enumeration<InputStream> {
@@ -135,7 +134,6 @@ public class PNGImageReader extends ImageReader {
static final int tRNS_TYPE = 0x74524e53;
static final int zTXt_TYPE = 0x7a545874;
- static final int MAX_INFLATED_TEXT_LENGTH = 262144;
static final int PNG_COLOR_GRAY = 0;
static final int PNG_COLOR_RGB = 2;
static final int PNG_COLOR_PALETTE = 3;
@@ -622,9 +620,18 @@ public class PNGImageReader extends ImageReader {
private static byte[] inflate(byte[] b) throws IOException {
InputStream bais = new ByteArrayInputStream(b);
- try (InputStream iis = new InflaterInputStream(bais)) {
- return IOUtils.readNBytes(iis, MAX_INFLATED_TEXT_LENGTH);
+ InputStream iis = new InflaterInputStream(bais);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ int c;
+ try {
+ while ((c = iis.read()) != -1) {
+ baos.write(c);
+ }
+ } finally {
+ iis.close();
}
+ return baos.toByteArray();
}
private void parse_zTXt_chunk(int chunkLength) throws IOException {
diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
index b874164ff1..72167580a9 100644
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
@@ -531,16 +531,14 @@ class Metacity implements SynthConstants {
URL url = new URL(new File(userHome).toURI().toURL(),
".gconf/apps/metacity/general/%25gconf.xml");
// Pending: verify character encoding spec for gconf
+ Reader reader = new InputStreamReader(url.openStream(), "ISO-8859-1");
+ char[] buf = new char[1024];
StringBuffer strBuf = new StringBuffer();
- try (InputStream in = url.openStream();
- Reader reader = new InputStreamReader(in, "ISO-8859-1"))
- {
- char[] buf = new char[1024];
- int n;
- while ((n = reader.read(buf)) >= 0) {
- strBuf.append(buf, 0, n);
- }
+ int n;
+ while ((n = reader.read(buf)) >= 0) {
+ strBuf.append(buf, 0, n);
}
+ reader.close();
String str = strBuf.toString();
if (str != null) {
String strLowerCase = str.toLowerCase();
diff --git a/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java
index 365e87ca90..841de2f9b0 100644
--- a/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java
+++ b/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -47,8 +47,10 @@ public final class AudioFileSoundbankReader extends SoundbankReader {
public Soundbank getSoundbank(URL url)
throws InvalidMidiDataException, IOException {
- try (AudioInputStream ais = AudioSystem.getAudioInputStream(url)) {
+ try {
+ AudioInputStream ais = AudioSystem.getAudioInputStream(url);
Soundbank sbk = getSoundbank(ais);
+ ais.close();
return sbk;
} catch (UnsupportedAudioFileException e) {
return null;
@@ -91,13 +93,6 @@ public final class AudioFileSoundbankReader extends SoundbankReader {
"Can not allocate enough memory to read audio data.");
}
- long maximumHeapSize = (long) ((Runtime.getRuntime().maxMemory() -
- (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())) * 0.9);
- if (totalSize > maximumHeapSize) {
- throw new InvalidMidiDataException(
- "Insufficient heap size to render audio data.");
- }
-
if (ais.getFrameLength() == -1 || totalSize > MEGABYTE) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buff = new byte[DEFAULT_BUFFER_SIZE - (DEFAULT_BUFFER_SIZE % frameSize)];
diff --git a/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java b/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java
index 3e9ea9c19a..1aa62d9943 100644
--- a/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java
+++ b/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java
@@ -186,16 +186,22 @@ public final class DLSSoundbank implements Soundbank {
}
public DLSSoundbank(URL url) throws IOException {
- try (InputStream is = url.openStream()) {
+ InputStream is = url.openStream();
+ try {
readSoundbank(is);
+ } finally {
+ is.close();
}
}
public DLSSoundbank(File file) throws IOException {
largeFormat = true;
sampleFile = file;
- try (InputStream is = new FileInputStream(file)) {
+ InputStream is = new FileInputStream(file);
+ try {
readSoundbank(is);
+ } finally {
+ is.close();
}
}
@@ -864,21 +870,15 @@ public final class DLSSoundbank implements Soundbank {
}
public void save(String name) throws IOException {
- try (RIFFWriter writer = new RIFFWriter(name, "DLS ")) {
- writeSoundbank(writer);
- }
+ writeSoundbank(new RIFFWriter(name, "DLS "));
}
public void save(File file) throws IOException {
- try (RIFFWriter writer = new RIFFWriter(file, "DLS ")) {
- writeSoundbank(writer);
- }
+ writeSoundbank(new RIFFWriter(file, "DLS "));
}
public void save(OutputStream out) throws IOException {
- try (RIFFWriter writer = new RIFFWriter(out, "DLS ")) {
- writeSoundbank(writer);
- }
+ writeSoundbank(new RIFFWriter(out, "DLS "));
}
private void writeSoundbank(RIFFWriter writer) throws IOException {
@@ -918,6 +918,8 @@ public final class DLSSoundbank implements Soundbank {
writer.seek(bak);
writeInfo(writer.writeList("INFO"), info);
+
+ writer.close();
}
private void writeSample(RIFFWriter writer, DLSSample sample)
diff --git a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java
index 951ca8ac8e..7bc1664f9c 100644
--- a/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java
+++ b/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java
@@ -61,7 +61,8 @@ public final class JARSoundbankReader extends SoundbankReader {
private static boolean isZIP(URL url) {
boolean ok = false;
try {
- try (InputStream stream = url.openStream()) {
+ InputStream stream = url.openStream();
+ try {
byte[] buff = new byte[4];
ok = stream.read(buff) == 4;
if (ok) {
@@ -70,6 +71,8 @@ public final class JARSoundbankReader extends SoundbankReader {
&& buff[2] == 0x03
&& buff[3] == 0x04);
}
+ } finally {
+ stream.close();
}
} catch (IOException e) {
}
@@ -84,10 +87,12 @@ public final class JARSoundbankReader extends SoundbankReader {
ArrayList<Soundbank> soundbanks = new ArrayList<Soundbank>();
URLClassLoader ucl = URLClassLoader.newInstance(new URL[]{url});
- try (InputStream stream = ucl.getResourceAsStream(
- "META-INF/services/javax.sound.midi.Soundbank")) {
- if (stream == null)
- return null;
+ InputStream stream = ucl.getResourceAsStream(
+ "META-INF/services/javax.sound.midi.Soundbank");
+ if (stream == null)
+ return null;
+ try
+ {
BufferedReader r = new BufferedReader(new InputStreamReader(stream));
String line = r.readLine();
while (line != null) {
@@ -106,6 +111,10 @@ public final class JARSoundbankReader extends SoundbankReader {
line = r.readLine();
}
}
+ finally
+ {
+ stream.close();
+ }
if (soundbanks.size() == 0)
return null;
if (soundbanks.size() == 1)
diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java b/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java
index 08b51865bb..fb82f4d9f8 100644
--- a/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java
+++ b/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java
@@ -309,13 +309,11 @@ public final class ModelByteBuffer {
"No file associated with this ByteBuffer!");
}
- try (InputStream is = getInputStream();
- DataInputStream dis = new DataInputStream(is))
- {
- buffer = new byte[(int) capacity()];
- offset = 0;
- dis.readFully(buffer);
- }
+ DataInputStream is = new DataInputStream(getInputStream());
+ buffer = new byte[(int) capacity()];
+ offset = 0;
+ is.readFully(buffer);
+ is.close();
}
diff --git a/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java b/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java
index e40ac9dfe7..33515f400d 100644
--- a/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java
+++ b/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -172,12 +172,18 @@ public final class ModelByteBufferWavetable implements ModelWavetable {
if (format == null) {
if (buffer == null)
return null;
+ InputStream is = buffer.getInputStream();
AudioFormat format = null;
- try (InputStream is = buffer.getInputStream()) {
+ try {
format = AudioSystem.getAudioFileFormat(is).getFormat();
} catch (Exception e) {
//e.printStackTrace();
}
+ try {
+ is.close();
+ } catch (IOException e) {
+ //e.printStackTrace();
+ }
return format;
}
return format;
diff --git a/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java b/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java
index 86b8dc92f8..041c8aa1c2 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java
@@ -89,16 +89,23 @@ public final class SF2Soundbank implements Soundbank {
}
public SF2Soundbank(URL url) throws IOException {
- try (InputStream is = url.openStream()) {
+
+ InputStream is = url.openStream();
+ try {
readSoundbank(is);
+ } finally {
+ is.close();
}
}
public SF2Soundbank(File file) throws IOException {
largeFormat = true;
sampleFile = file;
- try (InputStream is = new FileInputStream(file)) {
+ InputStream is = new FileInputStream(file);
+ try {
readSoundbank(is);
+ } finally {
+ is.close();
}
}
@@ -515,27 +522,22 @@ public final class SF2Soundbank implements Soundbank {
}
public void save(String name) throws IOException {
- try (RIFFWriter writer = new RIFFWriter(name, "sfbk")) {
- writeSoundbank(writer);
- }
+ writeSoundbank(new RIFFWriter(name, "sfbk"));
}
public void save(File file) throws IOException {
- try (RIFFWriter writer = new RIFFWriter(file, "sfbk")) {
- writeSoundbank(writer);
- }
+ writeSoundbank(new RIFFWriter(file, "sfbk"));
}
public void save(OutputStream out) throws IOException {
- try (RIFFWriter writer = new RIFFWriter(out, "sfbk")) {
- writeSoundbank(writer);
- }
+ writeSoundbank(new RIFFWriter(out, "sfbk"));
}
private void writeSoundbank(RIFFWriter writer) throws IOException {
writeInfo(writer.writeList("INFO"));
writeSdtaChunk(writer.writeList("sdta"));
writePdtaChunk(writer.writeList("pdta"));
+ writer.close();
}
private void writeInfoStringChunk(RIFFWriter writer, String name,
diff --git a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
index f849bbf3c5..8464e5aef6 100644
--- a/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
+++ b/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java
@@ -738,10 +738,13 @@ public final class SoftSynthesizer implements AudioSynthesizer,
for (PrivilegedAction<InputStream> action : actions) {
try {
+ InputStream is = AccessController.doPrivileged(action);
+ if(is == null) continue;
Soundbank sbk;
- try (InputStream is = AccessController.doPrivileged(action)) {
- if (is == null) continue;
+ try {
sbk = MidiSystem.getSoundbank(new BufferedInputStream(is));
+ } finally {
+ is.close();
}
if (sbk != null) {
defaultSoundBank = sbk;
@@ -763,28 +766,30 @@ public final class SoftSynthesizer implements AudioSynthesizer,
/*
* Save generated soundbank to disk for faster future use.
*/
- final PrivilegedAction<OutputStream> action = () -> {
- try {
- File userhome = new File(System
- .getProperty("user.home"), ".gervill");
- if (!userhome.exists()) {
- userhome.mkdirs();
- }
- File emg_soundbank_file = new File(
- userhome, "soundbank-emg.sf2");
- if (emg_soundbank_file.exists()) {
+ OutputStream out = AccessController
+ .doPrivileged((PrivilegedAction<OutputStream>) () -> {
+ try {
+ File userhome = new File(System
+ .getProperty("user.home"), ".gervill");
+ if (!userhome.exists()) {
+ userhome.mkdirs();
+ }
+ File emg_soundbank_file = new File(
+ userhome, "soundbank-emg.sf2");
+ if (emg_soundbank_file.exists()) {
+ return null;
+ }
+ return new FileOutputStream(emg_soundbank_file);
+ } catch (final FileNotFoundException ignored) {
+ }
return null;
- }
- return new FileOutputStream(emg_soundbank_file);
- } catch (final FileNotFoundException ignored) {
- }
- return null;
- };
- try (OutputStream out = AccessController.doPrivileged(action)) {
- if (out != null) {
+ });
+ if (out != null) {
+ try {
((SF2Soundbank) defaultSoundBank).save(out);
+ out.close();
+ } catch (final IOException ignored) {
}
- } catch (final IOException ignored) {
}
}
}
diff --git a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java
index f7abc15c5f..20ebe4f060 100644
--- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java
+++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -145,27 +145,34 @@ public final class StandardMidiFileReader extends MidiFileReader {
public MidiFileFormat getMidiFileFormat(URL url) throws InvalidMidiDataException, IOException {
- try (InputStream urlStream = url.openStream(); // throws IOException
- BufferedInputStream bis = new BufferedInputStream(urlStream, bisBufferSize))
- {
- MidiFileFormat fileFormat = getMidiFileFormat(bis); // throws InvalidMidiDataException
- return fileFormat;
+ InputStream urlStream = url.openStream(); // throws IOException
+ BufferedInputStream bis = new BufferedInputStream( urlStream, bisBufferSize );
+ MidiFileFormat fileFormat = null;
+ try {
+ fileFormat = getMidiFileFormat( bis ); // throws InvalidMidiDataException
+ } finally {
+ bis.close();
}
+ return fileFormat;
}
public MidiFileFormat getMidiFileFormat(File file) throws InvalidMidiDataException, IOException {
- try (FileInputStream fis = new FileInputStream(file); // throws IOException
- BufferedInputStream bis = new BufferedInputStream(fis, bisBufferSize))
- {
- // $$fb 2002-04-17: part of fix for 4635286: MidiSystem.getMidiFileFormat() returns format having invalid length
- long length = file.length();
- if (length > Integer.MAX_VALUE) {
- length = MidiFileFormat.UNKNOWN_LENGTH;
- }
- MidiFileFormat fileFormat = getMidiFileFormatFromStream(bis, (int) length, null);
- return fileFormat;
+ FileInputStream fis = new FileInputStream(file); // throws IOException
+ BufferedInputStream bis = new BufferedInputStream(fis, bisBufferSize);
+
+ // $$fb 2002-04-17: part of fix for 4635286: MidiSystem.getMidiFileFormat() returns format having invalid length
+ long length = file.length();
+ if (length > Integer.MAX_VALUE) {
+ length = MidiFileFormat.UNKNOWN_LENGTH;
}
+ MidiFileFormat fileFormat = null;
+ try {
+ fileFormat = getMidiFileFormatFromStream(bis, (int) length, null);
+ } finally {
+ bis.close();
+ }
+ return fileFormat;
}
@@ -197,22 +204,28 @@ public final class StandardMidiFileReader extends MidiFileReader {
public Sequence getSequence(URL url) throws InvalidMidiDataException, IOException {
- try (InputStream is = url.openStream(); // throws IOException
- BufferedInputStream bis = new BufferedInputStream(is, bisBufferSize))
- {
- Sequence seq = getSequence(bis);
- return seq;
+ InputStream is = url.openStream(); // throws IOException
+ is = new BufferedInputStream(is, bisBufferSize);
+ Sequence seq = null;
+ try {
+ seq = getSequence(is);
+ } finally {
+ is.close();
}
+ return seq;
}
public Sequence getSequence(File file) throws InvalidMidiDataException, IOException {
- try (InputStream is = new FileInputStream(file); // throws IOException
- BufferedInputStream bis = new BufferedInputStream(is, bisBufferSize))
- {
- Sequence seq = getSequence(bis);
- return seq;
+ InputStream is = new FileInputStream(file); // throws IOException
+ is = new BufferedInputStream(is, bisBufferSize);
+ Sequence seq = null;
+ try {
+ seq = getSequence(is);
+ } finally {
+ is.close();
}
+ return seq;
}
}
diff --git a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
index d8abeccaee..97e0dc2928 100644
--- a/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
+++ b/jdk/src/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
@@ -149,10 +149,10 @@ public final class StandardMidiFileWriter extends MidiFileWriter {
}
public int write(Sequence in, int type, File out) throws IOException {
- try (FileOutputStream fos = new FileOutputStream(out)) { // throws IOException
- int bytesWritten = write(in, type, fos);
- return bytesWritten;
- }
+ FileOutputStream fos = new FileOutputStream(out); // throws IOException
+ int bytesWritten = write( in, type, fos );
+ fos.close();
+ return bytesWritten;
}
//=================================================================================
diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java
index 68a5728a10..b62c83839f 100644
--- a/jdk/src/share/classes/java/awt/Font.java
+++ b/jdk/src/share/classes/java/awt/Font.java
@@ -919,13 +919,18 @@ public class Font implements java.io.Serializable
int totalSize = 0;
try {
- /* don't close the input stream */
- try (final OutputStream outStream = AccessController.doPrivileged(
- (PrivilegedExceptionAction<OutputStream>)
- () -> new FileOutputStream(tFile))) {
- if (tracker != null) {
- tracker.set(tFile, outStream);
- }
+ final OutputStream outStream =
+ AccessController.doPrivileged(
+ new PrivilegedExceptionAction<OutputStream>() {
+ public OutputStream run() throws IOException {
+ return new FileOutputStream(tFile);
+ }
+ }
+ );
+ if (tracker != null) {
+ tracker.set(tFile, outStream);
+ }
+ try {
byte[] buf = new byte[8192];
for (;;) {
int bytesRead = fontStream.read(buf);
@@ -946,6 +951,9 @@ public class Font implements java.io.Serializable
}
outStream.write(buf, 0, bytesRead);
}
+ /* don't close the input stream */
+ } finally {
+ outStream.close();
}
/* After all references to a Font2D are dropped, the file
* will be removed. To support long-lived AppContexts,
diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java
index c37749737c..91c28f4e28 100644
--- a/jdk/src/share/classes/java/awt/Toolkit.java
+++ b/jdk/src/share/classes/java/awt/Toolkit.java
@@ -713,10 +713,12 @@ public abstract class Toolkit {
File propsFile = new File(
System.getProperty("user.home") +
sep + ".accessibility.properties");
- try (FileInputStream in = new FileInputStream(propsFile)) {
- // Inputstream has been buffered in Properties class
- properties.load(in);
- }
+ FileInputStream in =
+ new FileInputStream(propsFile);
+
+ // Inputstream has been buffered in Properties class
+ properties.load(in);
+ in.close();
} catch (Exception e) {
// Per-user accessibility properties file does not exist
}
@@ -729,10 +731,12 @@ public abstract class Toolkit {
File propsFile = new File(
System.getProperty("java.home") + sep + "lib" +
sep + "accessibility.properties");
- try (FileInputStream in = new FileInputStream(propsFile)) {
- // Inputstream has been buffered in Properties class
- properties.load(in);
- }
+ FileInputStream in =
+ new FileInputStream(propsFile);
+
+ // Inputstream has been buffered in Properties class
+ properties.load(in);
+ in.close();
} catch (Exception e) {
// System-wide accessibility properties file does
// not exist;
diff --git a/jdk/src/share/classes/java/beans/Beans.java b/jdk/src/share/classes/java/beans/Beans.java
index f121ae52cb..c781a98597 100644
--- a/jdk/src/share/classes/java/beans/Beans.java
+++ b/jdk/src/share/classes/java/beans/Beans.java
@@ -191,11 +191,13 @@ public class Beans {
serialized = true;
oins.close();
} catch (IOException ex) {
+ ins.close();
// Drop through and try opening the class. But remember
// the exception in case we can't find the class either.
serex = ex;
- } finally {
+ } catch (ClassNotFoundException ex) {
ins.close();
+ throw ex;
}
}
diff --git a/jdk/src/share/classes/java/util/zip/ZipFile.java b/jdk/src/share/classes/java/util/zip/ZipFile.java
index cdd8ce3fcb..9f8aff6eff 100644
--- a/jdk/src/share/classes/java/util/zip/ZipFile.java
+++ b/jdk/src/share/classes/java/util/zip/ZipFile.java
@@ -320,18 +320,16 @@ class ZipFile implements ZipConstants, Closeable {
long jzentry = 0;
synchronized (this) {
ensureOpen();
- jzentry = getEntry(jzfile, zc.getBytes(name));
- if (jzentry == 0 && !name.endsWith("/")) {
+ jzentry = getEntry(jzfile, zc.getBytes(name), true);
+ if (jzentry != 0) {
// If no entry is found for the specified 'name' and
// the 'name' does not end with a forward slash '/',
- // we try to find an entry with a slash '/' appended
- // to the end of the 'name'.
- jzentry = getEntry(jzfile, zc.getBytes(name + "/"));
- }
- if (jzentry != 0) {
- // When we search for the name of an entry with an appended
- // slash '/', the name that is found (with a slash '/' attached)
- // is used (disabled if jdk.util.zip.ensureTrailingSlash=false)
+ // the implementation tries to find the entry with a
+ // slash '/' appended to the end of the 'name', before
+ // returning null. When such entry is found, the name
+ // that actually is found (with a slash '/' attached)
+ // is used
+ // (disabled if jdk.util.zip.ensureTrailingSlash=false)
ZipEntry ze = ensuretrailingslash ? getZipEntry(null, jzentry)
: getZipEntry(name, jzentry);
freeEntry(jzfile, jzentry);
@@ -341,7 +339,8 @@ class ZipFile implements ZipConstants, Closeable {
return null;
}
- private static native long getEntry(long jzfile, byte[] name);
+ private static native long getEntry(long jzfile, byte[] name,
+ boolean addSlash);
// freeEntry releases the C jzentry struct.
private static native void freeEntry(long jzfile, long jzentry);
@@ -373,9 +372,9 @@ class ZipFile implements ZipConstants, Closeable {
synchronized (this) {
ensureOpen();
if (!zc.isUTF8() && (entry.flag & EFS) != 0) {
- jzentry = getEntry(jzfile, zc.getBytesUTF8(entry.name));
+ jzentry = getEntry(jzfile, zc.getBytesUTF8(entry.name), false);
} else {
- jzentry = getEntry(jzfile, zc.getBytes(entry.name));
+ jzentry = getEntry(jzfile, zc.getBytes(entry.name), false);
}
if (jzentry == 0) {
return null;
diff --git a/jdk/src/share/classes/javax/imageio/ImageIO.java b/jdk/src/share/classes/javax/imageio/ImageIO.java
index 9552e0e34c..13d623f2b7 100644
--- a/jdk/src/share/classes/javax/imageio/ImageIO.java
+++ b/jdk/src/share/classes/javax/imageio/ImageIO.java
@@ -39,6 +39,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.NoSuchElementException;
+import java.util.Set;
import javax.imageio.spi.IIORegistry;
import javax.imageio.spi.ImageReaderSpi;
import javax.imageio.spi.ImageReaderWriterSpi;
@@ -1392,7 +1394,7 @@ public final class ImageIO {
throw new IllegalArgumentException("input == null!");
}
- InputStream istream;
+ InputStream istream = null;
try {
istream = input.openStream();
} catch (IOException e) {
diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java b/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java
index cb88746212..0455d218b0 100644
--- a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java
@@ -92,7 +92,7 @@ class KeyImpl implements SecretKey, Destroyable, Serializable {
this.keyBytes = key.getBytes();
this.keyType = key.getEType();
} catch (KrbException e) {
- throw new IllegalArgumentException("key creation error", e);
+ throw new IllegalArgumentException(e.getMessage());
}
}
diff --git a/jdk/src/share/classes/javax/swing/JEditorPane.java b/jdk/src/share/classes/javax/swing/JEditorPane.java
index 27b15f5681..9707523666 100644
--- a/jdk/src/share/classes/javax/swing/JEditorPane.java
+++ b/jdk/src/share/classes/javax/swing/JEditorPane.java
@@ -794,12 +794,16 @@ public class JEditorPane extends JTextComponent {
private void handlePostData(HttpURLConnection conn, Object postData)
throws IOException {
conn.setDoOutput(true);
- conn.setRequestProperty("Content-Type",
- "application/x-www-form-urlencoded");
- try (OutputStream os = conn.getOutputStream();
- DataOutputStream dos = new DataOutputStream(os))
- {
- dos.writeBytes((String)postData);
+ DataOutputStream os = null;
+ try {
+ conn.setRequestProperty("Content-Type",
+ "application/x-www-form-urlencoded");
+ os = new DataOutputStream(conn.getOutputStream());
+ os.writeBytes((String) postData);
+ } finally {
+ if (os != null) {
+ os.close();
+ }
}
}
diff --git a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java
index 4d32ae08f8..aca0f18458 100644
--- a/jdk/src/share/classes/javax/swing/UIManager.java
+++ b/jdk/src/share/classes/javax/swing/UIManager.java
@@ -57,6 +57,7 @@ import sun.awt.SunToolkit;
import sun.awt.OSInfo;
import sun.security.action.GetPropertyAction;
import sun.swing.SwingUtilities2;
+import java.lang.reflect.Method;
import java.util.HashMap;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
@@ -1238,9 +1239,9 @@ public class UIManager implements Serializable
if (file.exists()) {
// InputStream has been buffered in Properties
// class
- try (FileInputStream ins = new FileInputStream(file)) {
- props.load(ins);
- }
+ FileInputStream ins = new FileInputStream(file);
+ props.load(ins);
+ ins.close();
}
}
catch (Exception e) {
diff --git a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
index 07e43d7e56..c49a1edad6 100644
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLEditorKit.java
@@ -391,11 +391,12 @@ public class HTMLEditorKit extends StyledEditorKit implements Accessible {
if (defaultStyles == null) {
defaultStyles = new StyleSheet();
appContext.put(DEFAULT_STYLES_KEY, defaultStyles);
- try (InputStream is = HTMLEditorKit.getResourceAsStream(DEFAULT_CSS);
- InputStreamReader isr = new InputStreamReader(is, "ISO-8859-1");
- Reader r = new BufferedReader(isr))
- {
+ try {
+ InputStream is = HTMLEditorKit.getResourceAsStream(DEFAULT_CSS);
+ Reader r = new BufferedReader(
+ new InputStreamReader(is, "ISO-8859-1"));
defaultStyles.loadRules(r, null);
+ r.close();
} catch (Throwable e) {
// on error we simply have no styles... the html
// will look mighty wrong but still function.
diff --git a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java
index fcb71d4362..59a697587e 100644
--- a/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java
+++ b/jdk/src/share/classes/javax/swing/text/html/StyleSheet.java
@@ -460,12 +460,15 @@ public class StyleSheet extends StyleContext {
* @since 1.3
*/
public void importStyleSheet(URL url) {
- try (InputStream is = url.openStream();
- InputStreamReader isr = new InputStreamReader(is);
- Reader r = new BufferedReader(isr))
- {
+ try {
+ InputStream is;
+
+ is = url.openStream();
+ Reader r = new BufferedReader(new InputStreamReader(is));
CssParser parser = new CssParser();
parser.parse(url, r, false, true);
+ r.close();
+ is.close();
} catch (Throwable e) {
// on error we simply have no styles... the html
// will look mighty wrong but still function.
diff --git a/jdk/src/share/classes/sun/awt/DebugSettings.java b/jdk/src/share/classes/sun/awt/DebugSettings.java
index 89ffeade5e..aaab07eeb9 100644
--- a/jdk/src/share/classes/sun/awt/DebugSettings.java
+++ b/jdk/src/share/classes/sun/awt/DebugSettings.java
@@ -178,9 +178,9 @@ final class DebugSettings {
File propFile = new File(propPath);
try {
println("Reading debug settings from '" + propFile.getCanonicalPath() + "'...");
- try (FileInputStream fin = new FileInputStream(propFile)) {
- props.load(fin);
- }
+ FileInputStream fin = new FileInputStream(propFile);
+ props.load(fin);
+ fin.close();
} catch ( FileNotFoundException fne ) {
println("Did not find settings file.");
} catch ( IOException ioe ) {
diff --git a/jdk/src/share/classes/sun/awt/FontConfiguration.java b/jdk/src/share/classes/sun/awt/FontConfiguration.java
index 66dc8f67f0..93e38e06e2 100644
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java
@@ -48,6 +48,7 @@ import java.util.Set;
import java.util.Vector;
import sun.font.CompositeFontDescriptor;
import sun.font.SunFontManager;
+import sun.font.FontManagerFactory;
import sun.font.FontUtilities;
import sun.util.logging.PlatformLogger;
@@ -198,12 +199,14 @@ public abstract class FontConfiguration {
getInstalledFallbackFonts(javaLib);
if (f != null) {
- try (FileInputStream in = new FileInputStream(f.getPath())) {
+ try {
+ FileInputStream in = new FileInputStream(f.getPath());
if (isProperties) {
loadProperties(in);
} else {
loadBinary(in);
}
+ in.close();
if (FontUtilities.debugFonts()) {
logger.config("Read logical font configuration from " + f);
}
diff --git a/jdk/src/share/classes/sun/awt/geom/AreaOp.java b/jdk/src/share/classes/sun/awt/geom/AreaOp.java
index 966ee33a79..dd9e957cc2 100644
--- a/jdk/src/share/classes/sun/awt/geom/AreaOp.java
+++ b/jdk/src/share/classes/sun/awt/geom/AreaOp.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -146,8 +146,6 @@ public abstract class AreaOp {
public static final int RSTAG_INSIDE = 1;
public static final int RSTAG_OUTSIDE = -1;
- public static final int MAX_LINK_COUNT = 1024;
-
public abstract void newRow();
public abstract int classify(Edge e);
@@ -197,25 +195,6 @@ public abstract class AreaOp {
}
};
- private void consumeSubCurves(Vector<CurveLink> subcurves,
- Vector<ChainEnd> chains,
- Vector<Curve> curve) {
- finalizeSubCurves(subcurves, chains);
- Enumeration<CurveLink> enum_ = subcurves.elements();
- while (enum_.hasMoreElements()) {
- CurveLink link = enum_.nextElement();
- curve.add(link.getMoveto());
- CurveLink nextlink = link;
- while ((nextlink = nextlink.getNext()) != null) {
- if (!link.absorb(nextlink)) {
- curve.add(link.getSubCurve());
- link = nextlink;
- }
- }
- curve.add(link.getSubCurve());
- }
- }
-
private Vector pruneEdges(Vector edges) {
int numedges = edges.size();
if (numedges < 2) {
@@ -238,8 +217,6 @@ public abstract class AreaOp {
Vector subcurves = new Vector();
Vector chains = new Vector();
Vector links = new Vector();
- Vector<Curve> ret = new Vector<>();
- int linkCount = 0;
// Active edges are between left (inclusive) and right (exclusive)
while (left < numedges) {
double y = yrange[0];
@@ -412,22 +389,27 @@ public abstract class AreaOp {
System.out.println(" "+link.getSubCurve());
}
}
- // If we have complex area calculation, we should consume the
- // intermediate subcurves to optimize memory footprint
- if (linkCount >= MAX_LINK_COUNT) {
- consumeSubCurves(subcurves, chains, ret);
- linkCount = 0;
- chains.clear();
- subcurves.clear();
- }
- linkCount += links.size();
resolveLinks(subcurves, chains, links);
links.clear();
// Finally capture the bottom of the valid Y range as the top
// of the next Y range.
yrange[0] = yend;
}
- consumeSubCurves(subcurves, chains, ret);
+ finalizeSubCurves(subcurves, chains);
+ Vector ret = new Vector();
+ Enumeration enum_ = subcurves.elements();
+ while (enum_.hasMoreElements()) {
+ CurveLink link = (CurveLink) enum_.nextElement();
+ ret.add(link.getMoveto());
+ CurveLink nextlink = link;
+ while ((nextlink = nextlink.getNext()) != null) {
+ if (!link.absorb(nextlink)) {
+ ret.add(link.getSubCurve());
+ link = nextlink;
+ }
+ }
+ ret.add(link.getSubCurve());
+ }
return ret;
}
diff --git a/jdk/src/share/classes/sun/awt/geom/Curve.java b/jdk/src/share/classes/sun/awt/geom/Curve.java
index 7f8fc1b68c..871be17f4c 100644
--- a/jdk/src/share/classes/sun/awt/geom/Curve.java
+++ b/jdk/src/share/classes/sun/awt/geom/Curve.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -926,9 +926,6 @@ public abstract class Curve {
double bump = ymin;
double maxbump = Math.min(ymin * 1E13, (y1 - y0) * .1);
double y = y0 + bump;
- if (!Double.isFinite(y1)) {
- return 0;
- }
while (y <= y1) {
if (fairlyClose(this.XforY(y), that.XforY(y))) {
if ((bump *= 2) > maxbump) {
@@ -1202,7 +1199,7 @@ public abstract class Curve {
public boolean fairlyClose(double v1, double v2) {
return (Math.abs(v1 - v2) <
- Math.max(Math.abs(v1), Math.abs(v2)) * 1E-8);
+ Math.max(Math.abs(v1), Math.abs(v2)) * 1E-10);
}
public abstract int getSegment(double coords[]);
diff --git a/jdk/src/share/classes/sun/awt/image/XbmImageDecoder.java b/jdk/src/share/classes/sun/awt/image/XbmImageDecoder.java
index edb86f1e0b..96546662d8 100644
--- a/jdk/src/share/classes/sun/awt/image/XbmImageDecoder.java
+++ b/jdk/src/share/classes/sun/awt/image/XbmImageDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,22 +23,13 @@
* questions.
*/
-/*
+/*-
* Reads xbitmap format images into a DIBitmap structure.
*/
package sun.awt.image;
-import java.awt.image.ImageConsumer;
-import java.awt.image.IndexColorModel;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static java.lang.Math.multiplyExact;
+import java.io.*;
+import java.awt.image.*;
/**
* Parse files of the form:
@@ -59,8 +50,6 @@ public class XbmImageDecoder extends ImageDecoder {
ImageConsumer.COMPLETESCANLINES |
ImageConsumer.SINGLEPASS |
ImageConsumer.SINGLEFRAME);
- private static final int MAX_XBM_SIZE = 16384;
- private static final int HEADER_SCAN_LIMIT = 100;
public XbmImageDecoder(InputStreamImageSource src, InputStream is) {
super(src, is);
@@ -83,155 +72,107 @@ public class XbmImageDecoder extends ImageDecoder {
* produce an image from the stream.
*/
public void produceImage() throws IOException, ImageFormatException {
+ char nm[] = new char[80];
+ int c;
+ int i = 0;
+ int state = 0;
int H = 0;
int W = 0;
int x = 0;
int y = 0;
- int n = 0;
- int state = 0;
+ boolean start = true;
byte raster[] = null;
IndexColorModel model = null;
-
- String matchRegex = "\\s*(0[xX])?((?:(?!,|\\};).)+)(,|\\};)";
- String replaceRegex = "0[xX]|,|\\s+|\\};";
-
- String line;
- int lineNum = 0;
-
- try (BufferedReader br = new BufferedReader(new InputStreamReader(input))) {
- // loop to process XBM header - width, height and create raster
- while (!aborted && (line = br.readLine()) != null
- && lineNum <= HEADER_SCAN_LIMIT) {
- lineNum++;
- // process #define stmts
- if (line.trim().startsWith("#define")) {
- String[] token = line.split("\\s+");
- if (token.length != 3) {
- error("Error while parsing define statement");
- }
- try {
- if (!token[2].trim().isEmpty() && state == 0) {
- if (token[1].endsWith("th")) {
- W = Integer.parseInt(token[2]);
- } else if (token[1].endsWith("t")) {
- H = Integer.parseInt(token[2]);
- }
- state = 1; // after first dimension is set
- } else if (!token[2].trim().isEmpty() && state == 1) {
- if (token[1].endsWith("th")) {
- W = Integer.parseInt(token[2]);
- } else if (token[1].endsWith("t")) {
- H = Integer.parseInt(token[2]);
- }
- state = 2; // after second dimension is set
- }
- } catch (NumberFormatException nfe) {
- // parseInt() can throw NFE
- error("Error while parsing width or height.");
+ while (!aborted && (c = input.read()) != -1) {
+ if ('a' <= c && c <= 'z' ||
+ 'A' <= c && c <= 'Z' ||
+ '0' <= c && c <= '9' || c == '#' || c == '_') {
+ if (i < 78)
+ nm[i++] = (char) c;
+ } else if (i > 0) {
+ int nc = i;
+ i = 0;
+ if (start) {
+ if (nc != 7 ||
+ nm[0] != '#' ||
+ nm[1] != 'd' ||
+ nm[2] != 'e' ||
+ nm[3] != 'f' ||
+ nm[4] != 'i' ||
+ nm[5] != 'n' ||
+ nm[6] != 'e')
+ {
+ error("Not an XBM file");
}
+ start = false;
}
-
- if (state == 2) {
- if (W <= 0 || H <= 0) {
- error("Invalid values for width or height.");
+ if (nm[nc - 1] == 'h')
+ state = 1; /* expecting width */
+ else if (nm[nc - 1] == 't' && nc > 1 && nm[nc - 2] == 'h')
+ state = 2; /* expecting height */
+ else if (nc > 2 && state < 0 && nm[0] == '0' && nm[1] == 'x') {
+ int n = 0;
+ for (int p = 2; p < nc; p++) {
+ c = nm[p];
+ if ('0' <= c && c <= '9')
+ c = c - '0';
+ else if ('A' <= c && c <= 'Z')
+ c = c - 'A' + 10;
+ else if ('a' <= c && c <= 'z')
+ c = c - 'a' + 10;
+ else
+ c = 0;
+ n = n * 16 + c;
}
- if (multiplyExact(W, H) > MAX_XBM_SIZE) {
- error("Large XBM file size."
- + " Maximum allowed size: " + MAX_XBM_SIZE);
+ for (int mask = 1; mask <= 0x80; mask <<= 1) {
+ if (x < W) {
+ if ((n & mask) != 0)
+ raster[x] = 1;
+ else
+ raster[x] = 0;
+ }
+ x++;
}
- model = new IndexColorModel(8, 2, XbmColormap,
- 0, false, 0);
- setDimensions(W, H);
- setColorModel(model);
- setHints(XbmHints);
- headerComplete();
- raster = new byte[W];
- state = 3;
- break;
- }
- }
-
- if (state != 3) {
- error("Width or Height of XBM file not defined");
- }
-
- boolean contFlag = false;
- StringBuilder sb = new StringBuilder();
-
- // loop to process image data
- while (!aborted && (line = br.readLine()) != null) {
- lineNum++;
-
- if (!contFlag) {
- if (line.contains("[]")) {
- contFlag = true;
- } else {
- continue;
+ if (x >= W) {
+ if (setPixels(0, y, W, 1, model, raster, 0, W) <= 0) {
+ return;
+ }
+ x = 0;
+ if (y++ >= H) {
+ break;
+ }
}
- }
-
- int end = line.indexOf(';');
- if (end >= 0) {
- sb.append(line, 0, end + 1);
- break;
} else {
- sb.append(line).append(System.lineSeparator());
- }
- }
-
- String resultLine = sb.toString();
- int cutOffIndex = resultLine.indexOf('{');
- resultLine = resultLine.substring(cutOffIndex + 1);
-
- Matcher matcher = Pattern.compile(matchRegex).matcher(resultLine);
- while (matcher.find()) {
- if (y >= H) {
- error("Scan size of XBM file exceeds"
- + " the defined width x height");
- }
-
- int startIndex = matcher.start();
- int endIndex = matcher.end();
- String hexByte = resultLine.substring(startIndex, endIndex);
- hexByte = hexByte.replaceAll("^\\s+", "");
-
- if (!(hexByte.startsWith("0x")
- || hexByte.startsWith("0X"))) {
- error("Invalid hexadecimal number at Ln#:" + lineNum
- + " Col#:" + (startIndex + 1));
- }
- hexByte = hexByte.replaceAll(replaceRegex, "");
- if (hexByte.length() != 2) {
- error("Invalid hexadecimal number at Ln#:" + lineNum
- + " Col#:" + (startIndex + 1));
- }
-
- try {
- n = Integer.parseInt(hexByte, 16);
- } catch (NumberFormatException nfe) {
- error("Error parsing hexadecimal at Ln#:" + lineNum
- + " Col#:" + (startIndex + 1));
- }
- for (int mask = 1; mask <= 0x80; mask <<= 1) {
- if (x < W) {
- if ((n & mask) != 0)
- raster[x] = 1;
+ int n = 0;
+ for (int p = 0; p < nc; p++)
+ if ('0' <= (c = nm[p]) && c <= '9')
+ n = n * 10 + c - '0';
+ else {
+ n = -1;
+ break;
+ }
+ if (n > 0 && state > 0) {
+ if (state == 1)
+ W = n;
else
- raster[x] = 0;
- }
- x++;
- }
-
- if (x >= W) {
- int result = setPixels(0, y, W, 1, model, raster, 0, W);
- if (result <= 0) {
- error("Unexpected error occurred during setPixel()");
+ H = n;
+ if (W == 0 || H == 0)
+ state = 0;
+ else {
+ model = new IndexColorModel(8, 2, XbmColormap,
+ 0, false, 0);
+ setDimensions(W, H);
+ setColorModel(model);
+ setHints(XbmHints);
+ headerComplete();
+ raster = new byte[W];
+ state = -1;
+ }
}
- x = 0;
- y++;
}
}
- imageComplete(ImageConsumer.STATICIMAGEDONE, true);
}
+ input.close();
+ imageComplete(ImageConsumer.STATICIMAGEDONE, true);
}
}
diff --git a/jdk/src/share/classes/sun/print/PSPrinterJob.java b/jdk/src/share/classes/sun/print/PSPrinterJob.java
index ec8343946f..c286400ce5 100644
--- a/jdk/src/share/classes/sun/print/PSPrinterJob.java
+++ b/jdk/src/share/classes/sun/print/PSPrinterJob.java
@@ -397,12 +397,11 @@ public class PSPrinterJob extends RasterPrinterJob {
}
// Load property file
+ InputStream in =
+ new BufferedInputStream(new FileInputStream(f.getPath()));
Properties props = new Properties();
- try (FileInputStream is = new FileInputStream(f.getPath());
- BufferedInputStream bis = new BufferedInputStream(is))
- {
- props.load(bis);
- }
+ props.load(in);
+ in.close();
return props;
} catch (Exception e){
return (Properties)null;
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/AesDkCrypto.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/AesDkCrypto.java
index f04f28ae13..54b9edffe4 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/AesDkCrypto.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/AesDkCrypto.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,8 +43,6 @@ import sun.security.krb5.Confounder;
import sun.security.krb5.internal.crypto.KeyUsage;
import java.util.Arrays;
-import static java.nio.charset.StandardCharsets.UTF_8;
-
/**
* This class provides the implementation of AES Encryption for Kerberos
* as defined RFC 3962.
@@ -106,8 +104,10 @@ public class AesDkCrypto extends DkCrypto {
byte[] saltUtf8 = null;
try {
- saltUtf8 = salt.getBytes(UTF_8);
+ saltUtf8 = salt.getBytes("UTF-8");
return stringToKey(password, saltUtf8, s2kparams);
+ } catch (Exception e) {
+ return null;
} finally {
if (saltUtf8 != null) {
Arrays.fill(saltUtf8, (byte)0);
@@ -118,7 +118,14 @@ public class AesDkCrypto extends DkCrypto {
private byte[] stringToKey(char[] secret, byte[] salt, byte[] params)
throws GeneralSecurityException {
- int iter_count = DkCrypto.iterationCount(params, DEFAULT_ITERATION_COUNT);
+ int iter_count = DEFAULT_ITERATION_COUNT;
+ if (params != null) {
+ if (params.length != 4) {
+ throw new RuntimeException("Invalid parameter to stringToKey");
+ }
+ iter_count = readBigEndian(params, 0, 4);
+ }
+
byte[] tmpKey = randomToKey(PBKDF2(secret, salt, iter_count,
getKeySeedLength()));
byte[] result = dk(tmpKey, KERBEROS_CONSTANT);
@@ -478,4 +485,17 @@ public class AesDkCrypto extends DkCrypto {
return result;
}
+
+ public static final int readBigEndian(byte[] data, int pos, int size) {
+ int retVal = 0;
+ int shifter = (size-1)*8;
+ while (size > 0) {
+ retVal += (data[pos] & 0xff) << shifter;
+ shifter -= 8;
+ pos++;
+ size--;
+ }
+ return retVal;
+ }
+
}
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/ArcFourCrypto.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/ArcFourCrypto.java
index a6fbefc464..cb9912df6c 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/ArcFourCrypto.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/ArcFourCrypto.java
@@ -90,6 +90,8 @@ public class ArcFourCrypto extends DkCrypto {
MessageDigest md = sun.security.provider.MD4.getInstance();
md.update(passwd);
digest = md.digest();
+ } catch (Exception e) {
+ return null;
} finally {
if (passwd != null) {
Arrays.fill(passwd, (byte)0);
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java
index 2c6f4bfe5b..506d8749cb 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/dk/DkCrypto.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2007, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -31,8 +31,9 @@
package sun.security.krb5.internal.crypto.dk;
import javax.crypto.Cipher;
+import javax.crypto.Mac;
import java.security.GeneralSecurityException;
-import java.security.InvalidAlgorithmParameterException;
+import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -695,41 +696,4 @@ public abstract class DkCrypto {
bb.get(answer, 0, len);
return answer;
}
-
- static int iterationCount(byte[] params, int defaultValue)
- throws InvalidAlgorithmParameterException {
- if (params == null) {
- return defaultValue;
- }
- if (params.length != 4) {
- throw new InvalidAlgorithmParameterException("Invalid params");
- }
- if (params[0] != 0 || ((params[1] & 0xff) >= 80)) {
- // IC should be less than 80 * 2^16. This is roughly
- // the same as PKCS12KeyStore's 5_000_000 limit.
- throw new InvalidAlgorithmParameterException(
- "Incoming iteration count is too big");
- }
- int iter_count = readBigEndian(params, 0, 4);
- if (!ALLOW_WEAK_PBKDF2_ITERATION_COUNT && iter_count < defaultValue) {
- throw new InvalidAlgorithmParameterException(
- "Incoming iteration count is too small");
- }
- return iter_count;
- }
-
- public static final int readBigEndian(byte[] data, int pos, int size) {
- int retVal = 0;
- int shifter = (size-1)*8;
- while (size > 0) {
- retVal += (data[pos] & 0xff) << shifter;
- shifter -= 8;
- pos++;
- size--;
- }
- return retVal;
- }
-
- // Only used by test
- public static boolean ALLOW_WEAK_PBKDF2_ITERATION_COUNT = false;
}
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
index 07c96367de..53dd8cc0fb 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -371,33 +371,12 @@ public class KeyTab implements KeyTabConstants {
addEntry(service, service.getSalt(), psswd, kvno, append);
}
- /**
- * Adds a new entry in the key table.
- * @param service the service which will have a new entry in the key table.
- * @param salt specified non default salt, cannot be null
- * @param psswd the password which generates the key.
- * @param kvno the kvno to use, -1 means automatic increasing
- * @param append false if entries with old kvno would be removed.
- * Note: if kvno is not -1, entries with the same kvno are always removed
- */
+ // Called by KDC test
public void addEntry(PrincipalName service, String salt, char[] psswd,
int kvno, boolean append) throws KrbException {
EncryptionKey[] encKeys = EncryptionKey.acquireSecretKeys(
- psswd, salt);
- addEntry(service, encKeys, kvno, append);
- }
-
- /**
- * Adds a new entry in the key table.
- * @param service the service which will have a new entry in the key table.
- * @param encKeys the keys to be added
- * @param kvno the kvno to use, -1 means automatic increasing
- * @param append false if entries with old kvno would be removed.
- * Note: if kvno is not -1, entries with the same kvno are always removed
- */
- public void addEntry(PrincipalName service, EncryptionKey[] encKeys,
- int kvno, boolean append) throws KrbException {
+ psswd, salt);
// There should be only one maximum KVNO value for all etypes, so that
// all added keys can have the same KVNO.
diff --git a/jdk/src/share/classes/sun/security/provider/MD4.java b/jdk/src/share/classes/sun/security/provider/MD4.java
index a808217c0c..454c441421 100644
--- a/jdk/src/share/classes/sun/security/provider/MD4.java
+++ b/jdk/src/share/classes/sun/security/provider/MD4.java
@@ -77,8 +77,13 @@ public final class MD4 extends DigestBase {
});
}
- public static MessageDigest getInstance() throws NoSuchAlgorithmException {
- return MessageDigest.getInstance("MD4", md4Provider);
+ public static MessageDigest getInstance() {
+ try {
+ return MessageDigest.getInstance("MD4", md4Provider);
+ } catch (NoSuchAlgorithmException e) {
+ // should never occur
+ throw new ProviderException(e);
+ }
}
// Standard constructor, creates a new MD4 instance.
diff --git a/jdk/src/share/classes/sun/security/provider/X509Factory.java b/jdk/src/share/classes/sun/security/provider/X509Factory.java
index e0deae26cc..5fa9416e60 100644
--- a/jdk/src/share/classes/sun/security/provider/X509Factory.java
+++ b/jdk/src/share/classes/sun/security/provider/X509Factory.java
@@ -65,7 +65,6 @@ public class X509Factory extends CertificateFactorySpi {
public static final String END_CERT = "-----END CERTIFICATE-----";
private static final int ENC_MAX_LENGTH = 4096 * 1024; // 4 MB MAX
- public static final int BER_ITERATION_COUNT = 128; // Limit nested depth
private static final Cache<Object, X509CertImpl> certCache
= Cache.newSoftMemoryCache(750);
@@ -550,7 +549,7 @@ public class X509Factory extends CertificateFactorySpi {
if (c == DerValue.tag_Sequence) {
ByteArrayOutputStream bout = new ByteArrayOutputStream(2048);
bout.write(c);
- readBERInternal(is, bout, c, BER_ITERATION_COUNT);
+ readBERInternal(is, bout, c);
return bout.toByteArray();
} else {
// Read BASE64 encoded data, might skip info at the beginning
@@ -665,16 +664,12 @@ public class X509Factory extends CertificateFactorySpi {
* @param is Read from this InputStream
* @param bout Write into this OutputStream
* @param tag Tag already read (-1 mean not read)
- * @param depth nesting depth limit
* @returns The current tag, used to check EOC in indefinite-length BER
* @throws IOException Any parsing error
*/
private static int readBERInternal(InputStream is,
- ByteArrayOutputStream bout, int tag, int depth) throws IOException {
+ ByteArrayOutputStream bout, int tag) throws IOException {
- if (depth-- == 0) {
- throw new IOException("Nesting sequence depth limit reached.");
- }
if (tag == -1) { // Not read before the call, read now
tag = is.read();
if (tag == -1) {
@@ -700,7 +695,7 @@ public class X509Factory extends CertificateFactorySpi {
"Non constructed encoding must have definite length");
}
while (true) {
- int subTag = readBERInternal(is, bout, -1, depth);
+ int subTag = readBERInternal(is, bout, -1);
if (subTag == 0) { // EOC, end of indefinite-length section
break;
}
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
index 45ac154390..1cc867f574 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,9 @@ import sun.security.x509.*;
/**
* Class to obtain CRLs via the CRLDistributionPoints extension.
- * <p>
+ * Note that the functionality of this class must be explicitly enabled
+ * via a system property, see the USE_CRLDP variable below.
+ *
* This class uses the URICertStore class to fetch CRLs. The URICertStore
* class also implements CRL caching: see the class description for more
* information.
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
index a70e800e46..7abb65f921 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/RevocationChecker.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@ import java.security.cert.CertPathValidatorException.BasicReason;
import java.security.cert.Extension;
import java.security.cert.*;
import java.util.*;
-import java.util.stream.Collectors;
import javax.security.auth.x500.X500Principal;
import static sun.security.provider.certpath.OCSP.*;
@@ -987,19 +986,13 @@ class RevocationChecker extends PKIXRevocationChecker {
// any way to convey them back to the application.
// That's the default, so no need to write code.
builderParams.setDate(params.date());
+ builderParams.setCertPathCheckers(params.certPathCheckers());
builderParams.setSigProvider(params.sigProvider());
// Skip revocation during this build to detect circular
// references. But check revocation afterwards, using the
// key (or any other that works).
builderParams.setRevocationEnabled(false);
- // Remove itself from params to avoid circular reference.
- builderParams.setCertPathCheckers(params.certPathCheckers()
- .stream()
- .filter(checker -> checker != this)
- .collect(Collectors.collectingAndThen(
- Collectors.toList(),
- Collections::unmodifiableList)));
// check for AuthorityInformationAccess extension
if (Builder.USE_AIA == true) {
diff --git a/jdk/src/share/classes/sun/security/validator/CADistrustPolicy.java b/jdk/src/share/classes/sun/security/validator/CADistrustPolicy.java
index 8a9e502f28..34c3f88088 100644
--- a/jdk/src/share/classes/sun/security/validator/CADistrustPolicy.java
+++ b/jdk/src/share/classes/sun/security/validator/CADistrustPolicy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -85,22 +85,6 @@ enum CADistrustPolicy {
}
CamerfirmaTLSPolicy.checkDistrust(chain);
}
- },
-
- /**
- * Distrust TLS Server certificates anchored by the Chunghwa ePKI root CA
- * and issued after March 17, 2026. If enabled, this policy is currently
- * enforced by the PKIX and SunX509 TrustManager implementations
- * of the SunJSSE provider implementation.
- */
- CHUNGHWA_TLS {
- void checkDistrust(String variant, X509Certificate[] chain)
- throws ValidatorException {
- if (!variant.equals(Validator.VAR_TLS_SERVER)) {
- return;
- }
- ChunghwaTLSPolicy.checkDistrust(chain);
- }
};
/**
diff --git a/jdk/src/share/classes/sun/security/validator/ChunghwaTLSPolicy.java b/jdk/src/share/classes/sun/security/validator/ChunghwaTLSPolicy.java
deleted file mode 100644
index 01fbd82c7b..0000000000
--- a/jdk/src/share/classes/sun/security/validator/ChunghwaTLSPolicy.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.security.validator;
-
-import java.security.cert.X509Certificate;
-import java.time.LocalDate;
-import java.time.Month;
-import java.time.ZoneOffset;
-import java.util.Date;
-import java.util.Map;
-import java.util.Set;
-
-import sun.security.util.Debug;
-import sun.security.x509.X509CertImpl;
-
-/**
- * This class checks if Chunghwa issued TLS Server certificates should be
- * restricted.
- */
-final class ChunghwaTLSPolicy {
-
- private static final Debug debug = Debug.getInstance("certpath");
-
- // SHA-256 certificate fingerprint of distrusted root for TLS
- // cacerts alias: chunghwaepkirootca
- // DN: OU=ePKI Root Certification Authority,
- // O="Chunghwa Telecom Co., Ltd.", C=TW
- private static final String FINGERPRINT =
- "C0A6F4DC63A24BFDCF54EF2A6A082A0A72DE35803E2FF5FF527AE5D87206DFD5";
-
- // Any TLS Server certificate that is anchored by the Chunghwa
- // root above and is issued after this date will be distrusted.
- private static final LocalDate MARCH_17_2026 =
- LocalDate.of(2026, Month.MARCH, 17);
-
- /**
- * This method assumes the eeCert is a TLS Server Cert and chains back to
- * the anchor.
- *
- * @param chain the end-entity's certificate chain. The end entity cert
- * is at index 0, the trust anchor at index n-1.
- * @throws ValidatorException if the certificate is distrusted
- */
- static void checkDistrust(X509Certificate[] chain)
- throws ValidatorException {
- X509Certificate anchor = chain[chain.length-1];
- String fp = fingerprint(anchor);
- if (fp == null) {
- throw new ValidatorException("Cannot generate fingerprint for "
- + "trust anchor of TLS server certificate");
- }
- if (FINGERPRINT.equalsIgnoreCase(fp)) {
- Date notBefore = chain[0].getNotBefore();
- LocalDate ldNotBefore = notBefore.toInstant()
- .atZone(ZoneOffset.UTC).toLocalDate();
- // reject if certificate is issued after March 17, 2026
- checkNotBefore(ldNotBefore, MARCH_17_2026, anchor);
- }
- }
-
- private static String fingerprint(X509Certificate cert) {
- return X509CertImpl.getFingerprint("SHA-256", cert);
- }
-
- // Check whether the certificate's notBeforeDate is after the
- // distrust date for the anchor (root CA). Throw ValidatorException
- // if it is after the distrust date.
- private static void checkNotBefore(LocalDate notBeforeDate,
- LocalDate distrustDate, X509Certificate anchor)
- throws ValidatorException {
- if (notBeforeDate.isAfter(distrustDate)) {
- throw new ValidatorException
- ("TLS Server certificate issued after " + distrustDate +
- " and anchored by a distrusted legacy Chunghwa root CA: "
- + anchor.getSubjectX500Principal(),
- ValidatorException.T_UNTRUSTED_CERT, anchor);
- }
- }
-
- private ChunghwaTLSPolicy() {}
-}
diff --git a/jdk/src/share/lib/security/java.security-aix b/jdk/src/share/lib/security/java.security-aix
index 2736882f3d..2c1415a804 100644
--- a/jdk/src/share/lib/security/java.security-aix
+++ b/jdk/src/share/lib/security/java.security-aix
@@ -1218,9 +1218,6 @@ jdk.sasl.disabledMechanisms=
# CAMERFIRMA_TLS : Distrust TLS Server certificates anchored by
# a Camerfirma root CA and issued after April 15, 2025.
#
-# CHUNGHWA_TLS : Distrust TLS Server certificates anchored by
-# a Chunghwa root CA and issued after March 17, 2026.
-#
# Leading and trailing whitespace surrounding each value are ignored.
# Unknown values are ignored. If the property is commented out or set to the
# empty String, no policies are enforced.
@@ -1232,8 +1229,7 @@ jdk.sasl.disabledMechanisms=
# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even
# if this property is not enabled.
#
-jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS,\
- CHUNGHWA_TLS
+jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS
#
# Policies for the proxy_impersonator Kerberos ccache configuration entry
diff --git a/jdk/src/share/lib/security/java.security-linux b/jdk/src/share/lib/security/java.security-linux
index 816302e2db..623bbe25c4 100644
--- a/jdk/src/share/lib/security/java.security-linux
+++ b/jdk/src/share/lib/security/java.security-linux
@@ -1224,9 +1224,6 @@ jdk.sasl.disabledMechanisms=
# CAMERFIRMA_TLS : Distrust TLS Server certificates anchored by
# a Camerfirma root CA and issued after April 15, 2025.
#
-# CHUNGHWA_TLS : Distrust TLS Server certificates anchored by
-# a Chunghwa root CA and issued after March 17, 2026.
-#
# Leading and trailing whitespace surrounding each value are ignored.
# Unknown values are ignored. If the property is commented out or set to the
# empty String, no policies are enforced.
@@ -1238,8 +1235,7 @@ jdk.sasl.disabledMechanisms=
# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even
# if this property is not enabled.
#
-jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS,\
- CHUNGHWA_TLS
+jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS
#
# Policies for the proxy_impersonator Kerberos ccache configuration entry
diff --git a/jdk/src/share/lib/security/java.security-macosx b/jdk/src/share/lib/security/java.security-macosx
index 18a01e4faf..078b24cdbf 100644
--- a/jdk/src/share/lib/security/java.security-macosx
+++ b/jdk/src/share/lib/security/java.security-macosx
@@ -1222,9 +1222,6 @@ jdk.sasl.disabledMechanisms=
# CAMERFIRMA_TLS : Distrust TLS Server certificates anchored by
# a Camerfirma root CA and issued after April 15, 2025.
#
-# CHUNGHWA_TLS : Distrust TLS Server certificates anchored by
-# a Chunghwa root CA and issued after March 17, 2026.
-#
# Leading and trailing whitespace surrounding each value are ignored.
# Unknown values are ignored. If the property is commented out or set to the
# empty String, no policies are enforced.
@@ -1236,8 +1233,7 @@ jdk.sasl.disabledMechanisms=
# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even
# if this property is not enabled.
#
-jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS,\
- CHUNGHWA_TLS
+jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS
#
# Policies for the proxy_impersonator Kerberos ccache configuration entry
diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris
index 9ca53122ce..a21fda52f3 100644
--- a/jdk/src/share/lib/security/java.security-solaris
+++ b/jdk/src/share/lib/security/java.security-solaris
@@ -1220,9 +1220,6 @@ jdk.sasl.disabledMechanisms=
# CAMERFIRMA_TLS : Distrust TLS Server certificates anchored by
# a Camerfirma root CA and issued after April 15, 2025.
#
-# CHUNGHWA_TLS : Distrust TLS Server certificates anchored by
-# a Chunghwa root CA and issued after March 17, 2026.
-#
# Leading and trailing whitespace surrounding each value are ignored.
# Unknown values are ignored. If the property is commented out or set to the
# empty String, no policies are enforced.
@@ -1234,8 +1231,7 @@ jdk.sasl.disabledMechanisms=
# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even
# if this property is not enabled.
#
-jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS,\
- CHUNGHWA_TLS
+jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS
#
# Policies for the proxy_impersonator Kerberos ccache configuration entry
diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows
index fdc05f3091..17922e66e6 100644
--- a/jdk/src/share/lib/security/java.security-windows
+++ b/jdk/src/share/lib/security/java.security-windows
@@ -1222,9 +1222,6 @@ jdk.sasl.disabledMechanisms=
# CAMERFIRMA_TLS : Distrust TLS Server certificates anchored by
# a Camerfirma root CA and issued after April 15, 2025.
#
-# CHUNGHWA_TLS : Distrust TLS Server certificates anchored by
-# a Chunghwa root CA and issued after March 17, 2026.
-#
# Leading and trailing whitespace surrounding each value are ignored.
# Unknown values are ignored. If the property is commented out or set to the
# empty String, no policies are enforced.
@@ -1236,8 +1233,7 @@ jdk.sasl.disabledMechanisms=
# jdk.certpath.disabledAlgorithms; those restrictions are still enforced even
# if this property is not enabled.
#
-jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS,\
- CHUNGHWA_TLS
+jdk.security.caDistrustPolicies=SYMANTEC_TLS,ENTRUST_TLS,CAMERFIRMA_TLS
#
# Policies for the proxy_impersonator Kerberos ccache configuration entry
diff --git a/jdk/src/share/native/java/util/zip/ZipFile.c b/jdk/src/share/native/java/util/zip/ZipFile.c
index 865ecb8f79..8e3698290d 100644
--- a/jdk/src/share/native/java/util/zip/ZipFile.c
+++ b/jdk/src/share/native/java/util/zip/ZipFile.c
@@ -163,7 +163,7 @@ Java_java_util_zip_ZipFile_close(JNIEnv *env, jclass cls, jlong zfile)
JNIEXPORT jlong JNICALL
Java_java_util_zip_ZipFile_getEntry(JNIEnv *env, jclass cls, jlong zfile,
- jbyteArray name)
+ jbyteArray name, jboolean addSlash)
{
#define MAXNAME 1024
jzfile *zip = jlong_to_ptr(zfile);
@@ -182,7 +182,7 @@ Java_java_util_zip_ZipFile_getEntry(JNIEnv *env, jclass cls, jlong zfile,
}
(*env)->GetByteArrayRegion(env, name, 0, ulen, (jbyte *)path);
path[ulen] = '\0';
- ze = ZIP_GetEntry(zip, path);
+ ze = ZIP_GetEntry2(zip, path, (jint)ulen, addSlash);
if (path != buf) {
free(path);
}
diff --git a/jdk/src/share/native/java/util/zip/zip_util.c b/jdk/src/share/native/java/util/zip/zip_util.c
index a5f164f750..5fd6fea049 100644
--- a/jdk/src/share/native/java/util/zip/zip_util.c
+++ b/jdk/src/share/native/java/util/zip/zip_util.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -566,7 +566,7 @@ static jlong
readCEN(jzfile *zip, jint knownTotal)
{
/* Following are unsigned 32-bit */
- jlong endpos, end64pos, cenpos, cenlen, cenoff, total64;
+ jlong endpos, end64pos, cenpos, cenlen, cenoff;
/* Following are unsigned 16-bit */
jint total, tablelen, i, j;
unsigned char *cenbuf = NULL;
@@ -600,16 +600,7 @@ readCEN(jzfile *zip, jint knownTotal)
if ((end64pos = findEND64(zip, end64buf, endpos)) != -1) {
cenlen = ZIP64_ENDSIZ(end64buf);
cenoff = ZIP64_ENDOFF(end64buf);
- total64 = ZIP64_ENDTOT(end64buf);
- /* ZIP64 size, offset and total-count fields are unsigned 64-bit
- * values. Sizes and offsets that do not fit in signed jlong
- * (i.e., >= 2^63), or total values that do not fit in jint, are
- * not supported and indicate a corrupt or invalid zip file.
- */
- if (cenlen < 0 || cenoff < 0 || total64 < 0 || total64 > INT_MAX) {
- ZIP_FORMAT_ERROR("Zip64 END values exceed supported size");
- }
- total = (jint)total64;
+ total = (jint)ZIP64_ENDTOT(end64buf);
endpos = end64pos;
endhdrlen = ZIP64_ENDHDR;
}
@@ -1148,8 +1139,20 @@ ZIP_FreeEntry(jzfile *jz, jzentry *ze)
}
}
-static jboolean
-equals(const char* name1, int len1, const char* name2, int len2) {
+/*
+ * Returns the zip entry corresponding to the specified name, or
+ * NULL if not found.
+ */
+jzentry *
+ZIP_GetEntry(jzfile *zip, char *name, jint ulen)
+{
+ if (ulen == 0) {
+ return ZIP_GetEntry2(zip, name, strlen(name), JNI_FALSE);
+ }
+ return ZIP_GetEntry2(zip, name, ulen, JNI_TRUE);
+}
+
+jboolean equals(char* name1, int len1, char* name2, int len2) {
if (len1 != len2) {
return JNI_FALSE;
}
@@ -1161,12 +1164,16 @@ equals(const char* name1, int len1, const char* name2, int len2) {
return JNI_TRUE;
}
+/*
+ * Returns the zip entry corresponding to the specified name, or
+ * NULL if not found.
+ * This method supports embedded null character in "name", use ulen
+ * for the length of "name".
+ */
jzentry *
-ZIP_GetEntry(jzfile *zip, const char *name)
+ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash)
{
- // length of the entry name being searched for
- const jint name_len = (jint) strlen(name);
- const unsigned int hsh = hashN(name, name_len);
+ unsigned int hsh = hashN(name, ulen);
jint idx;
jzentry *ze = 0;
@@ -1177,47 +1184,79 @@ ZIP_GetEntry(jzfile *zip, const char *name)
idx = zip->table[hsh % zip->tablelen];
- /* Check the cached entry first */
- ze = zip->cache;
- if (ze && equals(ze->name, ze->nlen, name, name_len)) {
- /* Cache hit! Remove and return the cached entry. */
- zip->cache = 0;
- ZIP_Unlock(zip);
- return ze;
- }
- ze = 0;
-
/*
- * Search down the target hash chain for a cell whose
- * 32 bit hash matches the hashed name.
+ * This while loop is an optimization where a double lookup
+ * for name and name+/ is being performed. The name char
+ * array has enough room at the end to try again with a
+ * slash appended if the first table lookup does not succeed.
*/
- while (idx != ZIP_ENDCHAIN) {
- jzcell *zc = &zip->entries[idx];
-
- if (zc->hash == hsh) {
- /*
- * OK, we've found a ZIP entry whose 32 bit hashcode
- * matches the name we're looking for. Try to read
- * its entry information from the CEN. If the CEN
- * name matches the name we're looking for, we're
- * done.
- * If the names don't match (which should be very rare)
- * we keep searching.
- */
- ze = newEntry(zip, zc, ACCESS_RANDOM);
- if (ze && equals(ze->name, ze->nlen, name, name_len)) {
- break;
- }
- if (ze != 0) {
- /* We need to release the lock across the free call */
- ZIP_Unlock(zip);
- ZIP_FreeEntry(zip, ze);
- ZIP_Lock(zip);
+ while(1) {
+
+ /* Check the cached entry first */
+ ze = zip->cache;
+ if (ze && equals(ze->name, ze->nlen, name, ulen)) {
+ /* Cache hit! Remove and return the cached entry. */
+ zip->cache = 0;
+ ZIP_Unlock(zip);
+ return ze;
+ }
+ ze = 0;
+
+ /*
+ * Search down the target hash chain for a cell whose
+ * 32 bit hash matches the hashed name.
+ */
+ while (idx != ZIP_ENDCHAIN) {
+ jzcell *zc = &zip->entries[idx];
+
+ if (zc->hash == hsh) {
+ /*
+ * OK, we've found a ZIP entry whose 32 bit hashcode
+ * matches the name we're looking for. Try to read
+ * its entry information from the CEN. If the CEN
+ * name matches the name we're looking for, we're
+ * done.
+ * If the names don't match (which should be very rare)
+ * we keep searching.
+ */
+ ze = newEntry(zip, zc, ACCESS_RANDOM);
+ if (ze && equals(ze->name, ze->nlen, name, ulen)) {
+ break;
+ }
+ if (ze != 0) {
+ /* We need to release the lock across the free call */
+ ZIP_Unlock(zip);
+ ZIP_FreeEntry(zip, ze);
+ ZIP_Lock(zip);
+ }
+ ze = 0;
}
- ze = 0;
+ idx = zc->next;
+ }
+
+ /* Entry found, return it */
+ if (ze != 0) {
+ break;
}
- idx = zc->next;
+
+ /* If no need to try appending slash, we are done */
+ if (!addSlash) {
+ break;
+ }
+
+ /* Slash is already there? */
+ if (name[ulen-1] == '/') {
+ break;
+ }
+
+ /* Add slash and try once more */
+ name[ulen++] = '/';
+ name[ulen] = '\0';
+ hsh = hash_append(hsh, '/');
+ idx = zip->table[hsh % zip->tablelen];
+ addSlash = JNI_FALSE;
}
+
Finally:
ZIP_Unlock(zip);
return ze;
@@ -1428,9 +1467,9 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
* has the size bigger than 2**32 bytes in ONE invocation.
*/
jzentry * JNICALL
-ZIP_FindEntry(jzfile *zip, const char *name, jint *sizeP, jint *nameLenP)
+ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
{
- jzentry *entry = ZIP_GetEntry(zip, name);
+ jzentry *entry = ZIP_GetEntry(zip, name, 0);
if (entry) {
*sizeP = (jint)entry->size;
*nameLenP = strlen(entry->name);
diff --git a/jdk/src/share/native/java/util/zip/zip_util.h b/jdk/src/share/native/java/util/zip/zip_util.h
index 970cc144e9..2a7ae4b7ee 100644
--- a/jdk/src/share/native/java/util/zip/zip_util.h
+++ b/jdk/src/share/native/java/util/zip/zip_util.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -239,15 +239,8 @@ typedef struct jzfile { /* Zip file */
*/
#define ZIP_ENDCHAIN ((jint)-1)
-/*
- * Returns the ZIP entry corresponding to the given (NULL terminated)
- * entry name. Returns NULL if no entry is found by that name.
- * If the entry is found, then the value of the given sizeP will be
- * updated to the ZIP entry's size and the value of nameLenP will be
- * updated to the ZIP entry name's length.
- */
jzentry * JNICALL
-ZIP_FindEntry(jzfile *zip, const char *name, jint *sizeP, jint *nameLenP);
+ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP);
jboolean JNICALL
ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entrynm);
@@ -273,14 +266,11 @@ ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified,
void JNICALL
ZIP_Close(jzfile *zip);
-/*
- * Returns the ZIP entry corresponding to the given (NULL terminated)
- * entry name. Returns NULL if no entry is found by that name.
- */
-jzentry * ZIP_GetEntry(jzfile *zip, const char *name);
+jzentry * ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
void ZIP_Lock(jzfile *zip);
void ZIP_Unlock(jzfile *zip);
jint ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len);
void ZIP_FreeEntry(jzfile *zip, jzentry *ze);
jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
+jzentry * ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash);
#endif /* !_ZIP_H_ */
diff --git a/jdk/src/share/native/sun/awt/giflib/COPYING b/jdk/src/share/native/sun/awt/giflib/COPYING
index 92774a3b03..b9c0b50126 100644
--- a/jdk/src/share/native/sun/awt/giflib/COPYING
+++ b/jdk/src/share/native/sun/awt/giflib/COPYING
@@ -1,4 +1,4 @@
-= MIT LICENSE
+The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c
index acedde1e01..6ddfb46060 100644
--- a/jdk/src/share/native/sun/awt/giflib/dgif_lib.c
+++ b/jdk/src/share/native/sun/awt/giflib/dgif_lib.c
@@ -30,15 +30,15 @@ The functions here and in egif_lib.c are partitioned carefully so that
if you only require one of read and write capability, only one of these
two modules will be linked. Preserve this property!
+SPDX-License-Identifier: MIT
+
*****************************************************************************/
-// SPDX-License-Identifier: MIT
-// SPDX-FileCopyrightText: Copyright (C) Eric S. Raymond <esr@thyrsus.com>
-#include <fcntl.h>
+#include <stdlib.h>
#include <limits.h>
#include <stdint.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
@@ -55,19 +55,18 @@ two modules will be linked. Preserve this property!
/* avoid extra function call in case we use fread (TVT) */
static int InternalRead(GifFileType *gif, GifByteType *buf, int len) {
- // fprintf(stderr, "### Read: %d\n", len);
- return (((GifFilePrivateType *)gif->Private)->Read
- ? ((GifFilePrivateType *)gif->Private)->Read(gif, buf, len)
- : fread(buf, 1, len,
- ((GifFilePrivateType *)gif->Private)->File));
+ //fprintf(stderr, "### Read: %d\n", len);
+ return
+ (((GifFilePrivateType*)gif->Private)->Read ?
+ ((GifFilePrivateType*)gif->Private)->Read(gif,buf,len) :
+ fread(buf,1,len,((GifFilePrivateType*)gif->Private)->File));
}
static int DGifGetWord(GifFileType *GifFile, GifWord *Word);
static int DGifSetupDecompress(GifFileType *GifFile);
static int DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line,
int LineLen);
-static int DGifGetPrefixChar(const GifPrefixType *Prefix, int Code,
- int ClearCode);
+static int DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode);
static int DGifDecompressInput(GifFileType *GifFile, int *Code);
static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf,
GifByteType *NextByte);
@@ -77,19 +76,20 @@ static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf,
Returns dynamically allocated GifFileType pointer which serves as the GIF
info record.
******************************************************************************/
-GifFileType *DGifOpenFileName(const char *FileName, int *Error) {
- int FileHandle;
- GifFileType *GifFile;
-
- if ((FileHandle = open(FileName, O_RDONLY)) == -1) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_OPEN_FAILED;
- }
- return NULL;
- }
-
- GifFile = DGifOpenFileHandle(FileHandle, Error);
- return GifFile;
+GifFileType *
+DGifOpenFileName(const char *FileName, int *Error)
+{
+ int FileHandle;
+ GifFileType *GifFile;
+
+ if ((FileHandle = open(FileName, O_RDONLY)) == -1) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_OPEN_FAILED;
+ return NULL;
+ }
+
+ GifFile = DGifOpenFileHandle(FileHandle, Error);
+ return GifFile;
}
/******************************************************************************
@@ -97,489 +97,484 @@ GifFileType *DGifOpenFileName(const char *FileName, int *Error) {
Returns dynamically allocated GifFileType pointer which serves as the GIF
info record.
******************************************************************************/
-GifFileType *DGifOpenFileHandle(int FileHandle, int *Error) {
- char Buf[GIF_STAMP_LEN + 1];
- GifFileType *GifFile;
- GifFilePrivateType *Private;
- FILE *f;
-
- GifFile = (GifFileType *)malloc(sizeof(GifFileType));
- if (GifFile == NULL) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- }
- (void)close(FileHandle);
- return NULL;
- }
-
- /*@i1@*/ memset(GifFile, '\0', sizeof(GifFileType));
-
- /* Belt and suspenders, in case the null pointer isn't zero */
- GifFile->SavedImages = NULL;
- GifFile->SColorMap = NULL;
-
- Private = (GifFilePrivateType *)calloc(1, sizeof(GifFilePrivateType));
- if (Private == NULL) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- }
- (void)close(FileHandle);
- free((char *)GifFile);
- return NULL;
- }
-
- /*@i1@*/ memset(Private, '\0', sizeof(GifFilePrivateType));
+GifFileType *
+DGifOpenFileHandle(int FileHandle, int *Error)
+{
+ char Buf[GIF_STAMP_LEN + 1];
+ GifFileType *GifFile;
+ GifFilePrivateType *Private;
+ FILE *f;
+
+ GifFile = (GifFileType *)malloc(sizeof(GifFileType));
+ if (GifFile == NULL) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ (void)close(FileHandle);
+ return NULL;
+ }
+
+ /*@i1@*/memset(GifFile, '\0', sizeof(GifFileType));
+
+ /* Belt and suspenders, in case the null pointer isn't zero */
+ GifFile->SavedImages = NULL;
+ GifFile->SColorMap = NULL;
+
+ Private = (GifFilePrivateType *)calloc(1, sizeof(GifFilePrivateType));
+ if (Private == NULL) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ (void)close(FileHandle);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ /*@i1@*/memset(Private, '\0', sizeof(GifFilePrivateType));
#ifdef _WIN32
- _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
-#endif /* _WIN32 */
-
- f = fdopen(FileHandle, "rb"); /* Make it into a stream: */
-
- /*@-mustfreeonly@*/
- GifFile->Private = (void *)Private;
- Private->FileHandle = FileHandle;
- Private->File = f;
- Private->FileState = FILE_STATE_READ;
- Private->Read = NULL; /* don't use alternate input method (TVT) */
- GifFile->UserData = NULL; /* TVT */
- /*@=mustfreeonly@*/
-
- /* Let's see if this is a GIF file: */
- /* coverity[check_return] */
- if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) !=
- GIF_STAMP_LEN) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_READ_FAILED;
- }
- (void)fclose(f);
- free((char *)Private);
- free((char *)GifFile);
- return NULL;
- }
-
- /* Check for GIF prefix at start of file */
- Buf[GIF_STAMP_LEN] = 0;
- if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_NOT_GIF_FILE;
- }
- (void)fclose(f);
- free((char *)Private);
- free((char *)GifFile);
- return NULL;
- }
-
- if (DGifGetScreenDesc(GifFile) == GIF_ERROR) {
- (void)fclose(f);
- free((char *)Private);
- free((char *)GifFile);
- return NULL;
- }
-
- GifFile->Error = 0;
-
- /* What version of GIF? */
- Private->gif89 = (Buf[GIF_VERSION_POS + 1] == '9');
+ _setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */
+#endif /* _WIN32 */
- return GifFile;
+ f = fdopen(FileHandle, "rb"); /* Make it into a stream: */
+
+ /*@-mustfreeonly@*/
+ GifFile->Private = (void *)Private;
+ Private->FileHandle = FileHandle;
+ Private->File = f;
+ Private->FileState = FILE_STATE_READ;
+ Private->Read = NULL; /* don't use alternate input method (TVT) */
+ GifFile->UserData = NULL; /* TVT */
+ /*@=mustfreeonly@*/
+
+ /* Let's see if this is a GIF file: */
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_READ_FAILED;
+ (void)fclose(f);
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ /* Check for GIF prefix at start of file */
+ Buf[GIF_STAMP_LEN] = 0;
+ if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_GIF_FILE;
+ (void)fclose(f);
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ if (DGifGetScreenDesc(GifFile) == GIF_ERROR) {
+ (void)fclose(f);
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ GifFile->Error = 0;
+
+ /* What version of GIF? */
+ Private->gif89 = (Buf[GIF_VERSION_POS] == '9');
+
+ return GifFile;
}
/******************************************************************************
GifFileType constructor with user supplied input function (TVT)
******************************************************************************/
-GifFileType *DGifOpen(void *userData, InputFunc readFunc, int *Error) {
- char Buf[GIF_STAMP_LEN + 1];
- GifFileType *GifFile;
- GifFilePrivateType *Private;
-
- GifFile = (GifFileType *)malloc(sizeof(GifFileType));
- if (GifFile == NULL) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- }
- return NULL;
- }
-
- memset(GifFile, '\0', sizeof(GifFileType));
-
- /* Belt and suspenders, in case the null pointer isn't zero */
- GifFile->SavedImages = NULL;
- GifFile->SColorMap = NULL;
-
- Private = (GifFilePrivateType *)calloc(1, sizeof(GifFilePrivateType));
- if (!Private) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- }
- free((char *)GifFile);
- return NULL;
- }
- /*@i1@*/ memset(Private, '\0', sizeof(GifFilePrivateType));
-
- GifFile->Private = (void *)Private;
- Private->FileHandle = 0;
- Private->File = NULL;
- Private->FileState = FILE_STATE_READ;
-
- Private->Read = readFunc; /* TVT */
- GifFile->UserData = userData; /* TVT */
-
- /* Lets see if this is a GIF file: */
- /* coverity[check_return] */
- if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) !=
- GIF_STAMP_LEN) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_READ_FAILED;
- }
- free((char *)Private);
- free((char *)GifFile);
- return NULL;
- }
-
- /* Check for GIF prefix at start of file */
- Buf[GIF_STAMP_LEN] = '\0';
- if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) {
- if (Error != NULL) {
- *Error = D_GIF_ERR_NOT_GIF_FILE;
- }
- free((char *)Private);
- free((char *)GifFile);
- return NULL;
- }
-
- if (DGifGetScreenDesc(GifFile) == GIF_ERROR) {
- free((char *)Private);
- free((char *)GifFile);
- if (Error != NULL) {
- *Error = D_GIF_ERR_NO_SCRN_DSCR;
- }
- return NULL;
- }
-
- GifFile->Error = 0;
-
- /* What version of GIF? */
- Private->gif89 = (Buf[GIF_VERSION_POS + 1] == '9');
-
- return GifFile;
+GifFileType *
+DGifOpen(void *userData, InputFunc readFunc, int *Error)
+{
+ char Buf[GIF_STAMP_LEN + 1];
+ GifFileType *GifFile;
+ GifFilePrivateType *Private;
+
+ GifFile = (GifFileType *)malloc(sizeof(GifFileType));
+ if (GifFile == NULL) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return NULL;
+ }
+
+ memset(GifFile, '\0', sizeof(GifFileType));
+
+ /* Belt and suspenders, in case the null pointer isn't zero */
+ GifFile->SavedImages = NULL;
+ GifFile->SColorMap = NULL;
+
+ Private = (GifFilePrivateType *)calloc(1, sizeof(GifFilePrivateType));
+ if (!Private) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ free((char *)GifFile);
+ return NULL;
+ }
+ /*@i1@*/memset(Private, '\0', sizeof(GifFilePrivateType));
+
+ GifFile->Private = (void *)Private;
+ Private->FileHandle = 0;
+ Private->File = NULL;
+ Private->FileState = FILE_STATE_READ;
+
+ Private->Read = readFunc; /* TVT */
+ GifFile->UserData = userData; /* TVT */
+
+ /* Lets see if this is a GIF file: */
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, (unsigned char *)Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_READ_FAILED;
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ /* Check for GIF prefix at start of file */
+ Buf[GIF_STAMP_LEN] = '\0';
+ if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) {
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NOT_GIF_FILE;
+ free((char *)Private);
+ free((char *)GifFile);
+ return NULL;
+ }
+
+ if (DGifGetScreenDesc(GifFile) == GIF_ERROR) {
+ free((char *)Private);
+ free((char *)GifFile);
+ if (Error != NULL)
+ *Error = D_GIF_ERR_NO_SCRN_DSCR;
+ return NULL;
+ }
+
+ GifFile->Error = 0;
+
+ /* What version of GIF? */
+ Private->gif89 = (Buf[GIF_VERSION_POS] == '9');
+
+ return GifFile;
}
/******************************************************************************
This routine should be called before any other DGif calls. Note that
this routine is called automatically from DGif file open routines.
******************************************************************************/
-int DGifGetScreenDesc(GifFileType *GifFile) {
- int BitsPerPixel;
- bool SortFlag;
- GifByteType Buf[3];
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+int
+DGifGetScreenDesc(GifFileType *GifFile)
+{
+ int BitsPerPixel;
+ bool SortFlag;
+ GifByteType Buf[3];
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- /* Put the screen descriptor into the file: */
- if (DGifGetWord(GifFile, &GifFile->SWidth) == GIF_ERROR ||
- DGifGetWord(GifFile, &GifFile->SHeight) == GIF_ERROR) {
- return GIF_ERROR;
+ /* Put the screen descriptor into the file: */
+ if (DGifGetWord(GifFile, &GifFile->SWidth) == GIF_ERROR ||
+ DGifGetWord(GifFile, &GifFile->SHeight) == GIF_ERROR)
+ return GIF_ERROR;
+
+ if (InternalRead(GifFile, Buf, 3) != 3) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ GifFreeMapObject(GifFile->SColorMap);
+ GifFile->SColorMap = NULL;
+ return GIF_ERROR;
+ }
+ GifFile->SColorResolution = (((Buf[0] & 0x70) + 1) >> 4) + 1;
+ SortFlag = (Buf[0] & 0x08) != 0;
+ BitsPerPixel = (Buf[0] & 0x07) + 1;
+ GifFile->SBackGroundColor = Buf[1];
+ GifFile->AspectByte = Buf[2];
+ if (Buf[0] & 0x80) { /* Do we have global color map? */
+ int i;
+
+ GifFile->SColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL);
+ if (GifFile->SColorMap == NULL) {
+ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
}
- if (InternalRead(GifFile, Buf, 3) != 3) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
+ /* Get the global color map: */
+ GifFile->SColorMap->SortFlag = SortFlag;
+ for (i = 0; i < GifFile->SColorMap->ColorCount; i++) {
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, Buf, 3) != 3) {
GifFreeMapObject(GifFile->SColorMap);
GifFile->SColorMap = NULL;
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
return GIF_ERROR;
+ }
+ GifFile->SColorMap->Colors[i].Red = Buf[0];
+ GifFile->SColorMap->Colors[i].Green = Buf[1];
+ GifFile->SColorMap->Colors[i].Blue = Buf[2];
}
- GifFile->SColorResolution = (((Buf[0] & 0x70) + 1) >> 4) + 1;
- SortFlag = (Buf[0] & 0x08) != 0;
- BitsPerPixel = (Buf[0] & 0x07) + 1;
- GifFile->SBackGroundColor = Buf[1];
- GifFile->AspectByte = Buf[2];
- if (Buf[0] & 0x80) { /* Do we have global color map? */
- int i;
-
- GifFile->SColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL);
- if (GifFile->SColorMap == NULL) {
- GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- return GIF_ERROR;
- }
-
- /* Get the global color map: */
- GifFile->SColorMap->SortFlag = SortFlag;
- for (i = 0; i < GifFile->SColorMap->ColorCount; i++) {
- /* coverity[check_return] */
- if (InternalRead(GifFile, Buf, 3) != 3) {
- GifFreeMapObject(GifFile->SColorMap);
- GifFile->SColorMap = NULL;
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- GifFile->SColorMap->Colors[i].Red = Buf[0];
- GifFile->SColorMap->Colors[i].Green = Buf[1];
- GifFile->SColorMap->Colors[i].Blue = Buf[2];
- }
- } else {
- GifFile->SColorMap = NULL;
- }
+ } else {
+ GifFile->SColorMap = NULL;
+ }
- /*
- * No check here for whether the background color is in range for the
- * screen color map. Possibly there should be.
- */
+ /*
+ * No check here for whether the background color is in range for the
+ * screen color map. Possibly there should be.
+ */
- return GIF_OK;
+ return GIF_OK;
}
-const char *DGifGetGifVersion(GifFileType *GifFile) {
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+const char *
+DGifGetGifVersion(GifFileType *GifFile)
+{
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
- if (Private->gif89) {
- return GIF89_STAMP;
- } else {
- return GIF87_STAMP;
- }
+ if (Private->gif89)
+ return GIF89_STAMP;
+ else
+ return GIF87_STAMP;
}
/******************************************************************************
This routine should be called before any attempt to read an image.
******************************************************************************/
-int DGifGetRecordType(GifFileType *GifFile, GifRecordType *Type) {
- GifByteType Buf;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
-
- /* coverity[check_return] */
- if (InternalRead(GifFile, &Buf, 1) != 1) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
-
- // fprintf(stderr, "### DGifGetRecordType: %02x\n", Buf);
- switch (Buf) {
- case DESCRIPTOR_INTRODUCER:
- *Type = IMAGE_DESC_RECORD_TYPE;
- break;
- case EXTENSION_INTRODUCER:
- *Type = EXTENSION_RECORD_TYPE;
- break;
- case TERMINATOR_INTRODUCER:
- *Type = TERMINATE_RECORD_TYPE;
- break;
- default:
- *Type = UNDEFINED_RECORD_TYPE;
- GifFile->Error = D_GIF_ERR_WRONG_RECORD;
- return GIF_ERROR;
- }
+int
+DGifGetRecordType(GifFileType *GifFile, GifRecordType* Type)
+{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- return GIF_OK;
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, &Buf, 1) != 1) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+
+ //fprintf(stderr, "### DGifGetRecordType: %02x\n", Buf);
+ switch (Buf) {
+ case DESCRIPTOR_INTRODUCER:
+ *Type = IMAGE_DESC_RECORD_TYPE;
+ break;
+ case EXTENSION_INTRODUCER:
+ *Type = EXTENSION_RECORD_TYPE;
+ break;
+ case TERMINATOR_INTRODUCER:
+ *Type = TERMINATE_RECORD_TYPE;
+ break;
+ default:
+ *Type = UNDEFINED_RECORD_TYPE;
+ GifFile->Error = D_GIF_ERR_WRONG_RECORD;
+ return GIF_ERROR;
+ }
+
+ return GIF_OK;
}
-int DGifGetImageHeader(GifFileType *GifFile) {
- unsigned int BitsPerPixel;
- GifByteType Buf[3];
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+int
+DGifGetImageHeader(GifFileType *GifFile)
+{
+ unsigned int BitsPerPixel;
+ GifByteType Buf[3];
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- if (DGifGetWord(GifFile, &GifFile->Image.Left) == GIF_ERROR ||
- DGifGetWord(GifFile, &GifFile->Image.Top) == GIF_ERROR ||
- DGifGetWord(GifFile, &GifFile->Image.Width) == GIF_ERROR ||
- DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR) {
- return GIF_ERROR;
- }
- if (InternalRead(GifFile, Buf, 1) != 1) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
+ if (DGifGetWord(GifFile, &GifFile->Image.Left) == GIF_ERROR ||
+ DGifGetWord(GifFile, &GifFile->Image.Top) == GIF_ERROR ||
+ DGifGetWord(GifFile, &GifFile->Image.Width) == GIF_ERROR ||
+ DGifGetWord(GifFile, &GifFile->Image.Height) == GIF_ERROR)
+ return GIF_ERROR;
+ if (InternalRead(GifFile, Buf, 1) != 1) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ GifFreeMapObject(GifFile->Image.ColorMap);
+ GifFile->Image.ColorMap = NULL;
+ return GIF_ERROR;
+ }
+ BitsPerPixel = (Buf[0] & 0x07) + 1;
+ GifFile->Image.Interlace = (Buf[0] & 0x40) ? true : false;
+
+ /* Setup the colormap */
+ if (GifFile->Image.ColorMap) {
+ GifFreeMapObject(GifFile->Image.ColorMap);
+ GifFile->Image.ColorMap = NULL;
+ }
+ /* Does this image have local color map? */
+ if (Buf[0] & 0x80) {
+ unsigned int i;
+
+ GifFile->Image.ColorMap = GifMakeMapObject(1 << BitsPerPixel, NULL);
+ if (GifFile->Image.ColorMap == NULL) {
+ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+
+ /* Get the image local color map: */
+ for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, Buf, 3) != 3) {
GifFreeMapObject(GifFile->Image.ColorMap);
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
GifFile->Image.ColorMap = NULL;
return GIF_ERROR;
+ }
+ GifFile->Image.ColorMap->Colors[i].Red = Buf[0];
+ GifFile->Image.ColorMap->Colors[i].Green = Buf[1];
+ GifFile->Image.ColorMap->Colors[i].Blue = Buf[2];
}
- BitsPerPixel = (Buf[0] & 0x07) + 1;
- GifFile->Image.Interlace = (Buf[0] & 0x40) ? true : false;
+ }
- /* Setup the colormap */
- if (GifFile->Image.ColorMap) {
- GifFreeMapObject(GifFile->Image.ColorMap);
- GifFile->Image.ColorMap = NULL;
- }
- /* Does this image have local color map? */
- if (Buf[0] & 0x80) {
- unsigned int i;
-
- GifFile->Image.ColorMap =
- GifMakeMapObject(1 << BitsPerPixel, NULL);
- if (GifFile->Image.ColorMap == NULL) {
- GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- return GIF_ERROR;
- }
+ Private->PixelCount = (long)GifFile->Image.Width *
+ (long)GifFile->Image.Height;
- /* Get the image local color map: */
- for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
- /* coverity[check_return] */
- if (InternalRead(GifFile, Buf, 3) != 3) {
- GifFreeMapObject(GifFile->Image.ColorMap);
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- GifFile->Image.ColorMap = NULL;
- return GIF_ERROR;
- }
- GifFile->Image.ColorMap->Colors[i].Red = Buf[0];
- GifFile->Image.ColorMap->Colors[i].Green = Buf[1];
- GifFile->Image.ColorMap->Colors[i].Blue = Buf[2];
- }
- }
-
- Private->PixelCount =
- (long)GifFile->Image.Width * (long)GifFile->Image.Height;
-
- /* Reset decompress algorithm parameters. */
- return DGifSetupDecompress(GifFile);
+ /* Reset decompress algorithm parameters. */
+ return DGifSetupDecompress(GifFile);
}
/******************************************************************************
This routine should be called before any attempt to read an image.
Note it is assumed the Image desc. header has been read.
******************************************************************************/
-int DGifGetImageDesc(GifFileType *GifFile) {
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
- SavedImage *sp;
-
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
-
- if (DGifGetImageHeader(GifFile) == GIF_ERROR) {
- return GIF_ERROR;
- }
-
- if (GifFile->SavedImages) {
- SavedImage *new_saved_images = (SavedImage *)reallocarray(
- GifFile->SavedImages, (GifFile->ImageCount + 1),
- sizeof(SavedImage));
- if (new_saved_images == NULL) {
- GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- return GIF_ERROR;
- }
- GifFile->SavedImages = new_saved_images;
- } else {
- if ((GifFile->SavedImages =
- (SavedImage *)malloc(sizeof(SavedImage))) == NULL) {
- GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- return GIF_ERROR;
- }
- }
-
- sp = &GifFile->SavedImages[GifFile->ImageCount];
- memcpy(&sp->ImageDesc, &GifFile->Image, sizeof(GifImageDesc));
- if (GifFile->Image.ColorMap != NULL) {
- sp->ImageDesc.ColorMap =
- GifMakeMapObject(GifFile->Image.ColorMap->ColorCount,
- GifFile->Image.ColorMap->Colors);
- if (sp->ImageDesc.ColorMap == NULL) {
- GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
- return GIF_ERROR;
- }
- }
- sp->RasterBits = (unsigned char *)NULL;
- sp->ExtensionBlockCount = 0;
- sp->ExtensionBlocks = (ExtensionBlock *)NULL;
-
- GifFile->ImageCount++;
+int
+DGifGetImageDesc(GifFileType *GifFile)
+{
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ SavedImage *sp;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- return GIF_OK;
+ if (DGifGetImageHeader(GifFile) == GIF_ERROR) {
+ return GIF_ERROR;
+ }
+
+ if (GifFile->SavedImages) {
+ SavedImage* new_saved_images =
+ (SavedImage *)reallocarray(GifFile->SavedImages,
+ (GifFile->ImageCount + 1), sizeof(SavedImage));
+ if (new_saved_images == NULL) {
+ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+ GifFile->SavedImages = new_saved_images;
+ } else {
+ if ((GifFile->SavedImages =
+ (SavedImage *) malloc(sizeof(SavedImage))) == NULL) {
+ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+ }
+
+ sp = &GifFile->SavedImages[GifFile->ImageCount];
+ memcpy(&sp->ImageDesc, &GifFile->Image, sizeof(GifImageDesc));
+ if (GifFile->Image.ColorMap != NULL) {
+ sp->ImageDesc.ColorMap = GifMakeMapObject(
+ GifFile->Image.ColorMap->ColorCount,
+ GifFile->Image.ColorMap->Colors);
+ if (sp->ImageDesc.ColorMap == NULL) {
+ GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
+ return GIF_ERROR;
+ }
+ }
+ sp->RasterBits = (unsigned char *)NULL;
+ sp->ExtensionBlockCount = 0;
+ sp->ExtensionBlocks = (ExtensionBlock *) NULL;
+
+ GifFile->ImageCount++;
+
+ return GIF_OK;
}
/******************************************************************************
Get one full scanned line (Line) of length LineLen from GIF file.
******************************************************************************/
-int DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) {
- GifByteType *Dummy;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+int
+DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
+{
+ GifByteType *Dummy;
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+ if (!LineLen)
+ LineLen = GifFile->Image.Width;
- if (!LineLen) {
- LineLen = GifFile->Image.Width;
- }
+ if ((Private->PixelCount -= LineLen) > 0xffff0000UL) {
+ GifFile->Error = D_GIF_ERR_DATA_TOO_BIG;
+ return GIF_ERROR;
+ }
- if (LineLen < 0 || Private->PixelCount < (unsigned long)LineLen) {
- GifFile->Error = D_GIF_ERR_DATA_TOO_BIG;
- return GIF_ERROR;
- }
- Private->PixelCount -= LineLen;
-
- if (DGifDecompressLine(GifFile, Line, LineLen) == GIF_OK) {
- if (Private->PixelCount == 0) {
- /* We probably won't be called any more, so let's clean
- * up everything before we return: need to flush out all
- * the rest of image until an empty block (size 0)
- * detected. We use GetCodeNext.
- */
- do {
- if (DGifGetCodeNext(GifFile, &Dummy) ==
- GIF_ERROR) {
- return GIF_ERROR;
- }
- } while (Dummy != NULL);
- }
- return GIF_OK;
- } else {
- return GIF_ERROR;
+ if (DGifDecompressLine(GifFile, Line, LineLen) == GIF_OK) {
+ if (Private->PixelCount == 0) {
+ /* We probably won't be called any more, so let's clean up
+ * everything before we return: need to flush out all the
+ * rest of image until an empty block (size 0)
+ * detected. We use GetCodeNext.
+ */
+ do
+ if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR)
+ return GIF_ERROR;
+ while (Dummy != NULL) ;
}
+ return GIF_OK;
+ } else
+ return GIF_ERROR;
}
/******************************************************************************
Put one pixel (Pixel) into GIF file.
******************************************************************************/
-int DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel) {
- GifByteType *Dummy;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+int
+DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel)
+{
+ GifByteType *Dummy;
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
+ if (--Private->PixelCount > 0xffff0000UL)
+ {
+ GifFile->Error = D_GIF_ERR_DATA_TOO_BIG;
+ return GIF_ERROR;
+ }
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+ if (DGifDecompressLine(GifFile, &Pixel, 1) == GIF_OK) {
if (Private->PixelCount == 0) {
- GifFile->Error = D_GIF_ERR_DATA_TOO_BIG;
- return GIF_ERROR;
- }
- Private->PixelCount --;
-
- if (DGifDecompressLine(GifFile, &Pixel, 1) == GIF_OK) {
- if (Private->PixelCount == 0) {
- /* We probably won't be called any more, so let's clean
- * up everything before we return: need to flush out all
- * the rest of image until an empty block (size 0)
- * detected. We use GetCodeNext.
- */
- do {
- if (DGifGetCodeNext(GifFile, &Dummy) ==
- GIF_ERROR) {
- return GIF_ERROR;
- }
- } while (Dummy != NULL);
- }
- return GIF_OK;
- } else {
- return GIF_ERROR;
+ /* We probably won't be called any more, so let's clean up
+ * everything before we return: need to flush out all the
+ * rest of image until an empty block (size 0)
+ * detected. We use GetCodeNext.
+ */
+ do
+ if (DGifGetCodeNext(GifFile, &Dummy) == GIF_ERROR)
+ return GIF_ERROR;
+ while (Dummy != NULL) ;
}
+ return GIF_OK;
+ } else
+ return GIF_ERROR;
}
/******************************************************************************
@@ -589,28 +584,28 @@ int DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel) {
The Extension should NOT be freed by the user (not dynamically allocated).
Note it is assumed the Extension description header has been read.
******************************************************************************/
-int DGifGetExtension(GifFileType *GifFile, int *ExtCode,
- GifByteType **Extension) {
- GifByteType Buf;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- // fprintf(stderr, "### -> DGifGetExtension:\n");
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+int
+DGifGetExtension(GifFileType *GifFile, int *ExtCode, GifByteType **Extension)
+{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ //fprintf(stderr, "### -> DGifGetExtension:\n");
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- /* coverity[check_return] */
- if (InternalRead(GifFile, &Buf, 1) != 1) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- *ExtCode = Buf;
- // fprintf(stderr, "### <- DGifGetExtension: %02x, about to call
- // next\n", Buf);
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, &Buf, 1) != 1) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ *ExtCode = Buf;
+ //fprintf(stderr, "### <- DGifGetExtension: %02x, about to call next\n", Buf);
- return DGifGetExtensionNext(GifFile, Extension);
+ return DGifGetExtensionNext(GifFile, Extension);
}
/******************************************************************************
@@ -618,32 +613,32 @@ int DGifGetExtension(GifFileType *GifFile, int *ExtCode,
routine should be called until NULL Extension is returned.
The Extension should NOT be freed by the user (not dynamically allocated).
******************************************************************************/
-int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **Extension) {
- GifByteType Buf;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- // fprintf(stderr, "### -> DGifGetExtensionNext\n");
- if (InternalRead(GifFile, &Buf, 1) != 1) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- // fprintf(stderr, "### DGifGetExtensionNext sees %d\n", Buf);
-
- if (Buf > 0) {
- *Extension = Private->Buf; /* Use private unused buffer. */
- (*Extension)[0] =
- Buf; /* Pascal strings notation (pos. 0 is len.). */
- /* coverity[tainted_data,check_return] */
- if (InternalRead(GifFile, &((*Extension)[1]), Buf) != Buf) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- } else {
- *Extension = NULL;
- }
- // fprintf(stderr, "### <- DGifGetExtensionNext: %p\n", Extension);
-
- return GIF_OK;
+int
+DGifGetExtensionNext(GifFileType *GifFile, GifByteType ** Extension)
+{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ //fprintf(stderr, "### -> DGifGetExtensionNext\n");
+ if (InternalRead(GifFile, &Buf, 1) != 1) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ //fprintf(stderr, "### DGifGetExtensionNext sees %d\n", Buf);
+
+ if (Buf > 0) {
+ *Extension = Private->Buf; /* Use private unused buffer. */
+ (*Extension)[0] = Buf; /* Pascal strings notation (pos. 0 is len.). */
+ /* coverity[tainted_data,check_return] */
+ if (InternalRead(GifFile, &((*Extension)[1]), Buf) != Buf) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ } else
+ *Extension = NULL;
+ //fprintf(stderr, "### <- DGifGetExtensionNext: %p\n", Extension);
+
+ return GIF_OK;
}
/******************************************************************************
@@ -652,125 +647,119 @@ int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **Extension) {
int DGifExtensionToGCB(const size_t GifExtensionLength,
const GifByteType *GifExtension,
- GraphicsControlBlock *GCB) {
- if (GifExtensionLength != 4) {
- return GIF_ERROR;
- }
-
- GCB->DisposalMode = (GifExtension[0] >> 2) & 0x07;
- GCB->UserInputFlag = (GifExtension[0] & 0x02) != 0;
- GCB->DelayTime =
- UNSIGNED_LITTLE_ENDIAN(GifExtension[1], GifExtension[2]);
- if (GifExtension[0] & 0x01) {
- GCB->TransparentColor = (int)GifExtension[3];
- } else {
- GCB->TransparentColor = NO_TRANSPARENT_COLOR;
- }
+ GraphicsControlBlock *GCB)
+{
+ if (GifExtensionLength != 4) {
+ return GIF_ERROR;
+ }
+
+ GCB->DisposalMode = (GifExtension[0] >> 2) & 0x07;
+ GCB->UserInputFlag = (GifExtension[0] & 0x02) != 0;
+ GCB->DelayTime = UNSIGNED_LITTLE_ENDIAN(GifExtension[1], GifExtension[2]);
+ if (GifExtension[0] & 0x01)
+ GCB->TransparentColor = (int)GifExtension[3];
+ else
+ GCB->TransparentColor = NO_TRANSPARENT_COLOR;
- return GIF_OK;
+ return GIF_OK;
}
/******************************************************************************
Extract the Graphics Control Block for a saved image, if it exists.
******************************************************************************/
-int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex,
- GraphicsControlBlock *GCB) {
- int i;
+int DGifSavedExtensionToGCB(GifFileType *GifFile,
+ int ImageIndex, GraphicsControlBlock *GCB)
+{
+ int i;
- if (ImageIndex < 0 || ImageIndex > GifFile->ImageCount - 1) {
- return GIF_ERROR;
- }
+ if (ImageIndex < 0 || ImageIndex > GifFile->ImageCount - 1)
+ return GIF_ERROR;
- GCB->DisposalMode = DISPOSAL_UNSPECIFIED;
- GCB->UserInputFlag = false;
- GCB->DelayTime = 0;
- GCB->TransparentColor = NO_TRANSPARENT_COLOR;
+ GCB->DisposalMode = DISPOSAL_UNSPECIFIED;
+ GCB->UserInputFlag = false;
+ GCB->DelayTime = 0;
+ GCB->TransparentColor = NO_TRANSPARENT_COLOR;
- for (i = 0; i < GifFile->SavedImages[ImageIndex].ExtensionBlockCount;
- i++) {
- ExtensionBlock *ep =
- &GifFile->SavedImages[ImageIndex].ExtensionBlocks[i];
- if (ep->Function == GRAPHICS_EXT_FUNC_CODE) {
- return DGifExtensionToGCB(ep->ByteCount, ep->Bytes,
- GCB);
- }
- }
+ for (i = 0; i < GifFile->SavedImages[ImageIndex].ExtensionBlockCount; i++) {
+ ExtensionBlock *ep = &GifFile->SavedImages[ImageIndex].ExtensionBlocks[i];
+ if (ep->Function == GRAPHICS_EXT_FUNC_CODE)
+ return DGifExtensionToGCB(ep->ByteCount, ep->Bytes, GCB);
+ }
- return GIF_ERROR;
+ return GIF_ERROR;
}
/******************************************************************************
This routine should be called last, to close the GIF file.
******************************************************************************/
-int DGifCloseFile(GifFileType *GifFile, int *ErrorCode) {
- GifFilePrivateType *Private;
+int
+DGifCloseFile(GifFileType *GifFile, int *ErrorCode)
+{
+ GifFilePrivateType *Private;
- if (GifFile == NULL || GifFile->Private == NULL) {
- return GIF_ERROR;
- }
+ if (GifFile == NULL || GifFile->Private == NULL)
+ return GIF_ERROR;
- if (GifFile->Image.ColorMap) {
- GifFreeMapObject(GifFile->Image.ColorMap);
- GifFile->Image.ColorMap = NULL;
- }
+ if (GifFile->Image.ColorMap) {
+ GifFreeMapObject(GifFile->Image.ColorMap);
+ GifFile->Image.ColorMap = NULL;
+ }
- if (GifFile->SColorMap) {
- GifFreeMapObject(GifFile->SColorMap);
- GifFile->SColorMap = NULL;
- }
-
- if (GifFile->SavedImages) {
- GifFreeSavedImages(GifFile);
- GifFile->SavedImages = NULL;
- }
+ if (GifFile->SColorMap) {
+ GifFreeMapObject(GifFile->SColorMap);
+ GifFile->SColorMap = NULL;
+ }
- GifFreeExtensions(&GifFile->ExtensionBlockCount,
- &GifFile->ExtensionBlocks);
+ if (GifFile->SavedImages) {
+ GifFreeSavedImages(GifFile);
+ GifFile->SavedImages = NULL;
+ }
- Private = (GifFilePrivateType *)GifFile->Private;
+ GifFreeExtensions(&GifFile->ExtensionBlockCount, &GifFile->ExtensionBlocks);
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- if (ErrorCode != NULL) {
- *ErrorCode = D_GIF_ERR_NOT_READABLE;
- }
- free((char *)GifFile->Private);
- free(GifFile);
- return GIF_ERROR;
- }
+ Private = (GifFilePrivateType *) GifFile->Private;
- if (Private->File && (fclose(Private->File) != 0)) {
- if (ErrorCode != NULL) {
- *ErrorCode = D_GIF_ERR_CLOSE_FAILED;
- }
- free((char *)GifFile->Private);
- free(GifFile);
- return GIF_ERROR;
- }
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ if (ErrorCode != NULL)
+ *ErrorCode = D_GIF_ERR_NOT_READABLE;
+ free((char *)GifFile->Private);
+ free(GifFile);
+ return GIF_ERROR;
+ }
+ if (Private->File && (fclose(Private->File) != 0)) {
+ if (ErrorCode != NULL)
+ *ErrorCode = D_GIF_ERR_CLOSE_FAILED;
free((char *)GifFile->Private);
free(GifFile);
- if (ErrorCode != NULL) {
- *ErrorCode = D_GIF_SUCCEEDED;
- }
- return GIF_OK;
+ return GIF_ERROR;
+ }
+
+ free((char *)GifFile->Private);
+ free(GifFile);
+ if (ErrorCode != NULL)
+ *ErrorCode = D_GIF_SUCCEEDED;
+ return GIF_OK;
}
/******************************************************************************
Get 2 bytes (word) from the given file:
******************************************************************************/
-static int DGifGetWord(GifFileType *GifFile, GifWord *Word) {
- unsigned char c[2];
-
- /* coverity[check_return] */
- if (InternalRead(GifFile, c, 2) != 2) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
+static int
+DGifGetWord(GifFileType *GifFile, GifWord *Word)
+{
+ unsigned char c[2];
+
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, c, 2) != 2) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
- *Word = (GifWord)UNSIGNED_LITTLE_ENDIAN(c[0], c[1]);
- return GIF_OK;
+ *Word = (GifWord)UNSIGNED_LITTLE_ENDIAN(c[0], c[1]);
+ return GIF_OK;
}
/******************************************************************************
@@ -780,18 +769,20 @@ static int DGifGetWord(GifFileType *GifFile, GifWord *Word) {
to DGifGetCodeNext, until NULL block is returned.
The block should NOT be freed by the user (not dynamically allocated).
******************************************************************************/
-int DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock) {
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+int
+DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock)
+{
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- *CodeSize = Private->BitsPerPixel;
+ *CodeSize = Private->BitsPerPixel;
- return DGifGetCodeNext(GifFile, CodeBlock);
+ return DGifGetCodeNext(GifFile, CodeBlock);
}
/******************************************************************************
@@ -799,79 +790,77 @@ int DGifGetCode(GifFileType *GifFile, int *CodeSize, GifByteType **CodeBlock) {
called until NULL block is returned.
The block should NOT be freed by the user (not dynamically allocated).
******************************************************************************/
-int DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock) {
- GifByteType Buf;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- /* coverity[tainted_data_argument] */
- /* coverity[check_return] */
- if (InternalRead(GifFile, &Buf, 1) != 1) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
-
- /* coverity[lower_bounds] */
- if (Buf > 0) {
- *CodeBlock = Private->Buf; /* Use private unused buffer. */
- (*CodeBlock)[0] =
- Buf; /* Pascal strings notation (pos. 0 is len.). */
- /* coverity[tainted_data] */
- if (InternalRead(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- } else {
- *CodeBlock = NULL;
- Private->Buf[0] = 0; /* Make sure the buffer is empty! */
- Private->PixelCount =
- 0; /* And local info. indicate image read. */
- }
-
- return GIF_OK;
+int
+DGifGetCodeNext(GifFileType *GifFile, GifByteType **CodeBlock)
+{
+ GifByteType Buf;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ /* coverity[tainted_data_argument] */
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, &Buf, 1) != 1) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+
+ /* coverity[lower_bounds] */
+ if (Buf > 0) {
+ *CodeBlock = Private->Buf; /* Use private unused buffer. */
+ (*CodeBlock)[0] = Buf; /* Pascal strings notation (pos. 0 is len.). */
+ /* coverity[tainted_data] */
+ if (InternalRead(GifFile, &((*CodeBlock)[1]), Buf) != Buf) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ } else {
+ *CodeBlock = NULL;
+ Private->Buf[0] = 0; /* Make sure the buffer is empty! */
+ Private->PixelCount = 0; /* And local info. indicate image read. */
+ }
+
+ return GIF_OK;
}
/******************************************************************************
Setup the LZ decompression for this image:
******************************************************************************/
-static int DGifSetupDecompress(GifFileType *GifFile) {
- int i, BitsPerPixel;
- GifByteType CodeSize;
- GifPrefixType *Prefix;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- /* coverity[check_return] */
- if (InternalRead(GifFile, &CodeSize, 1) <
- 1) { /* Read Code size from file. */
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR; /* Failed to read Code size. */
- }
- BitsPerPixel = CodeSize;
-
- /* this can only happen on a severely malformed GIF */
- if (BitsPerPixel > 8) {
- GifFile->Error =
- D_GIF_ERR_READ_FAILED; /* somewhat bogus error code */
- return GIF_ERROR; /* Failed to read Code size. */
- }
-
- Private->Buf[0] = 0; /* Input Buffer empty. */
- Private->BitsPerPixel = BitsPerPixel;
- Private->ClearCode = (1 << BitsPerPixel);
- Private->EOFCode = Private->ClearCode + 1;
- Private->RunningCode = Private->EOFCode + 1;
- Private->RunningBits = BitsPerPixel + 1; /* Number of bits per code. */
- Private->MaxCode1 = 1 << Private->RunningBits; /* Max. code + 1. */
- Private->StackPtr = 0; /* No pixels on the pixel stack. */
- Private->LastCode = NO_SUCH_CODE;
- Private->CrntShiftState = 0; /* No information in CrntShiftDWord. */
- Private->CrntShiftDWord = 0;
-
- Prefix = Private->Prefix;
- for (i = 0; i <= LZ_MAX_CODE; i++) {
- Prefix[i] = NO_SUCH_CODE;
- }
-
- return GIF_OK;
+static int
+DGifSetupDecompress(GifFileType *GifFile)
+{
+ int i, BitsPerPixel;
+ GifByteType CodeSize;
+ GifPrefixType *Prefix;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, &CodeSize, 1) < 1) { /* Read Code size from file. */
+ return GIF_ERROR; /* Failed to read Code size. */
+ }
+ BitsPerPixel = CodeSize;
+
+ /* this can only happen on a severely malformed GIF */
+ if (BitsPerPixel > 8) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED; /* somewhat bogus error code */
+ return GIF_ERROR; /* Failed to read Code size. */
+ }
+
+ Private->Buf[0] = 0; /* Input Buffer empty. */
+ Private->BitsPerPixel = BitsPerPixel;
+ Private->ClearCode = (1 << BitsPerPixel);
+ Private->EOFCode = Private->ClearCode + 1;
+ Private->RunningCode = Private->EOFCode + 1;
+ Private->RunningBits = BitsPerPixel + 1; /* Number of bits per code. */
+ Private->MaxCode1 = 1 << Private->RunningBits; /* Max. code + 1. */
+ Private->StackPtr = 0; /* No pixels on the pixel stack. */
+ Private->LastCode = NO_SUCH_CODE;
+ Private->CrntShiftState = 0; /* No information in CrntShiftDWord. */
+ Private->CrntShiftDWord = 0;
+
+ Prefix = Private->Prefix;
+ for (i = 0; i <= LZ_MAX_CODE; i++)
+ Prefix[i] = NO_SUCH_CODE;
+
+ return GIF_OK;
}
/******************************************************************************
@@ -880,149 +869,127 @@ static int DGifSetupDecompress(GifFileType *GifFile) {
This routine can be called few times (one per scan line, for example), in
order the complete the whole image.
******************************************************************************/
-static int DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line,
- int LineLen) {
- int i = 0;
- int j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr;
- GifByteType *Stack, *Suffix;
- GifPrefixType *Prefix;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- StackPtr = Private->StackPtr;
- Prefix = Private->Prefix;
- Suffix = Private->Suffix;
- Stack = Private->Stack;
- EOFCode = Private->EOFCode;
- ClearCode = Private->ClearCode;
- LastCode = Private->LastCode;
-
- if (StackPtr > LZ_MAX_CODE) {
- return GIF_ERROR;
- }
-
- if (StackPtr != 0) {
- /* Let pop the stack off before continueing to read the GIF
- * file: */
- while (StackPtr != 0 && i < LineLen) {
- Line[i++] = Stack[--StackPtr];
+static int
+DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line, int LineLen)
+{
+ int i = 0;
+ int j, CrntCode, EOFCode, ClearCode, CrntPrefix, LastCode, StackPtr;
+ GifByteType *Stack, *Suffix;
+ GifPrefixType *Prefix;
+ GifFilePrivateType *Private = (GifFilePrivateType *) GifFile->Private;
+
+ StackPtr = Private->StackPtr;
+ Prefix = Private->Prefix;
+ Suffix = Private->Suffix;
+ Stack = Private->Stack;
+ EOFCode = Private->EOFCode;
+ ClearCode = Private->ClearCode;
+ LastCode = Private->LastCode;
+
+ if (StackPtr > LZ_MAX_CODE) {
+ return GIF_ERROR;
+ }
+
+ if (StackPtr != 0) {
+ /* Let pop the stack off before continueing to read the GIF file: */
+ while (StackPtr != 0 && i < LineLen)
+ Line[i++] = Stack[--StackPtr];
+ }
+
+ while (i < LineLen) { /* Decode LineLen items. */
+ if (DGifDecompressInput(GifFile, &CrntCode) == GIF_ERROR)
+ return GIF_ERROR;
+
+ if (CrntCode == EOFCode) {
+ /* Note however that usually we will not be here as we will stop
+ * decoding as soon as we got all the pixel, or EOF code will
+ * not be read at all, and DGifGetLine/Pixel clean everything. */
+ GifFile->Error = D_GIF_ERR_EOF_TOO_SOON;
+ return GIF_ERROR;
+ } else if (CrntCode == ClearCode) {
+ /* We need to start over again: */
+ for (j = 0; j <= LZ_MAX_CODE; j++)
+ Prefix[j] = NO_SUCH_CODE;
+ Private->RunningCode = Private->EOFCode + 1;
+ Private->RunningBits = Private->BitsPerPixel + 1;
+ Private->MaxCode1 = 1 << Private->RunningBits;
+ LastCode = Private->LastCode = NO_SUCH_CODE;
+ } else {
+ /* Its regular code - if in pixel range simply add it to output
+ * stream, otherwise trace to codes linked list until the prefix
+ * is in pixel range: */
+ if (CrntCode < ClearCode) {
+ /* This is simple - its pixel scalar, so add it to output: */
+ Line[i++] = CrntCode;
+ } else {
+ /* Its a code to needed to be traced: trace the linked list
+ * until the prefix is a pixel, while pushing the suffix
+ * pixels on our stack. If we done, pop the stack in reverse
+ * (thats what stack is good for!) order to output. */
+ if (Prefix[CrntCode] == NO_SUCH_CODE) {
+ CrntPrefix = LastCode;
+
+ /* Only allowed if CrntCode is exactly the running code:
+ * In that case CrntCode = XXXCode, CrntCode or the
+ * prefix code is last code and the suffix char is
+ * exactly the prefix of last code! */
+ if (CrntCode == Private->RunningCode - 2) {
+ Suffix[Private->RunningCode - 2] =
+ Stack[StackPtr++] = DGifGetPrefixChar(Prefix,
+ LastCode,
+ ClearCode);
+ } else {
+ Suffix[Private->RunningCode - 2] =
+ Stack[StackPtr++] = DGifGetPrefixChar(Prefix,
+ CrntCode,
+ ClearCode);
+ }
+ } else
+ CrntPrefix = CrntCode;
+
+ /* Now (if image is O.K.) we should not get a NO_SUCH_CODE
+ * during the trace. As we might loop forever, in case of
+ * defective image, we use StackPtr as loop counter and stop
+ * before overflowing Stack[]. */
+ while (StackPtr < LZ_MAX_CODE &&
+ CrntPrefix > ClearCode && CrntPrefix <= LZ_MAX_CODE) {
+ Stack[StackPtr++] = Suffix[CrntPrefix];
+ CrntPrefix = Prefix[CrntPrefix];
}
- }
-
- while (i < LineLen) { /* Decode LineLen items. */
- if (DGifDecompressInput(GifFile, &CrntCode) == GIF_ERROR) {
- return GIF_ERROR;
+ if (StackPtr >= LZ_MAX_CODE || CrntPrefix > LZ_MAX_CODE) {
+ GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
+ return GIF_ERROR;
}
-
- if (CrntCode == EOFCode) {
- /* Note however that usually we will not be here as we
- * will stop decoding as soon as we got all the pixel,
- * or EOF code will not be read at all, and
- * DGifGetLine/Pixel clean everything. */
- GifFile->Error = D_GIF_ERR_EOF_TOO_SOON;
- return GIF_ERROR;
- } else if (CrntCode == ClearCode) {
- /* We need to start over again: */
- for (j = 0; j <= LZ_MAX_CODE; j++) {
- Prefix[j] = NO_SUCH_CODE;
- }
- Private->RunningCode = Private->EOFCode + 1;
- Private->RunningBits = Private->BitsPerPixel + 1;
- Private->MaxCode1 = 1 << Private->RunningBits;
- LastCode = Private->LastCode = NO_SUCH_CODE;
+ /* Push the last character on stack: */
+ Stack[StackPtr++] = CrntPrefix;
+
+ /* Now lets pop all the stack into output: */
+ while (StackPtr != 0 && i < LineLen)
+ Line[i++] = Stack[--StackPtr];
+ }
+ if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < (LZ_MAX_CODE+1) && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+ Prefix[Private->RunningCode - 2] = LastCode;
+
+ if (CrntCode == Private->RunningCode - 2) {
+ /* Only allowed if CrntCode is exactly the running code:
+ * In that case CrntCode = XXXCode, CrntCode or the
+ * prefix code is last code and the suffix char is
+ * exactly the prefix of last code! */
+ Suffix[Private->RunningCode - 2] =
+ DGifGetPrefixChar(Prefix, LastCode, ClearCode);
} else {
- /* Its regular code - if in pixel range simply add it to
- * output stream, otherwise trace to codes linked list
- * until the prefix is in pixel range: */
- if (CrntCode < ClearCode) {
- /* This is simple - its pixel scalar, so add it
- * to output: */
- Line[i++] = CrntCode;
- } else {
- /* Its a code to needed to be traced: trace the
- * linked list until the prefix is a pixel,
- * while pushing the suffix pixels on our stack.
- * If we done, pop the stack in reverse (thats
- * what stack is good for!) order to output. */
- if (Prefix[CrntCode] == NO_SUCH_CODE) {
- CrntPrefix = LastCode;
-
- /* Only allowed if CrntCode is exactly
- * the running code: In that case
- * CrntCode = XXXCode, CrntCode or the
- * prefix code is last code and the
- * suffix char is exactly the prefix of
- * last code! */
- if (CrntCode ==
- Private->RunningCode - 2) {
- Suffix[Private->RunningCode -
- 2] = Stack[StackPtr++] =
- DGifGetPrefixChar(
- Prefix, LastCode,
- ClearCode);
- } else {
- Suffix[Private->RunningCode -
- 2] = Stack[StackPtr++] =
- DGifGetPrefixChar(
- Prefix, CrntCode,
- ClearCode);
- }
- } else {
- CrntPrefix = CrntCode;
- }
-
- /* Now (if image is O.K.) we should not get a
- * NO_SUCH_CODE during the trace. As we might
- * loop forever, in case of defective image, we
- * use StackPtr as loop counter and stop before
- * overflowing Stack[]. */
- while (StackPtr < LZ_MAX_CODE &&
- CrntPrefix > ClearCode &&
- CrntPrefix <= LZ_MAX_CODE) {
- Stack[StackPtr++] = Suffix[CrntPrefix];
- CrntPrefix = Prefix[CrntPrefix];
- }
- if (StackPtr >= LZ_MAX_CODE ||
- CrntPrefix > LZ_MAX_CODE) {
- GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
- return GIF_ERROR;
- }
- /* Push the last character on stack: */
- Stack[StackPtr++] = CrntPrefix;
-
- /* Now lets pop all the stack into output: */
- while (StackPtr != 0 && i < LineLen) {
- Line[i++] = Stack[--StackPtr];
- }
- }
- if (LastCode != NO_SUCH_CODE &&
- Private->RunningCode - 2 < (LZ_MAX_CODE + 1) &&
- Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
- Prefix[Private->RunningCode - 2] = LastCode;
-
- if (CrntCode == Private->RunningCode - 2) {
- /* Only allowed if CrntCode is exactly
- * the running code: In that case
- * CrntCode = XXXCode, CrntCode or the
- * prefix code is last code and the
- * suffix char is exactly the prefix of
- * last code! */
- Suffix[Private->RunningCode - 2] =
- DGifGetPrefixChar(Prefix, LastCode,
- ClearCode);
- } else {
- Suffix[Private->RunningCode - 2] =
- DGifGetPrefixChar(Prefix, CrntCode,
- ClearCode);
- }
- }
- LastCode = CrntCode;
+ Suffix[Private->RunningCode - 2] =
+ DGifGetPrefixChar(Prefix, CrntCode, ClearCode);
}
+ }
+ LastCode = CrntCode;
}
+ }
- Private->LastCode = LastCode;
- Private->StackPtr = StackPtr;
+ Private->LastCode = LastCode;
+ Private->StackPtr = StackPtr;
- return GIF_OK;
+ return GIF_OK;
}
/******************************************************************************
@@ -1031,55 +998,55 @@ static int DGifDecompressLine(GifFileType *GifFile, GifPixelType *Line,
If image is defective, we might loop here forever, so we limit the loops to
the maximum possible if image O.k. - LZ_MAX_CODE times.
******************************************************************************/
-static int DGifGetPrefixChar(const GifPrefixType *Prefix, int Code,
- int ClearCode) {
- int i = 0;
-
- while (Code > ClearCode && i++ <= LZ_MAX_CODE) {
- if (Code > LZ_MAX_CODE) {
- return NO_SUCH_CODE;
- }
- Code = Prefix[Code];
- }
- return Code;
+static int
+DGifGetPrefixChar(GifPrefixType *Prefix, int Code, int ClearCode)
+{
+ int i = 0;
+
+ while (Code > ClearCode && i++ <= LZ_MAX_CODE) {
+ if (Code > LZ_MAX_CODE) {
+ return NO_SUCH_CODE;
+ }
+ Code = Prefix[Code];
+ }
+ return Code;
}
/******************************************************************************
Interface for accessing the LZ codes directly. Set Code to the real code
(12bits), or to -1 if EOF code is returned.
******************************************************************************/
-int DGifGetLZCodes(GifFileType *GifFile, int *Code) {
- GifByteType *CodeBlock;
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+int
+DGifGetLZCodes(GifFileType *GifFile, int *Code)
+{
+ GifByteType *CodeBlock;
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ if (!IS_READABLE(Private)) {
+ /* This file was NOT open for reading: */
+ GifFile->Error = D_GIF_ERR_NOT_READABLE;
+ return GIF_ERROR;
+ }
- if (!IS_READABLE(Private)) {
- /* This file was NOT open for reading: */
- GifFile->Error = D_GIF_ERR_NOT_READABLE;
- return GIF_ERROR;
- }
+ if (DGifDecompressInput(GifFile, Code) == GIF_ERROR)
+ return GIF_ERROR;
- if (DGifDecompressInput(GifFile, Code) == GIF_ERROR) {
+ if (*Code == Private->EOFCode) {
+ /* Skip rest of codes (hopefully only NULL terminating block): */
+ do {
+ if (DGifGetCodeNext(GifFile, &CodeBlock) == GIF_ERROR)
return GIF_ERROR;
- }
+ } while (CodeBlock != NULL) ;
- if (*Code == Private->EOFCode) {
- /* Skip rest of codes (hopefully only NULL terminating block):
- */
- do {
- if (DGifGetCodeNext(GifFile, &CodeBlock) == GIF_ERROR) {
- return GIF_ERROR;
- }
- } while (CodeBlock != NULL);
-
- *Code = -1;
- } else if (*Code == Private->ClearCode) {
- /* We need to start over again: */
- Private->RunningCode = Private->EOFCode + 1;
- Private->RunningBits = Private->BitsPerPixel + 1;
- Private->MaxCode1 = 1 << Private->RunningBits;
- }
+ *Code = -1;
+ } else if (*Code == Private->ClearCode) {
+ /* We need to start over again: */
+ Private->RunningCode = Private->EOFCode + 1;
+ Private->RunningBits = Private->BitsPerPixel + 1;
+ Private->MaxCode1 = 1 << Private->RunningBits;
+ }
- return GIF_OK;
+ return GIF_OK;
}
/******************************************************************************
@@ -1088,48 +1055,52 @@ int DGifGetLZCodes(GifFileType *GifFile, int *Code) {
8 bits (bytes) packets, into the real codes.
Returns GIF_OK if read successfully.
******************************************************************************/
-static int DGifDecompressInput(GifFileType *GifFile, int *Code) {
- static const unsigned short CodeMasks[] = {
- 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f,
- 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff};
-
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
-
- GifByteType NextByte;
-
- /* The image can't contain more than LZ_BITS per code. */
- if (Private->RunningBits > LZ_BITS) {
- GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
- return GIF_ERROR;
- }
-
- while (Private->CrntShiftState < Private->RunningBits) {
- /* Needs to get more bytes from input stream for next code: */
- if (DGifBufferedInput(GifFile, Private->Buf, &NextByte) ==
- GIF_ERROR) {
- return GIF_ERROR;
- }
- Private->CrntShiftDWord |= ((unsigned long)NextByte)
- << Private->CrntShiftState;
- Private->CrntShiftState += 8;
- }
- *Code = Private->CrntShiftDWord & CodeMasks[Private->RunningBits];
-
- Private->CrntShiftDWord >>= Private->RunningBits;
- Private->CrntShiftState -= Private->RunningBits;
-
- /* If code cannot fit into RunningBits bits, must raise its size. Note
- * however that codes above 4095 are used for special signaling.
- * If we're using LZ_BITS bits already and we're at the max code, just
- * keep using the table as it is, don't increment Private->RunningCode.
- */
- if (Private->RunningCode < LZ_MAX_CODE + 2 &&
- ++Private->RunningCode > Private->MaxCode1 &&
- Private->RunningBits < LZ_BITS) {
- Private->MaxCode1 <<= 1;
- Private->RunningBits++;
- }
- return GIF_OK;
+static int
+DGifDecompressInput(GifFileType *GifFile, int *Code)
+{
+ static const unsigned short CodeMasks[] = {
+ 0x0000, 0x0001, 0x0003, 0x0007,
+ 0x000f, 0x001f, 0x003f, 0x007f,
+ 0x00ff, 0x01ff, 0x03ff, 0x07ff,
+ 0x0fff
+ };
+
+ GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+
+ GifByteType NextByte;
+
+ /* The image can't contain more than LZ_BITS per code. */
+ if (Private->RunningBits > LZ_BITS) {
+ GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
+ return GIF_ERROR;
+ }
+
+ while (Private->CrntShiftState < Private->RunningBits) {
+ /* Needs to get more bytes from input stream for next code: */
+ if (DGifBufferedInput(GifFile, Private->Buf, &NextByte) == GIF_ERROR) {
+ return GIF_ERROR;
+ }
+ Private->CrntShiftDWord |=
+ ((unsigned long)NextByte) << Private->CrntShiftState;
+ Private->CrntShiftState += 8;
+ }
+ *Code = Private->CrntShiftDWord & CodeMasks[Private->RunningBits];
+
+ Private->CrntShiftDWord >>= Private->RunningBits;
+ Private->CrntShiftState -= Private->RunningBits;
+
+ /* If code cannot fit into RunningBits bits, must raise its size. Note
+ * however that codes above 4095 are used for special signaling.
+ * If we're using LZ_BITS bits already and we're at the max code, just
+ * keep using the table as it is, don't increment Private->RunningCode.
+ */
+ if (Private->RunningCode < LZ_MAX_CODE + 2 &&
+ ++Private->RunningCode > Private->MaxCode1 &&
+ Private->RunningBits < LZ_BITS) {
+ Private->MaxCode1 <<= 1;
+ Private->RunningBits++;
+ }
+ return GIF_OK;
}
/******************************************************************************
@@ -1138,61 +1109,37 @@ static int DGifDecompressInput(GifFileType *GifFile, int *Code) {
The routine returns the next byte from its internal buffer (or read next
block in if buffer empty) and returns GIF_OK if succesful.
******************************************************************************/
-static int DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf,
- GifByteType *NextByte) {
- if (Buf[0] == 0) {
- /* Needs to read the next buffer - this one is empty: */
- /* coverity[check_return] */
- if (InternalRead(GifFile, Buf, 1) != 1) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- /* There shouldn't be any empty data blocks here as the LZW spec
- * says the LZW termination code should come first. Therefore
- * we shouldn't be inside this routine at that point.
- */
- if (Buf[0] == 0) {
- GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
- return GIF_ERROR;
- }
- if (InternalRead(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
- GifFile->Error = D_GIF_ERR_READ_FAILED;
- return GIF_ERROR;
- }
- *NextByte = Buf[1];
- Buf[1] = 2; /* We use now the second place as last char read! */
- Buf[0]--;
- } else {
- *NextByte = Buf[Buf[1]++];
- Buf[0]--;
- }
-
- return GIF_OK;
-}
-
-/******************************************************************************
- This routine is called in case of error during parsing image. We need to
- decrease image counter and reallocate memory for saved images. Not decreasing
- ImageCount may lead to null pointer dereference, because the last element in
- SavedImages may point to the spoilt image and null pointer buffers.
-*******************************************************************************/
-void DGifDecreaseImageCounter(GifFileType *GifFile) {
- SavedImage *correct_saved_images;
-
- GifFile->ImageCount--;
- if (GifFile->SavedImages[GifFile->ImageCount].RasterBits != NULL) {
- free(GifFile->SavedImages[GifFile->ImageCount].RasterBits);
- }
- if (GifFile->SavedImages[GifFile->ImageCount].ImageDesc.ColorMap != NULL) {
- GifFreeMapObject(GifFile->SavedImages[GifFile->ImageCount].ImageDesc.ColorMap);
- }
-
- // Realloc array according to the new image counter.
- correct_saved_images = (SavedImage *)reallocarray(
- GifFile->SavedImages, GifFile->ImageCount, sizeof(SavedImage));
- if (correct_saved_images != NULL) {
- GifFile->SavedImages = correct_saved_images;
+static int
+DGifBufferedInput(GifFileType *GifFile, GifByteType *Buf, GifByteType *NextByte)
+{
+ if (Buf[0] == 0) {
+ /* Needs to read the next buffer - this one is empty: */
+ /* coverity[check_return] */
+ if (InternalRead(GifFile, Buf, 1) != 1) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
}
+ /* There shouldn't be any empty data blocks here as the LZW spec
+ * says the LZW termination code should come first. Therefore we
+ * shouldn't be inside this routine at that point.
+ */
+ if (Buf[0] == 0) {
+ GifFile->Error = D_GIF_ERR_IMAGE_DEFECT;
+ return GIF_ERROR;
+ }
+ if (InternalRead(GifFile, &Buf[1], Buf[0]) != Buf[0]) {
+ GifFile->Error = D_GIF_ERR_READ_FAILED;
+ return GIF_ERROR;
+ }
+ *NextByte = Buf[1];
+ Buf[1] = 2; /* We use now the second place as last char read! */
+ Buf[0]--;
+ } else {
+ *NextByte = Buf[Buf[1]++];
+ Buf[0]--;
+ }
+
+ return GIF_OK;
}
/******************************************************************************
@@ -1200,144 +1147,119 @@ void DGifDecreaseImageCounter(GifFileType *GifFile) {
the GifFileType pointer. Call DGifOpenFileName() or DGifOpenFileHandle()
first to initialize I/O. Its inverse is EGifSpew().
*******************************************************************************/
-int DGifSlurp(GifFileType *GifFile) {
- size_t ImageSize;
- GifRecordType RecordType;
- SavedImage *sp;
- GifByteType *ExtData;
- int ExtFunction;
-
- GifFile->ExtensionBlocks = NULL;
- GifFile->ExtensionBlockCount = 0;
-
- do {
- if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
- return (GIF_ERROR);
- }
-
- switch (RecordType) {
- case IMAGE_DESC_RECORD_TYPE:
- if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
- return (GIF_ERROR);
- }
-
- sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
- /* Allocate memory for the image */
- if (sp->ImageDesc.Width <= 0 ||
- sp->ImageDesc.Height <= 0 ||
- sp->ImageDesc.Width >
- (INT_MAX / sp->ImageDesc.Height)) {
- DGifDecreaseImageCounter(GifFile);
- return GIF_ERROR;
- }
- ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
-
- if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) {
- DGifDecreaseImageCounter(GifFile);
- return GIF_ERROR;
- }
- sp->RasterBits = (unsigned char *)reallocarray(
- NULL, ImageSize, sizeof(GifPixelType));
-
- if (sp->RasterBits == NULL) {
- DGifDecreaseImageCounter(GifFile);
- return GIF_ERROR;
- }
-
- if (sp->ImageDesc.Interlace) {
- int i, j;
- /*
- * The way an interlaced image should be read -
- * offsets and jumps...
- */
- static const int InterlacedOffset[] = {0, 4, 2,
- 1};
- static const int InterlacedJumps[] = {8, 8, 4,
- 2};
- /* Need to perform 4 passes on the image */
- for (i = 0; i < 4; i++) {
- for (j = InterlacedOffset[i];
- j < sp->ImageDesc.Height;
- j += InterlacedJumps[i]) {
- if (DGifGetLine(
- GifFile,
- sp->RasterBits +
- j * sp->ImageDesc
- .Width,
- sp->ImageDesc.Width) ==
- GIF_ERROR) {
- DGifDecreaseImageCounter(
- GifFile);
- return GIF_ERROR;
- }
- }
- }
- } else {
- if (DGifGetLine(GifFile, sp->RasterBits,
- ImageSize) == GIF_ERROR) {
- DGifDecreaseImageCounter(GifFile);
- return GIF_ERROR;
- }
- }
-
- if (GifFile->ExtensionBlocks) {
- sp->ExtensionBlocks = GifFile->ExtensionBlocks;
- sp->ExtensionBlockCount =
- GifFile->ExtensionBlockCount;
-
- GifFile->ExtensionBlocks = NULL;
- GifFile->ExtensionBlockCount = 0;
- }
- break;
-
- case EXTENSION_RECORD_TYPE:
- if (DGifGetExtension(GifFile, &ExtFunction, &ExtData) ==
- GIF_ERROR) {
- return (GIF_ERROR);
- }
- /* Create an extension block with our data */
- if (ExtData != NULL) {
- if (GifAddExtensionBlock(
- &GifFile->ExtensionBlockCount,
- &GifFile->ExtensionBlocks, ExtFunction,
- ExtData[0], &ExtData[1]) == GIF_ERROR) {
- return (GIF_ERROR);
- }
- }
- for (;;) {
- if (DGifGetExtensionNext(GifFile, &ExtData) ==
- GIF_ERROR) {
- return (GIF_ERROR);
- }
- if (ExtData == NULL) {
- break;
- }
- /* Continue the extension block */
- if (GifAddExtensionBlock(
- &GifFile->ExtensionBlockCount,
- &GifFile->ExtensionBlocks,
- CONTINUE_EXT_FUNC_CODE, ExtData[0],
- &ExtData[1]) == GIF_ERROR) {
- return (GIF_ERROR);
- }
- }
- break;
-
- case TERMINATE_RECORD_TYPE:
- break;
-
- default: /* Should be trapped by DGifGetRecordType */
- break;
- }
- } while (RecordType != TERMINATE_RECORD_TYPE);
-
- /* Sanity check for corrupted file */
- if (GifFile->ImageCount == 0) {
- GifFile->Error = D_GIF_ERR_NO_IMAG_DSCR;
- return (GIF_ERROR);
- }
-
- return (GIF_OK);
+int
+DGifSlurp(GifFileType *GifFile)
+{
+ size_t ImageSize;
+ GifRecordType RecordType;
+ SavedImage *sp;
+ GifByteType *ExtData;
+ int ExtFunction;
+
+ GifFile->ExtensionBlocks = NULL;
+ GifFile->ExtensionBlockCount = 0;
+
+ do {
+ if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR)
+ return (GIF_ERROR);
+
+ switch (RecordType) {
+ case IMAGE_DESC_RECORD_TYPE:
+ if (DGifGetImageDesc(GifFile) == GIF_ERROR)
+ return (GIF_ERROR);
+
+ sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
+ /* Allocate memory for the image */
+ if (sp->ImageDesc.Width <= 0 || sp->ImageDesc.Height <= 0 ||
+ sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
+ return GIF_ERROR;
+ }
+ ImageSize = sp->ImageDesc.Width * sp->ImageDesc.Height;
+
+ if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) {
+ return GIF_ERROR;
+ }
+ sp->RasterBits = (unsigned char *)reallocarray(NULL, ImageSize,
+ sizeof(GifPixelType));
+
+ if (sp->RasterBits == NULL) {
+ return GIF_ERROR;
+ }
+
+ if (sp->ImageDesc.Interlace) {
+ int i, j;
+ /*
+ * The way an interlaced image should be read -
+ * offsets and jumps...
+ */
+ int InterlacedOffset[] = { 0, 4, 2, 1 };
+ int InterlacedJumps[] = { 8, 8, 4, 2 };
+ /* Need to perform 4 passes on the image */
+ for (i = 0; i < 4; i++)
+ for (j = InterlacedOffset[i];
+ j < sp->ImageDesc.Height;
+ j += InterlacedJumps[i]) {
+ if (DGifGetLine(GifFile,
+ sp->RasterBits+j*sp->ImageDesc.Width,
+ sp->ImageDesc.Width) == GIF_ERROR)
+ return GIF_ERROR;
+ }
+ }
+ else {
+ if (DGifGetLine(GifFile,sp->RasterBits,ImageSize)==GIF_ERROR)
+ return (GIF_ERROR);
+ }
+
+ if (GifFile->ExtensionBlocks) {
+ sp->ExtensionBlocks = GifFile->ExtensionBlocks;
+ sp->ExtensionBlockCount = GifFile->ExtensionBlockCount;
+
+ GifFile->ExtensionBlocks = NULL;
+ GifFile->ExtensionBlockCount = 0;
+ }
+ break;
+
+ case EXTENSION_RECORD_TYPE:
+ if (DGifGetExtension(GifFile,&ExtFunction,&ExtData) == GIF_ERROR)
+ return (GIF_ERROR);
+ /* Create an extension block with our data */
+ if (ExtData != NULL) {
+ if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
+ &GifFile->ExtensionBlocks,
+ ExtFunction, ExtData[0], &ExtData[1])
+ == GIF_ERROR)
+ return (GIF_ERROR);
+ }
+ for (;;) {
+ if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
+ return (GIF_ERROR);
+ if (ExtData == NULL)
+ break;
+ /* Continue the extension block */
+ if (ExtData != NULL)
+ if (GifAddExtensionBlock(&GifFile->ExtensionBlockCount,
+ &GifFile->ExtensionBlocks,
+ CONTINUE_EXT_FUNC_CODE,
+ ExtData[0], &ExtData[1]) == GIF_ERROR)
+ return (GIF_ERROR);
+ }
+ break;
+
+ case TERMINATE_RECORD_TYPE:
+ break;
+
+ default: /* Should be trapped by DGifGetRecordType */
+ break;
+ }
+ } while (RecordType != TERMINATE_RECORD_TYPE);
+
+ /* Sanity check for corrupted file */
+ if (GifFile->ImageCount == 0) {
+ GifFile->Error = D_GIF_ERR_NO_IMAG_DSCR;
+ return(GIF_ERROR);
+ }
+
+ return (GIF_OK);
}
/* end */
diff --git a/jdk/src/share/native/sun/awt/giflib/gif_err.c b/jdk/src/share/native/sun/awt/giflib/gif_err.c
index a3cc03b886..db08838eff 100644
--- a/jdk/src/share/native/sun/awt/giflib/gif_err.c
+++ b/jdk/src/share/native/sun/awt/giflib/gif_err.c
@@ -26,9 +26,9 @@
gif_err.c - handle error reporting for the GIF library.
+SPDX-License-Identifier: MIT
+
****************************************************************************/
-// SPDX-License-Identifier: MIT
-// SPDX-File-Copyright-Txt: (C) Copyright 1989 Gershon Elber
#include <stdio.h>
@@ -38,84 +38,86 @@ gif_err.c - handle error reporting for the GIF library.
/*****************************************************************************
Return a string description of the last GIF error
*****************************************************************************/
-const char *GifErrorString(int ErrorCode) {
- const char *Err;
+const char *
+GifErrorString(int ErrorCode)
+{
+ const char *Err;
- switch (ErrorCode) {
- case E_GIF_ERR_OPEN_FAILED:
- Err = "Failed to open given file";
- break;
- case E_GIF_ERR_WRITE_FAILED:
- Err = "Failed to write to given file";
- break;
- case E_GIF_ERR_HAS_SCRN_DSCR:
- Err = "Screen descriptor has already been set";
- break;
- case E_GIF_ERR_HAS_IMAG_DSCR:
- Err = "Image descriptor is still active";
- break;
- case E_GIF_ERR_NO_COLOR_MAP:
- Err = "Neither global nor local color map";
- break;
- case E_GIF_ERR_DATA_TOO_BIG:
- Err = "Number of pixels bigger than width * height";
- break;
- case E_GIF_ERR_NOT_ENOUGH_MEM:
- Err = "Failed to allocate required memory";
- break;
- case E_GIF_ERR_DISK_IS_FULL:
- Err = "Write failed (disk full?)";
- break;
- case E_GIF_ERR_CLOSE_FAILED:
- Err = "Failed to close given file";
- break;
- case E_GIF_ERR_NOT_WRITEABLE:
- Err = "Given file was not opened for write";
- break;
- case D_GIF_ERR_OPEN_FAILED:
- Err = "Failed to open given file";
- break;
- case D_GIF_ERR_READ_FAILED:
- Err = "Failed to read from given file";
- break;
- case D_GIF_ERR_NOT_GIF_FILE:
- Err = "Data is not in GIF format";
- break;
- case D_GIF_ERR_NO_SCRN_DSCR:
- Err = "No screen descriptor detected";
- break;
- case D_GIF_ERR_NO_IMAG_DSCR:
- Err = "No Image Descriptor detected";
- break;
- case D_GIF_ERR_NO_COLOR_MAP:
- Err = "Neither global nor local color map";
- break;
- case D_GIF_ERR_WRONG_RECORD:
- Err = "Wrong record type detected";
- break;
- case D_GIF_ERR_DATA_TOO_BIG:
- Err = "Number of pixels bigger than width * height";
- break;
- case D_GIF_ERR_NOT_ENOUGH_MEM:
- Err = "Failed to allocate required memory";
- break;
- case D_GIF_ERR_CLOSE_FAILED:
- Err = "Failed to close given file";
- break;
- case D_GIF_ERR_NOT_READABLE:
- Err = "Given file was not opened for read";
- break;
- case D_GIF_ERR_IMAGE_DEFECT:
- Err = "Image is defective, decoding aborted";
- break;
- case D_GIF_ERR_EOF_TOO_SOON:
- Err = "Image EOF detected before image complete";
- break;
- default:
- Err = NULL;
- break;
- }
- return Err;
+ switch (ErrorCode) {
+ case E_GIF_ERR_OPEN_FAILED:
+ Err = "Failed to open given file";
+ break;
+ case E_GIF_ERR_WRITE_FAILED:
+ Err = "Failed to write to given file";
+ break;
+ case E_GIF_ERR_HAS_SCRN_DSCR:
+ Err = "Screen descriptor has already been set";
+ break;
+ case E_GIF_ERR_HAS_IMAG_DSCR:
+ Err = "Image descriptor is still active";
+ break;
+ case E_GIF_ERR_NO_COLOR_MAP:
+ Err = "Neither global nor local color map";
+ break;
+ case E_GIF_ERR_DATA_TOO_BIG:
+ Err = "Number of pixels bigger than width * height";
+ break;
+ case E_GIF_ERR_NOT_ENOUGH_MEM:
+ Err = "Failed to allocate required memory";
+ break;
+ case E_GIF_ERR_DISK_IS_FULL:
+ Err = "Write failed (disk full?)";
+ break;
+ case E_GIF_ERR_CLOSE_FAILED:
+ Err = "Failed to close given file";
+ break;
+ case E_GIF_ERR_NOT_WRITEABLE:
+ Err = "Given file was not opened for write";
+ break;
+ case D_GIF_ERR_OPEN_FAILED:
+ Err = "Failed to open given file";
+ break;
+ case D_GIF_ERR_READ_FAILED:
+ Err = "Failed to read from given file";
+ break;
+ case D_GIF_ERR_NOT_GIF_FILE:
+ Err = "Data is not in GIF format";
+ break;
+ case D_GIF_ERR_NO_SCRN_DSCR:
+ Err = "No screen descriptor detected";
+ break;
+ case D_GIF_ERR_NO_IMAG_DSCR:
+ Err = "No Image Descriptor detected";
+ break;
+ case D_GIF_ERR_NO_COLOR_MAP:
+ Err = "Neither global nor local color map";
+ break;
+ case D_GIF_ERR_WRONG_RECORD:
+ Err = "Wrong record type detected";
+ break;
+ case D_GIF_ERR_DATA_TOO_BIG:
+ Err = "Number of pixels bigger than width * height";
+ break;
+ case D_GIF_ERR_NOT_ENOUGH_MEM:
+ Err = "Failed to allocate required memory";
+ break;
+ case D_GIF_ERR_CLOSE_FAILED:
+ Err = "Failed to close given file";
+ break;
+ case D_GIF_ERR_NOT_READABLE:
+ Err = "Given file was not opened for read";
+ break;
+ case D_GIF_ERR_IMAGE_DEFECT:
+ Err = "Image is defective, decoding aborted";
+ break;
+ case D_GIF_ERR_EOF_TOO_SOON:
+ Err = "Image EOF detected before image complete";
+ break;
+ default:
+ Err = NULL;
+ break;
+ }
+ return Err;
}
/* end */
diff --git a/jdk/src/share/native/sun/awt/giflib/gif_hash.h b/jdk/src/share/native/sun/awt/giflib/gif_hash.h
index eb3cba3135..6cabd0866e 100644
--- a/jdk/src/share/native/sun/awt/giflib/gif_hash.h
+++ b/jdk/src/share/native/sun/awt/giflib/gif_hash.h
@@ -26,34 +26,37 @@
gif_hash.h - magfic constants and declarations for GIF LZW
+SPDX-License-Identifier: MIT
+
******************************************************************************/
-// SPDX-License-Identifier: MIT
#ifndef _GIF_HASH_H_
#define _GIF_HASH_H_
+/** Begin JDK modifications to support building on Windows **/
#ifndef _WIN32
#include <unistd.h>
-#endif /* _WIN32 */
+#endif
+/** End JDK modifications to support building on Windows **/
#include <stdint.h>
-#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
-#define HT_KEY_MASK 0x1FFF /* 13bits keys */
-#define HT_KEY_NUM_BITS 13 /* 13bits keys */
-#define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */
-#define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
+#define HT_SIZE 8192 /* 12bits = 4096 or twice as big! */
+#define HT_KEY_MASK 0x1FFF /* 13bits keys */
+#define HT_KEY_NUM_BITS 13 /* 13bits keys */
+#define HT_MAX_KEY 8191 /* 13bits - 1, maximal code possible */
+#define HT_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
/* The 32 bits of the long are divided into two parts for the key & code: */
/* 1. The code is 12 bits as our compression algorithm is limited to 12bits */
/* 2. The key is 12 bits Prefix code + 8 bit new char or 20 bits. */
/* The key is the upper 20 bits. The code is the lower 12. */
-#define HT_GET_KEY(l) (l >> 12)
-#define HT_GET_CODE(l) (l & 0x0FFF)
-#define HT_PUT_KEY(l) (l << 12)
-#define HT_PUT_CODE(l) (l & 0x0FFF)
+#define HT_GET_KEY(l) (l >> 12)
+#define HT_GET_CODE(l) (l & 0x0FFF)
+#define HT_PUT_KEY(l) (l << 12)
+#define HT_PUT_CODE(l) (l & 0x0FFF)
typedef struct GifHashTableType {
- uint32_t HTable[HT_SIZE];
+ uint32_t HTable[HT_SIZE];
} GifHashTableType;
GifHashTableType *_InitHashTable(void);
diff --git a/jdk/src/share/native/sun/awt/giflib/gif_lib.h b/jdk/src/share/native/sun/awt/giflib/gif_lib.h
index 449fe3c2fc..f739b36adf 100644
--- a/jdk/src/share/native/sun/awt/giflib/gif_lib.h
+++ b/jdk/src/share/native/sun/awt/giflib/gif_lib.h
@@ -37,32 +37,29 @@ SPDX-License-Identifier: MIT
extern "C" {
#endif /* __cplusplus */
-#define GIFLIB_MAJOR 6
-#define GIFLIB_MINOR 1
-#define GIFLIB_RELEASE 2
+#define GIFLIB_MAJOR 5
+#define GIFLIB_MINOR 2
+#define GIFLIB_RELEASE 1
-#define GIF_ERROR 0
-#define GIF_OK 1
+#define GIF_ERROR 0
+#define GIF_OK 1
#include <stddef.h>
/** Begin JDK modifications to support building using old compilers**/
-#ifndef _WIN32
-#include <stdbool.h>
-#else
+//#include <stdbool.h>
#ifdef bool
#undef bool
#endif
typedef int bool;
#define false 0
#define true 1
-#endif
/** End JDK modifications to support building using old compilers**/
-#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
+#define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
#define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
-#define GIF_VERSION_POS 3 /* Version first character in stamp. */
-#define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */
-#define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */
+#define GIF_VERSION_POS 3 /* Version first character in stamp. */
+#define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */
+#define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */
typedef unsigned char GifPixelType;
typedef unsigned char *GifRowType;
@@ -71,88 +68,88 @@ typedef unsigned int GifPrefixType;
typedef int GifWord;
typedef struct GifColorType {
- GifByteType Red, Green, Blue;
+ GifByteType Red, Green, Blue;
} GifColorType;
typedef struct ColorMapObject {
- int ColorCount;
- int BitsPerPixel;
- bool SortFlag;
- GifColorType *Colors; /* on malloc(3) heap */
+ int ColorCount;
+ int BitsPerPixel;
+ bool SortFlag;
+ GifColorType *Colors; /* on malloc(3) heap */
} ColorMapObject;
typedef struct GifImageDesc {
- GifWord Left, Top, Width, Height; /* Current image dimensions. */
- bool Interlace; /* Sequential/Interlaced lines. */
- ColorMapObject *ColorMap; /* The local color map */
+ GifWord Left, Top, Width, Height; /* Current image dimensions. */
+ bool Interlace; /* Sequential/Interlaced lines. */
+ ColorMapObject *ColorMap; /* The local color map */
} GifImageDesc;
typedef struct ExtensionBlock {
- int ByteCount;
- GifByteType *Bytes; /* on malloc(3) heap */
- int Function; /* The block function code */
-#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */
-#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */
-#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */
-#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */
-#define APPLICATION_EXT_FUNC_CODE 0xff /* application block (GIF89) */
+ int ByteCount;
+ GifByteType *Bytes; /* on malloc(3) heap */
+ int Function; /* The block function code */
+#define CONTINUE_EXT_FUNC_CODE 0x00 /* continuation subblock */
+#define COMMENT_EXT_FUNC_CODE 0xfe /* comment */
+#define GRAPHICS_EXT_FUNC_CODE 0xf9 /* graphics control (GIF89) */
+#define PLAINTEXT_EXT_FUNC_CODE 0x01 /* plaintext */
+#define APPLICATION_EXT_FUNC_CODE 0xff /* application block (GIF89) */
} ExtensionBlock;
typedef struct SavedImage {
- GifImageDesc ImageDesc;
- GifByteType *RasterBits; /* on malloc(3) heap */
- int ExtensionBlockCount; /* Count of extensions before image */
- ExtensionBlock *ExtensionBlocks; /* Extensions before image */
+ GifImageDesc ImageDesc;
+ GifByteType *RasterBits; /* on malloc(3) heap */
+ int ExtensionBlockCount; /* Count of extensions before image */
+ ExtensionBlock *ExtensionBlocks; /* Extensions before image */
} SavedImage;
typedef struct GifFileType {
- GifWord SWidth, SHeight; /* Size of virtual canvas */
- GifWord SColorResolution; /* How many colors can we generate? */
- GifWord SBackGroundColor; /* Background color for virtual canvas */
- GifByteType AspectByte; /* Used to compute pixel aspect ratio */
- ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */
- int ImageCount; /* Number of current image (both APIs) */
- GifImageDesc Image; /* Current image (low-level API) */
- SavedImage *SavedImages; /* Image sequence (high-level API) */
- int ExtensionBlockCount; /* Count extensions past last image */
- ExtensionBlock *ExtensionBlocks; /* Extensions past last image */
- int Error; /* Last error condition reported */
- void *UserData; /* hook to attach user data (TVT) */
- void *Private; /* Don't mess with this! */
+ GifWord SWidth, SHeight; /* Size of virtual canvas */
+ GifWord SColorResolution; /* How many colors can we generate? */
+ GifWord SBackGroundColor; /* Background color for virtual canvas */
+ GifByteType AspectByte; /* Used to compute pixel aspect ratio */
+ ColorMapObject *SColorMap; /* Global colormap, NULL if nonexistent. */
+ int ImageCount; /* Number of current image (both APIs) */
+ GifImageDesc Image; /* Current image (low-level API) */
+ SavedImage *SavedImages; /* Image sequence (high-level API) */
+ int ExtensionBlockCount; /* Count extensions past last image */
+ ExtensionBlock *ExtensionBlocks; /* Extensions past last image */
+ int Error; /* Last error condition reported */
+ void *UserData; /* hook to attach user data (TVT) */
+ void *Private; /* Don't mess with this! */
} GifFileType;
-#define GIF_ASPECT_RATIO(n) ((n) + 15.0 / 64.0)
+#define GIF_ASPECT_RATIO(n) ((n)+15.0/64.0)
typedef enum {
- UNDEFINED_RECORD_TYPE,
- SCREEN_DESC_RECORD_TYPE,
- IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */
- EXTENSION_RECORD_TYPE, /* Begin with '!' */
- TERMINATE_RECORD_TYPE /* Begin with ';' */
+ UNDEFINED_RECORD_TYPE,
+ SCREEN_DESC_RECORD_TYPE,
+ IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */
+ EXTENSION_RECORD_TYPE, /* Begin with '!' */
+ TERMINATE_RECORD_TYPE /* Begin with ';' */
} GifRecordType;
/* func type to read gif data from arbitrary sources (TVT) */
-typedef int (*InputFunc)(GifFileType *, GifByteType *, int);
+typedef int (*InputFunc) (GifFileType *, GifByteType *, int);
/* func type to write gif data to arbitrary targets.
* Returns count of bytes written. (MRB)
*/
-typedef int (*OutputFunc)(GifFileType *, const GifByteType *, int);
+typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int);
/******************************************************************************
GIF89 structures
******************************************************************************/
typedef struct GraphicsControlBlock {
- int DisposalMode;
-#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */
-#define DISPOSE_DO_NOT 1 /* Leave image in place */
-#define DISPOSE_BACKGROUND 2 /* Set area too background color */
-#define DISPOSE_PREVIOUS 3 /* Restore to previous content */
- bool UserInputFlag; /* User confirmation required before disposal */
- int DelayTime; /* pre-display delay in 0.01sec units */
- int TransparentColor; /* Palette index for transparency, -1 if none */
-#define NO_TRANSPARENT_COLOR -1
+ int DisposalMode;
+#define DISPOSAL_UNSPECIFIED 0 /* No disposal specified. */
+#define DISPOSE_DO_NOT 1 /* Leave image in place */
+#define DISPOSE_BACKGROUND 2 /* Set area too background color */
+#define DISPOSE_PREVIOUS 3 /* Restore to previous content */
+ bool UserInputFlag; /* User confirmation required before disposal */
+ int DelayTime; /* pre-display delay in 0.01sec units */
+ int TransparentColor; /* Palette index for transparency, -1 if none */
+#define NO_TRANSPARENT_COLOR -1
} GraphicsControlBlock;
/******************************************************************************
@@ -164,44 +161,49 @@ GifFileType *EGifOpenFileName(const char *GifFileName,
const bool GifTestExistence, int *Error);
GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error);
GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error);
-int EGifSpew(GifFileType *GifFile, int *ErrorCode);
+int EGifSpew(GifFileType * GifFile);
const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */
int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
-#define E_GIF_SUCCEEDED 0
-#define E_GIF_ERR_OPEN_FAILED 201 /* And EGif possible errors. */
-#define E_GIF_ERR_WRITE_FAILED 202
-#define E_GIF_ERR_HAS_SCRN_DSCR 203
-#define E_GIF_ERR_HAS_IMAG_DSCR 204
-#define E_GIF_ERR_NO_COLOR_MAP 205
-#define E_GIF_ERR_DATA_TOO_BIG 206
-#define E_GIF_ERR_NOT_ENOUGH_MEM 207
-#define E_GIF_ERR_DISK_IS_FULL 208
-#define E_GIF_ERR_CLOSE_FAILED 209
-#define E_GIF_ERR_NOT_WRITEABLE 210
+#define E_GIF_SUCCEEDED 0
+#define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */
+#define E_GIF_ERR_WRITE_FAILED 2
+#define E_GIF_ERR_HAS_SCRN_DSCR 3
+#define E_GIF_ERR_HAS_IMAG_DSCR 4
+#define E_GIF_ERR_NO_COLOR_MAP 5
+#define E_GIF_ERR_DATA_TOO_BIG 6
+#define E_GIF_ERR_NOT_ENOUGH_MEM 7
+#define E_GIF_ERR_DISK_IS_FULL 8
+#define E_GIF_ERR_CLOSE_FAILED 9
+#define E_GIF_ERR_NOT_WRITEABLE 10
/* These are legacy. You probably do not want to call them directly */
-int EGifPutScreenDesc(GifFileType *GifFile, const int GifWidth,
- const int GifHeight, const int GifColorRes,
+int EGifPutScreenDesc(GifFileType *GifFile,
+ const int GifWidth, const int GifHeight,
+ const int GifColorRes,
const int GifBackGround,
const ColorMapObject *GifColorMap);
-int EGifPutImageDesc(GifFileType *GifFile, const int GifLeft, const int GifTop,
+int EGifPutImageDesc(GifFileType *GifFile,
+ const int GifLeft, const int GifTop,
const int GifWidth, const int GifHeight,
const bool GifInterlace,
const ColorMapObject *GifColorMap);
void EGifSetGifVersion(GifFileType *GifFile, const bool gif89);
-int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
+int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine,
+ int GifLineLen);
int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel);
int EGifPutComment(GifFileType *GifFile, const char *GifComment);
int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode);
-int EGifPutExtensionBlock(GifFileType *GifFile, const int GifExtLen,
- const void *GifExtension);
+int EGifPutExtensionBlock(GifFileType *GifFile,
+ const int GifExtLen, const void *GifExtension);
int EGifPutExtensionTrailer(GifFileType *GifFile);
int EGifPutExtension(GifFileType *GifFile, const int GifExtCode,
- const int GifExtLen, const void *GifExtension);
+ const int GifExtLen,
+ const void *GifExtension);
int EGifPutCode(GifFileType *GifFile, int GifCodeSize,
const GifByteType *GifCodeBlock);
-int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock);
+int EGifPutCodeNext(GifFileType *GifFile,
+ const GifByteType *GifCodeBlock);
/******************************************************************************
GIF decoding routines
@@ -210,25 +212,24 @@ int EGifPutCodeNext(GifFileType *GifFile, const GifByteType *GifCodeBlock);
/* Main entry points */
GifFileType *DGifOpenFileName(const char *GifFileName, int *Error);
GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error);
-int DGifSlurp(GifFileType *GifFile);
-GifFileType *DGifOpen(void *userPtr, InputFunc readFunc,
- int *Error); /* new one (TVT) */
-int DGifCloseFile(GifFileType *GifFile, int *ErrorCode);
-
-#define D_GIF_SUCCEEDED 0
-#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */
-#define D_GIF_ERR_READ_FAILED 102
-#define D_GIF_ERR_NOT_GIF_FILE 103
-#define D_GIF_ERR_NO_SCRN_DSCR 104
-#define D_GIF_ERR_NO_IMAG_DSCR 105
-#define D_GIF_ERR_NO_COLOR_MAP 106
-#define D_GIF_ERR_WRONG_RECORD 107
-#define D_GIF_ERR_DATA_TOO_BIG 108
+int DGifSlurp(GifFileType * GifFile);
+GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */
+ int DGifCloseFile(GifFileType * GifFile, int *ErrorCode);
+
+#define D_GIF_SUCCEEDED 0
+#define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */
+#define D_GIF_ERR_READ_FAILED 102
+#define D_GIF_ERR_NOT_GIF_FILE 103
+#define D_GIF_ERR_NO_SCRN_DSCR 104
+#define D_GIF_ERR_NO_IMAG_DSCR 105
+#define D_GIF_ERR_NO_COLOR_MAP 106
+#define D_GIF_ERR_WRONG_RECORD 107
+#define D_GIF_ERR_DATA_TOO_BIG 108
#define D_GIF_ERR_NOT_ENOUGH_MEM 109
-#define D_GIF_ERR_CLOSE_FAILED 110
-#define D_GIF_ERR_NOT_READABLE 111
-#define D_GIF_ERR_IMAGE_DEFECT 112
-#define D_GIF_ERR_EOF_TOO_SOON 113
+#define D_GIF_ERR_CLOSE_FAILED 110
+#define D_GIF_ERR_NOT_READABLE 111
+#define D_GIF_ERR_IMAGE_DEFECT 112
+#define D_GIF_ERR_EOF_TOO_SOON 113
/* These are legacy. You probably do not want to call them directly */
int DGifGetScreenDesc(GifFileType *GifFile);
@@ -246,10 +247,11 @@ int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
const char *DGifGetGifVersion(GifFileType *GifFile);
+
/******************************************************************************
Error handling and reporting.
******************************************************************************/
-extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
+extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
/*****************************************************************************
Everything below this point is new after version 1.2, supporting `slurp
@@ -261,26 +263,26 @@ extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
******************************************************************************/
extern ColorMapObject *GifMakeMapObject(int ColorCount,
- const GifColorType *ColorMap);
+ const GifColorType *ColorMap);
extern void GifFreeMapObject(ColorMapObject *Object);
extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
- const ColorMapObject *ColorIn2,
- GifPixelType ColorTransIn2[]);
+ const ColorMapObject *ColorIn2,
+ GifPixelType ColorTransIn2[]);
extern int GifBitSize(int n);
/******************************************************************************
Support for the in-core structures allocation (slurp mode).
******************************************************************************/
-extern void GifApplyTranslation(SavedImage *Image,
- const GifPixelType Translation[]);
+extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
extern int GifAddExtensionBlock(int *ExtensionBlock_Count,
- ExtensionBlock **ExtensionBlocks, int Function,
+ ExtensionBlock **ExtensionBlocks,
+ int Function,
unsigned int Len, unsigned char ExtData[]);
extern void GifFreeExtensions(int *ExtensionBlock_Count,
ExtensionBlock **ExtensionBlocks);
extern SavedImage *GifMakeSavedImage(GifFileType *GifFile,
- const SavedImage *CopyFrom);
+ const SavedImage *CopyFrom);
extern void GifFreeSavedImages(GifFileType *GifFile);
/******************************************************************************
@@ -293,31 +295,37 @@ int DGifExtensionToGCB(const size_t GifExtensionLength,
size_t EGifGCBToExtension(const GraphicsControlBlock *GCB,
GifByteType *GifExtension);
-int DGifSavedExtensionToGCB(GifFileType *GifFile, int ImageIndex,
+int DGifSavedExtensionToGCB(GifFileType *GifFile,
+ int ImageIndex,
GraphicsControlBlock *GCB);
int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB,
- GifFileType *GifFile, int ImageIndex);
+ GifFileType *GifFile,
+ int ImageIndex);
/******************************************************************************
The library's internal utility font
******************************************************************************/
-#define GIF_FONT_WIDTH 8
+#define GIF_FONT_WIDTH 8
#define GIF_FONT_HEIGHT 8
extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH];
-extern void GifDrawText8x8(SavedImage *Image, const int x, const int y,
- const char *legend, const int color);
+extern void GifDrawText8x8(SavedImage *Image,
+ const int x, const int y,
+ const char *legend, const int color);
-extern void GifDrawBox(SavedImage *Image, const int x, const int y, const int w,
- const int d, const int color);
+extern void GifDrawBox(SavedImage *Image,
+ const int x, const int y,
+ const int w, const int d, const int color);
-extern void GifDrawRectangle(SavedImage *Image, const int x, const int y,
- const int w, const int d, const int color);
+extern void GifDrawRectangle(SavedImage *Image,
+ const int x, const int y,
+ const int w, const int d, const int color);
-extern void GifDrawBoxedText8x8(SavedImage *Image, const int x, const int y,
- const char *legend, const int border,
- const int bg, const int fg);
+extern void GifDrawBoxedText8x8(SavedImage *Image,
+ const int x, const int y,
+ const char *legend,
+ const int border, const int bg, const int fg);
#ifdef __cplusplus
}
diff --git a/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h b/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h
index 079d05898b..4f832676ff 100644
--- a/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h
+++ b/jdk/src/share/native/sun/awt/giflib/gif_lib_private.h
@@ -33,57 +33,55 @@ SPDX-License-Identifier: MIT
#ifndef _GIF_LIB_PRIVATE_H
#define _GIF_LIB_PRIVATE_H
-#include "gif_hash.h"
#include "gif_lib.h"
+#include "gif_hash.h"
#ifndef SIZE_MAX
-#define SIZE_MAX UINTPTR_MAX
+ #define SIZE_MAX UINTPTR_MAX
#endif
-#define EXTENSION_INTRODUCER 0x21
-#define DESCRIPTOR_INTRODUCER 0x2c
-#define TERMINATOR_INTRODUCER 0x3b
+#define EXTENSION_INTRODUCER 0x21
+#define DESCRIPTOR_INTRODUCER 0x2c
+#define TERMINATOR_INTRODUCER 0x3b
-#define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
-#define LZ_BITS 12
+#define LZ_MAX_CODE 4095 /* Biggest code possible in 12 bits. */
+#define LZ_BITS 12
-#define FLUSH_OUTPUT 4096 /* Impossible code, to signal flush. */
-#define FIRST_CODE 4097 /* Impossible code, to signal first. */
-#define NO_SUCH_CODE 4098 /* Impossible code, to signal empty. */
+#define FLUSH_OUTPUT 4096 /* Impossible code, to signal flush. */
+#define FIRST_CODE 4097 /* Impossible code, to signal first. */
+#define NO_SUCH_CODE 4098 /* Impossible code, to signal empty. */
-#define FILE_STATE_WRITE 0x01
-#define FILE_STATE_SCREEN 0x02
-#define FILE_STATE_IMAGE 0x04
-#define FILE_STATE_READ 0x08
+#define FILE_STATE_WRITE 0x01
+#define FILE_STATE_SCREEN 0x02
+#define FILE_STATE_IMAGE 0x04
+#define FILE_STATE_READ 0x08
-#define IS_READABLE(Private) (Private->FileState & FILE_STATE_READ)
-#define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE)
+#define IS_READABLE(Private) (Private->FileState & FILE_STATE_READ)
+#define IS_WRITEABLE(Private) (Private->FileState & FILE_STATE_WRITE)
typedef struct GifFilePrivateType {
- GifWord FileState, FileHandle, /* Where all this data goes to! */
- BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */
- ClearCode, /* The CLEAR LZ code. */
- EOFCode, /* The EOF LZ code. */
- RunningCode, /* The next code algorithm can generate. */
- RunningBits, /* The number of bits required to represent
- RunningCode. */
- MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits.
- */
- LastCode, /* The code before the current code. */
- CrntCode, /* Current algorithm code. */
- StackPtr, /* For character stack (see below). */
- CrntShiftState; /* Number of bits in CrntShiftDWord. */
- unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */
- unsigned long PixelCount; /* Number of pixels in image. */
- FILE *File; /* File as stream. */
- InputFunc Read; /* function to read gif input (TVT) */
- OutputFunc Write; /* function to write gif output (MRB) */
- GifByteType Buf[256]; /* Compressed input is buffered here. */
- GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */
- GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */
- GifPrefixType Prefix[LZ_MAX_CODE + 1];
- GifHashTableType *HashTable;
- bool gif89;
+ GifWord FileState, FileHandle, /* Where all this data goes to! */
+ BitsPerPixel, /* Bits per pixel (Codes uses at least this + 1). */
+ ClearCode, /* The CLEAR LZ code. */
+ EOFCode, /* The EOF LZ code. */
+ RunningCode, /* The next code algorithm can generate. */
+ RunningBits, /* The number of bits required to represent RunningCode. */
+ MaxCode1, /* 1 bigger than max. possible code, in RunningBits bits. */
+ LastCode, /* The code before the current code. */
+ CrntCode, /* Current algorithm code. */
+ StackPtr, /* For character stack (see below). */
+ CrntShiftState; /* Number of bits in CrntShiftDWord. */
+ unsigned long CrntShiftDWord; /* For bytes decomposition into codes. */
+ unsigned long PixelCount; /* Number of pixels in image. */
+ FILE *File; /* File as stream. */
+ InputFunc Read; /* function to read gif input (TVT) */
+ OutputFunc Write; /* function to write gif output (MRB) */
+ GifByteType Buf[256]; /* Compressed input is buffered here. */
+ GifByteType Stack[LZ_MAX_CODE]; /* Decoded pixels are stacked here. */
+ GifByteType Suffix[LZ_MAX_CODE + 1]; /* So we can trace the codes. */
+ GifPrefixType Prefix[LZ_MAX_CODE + 1];
+ GifHashTableType *HashTable;
+ bool gif89;
} GifFilePrivateType;
#ifndef HAVE_REALLOCARRAY
diff --git a/jdk/src/share/native/sun/awt/giflib/gifalloc.c b/jdk/src/share/native/sun/awt/giflib/gifalloc.c
index 25e0391449..75b74b4fba 100644
--- a/jdk/src/share/native/sun/awt/giflib/gifalloc.c
+++ b/jdk/src/share/native/sun/awt/giflib/gifalloc.c
@@ -26,102 +26,107 @@
GIF construction tools
+SPDX-License-Identifier: MIT
+
****************************************************************************/
-// SPDX-License-Identifier: MIT
-// SPDX-FileCopyrightText: Copyright (C) Eric S. Raymond <esr@thyrsus.com>
-#include <stdio.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#include "gif_lib.h"
#include "gif_lib_private.h"
-#define MAX(x, y) (((x) > (y)) ? (x) : (y))
+#define MAX(x, y) (((x) > (y)) ? (x) : (y))
/******************************************************************************
Miscellaneous utility functions
******************************************************************************/
/* return smallest bitfield size n will fit in */
-int GifBitSize(int n) {
- register int i;
-
- for (i = 1; i <= 8; i++) {
- if ((1 << i) >= n) {
- break;
- }
- }
- return (i);
+int
+GifBitSize(int n)
+{
+ register int i;
+
+ for (i = 1; i <= 8; i++)
+ if ((1 << i) >= n)
+ break;
+ return (i);
}
/******************************************************************************
- Color map object functions
+ Color map object functions
******************************************************************************/
/*
* Allocate a color map of given size; initialize with contents of
* ColorMap if that pointer is non-NULL.
*/
-ColorMapObject *GifMakeMapObject(int ColorCount, const GifColorType *ColorMap) {
- ColorMapObject *Object;
-
- /*** FIXME: Our ColorCount has to be a power of two. Is it necessary to
- * make the user know that or should we automatically round up instead?
- */
- if (ColorCount != (1 << GifBitSize(ColorCount))) {
- return ((ColorMapObject *)NULL);
- }
-
- Object = (ColorMapObject *)malloc(sizeof(ColorMapObject));
- if (Object == (ColorMapObject *)NULL) {
- return ((ColorMapObject *)NULL);
- }
-
- Object->Colors =
- (GifColorType *)calloc(ColorCount, sizeof(GifColorType));
- if (Object->Colors == (GifColorType *)NULL) {
- free(Object);
- return ((ColorMapObject *)NULL);
- }
-
- Object->ColorCount = ColorCount;
- Object->BitsPerPixel = GifBitSize(ColorCount);
- Object->SortFlag = false;
-
- if (ColorMap != NULL) {
- memcpy((char *)Object->Colors, (char *)ColorMap,
- ColorCount * sizeof(GifColorType));
- }
-
- return (Object);
+ColorMapObject *
+GifMakeMapObject(int ColorCount, const GifColorType *ColorMap)
+{
+ ColorMapObject *Object;
+
+ /*** FIXME: Our ColorCount has to be a power of two. Is it necessary to
+ * make the user know that or should we automatically round up instead? */
+ if (ColorCount != (1 << GifBitSize(ColorCount))) {
+ return ((ColorMapObject *) NULL);
+ }
+
+ Object = (ColorMapObject *)malloc(sizeof(ColorMapObject));
+ if (Object == (ColorMapObject *) NULL) {
+ return ((ColorMapObject *) NULL);
+ }
+
+ Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType));
+ if (Object->Colors == (GifColorType *) NULL) {
+ free(Object);
+ return ((ColorMapObject *) NULL);
+ }
+
+ Object->ColorCount = ColorCount;
+ Object->BitsPerPixel = GifBitSize(ColorCount);
+ Object->SortFlag = false;
+
+ if (ColorMap != NULL) {
+ memcpy((char *)Object->Colors,
+ (char *)ColorMap, ColorCount * sizeof(GifColorType));
+ }
+
+ return (Object);
}
/*******************************************************************************
- Free a color map object
+Free a color map object
*******************************************************************************/
-void GifFreeMapObject(ColorMapObject *Object) {
- if (Object != NULL) {
- (void)free(Object->Colors);
- (void)free(Object);
- }
+void
+GifFreeMapObject(ColorMapObject *Object)
+{
+ if (Object != NULL) {
+ (void)free(Object->Colors);
+ (void)free(Object);
+ }
}
#ifdef DEBUG
-void DumpColorMap(ColorMapObject *Object, FILE *fp) {
- if (Object != NULL) {
- int i, j, Len = Object->ColorCount;
-
- for (i = 0; i < Len; i += 4) {
- for (j = 0; j < 4 && j < Len; j++) {
- (void)fprintf(fp, "%3d: %02x %02x %02x ",
- i + j, Object->Colors[i + j].Red,
- Object->Colors[i + j].Green,
- Object->Colors[i + j].Blue);
- }
- (void)fprintf(fp, "\n");
- }
+void
+DumpColorMap(ColorMapObject *Object,
+ FILE * fp)
+{
+ if (Object != NULL) {
+ int i, j, Len = Object->ColorCount;
+
+ for (i = 0; i < Len; i += 4) {
+ for (j = 0; j < 4 && j < Len; j++) {
+ (void)fprintf(fp, "%3d: %02x %02x %02x ", i + j,
+ Object->Colors[i + j].Red,
+ Object->Colors[i + j].Green,
+ Object->Colors[i + j].Blue);
+ }
+ (void)fprintf(fp, "\n");
}
+ }
}
#endif /* DEBUG */
@@ -132,344 +137,308 @@ void DumpColorMap(ColorMapObject *Object, FILE *fp) {
copied iff they didn't exist before. ColorTransIn2 maps the old
ColorIn2 into the ColorUnion color map table./
*******************************************************************************/
-ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
- const ColorMapObject *ColorIn2,
- GifPixelType ColorTransIn2[]) {
- int i, j, CrntSlot, RoundUpTo, NewGifBitSize;
- ColorMapObject *ColorUnion;
-
- /*
- * We don't worry about duplicates within either color map; if
- * the caller wants to resolve those, he can perform unions
- * with an empty color map.
- */
+ColorMapObject *
+GifUnionColorMap(const ColorMapObject *ColorIn1,
+ const ColorMapObject *ColorIn2,
+ GifPixelType ColorTransIn2[])
+{
+ int i, j, CrntSlot, RoundUpTo, NewGifBitSize;
+ ColorMapObject *ColorUnion;
+
+ /*
+ * We don't worry about duplicates within either color map; if
+ * the caller wants to resolve those, he can perform unions
+ * with an empty color map.
+ */
+
+ /* Allocate table which will hold the result for sure. */
+ ColorUnion = GifMakeMapObject(MAX(ColorIn1->ColorCount,
+ ColorIn2->ColorCount) * 2, NULL);
+
+ if (ColorUnion == NULL)
+ return (NULL);
+
+ /*
+ * Copy ColorIn1 to ColorUnion.
+ */
+ for (i = 0; i < ColorIn1->ColorCount; i++)
+ ColorUnion->Colors[i] = ColorIn1->Colors[i];
+ CrntSlot = ColorIn1->ColorCount;
+
+ /*
+ * Potentially obnoxious hack:
+ *
+ * Back CrntSlot down past all contiguous {0, 0, 0} slots at the end
+ * of table 1. This is very useful if your display is limited to
+ * 16 colors.
+ */
+ while (ColorIn1->Colors[CrntSlot - 1].Red == 0
+ && ColorIn1->Colors[CrntSlot - 1].Green == 0
+ && ColorIn1->Colors[CrntSlot - 1].Blue == 0)
+ CrntSlot--;
+
+ /* Copy ColorIn2 to ColorUnion (use old colors if they exist): */
+ for (i = 0; i < ColorIn2->ColorCount && CrntSlot <= 256; i++) {
+ /* Let's see if this color already exists: */
+ for (j = 0; j < ColorIn1->ColorCount; j++)
+ if (memcmp (&ColorIn1->Colors[j], &ColorIn2->Colors[i],
+ sizeof(GifColorType)) == 0)
+ break;
+
+ if (j < ColorIn1->ColorCount)
+ ColorTransIn2[i] = j; /* color exists in Color1 */
+ else {
+ /* Color is new - copy it to a new slot: */
+ ColorUnion->Colors[CrntSlot] = ColorIn2->Colors[i];
+ ColorTransIn2[i] = CrntSlot++;
+ }
+ }
- /* Allocate table which will hold the result for sure. */
- ColorUnion = GifMakeMapObject(
- MAX(ColorIn1->ColorCount, ColorIn2->ColorCount) * 2, NULL);
+ if (CrntSlot > 256) {
+ GifFreeMapObject(ColorUnion);
+ return ((ColorMapObject *) NULL);
+ }
- if (ColorUnion == NULL) {
- return (NULL);
- }
+ NewGifBitSize = GifBitSize(CrntSlot);
+ RoundUpTo = (1 << NewGifBitSize);
- /*
- * Copy ColorIn1 to ColorUnion.
- */
- for (i = 0; i < ColorIn1->ColorCount; i++) {
- ColorUnion->Colors[i] = ColorIn1->Colors[i];
- }
- CrntSlot = ColorIn1->ColorCount;
+ if (RoundUpTo != ColorUnion->ColorCount) {
+ register GifColorType *Map = ColorUnion->Colors;
/*
- * Potentially obnoxious hack:
- *
- * Back CrntSlot down past all contiguous {0, 0, 0} slots at the end
- * of table 1. This is very useful if your display is limited to
- * 16 colors.
+ * Zero out slots up to next power of 2.
+ * We know these slots exist because of the way ColorUnion's
+ * start dimension was computed.
*/
- while (ColorIn1->Colors[CrntSlot - 1].Red == 0 &&
- ColorIn1->Colors[CrntSlot - 1].Green == 0 &&
- ColorIn1->Colors[CrntSlot - 1].Blue == 0) {
- CrntSlot--;
- }
-
- /* Copy ColorIn2 to ColorUnion (use old colors if they exist): */
- for (i = 0; i < ColorIn2->ColorCount && CrntSlot <= 256; i++) {
- /* Let's see if this color already exists: */
- for (j = 0; j < ColorIn1->ColorCount; j++) {
- if (memcmp(&ColorIn1->Colors[j], &ColorIn2->Colors[i],
- sizeof(GifColorType)) == 0) {
- break;
- }
- }
-
- if (j < ColorIn1->ColorCount) {
- ColorTransIn2[i] = j; /* color exists in Color1 */
- } else {
- /* Color is new - copy it to a new slot: */
- ColorUnion->Colors[CrntSlot] = ColorIn2->Colors[i];
- ColorTransIn2[i] = CrntSlot++;
- }
- }
-
- if (CrntSlot > 256) {
+ for (j = CrntSlot; j < RoundUpTo; j++)
+ Map[j].Red = Map[j].Green = Map[j].Blue = 0;
+
+ /* perhaps we can shrink the map? */
+ if (RoundUpTo < ColorUnion->ColorCount) {
+ GifColorType *new_map = (GifColorType *)reallocarray(Map,
+ RoundUpTo, sizeof(GifColorType));
+ if( new_map == NULL ) {
GifFreeMapObject(ColorUnion);
- return ((ColorMapObject *)NULL);
- }
-
- NewGifBitSize = GifBitSize(CrntSlot);
- RoundUpTo = (1 << NewGifBitSize);
-
- if (RoundUpTo != ColorUnion->ColorCount) {
- register GifColorType *Map = ColorUnion->Colors;
-
- /*
- * Zero out slots up to next power of 2.
- * We know these slots exist because of the way ColorUnion's
- * start dimension was computed.
- */
- for (j = CrntSlot; j < RoundUpTo; j++) {
- Map[j].Red = Map[j].Green = Map[j].Blue = 0;
- }
-
- /* perhaps we can shrink the map? */
- if (RoundUpTo < ColorUnion->ColorCount) {
- GifColorType *new_map = (GifColorType *)reallocarray(
- Map, RoundUpTo, sizeof(GifColorType));
- if (new_map == NULL) {
- GifFreeMapObject(ColorUnion);
- return ((ColorMapObject *)NULL);
- }
- ColorUnion->Colors = new_map;
- }
+ return ((ColorMapObject *) NULL);
+ }
+ ColorUnion->Colors = new_map;
}
+ }
- ColorUnion->ColorCount = RoundUpTo;
- ColorUnion->BitsPerPixel = NewGifBitSize;
+ ColorUnion->ColorCount = RoundUpTo;
+ ColorUnion->BitsPerPixel = NewGifBitSize;
- return (ColorUnion);
+ return (ColorUnion);
}
/*******************************************************************************
Apply a given color translation to the raster bits of an image
*******************************************************************************/
-void GifApplyTranslation(SavedImage *Image, const GifPixelType Translation[]) {
- register int i;
- register int RasterSize =
- Image->ImageDesc.Height * Image->ImageDesc.Width;
-
- for (i = 0; i < RasterSize; i++) {
- Image->RasterBits[i] = Translation[Image->RasterBits[i]];
- }
+void
+GifApplyTranslation(SavedImage *Image, GifPixelType Translation[])
+{
+ register int i;
+ register int RasterSize = Image->ImageDesc.Height * Image->ImageDesc.Width;
+
+ for (i = 0; i < RasterSize; i++)
+ Image->RasterBits[i] = Translation[Image->RasterBits[i]];
}
/******************************************************************************
Extension record functions
******************************************************************************/
-int GifAddExtensionBlock(int *ExtensionBlockCount,
- ExtensionBlock **ExtensionBlocks, int Function,
- unsigned int Len, unsigned char ExtData[]) {
- ExtensionBlock *ep;
-
- if (*ExtensionBlocks == NULL) {
- *ExtensionBlocks =
- (ExtensionBlock *)malloc(sizeof(ExtensionBlock));
- } else {
- ExtensionBlock *ep_new = (ExtensionBlock *)reallocarray(
- *ExtensionBlocks, (*ExtensionBlockCount + 1),
- sizeof(ExtensionBlock));
- if (ep_new == NULL) {
- return (GIF_ERROR);
- }
- *ExtensionBlocks = ep_new;
- }
-
- if (*ExtensionBlocks == NULL) {
- return (GIF_ERROR);
- }
-
- ep = &(*ExtensionBlocks)[(*ExtensionBlockCount)++];
-
- ep->Function = Function;
- ep->ByteCount = Len;
- ep->Bytes = (GifByteType *)malloc(ep->ByteCount);
- if (ep->Bytes == NULL) {
- return (GIF_ERROR);
- }
-
- if (ExtData != NULL) {
- memcpy(ep->Bytes, ExtData, Len);
- }
-
- return (GIF_OK);
+int
+GifAddExtensionBlock(int *ExtensionBlockCount,
+ ExtensionBlock **ExtensionBlocks,
+ int Function,
+ unsigned int Len,
+ unsigned char ExtData[])
+{
+ ExtensionBlock *ep;
+
+ if (*ExtensionBlocks == NULL)
+ *ExtensionBlocks=(ExtensionBlock *)malloc(sizeof(ExtensionBlock));
+ else {
+ ExtensionBlock* ep_new = (ExtensionBlock *)reallocarray
+ (*ExtensionBlocks, (*ExtensionBlockCount + 1),
+ sizeof(ExtensionBlock));
+ if( ep_new == NULL )
+ return (GIF_ERROR);
+ *ExtensionBlocks = ep_new;
+ }
+
+ if (*ExtensionBlocks == NULL)
+ return (GIF_ERROR);
+
+ ep = &(*ExtensionBlocks)[(*ExtensionBlockCount)++];
+
+ ep->Function = Function;
+ ep->ByteCount=Len;
+ ep->Bytes = (GifByteType *)malloc(ep->ByteCount);
+ if (ep->Bytes == NULL)
+ return (GIF_ERROR);
+
+ if (ExtData != NULL) {
+ memcpy(ep->Bytes, ExtData, Len);
+ }
+
+ return (GIF_OK);
}
-void GifFreeExtensions(int *ExtensionBlockCount,
- ExtensionBlock **ExtensionBlocks) {
- ExtensionBlock *ep;
-
- if (*ExtensionBlocks == NULL) {
- return;
- }
-
- for (ep = *ExtensionBlocks;
- ep < (*ExtensionBlocks + *ExtensionBlockCount); ep++) {
- (void)free((char *)ep->Bytes);
- }
- (void)free((char *)*ExtensionBlocks);
- *ExtensionBlocks = NULL;
- *ExtensionBlockCount = 0;
+void
+GifFreeExtensions(int *ExtensionBlockCount,
+ ExtensionBlock **ExtensionBlocks)
+{
+ ExtensionBlock *ep;
+
+ if (*ExtensionBlocks == NULL)
+ return;
+
+ for (ep = *ExtensionBlocks;
+ ep < (*ExtensionBlocks + *ExtensionBlockCount);
+ ep++)
+ (void)free((char *)ep->Bytes);
+ (void)free((char *)*ExtensionBlocks);
+ *ExtensionBlocks = NULL;
+ *ExtensionBlockCount = 0;
}
/******************************************************************************
- Image block allocation functions
+ Image block allocation functions
******************************************************************************/
/* Private Function:
* Frees the last image in the GifFile->SavedImages array
*/
-void FreeLastSavedImage(GifFileType *GifFile) {
- SavedImage *sp;
-
- if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) {
- return;
- }
-
- /* Remove one SavedImage from the GifFile */
- GifFile->ImageCount--;
- sp = &GifFile->SavedImages[GifFile->ImageCount];
-
- /* Deallocate its Colormap */
- if (sp->ImageDesc.ColorMap != NULL) {
- GifFreeMapObject(sp->ImageDesc.ColorMap);
- sp->ImageDesc.ColorMap = NULL;
- }
-
- /* Deallocate the image data */
- if (sp->RasterBits != NULL) {
- free((char *)sp->RasterBits);
- }
-
- /* Deallocate any extensions */
- GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks);
-
- /*** FIXME: We could realloc the GifFile->SavedImages structure but is
- * there a point to it? Saves some memory but we'd have to do it every
- * time. If this is used in GifFreeSavedImages then it would be
- * inefficient (The whole array is going to be deallocated.) If we just
- * use it when we want to free the last Image it's convenient to do it
- * here.
- */
+void
+FreeLastSavedImage(GifFileType *GifFile)
+{
+ SavedImage *sp;
+
+ if ((GifFile == NULL) || (GifFile->SavedImages == NULL))
+ return;
+
+ /* Remove one SavedImage from the GifFile */
+ GifFile->ImageCount--;
+ sp = &GifFile->SavedImages[GifFile->ImageCount];
+
+ /* Deallocate its Colormap */
+ if (sp->ImageDesc.ColorMap != NULL) {
+ GifFreeMapObject(sp->ImageDesc.ColorMap);
+ sp->ImageDesc.ColorMap = NULL;
+ }
+
+ /* Deallocate the image data */
+ if (sp->RasterBits != NULL)
+ free((char *)sp->RasterBits);
+
+ /* Deallocate any extensions */
+ GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks);
+
+ /*** FIXME: We could realloc the GifFile->SavedImages structure but is
+ * there a point to it? Saves some memory but we'd have to do it every
+ * time. If this is used in GifFreeSavedImages then it would be inefficient
+ * (The whole array is going to be deallocated.) If we just use it when
+ * we want to free the last Image it's convenient to do it here.
+ */
}
/*
* Append an image block to the SavedImages array
*/
-SavedImage *GifMakeSavedImage(GifFileType *GifFile,
- const SavedImage *CopyFrom) {
- // cppcheck-suppress ctunullpointer
- if (GifFile->SavedImages == NULL) {
- GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
- } else {
- SavedImage *newSavedImages = (SavedImage *)reallocarray(
- GifFile->SavedImages, (GifFile->ImageCount + 1),
- sizeof(SavedImage));
- if (newSavedImages == NULL) {
- return ((SavedImage *)NULL);
+SavedImage *
+GifMakeSavedImage(GifFileType *GifFile, const SavedImage *CopyFrom)
+{
+ if (GifFile->SavedImages == NULL)
+ GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
+ else {
+ SavedImage* newSavedImages = (SavedImage *)reallocarray(GifFile->SavedImages,
+ (GifFile->ImageCount + 1), sizeof(SavedImage));
+ if( newSavedImages == NULL)
+ return ((SavedImage *)NULL);
+ GifFile->SavedImages = newSavedImages;
+ }
+ if (GifFile->SavedImages == NULL)
+ return ((SavedImage *)NULL);
+ else {
+ SavedImage *sp = &GifFile->SavedImages[GifFile->ImageCount++];
+
+ if (CopyFrom != NULL) {
+ memcpy((char *)sp, CopyFrom, sizeof(SavedImage));
+
+ /*
+ * Make our own allocated copies of the heap fields in the
+ * copied record. This guards against potential aliasing
+ * problems.
+ */
+
+ /* first, the local color map */
+ if (CopyFrom->ImageDesc.ColorMap != NULL) {
+ sp->ImageDesc.ColorMap = GifMakeMapObject(
+ CopyFrom->ImageDesc.ColorMap->ColorCount,
+ CopyFrom->ImageDesc.ColorMap->Colors);
+ if (sp->ImageDesc.ColorMap == NULL) {
+ FreeLastSavedImage(GifFile);
+ return (SavedImage *)(NULL);
}
- GifFile->SavedImages = newSavedImages;
- }
- if (GifFile->SavedImages == NULL) {
- return ((SavedImage *)NULL);
- } else {
- SavedImage *sp = &GifFile->SavedImages[GifFile->ImageCount++];
-
- if (CopyFrom != NULL) {
- memcpy((char *)sp, CopyFrom, sizeof(SavedImage));
-
- /*
- * Make our own allocated copies of the heap fields in
- * the copied record. This guards against potential
- * aliasing problems.
- */
-
- /* Null out aliased pointers before any allocations
- * so that FreeLastSavedImage won't free CopyFrom's
- * data if an allocation fails partway through. */
- sp->ImageDesc.ColorMap = NULL;
- sp->RasterBits = NULL;
- sp->ExtensionBlocks = NULL;
- sp->ExtensionBlockCount = 0;
-
- /* first, the local color map */
- if (CopyFrom->ImageDesc.ColorMap != NULL) {
- sp->ImageDesc.ColorMap = GifMakeMapObject(
- CopyFrom->ImageDesc.ColorMap->ColorCount,
- CopyFrom->ImageDesc.ColorMap->Colors);
- if (sp->ImageDesc.ColorMap == NULL) {
- FreeLastSavedImage(GifFile);
- return (SavedImage *)(NULL);
- }
- }
-
- /* next, the raster */
- sp->RasterBits = (unsigned char *)reallocarray(
- NULL,
- (CopyFrom->ImageDesc.Height *
- CopyFrom->ImageDesc.Width),
- sizeof(GifPixelType));
- if (sp->RasterBits == NULL) {
- FreeLastSavedImage(GifFile);
- return (SavedImage *)(NULL);
- }
- memcpy(sp->RasterBits, CopyFrom->RasterBits,
- sizeof(GifPixelType) *
- CopyFrom->ImageDesc.Height *
- CopyFrom->ImageDesc.Width);
-
- /* finally, the extension blocks */
- if (CopyFrom->ExtensionBlocks != NULL) {
- int k;
- sp->ExtensionBlocks =
- (ExtensionBlock *)calloc(
- CopyFrom->ExtensionBlockCount,
- sizeof(ExtensionBlock));
- if (sp->ExtensionBlocks == NULL) {
- FreeLastSavedImage(GifFile);
- return (SavedImage *)(NULL);
- }
- for (k = 0; k < CopyFrom->ExtensionBlockCount;
- k++) {
- ExtensionBlock *dst =
- &sp->ExtensionBlocks[k];
- ExtensionBlock *src =
- &CopyFrom->ExtensionBlocks[k];
- dst->Function = src->Function;
- dst->ByteCount = src->ByteCount;
- if (src->ByteCount > 0) {
- dst->Bytes =
- (GifByteType *)malloc(
- src->ByteCount);
- if (dst->Bytes == NULL) {
- FreeLastSavedImage(
- GifFile);
- return (SavedImage *)(NULL);
- }
- memcpy(dst->Bytes, src->Bytes,
- src->ByteCount);
- }
- }
- }
- } else {
- memset((char *)sp, '\0', sizeof(SavedImage));
+ }
+
+ /* next, the raster */
+ sp->RasterBits = (unsigned char *)reallocarray(NULL,
+ (CopyFrom->ImageDesc.Height *
+ CopyFrom->ImageDesc.Width),
+ sizeof(GifPixelType));
+ if (sp->RasterBits == NULL) {
+ FreeLastSavedImage(GifFile);
+ return (SavedImage *)(NULL);
+ }
+ memcpy(sp->RasterBits, CopyFrom->RasterBits,
+ sizeof(GifPixelType) * CopyFrom->ImageDesc.Height *
+ CopyFrom->ImageDesc.Width);
+
+ /* finally, the extension blocks */
+ if (CopyFrom->ExtensionBlocks != NULL) {
+ sp->ExtensionBlocks = (ExtensionBlock *)reallocarray(NULL,
+ CopyFrom->ExtensionBlockCount,
+ sizeof(ExtensionBlock));
+ if (sp->ExtensionBlocks == NULL) {
+ FreeLastSavedImage(GifFile);
+ return (SavedImage *)(NULL);
}
-
- return (sp);
+ memcpy(sp->ExtensionBlocks, CopyFrom->ExtensionBlocks,
+ sizeof(ExtensionBlock) * CopyFrom->ExtensionBlockCount);
+ }
+ }
+ else {
+ memset((char *)sp, '\0', sizeof(SavedImage));
}
+
+ return (sp);
+ }
}
-void GifFreeSavedImages(GifFileType *GifFile) {
- SavedImage *sp;
+void
+GifFreeSavedImages(GifFileType *GifFile)
+{
+ SavedImage *sp;
- if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) {
- return;
+ if ((GifFile == NULL) || (GifFile->SavedImages == NULL)) {
+ return;
+ }
+ for (sp = GifFile->SavedImages;
+ sp < GifFile->SavedImages + GifFile->ImageCount; sp++) {
+ if (sp->ImageDesc.ColorMap != NULL) {
+ GifFreeMapObject(sp->ImageDesc.ColorMap);
+ sp->ImageDesc.ColorMap = NULL;
}
- for (sp = GifFile->SavedImages;
- sp < GifFile->SavedImages + GifFile->ImageCount; sp++) {
- if (sp->ImageDesc.ColorMap != NULL) {
- GifFreeMapObject(sp->ImageDesc.ColorMap);
- sp->ImageDesc.ColorMap = NULL;
- }
- if (sp->RasterBits != NULL) {
- free((char *)sp->RasterBits);
- }
+ if (sp->RasterBits != NULL)
+ free((char *)sp->RasterBits);
- GifFreeExtensions(&sp->ExtensionBlockCount,
- &sp->ExtensionBlocks);
- }
- free((char *)GifFile->SavedImages);
- GifFile->SavedImages = NULL;
+ GifFreeExtensions(&sp->ExtensionBlockCount, &sp->ExtensionBlocks);
+ }
+ free((char *)GifFile->SavedImages);
+ GifFile->SavedImages = NULL;
}
/* end */
diff --git a/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c b/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c
index 57504fceaa..452df69d7c 100644
--- a/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c
+++ b/jdk/src/share/native/sun/awt/giflib/openbsd-reallocarray.c
@@ -22,76 +22,78 @@
* questions.
*/
+/* $OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $ */
/*
- * SPDX-FileCopyrightText: Copyright (C) 2008 Otto Moerbeek <otto@drijf.net>
+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
* SPDX-License-Identifier: MIT
*/
+#include <sys/types.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
-#include <sys/types.h>
#ifndef SIZE_MAX
-#define SIZE_MAX UINTPTR_MAX
+ #define SIZE_MAX UINTPTR_MAX
#endif
/*
* This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX
* if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW
*/
-#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
+#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4))
-void *openbsd_reallocarray(void *optr, size_t nmemb, size_t size) {
- if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
- nmemb > 0 && SIZE_MAX / nmemb < size) {
- errno = ENOMEM;
- return NULL;
- }
- /*
- * Head off variations in realloc behavior on different
- * platforms (reported by MarkR <mrogers6@users.sf.net>)
- *
- * The behaviour of reallocarray is implementation-defined if
- * nmemb or size is zero. It can return NULL or non-NULL
- * depending on the platform.
- * https://www.securecoding.cert.org/confluence/display/c/MEM04-C.Beware+of+zero-lengthallocations
- *
- * Here are some extracts from realloc man pages on different platforms.
- *
- * void realloc( void memblock, size_t size );
- *
- * Windows:
- *
- * If there is not enough available memory to expand the block
- * to the given size, the original block is left unchanged,
- * and NULL is returned. If size is zero, then the block
- * pointed to by memblock is freed; the return value is NULL,
- * and memblock is left pointing at a freed block.
- *
- * OpenBSD:
- *
- * If size or nmemb is equal to 0, a unique pointer to an
- * access protected, zero sized object is returned. Access via
- * this pointer will generate a SIGSEGV exception.
- *
- * Linux:
- *
- * If size was equal to 0, either NULL or a pointer suitable
- * to be passed to free() is returned.
- *
- * OS X:
- *
- * If size is zero and ptr is not NULL, a new, minimum sized
- * object is allocated and the original object is freed.
- *
- * It looks like images with zero width or height can trigger
- * this, and fuzzing behaviour will differ by platform, so
- * fuzzing on one platform may not detect zero-size allocation
- * problems on other platforms.
- */
- if (size == 0 || nmemb == 0) {
- return NULL;
- }
- return realloc(optr, size * nmemb);
+void *
+openbsd_reallocarray(void *optr, size_t nmemb, size_t size)
+{
+ if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
+ nmemb > 0 && SIZE_MAX / nmemb < size) {
+ errno = ENOMEM;
+ return NULL;
+ }
+ /*
+ * Head off variations in realloc behavior on different
+ * platforms (reported by MarkR <mrogers6@users.sf.net>)
+ *
+ * The behaviour of reallocarray is implementation-defined if
+ * nmemb or size is zero. It can return NULL or non-NULL
+ * depending on the platform.
+ * https://www.securecoding.cert.org/confluence/display/c/MEM04-C.Beware+of+zero-lengthallocations
+ *
+ * Here are some extracts from realloc man pages on different platforms.
+ *
+ * void realloc( void memblock, size_t size );
+ *
+ * Windows:
+ *
+ * If there is not enough available memory to expand the block
+ * to the given size, the original block is left unchanged,
+ * and NULL is returned. If size is zero, then the block
+ * pointed to by memblock is freed; the return value is NULL,
+ * and memblock is left pointing at a freed block.
+ *
+ * OpenBSD:
+ *
+ * If size or nmemb is equal to 0, a unique pointer to an
+ * access protected, zero sized object is returned. Access via
+ * this pointer will generate a SIGSEGV exception.
+ *
+ * Linux:
+ *
+ * If size was equal to 0, either NULL or a pointer suitable
+ * to be passed to free() is returned.
+ *
+ * OS X:
+ *
+ * If size is zero and ptr is not NULL, a new, minimum sized
+ * object is allocated and the original object is freed.
+ *
+ * It looks like images with zero width or height can trigger
+ * this, and fuzzing behaviour will differ by platform, so
+ * fuzzing on one platform may not detect zero-size allocation
+ * problems on other platforms.
+ */
+ if (size == 0 || nmemb == 0)
+ return NULL;
+ return realloc(optr, size * nmemb);
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftconfig.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftconfig.h
index d66c5df997..0667493fec 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftconfig.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
*
* ANSI-specific configuration file (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftheader.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftheader.h
index 16eab9048f..f6ef2618de 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftheader.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
*
* Build macros of the FreeType 2 library.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftoption.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftoption.h
index a0a1a410b6..d29a0a7cef 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftoption.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -158,12 +158,12 @@ FT_BEGIN_HEADER
/**************************************************************************
*
- * If this macro is defined, try to use an inlined 64-bit or assembler
- * version of the @FT_MulFix function, which is a 'hotspot' when loading
- * and hinting glyphs, and which should be executed as fast as possible.
+ * If this macro is defined, try to use an inlined assembler version of the
+ * @FT_MulFix function, which is a 'hotspot' when loading and hinting
+ * glyphs, and which should be executed as fast as possible.
*
- * If your compiler is not C99-compliant or CPU assembly is not supported,
- * you can disable this option.
+ * Note that if your compiler or CPU is not supported, this will default to
+ * the standard and portable implementation found in `ftcalc.c`.
*/
#define FT_CONFIG_OPTION_INLINE_MULFIX
@@ -293,31 +293,6 @@ FT_BEGIN_HEADER
/* #define FT_CONFIG_OPTION_USE_HARFBUZZ */
- /**************************************************************************
- *
- * HarfBuzz dynamic support.
- *
- * Define this macro if you want the HarfBuzz library to be loaded at
- * runtime instead of being linked to FreeType.
- *
- * This option has no effect if `FT_CONFIG_OPTION_USE_HARFBUZZ` is not
- * defined.
- *
- * When this option is enabled, FreeType will try to load the HarfBuzz
- * library at runtime, using `dlopen` or `LoadLibrary`, depending on the
- * platform. On Microsoft platforms, the library name looked up is
- * `libharfbuzz-0.dll`. On Apple platforms, the library name looked up
- * is `libharfbuzz.0.dylib`. On all other platforms, the library name
- * looked up is `libharfbuzz.so.0`. This name can be overridden by
- * defining the macro `FT_LIBHARFBUZZ` at FreeType compilation time.
- *
- * If you use a build system like cmake or the `configure` script,
- * options set by those programs have precedence, overwriting the value
- * here with the configured one.
- */
-/* #define FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
-
-
/**************************************************************************
*
* Brotli support.
@@ -704,7 +679,7 @@ FT_BEGIN_HEADER
* defined.
*
* [1]
- * https://learn.microsoft.com/typography/cleartype/truetypecleartype
+ * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
*/
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
@@ -722,7 +697,7 @@ FT_BEGIN_HEADER
* flags array which can be used to disambiguate, but old fonts will not
* have them.
*
- * https://learn.microsoft.com/typography/opentype/spec/glyf
+ * https://www.microsoft.com/typography/otspec/glyf.htm
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html
*/
#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
@@ -759,13 +734,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
- * embedded 'BDF~' table within an SFNT-based `.otb` font file. This table
- * is an extension used by X11 to preserve BDF properties after conversion
- * to SFNT containers. See
- *
- * https://fontforge.org/docs/techref/non-standard.html#non-standard-bdf
- *
- * for more details.
+ * embedded 'BDF~' table within SFNT-based bitmap formats.
*/
/* #define TT_CONFIG_OPTION_BDF */
@@ -791,10 +760,10 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* Option `TT_CONFIG_OPTION_GPOS_KERNING` enables a basic GPOS kerning
- * implementation (for TrueType and OpenType fonts only). With this
- * defined, FreeType is able to get kerning pair data from the GPOS 'kern'
- * feature as well as legacy 'kern' tables; without this defined, FreeType
- * will only be able to use legacy 'kern' tables.
+ * implementation (for TrueType fonts only). With this defined, FreeType
+ * is able to get kerning pair data from the GPOS 'kern' feature as well as
+ * legacy 'kern' tables; without this defined, FreeType will only be able
+ * to use legacy 'kern' tables.
*
* Note that FreeType does not support more advanced GPOS layout features;
* even the 'kern' feature implemented here doesn't handle more
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftstdlib.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftstdlib.h
index f846b4456c..e17aa7b89d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftstdlib.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
* ANSI-specific library and header configuration file (specification
* only).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/integer-types.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/integer-types.h
index a0b892ece4..c27505ffc4 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/integer-types.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/integer-types.h
@@ -4,7 +4,7 @@
*
* FreeType integer types definitions.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -17,8 +17,6 @@
#ifndef FREETYPE_CONFIG_INTEGER_TYPES_H_
#define FREETYPE_CONFIG_INTEGER_TYPES_H_
-FT_BEGIN_HEADER
-
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
@@ -244,34 +242,9 @@ FT_BEGIN_HEADER
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
#ifdef FT_INT64
-
typedef FT_INT64 FT_Int64;
typedef FT_UINT64 FT_UInt64;
+#endif
-# define FT_INT64_ZERO 0
-
-#else /* !FT_INT64 */
-
- /* we need to emulate 64-bit data types if none are available */
-
- typedef struct FT_Int64_
- {
- FT_UInt32 lo;
- FT_UInt32 hi;
-
- } FT_Int64;
-
- typedef struct FT_UInt64_
- {
- FT_UInt32 lo;
- FT_UInt32 hi;
-
- } FT_UInt64;
-
-# define FT_INT64_ZERO { 0, 0 }
-
-#endif /* !FT_INT64 */
-
-FT_END_HEADER
#endif /* FREETYPE_CONFIG_INTEGER_TYPES_H_ */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/mac-support.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/mac-support.h
index bd350851d5..07b6f915bd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/mac-support.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/mac-support.h
@@ -4,7 +4,7 @@
*
* Mac/OS X support configuration header.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -24,7 +24,6 @@
* This is the only necessary change, so it is defined here instead
* providing a new configuration file.
*/
-#ifdef FT_MACINTOSH
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
/* No Carbon frameworks for 64bit 10.4.x. */
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
@@ -37,7 +36,6 @@
( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )
#undef FT_MACINTOSH
#endif
-#endif /* __APPLE__ ... */
#elif defined( __SC__ ) || defined( __MRC__ )
/* Classic MacOS compilers */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/public-macros.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/public-macros.h
index 9f28b39473..f56581a6ee 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/public-macros.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/config/public-macros.h
@@ -4,7 +4,7 @@
*
* Define a set of compiler macros used in public FreeType headers.
*
- * Copyright (C) 2020-2025 by
+ * Copyright (C) 2020-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -62,8 +62,8 @@ FT_BEGIN_HEADER
* because it is needed by `FT_EXPORT`.
*/
- /* Visual C, MinGW, Cygwin */
-#if defined( _WIN32 ) || defined( __CYGWIN__ )
+ /* Visual C, mingw */
+#if defined( _WIN32 )
#if defined( FT2_BUILD_LIBRARY ) && defined( DLL_EXPORT )
#define FT_PUBLIC_FUNCTION_ATTRIBUTE __declspec( dllexport )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/freetype.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/freetype.h
index e8a1b1e2f3..58fc33dfe6 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/freetype.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
*
* FreeType high-level API and common types (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -811,7 +811,7 @@ FT_BEGIN_HEADER
* FT_ENCODING_MS_SYMBOL ::
* Microsoft Symbol encoding, used to encode mathematical symbols and
* wingdings. For more information, see
- * 'https://learn.microsoft.com/typography/opentype/spec/recom#non-standard-symbol-fonts',
+ * 'https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts',
* 'http://www.kostis.net/charsets/symbol.htm', and
* 'http://www.kostis.net/charsets/wingding.htm'.
*
@@ -1068,12 +1068,12 @@ FT_BEGIN_HEADER
* the face in the font file (starting with value~0). They are set
* to~0 if there is only one face in the font file.
*
- * [Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType
- * Font Variations only, holding the named instance index for the
- * current face index (starting with value~1; value~0 indicates font
- * access without a named instance). For non-variation fonts, bits
- * 16-30 are ignored. If we have the third named instance of face~4,
- * say, `face_index` is set to 0x00030004.
+ * [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation
+ * fonts only, holding the named instance index for the current face
+ * index (starting with value~1; value~0 indicates font access without
+ * a named instance). For non-variation fonts, bits 16-30 are ignored.
+ * If we have the third named instance of face~4, say, `face_index` is
+ * set to 0x00030004.
*
* Bit 31 is always zero (that is, `face_index` is always a positive
* value).
@@ -1092,10 +1092,10 @@ FT_BEGIN_HEADER
* the face; see @FT_STYLE_FLAG_XXX for the details.
*
* [Since 2.6.1] Bits 16-30 hold the number of named instances
- * available for the current face if we have a TrueType GX or OpenType
- * Font Variation. Bit 31 is always zero (that is, `style_flags` is
- * always a positive value). Note that a variation font has always at
- * least one named instance, namely the default instance.
+ * available for the current face if we have a GX or OpenType variation
+ * (sub)font. Bit 31 is always zero (that is, `style_flags` is always
+ * a positive value). Note that a variation font has always at least
+ * one named instance, namely the default instance.
*
* num_glyphs ::
* The number of glyphs in the face. If the face is scalable and has
@@ -1159,7 +1159,7 @@ FT_BEGIN_HEADER
* Note that the bounding box might be off by (at least) one pixel for
* hinted fonts. See @FT_Size_Metrics for further discussion.
*
- * Note that the bounding box does not vary in OpenType Font Variations
+ * Note that the bounding box does not vary in OpenType variation fonts
* and should only be used in relation to the default instance.
*
* units_per_EM ::
@@ -1218,7 +1218,7 @@ FT_BEGIN_HEADER
* Fields may be changed after a call to @FT_Attach_File or
* @FT_Attach_Stream.
*
- * For OpenType Font Variations, the values of the following fields can
+ * For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `ascender`, `descender`, `height`,
* `underline_position`, and `underline_thickness`.
@@ -1336,7 +1336,7 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_MULTIPLE_MASTERS ::
* The face contains multiple masters and is capable of interpolating
* between them. Supported formats are Adobe MM, TrueType GX, and
- * OpenType Font Variations.
+ * OpenType variation fonts.
*
* See section @multiple_masters for API details.
*
@@ -1609,7 +1609,7 @@ FT_BEGIN_HEADER
*
* @description:
* A macro that returns true whenever a face object is a named instance
- * of a TrueType GX or OpenType Font Variations.
+ * of a GX or OpenType variation font.
*
* [Since 2.9] Changing the design coordinates with
* @FT_Set_Var_Design_Coordinates or @FT_Set_Var_Blend_Coordinates does
@@ -2147,7 +2147,7 @@ FT_BEGIN_HEADER
* freed.
*
* [Since 2.10.1] If @FT_LOAD_NO_SCALE is set, outline coordinates of
- * OpenType Font Variations for a selected instance are internally
+ * OpenType variation fonts for a selected instance are internally
* handled as 26.6 fractional font units but returned as (rounded)
* integers, as expected. To get unrounded font units, don't use
* @FT_LOAD_NO_SCALE but load the glyph with @FT_LOAD_NO_HINTING and
@@ -2640,14 +2640,14 @@ FT_BEGIN_HEADER
* the face in the font file (starting with value~0). Set it to~0 if
* there is only one face in the font file.
*
- * [Since 2.6.1] Bits 16-30 are relevant to TrueType GX and OpenType
- * Font Variations only, specifying the named instance index for the
- * current face index (starting with value~1; value~0 makes FreeType
- * ignore named instances). For non-variation fonts, bits 16-30 are
- * ignored. Assuming that you want to access the third named instance
- * in face~4, `face_index` should be set to 0x00030004. If you want
- * to access face~4 without variation handling, simply set
- * `face_index` to value~4.
+ * [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation
+ * fonts only, specifying the named instance index for the current face
+ * index (starting with value~1; value~0 makes FreeType ignore named
+ * instances). For non-variation fonts, bits 16-30 are ignored.
+ * Assuming that you want to access the third named instance in face~4,
+ * `face_index` should be set to 0x00030004. If you want to access
+ * face~4 without variation handling, simply set `face_index` to
+ * value~4.
*
* `FT_Open_Face` and its siblings can be used to quickly check whether
* the font format of a given font resource is supported by FreeType.
@@ -2914,11 +2914,11 @@ FT_BEGIN_HEADER
* of the available glyphs at a given ppem value is available. FreeType
* silently uses outlines if there is no bitmap for a given glyph index.
*
- * For TrueType GX and OpenType Font Variations, a bitmap strike makes
- * sense only if the default instance is active (that is, no glyph
- * variation takes place); otherwise, FreeType simply ignores bitmap
- * strikes. The same is true for all named instances that are different
- * from the default instance.
+ * For GX and OpenType variation fonts, a bitmap strike makes sense only
+ * if the default instance is active (that is, no glyph variation takes
+ * place); otherwise, FreeType simply ignores bitmap strikes. The same
+ * is true for all named instances that are different from the default
+ * instance.
*
* Don't use this function if you are using the FreeType cache API.
*/
@@ -3078,7 +3078,7 @@ FT_BEGIN_HEADER
* is dependent entirely on how the size is defined in the source face.
* The font designer chooses the final size of each glyph relative to
* this size. For more information refer to
- * 'https://freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
+ * 'https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
*
* Contrary to @FT_Set_Char_Size, this function doesn't have special code
* to normalize zero-valued widths, heights, or resolutions, which are
@@ -3441,10 +3441,8 @@ FT_BEGIN_HEADER
* blending of the color glyph layers associated with the glyph index,
* using the same bitmap format as embedded color bitmap images. This
* is mainly for convenience and works only for glyphs in 'COLR' v0
- * tables. **There is no rendering support for 'COLR' v1** (with the
- * exception of v1 tables that exclusively use v0 features)! You need
- * a graphics library like Skia or Cairo to interpret the graphics
- * commands stored in v1 tables. For full control of color layers use
+ * tables (or glyphs in 'COLR' v1 tables that exclusively use v0
+ * features). For full control of color layers use
* @FT_Get_Color_Glyph_Layer and FreeType's color functions like
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
* so that the client application can handle blending by itself.
@@ -3897,10 +3895,8 @@ FT_BEGIN_HEADER
*
* This process can cost performance. There is an approximation that
* does not need to know about the background color; see
- * https://web.archive.org/web/20211019204945/https://bel.fi/alankila/lcd/
- * and
- * https://web.archive.org/web/20210211002939/https://bel.fi/alankila/lcd/alpcor.html
- * for details.
+ * https://bel.fi/alankila/lcd/ and
+ * https://bel.fi/alankila/lcd/alpcor.html for details.
*
* **ATTENTION**: Linear blending is even more important when dealing
* with subpixel-rendered glyphs to prevent color-fringing! A
@@ -3997,13 +3993,13 @@ FT_BEGIN_HEADER
* out of the scope of this API function -- they can be implemented
* through format-specific interfaces.
*
- * Note that, for TrueType and OpenType fonts only, this can extract data
- * from both the 'kern' table and the basic, pair-wise kerning feature
- * from the GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled),
- * though FreeType does not support the more advanced GPOS layout
- * features; use a library like HarfBuzz for those instead. If a font
- * has both a 'kern' table and kern features of a GPOS table, the 'kern'
- * table will be used.
+ * Note that, for TrueType fonts only, this can extract data from both
+ * the 'kern' table and the basic, pair-wise kerning feature from the
+ * GPOS table (with `TT_CONFIG_OPTION_GPOS_KERNING` enabled), though
+ * FreeType does not support the more advanced GPOS layout features; use
+ * a library like HarfBuzz for those instead. If a font has both a
+ * 'kern' table and kern features of a GPOS table, the 'kern' table will
+ * be used.
*
* Also note for right-to-left scripts, the functionality may differ for
* fonts with GPOS tables vs. 'kern' tables. For GPOS, right-to-left
@@ -4318,13 +4314,14 @@ FT_BEGIN_HEADER
* property `no-stem-darkening` provided by the 'autofit', 'cff',
* 'type1', and 't1cid' modules; see @no-stem-darkening).
*
+ * * @FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding
+ * to function @FT_Library_SetLcdFilterWeights).
+ *
* * @FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type~1, and CID
* 'random' operator, corresponding to the `random-seed` property
* provided by the 'cff', 'type1', and 't1cid' modules; see
* @random-seed).
*
- * * @FT_PARAM_TAG_LCD_FILTER_WEIGHTS (no longer supported).
- *
* Pass `NULL` as `data` in @FT_Parameter for a given tag to reset the
* option and use the library or module default again.
*
@@ -4351,17 +4348,25 @@ FT_BEGIN_HEADER
* FT_Bool darken_stems = 1;
*
* FT_Parameter property2;
+ * FT_LcdFiveTapFilter custom_weight =
+ * { 0x11, 0x44, 0x56, 0x44, 0x11 };
+ *
+ * FT_Parameter property3;
* FT_Int32 random_seed = 314159265;
*
- * FT_Parameter properties[2] = { property1,
- * property2 };
+ * FT_Parameter properties[3] = { property1,
+ * property2,
+ * property3 };
*
*
* property1.tag = FT_PARAM_TAG_STEM_DARKENING;
* property1.data = &darken_stems;
*
- * property2.tag = FT_PARAM_TAG_RANDOM_SEED;
- * property2.data = &random_seed;
+ * property2.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS;
+ * property2.data = custom_weight;
+ *
+ * property3.tag = FT_PARAM_TAG_RANDOM_SEED;
+ * property3.data = &random_seed;
*
* FT_Face_Properties( face, 3, properties );
* ```
@@ -4372,7 +4377,7 @@ FT_BEGIN_HEADER
* FT_Parameter property;
*
*
- * property.tag = FT_PARAM_TAG_STEM_DARKENING;
+ * property.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS;
* property.data = NULL;
*
* FT_Face_Properties( face, 1, &property );
@@ -4525,7 +4530,7 @@ FT_BEGIN_HEADER
* table description in the OpenType specification for the meaning of the
* various flags (which get synthesized for non-OpenType subglyphs).
*
- * https://learn.microsoft.com/typography/opentype/spec/glyf#composite-glyph-description
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description
*
* @values:
* FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::
@@ -4588,7 +4593,7 @@ FT_BEGIN_HEADER
* interpreted depending on the flags returned in `*p_flags`. See the
* OpenType specification for details.
*
- * https://learn.microsoft.com/typography/opentype/spec/glyf#composite-glyph-description
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description
*
*/
FT_EXPORT( FT_Error )
@@ -4614,7 +4619,7 @@ FT_BEGIN_HEADER
* associated with a font.
*
* See
- * https://adobe-type-tools.github.io/font-tech-notes/pdfs/AcrobatDC_FontPolicies.pdf
+ * https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf
* for more details.
*
* @values:
@@ -5168,8 +5173,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 14
-#define FREETYPE_PATCH 2
+#define FREETYPE_MINOR 13
+#define FREETYPE_PATCH 3
/**************************************************************************
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftadvanc.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftadvanc.h
index 62a856ccbd..85b8ba2554 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftadvanc.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
*
* Quick computation of advance widths (specification only).
*
- * Copyright (C) 2008-2025 by
+ * Copyright (C) 2008-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbbox.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbbox.h
index 348b4b3a26..12bbfa63a6 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbbox.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbbox.h
@@ -4,7 +4,7 @@
*
* FreeType exact bbox computation (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbdf.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbdf.h
index ab14224921..6f63b0b1e7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbdf.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbdf.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing BDF-specific strings (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -44,8 +44,7 @@ FT_BEGIN_HEADER
*
* @description:
* This section contains the declaration of functions specific to BDF and
- * PCF fonts. They also work for SFNT bitmap fonts that contain a 'BDF~'
- * table like X11's `.otb` fonts.
+ * PCF fonts.
*
*/
@@ -152,9 +151,7 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * This function only works with BDF faces and SFNT fonts that have a
- * 'BDF~' table, returning an error otherwise. For the latter, a bitmap
- * strike size must be selected first.
+ * This function only works with BDF faces, returning an error otherwise.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face,
@@ -168,7 +165,7 @@ FT_BEGIN_HEADER
* FT_Get_BDF_Property
*
* @description:
- * Retrieve a BDF property from a BDF or PCF font.
+ * Retrieve a BDF property from a BDF or PCF font file.
*
* @input:
* face ::
@@ -199,9 +196,6 @@ FT_BEGIN_HEADER
*
* In case of error, `aproperty->type` is always set to
* @BDF_PROPERTY_TYPE_NONE.
- *
- * This also works with SFNT fonts that have a 'BDF~' table, after a
- * bitmap strike size has been selected.
*/
FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbitmap.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbitmap.h
index a22d43adf1..df9d462652 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbitmap.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (specification).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcid.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcid.h
index 7cda8ff3f3..96b2a90fc5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcid.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcid.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information (specification).
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* Dereg Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcolor.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcolor.h
index 129b1a23fb..420720ddf2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcolor.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftcolor.h
@@ -4,7 +4,7 @@
*
* FreeType's glyph color management (specification).
*
- * Copyright (C) 2018-2025 by
+ * Copyright (C) 2018-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -317,15 +317,6 @@ FT_BEGIN_HEADER
* @description:
* The functions described here allow access of colored glyph layer data
* in OpenType's 'COLR' tables.
- *
- * Note that FreeType does *not* provide rendering in general of glyphs
- * that use a 'COLR' table! While FreeType has very limited rendering
- * support for 'COLR' v0 tables (without a possibility to change the
- * color palette) via @FT_Render_Glyph, there is no such convenience
- * code for 'COLR' v1 tables -- while it appears that v1 is simply an
- * 'improved' version of v0, this is not the case: it is a completely
- * different color font format, and you need a dedicated graphics
- * library like Skia or Cairo to handle a v1 table's drawing commands.
*/
@@ -368,7 +359,7 @@ FT_BEGIN_HEADER
* iteratively retrieve the colored glyph layers associated with the
* current glyph slot.
*
- * https://learn.microsoft.com/typography/opentype/spec/colr
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/colr
*
* The glyph layer data for a given glyph index, if present, provides an
* alternative, multi-color glyph representation: Instead of rendering
@@ -1527,7 +1518,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if a clip box is found. If no clip box is found or an error
- * occurred, value~0 is returned.
+ * occured, value~0 is returned.
*
* @note:
* To retrieve the clip box in font units, reset scale to units-per-em
@@ -1655,7 +1646,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if everything is OK. Value~0 if no details can be found for
- * this paint or any other error occurred.
+ * this paint or any other error occured.
*
* @since:
* 2.13
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftdriver.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftdriver.h
index b65a06ab69..1b7f539f5e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftdriver.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftdriver.h
@@ -4,7 +4,7 @@
*
* FreeType API for controlling driver modules (specification only).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -282,7 +282,7 @@ FT_BEGIN_HEADER
* minimize hinting techniques that were problematic with the extra
* resolution of ClearType; see
* http://rastertragedy.com/RTRCh4.htm#Sec1 and
- * https://learn.microsoft.com/typography/cleartype/truetypecleartype.
+ * https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx.
* This technique is not to be confused with ClearType compatible widths.
* ClearType backward compatibility has no direct impact on changing
* advance widths, but there might be an indirect impact on disabling
@@ -784,7 +784,7 @@ FT_BEGIN_HEADER
*
* Details on subpixel hinting and some of the necessary tweaks can be
* found in Greg Hitchcock's whitepaper at
- * 'https://learn.microsoft.com/typography/cleartype/truetypecleartype'.
+ * 'https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'.
* Note that FreeType currently doesn't really 'subpixel hint' (6x1, 6x2,
* or 6x5 supersampling) like discussed in the paper. Depending on the
* chosen interpreter, it simply ignores instructions on vertical stems
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrdef.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrdef.h
index 3e591bede8..710ca91bbd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrdef.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
*
* FreeType error codes (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrors.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrors.h
index eca494f90c..27c0ece5c1 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrors.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
*
* FreeType error code handling (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftfntfmt.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftfntfmt.h
index 5df82447d0..7c8b0874a8 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftfntfmt.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftfntfmt.h
@@ -4,7 +4,7 @@
*
* Support functions for font formats.
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgasp.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgasp.h
index 77e5a7e7bf..30e5a9bf82 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgasp.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgasp.h
@@ -4,7 +4,7 @@
*
* Access of TrueType's 'gasp' table (specification).
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftglyph.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftglyph.h
index 3691781cf5..dc1eb8873a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftglyph.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgzip.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgzip.h
index e26c334c11..9516dc030a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgzip.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftgzip.h
@@ -4,7 +4,7 @@
*
* Gzip-compressed stream support.
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftimage.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftimage.h
index a4dc724f34..2b4b4ac60a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftimage.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
* FreeType glyph image formats and default raster interface
* (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -267,10 +267,6 @@ FT_BEGIN_HEADER
* *logical* one. For example, if @FT_Pixel_Mode is set to
* `FT_PIXEL_MODE_LCD`, the logical width is a just a third of the
* physical one.
- *
- * An empty bitmap with a NULL `buffer` is valid, with `rows` and/or
- * `pitch` also set to 0. Such bitmaps might be produced while rendering
- * empty or degenerate outlines.
*/
typedef struct FT_Bitmap_
{
@@ -443,7 +439,7 @@ FT_BEGIN_HEADER
* rasterizer; see the `tags` field in @FT_Outline.
*
* Please refer to the description of the 'SCANTYPE' instruction in the
- * [OpenType specification](https://learn.microsoft.com/typography/opentype/spec/tt_instructions#scantype)
+ * [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#scantype)
* how simple drop-outs, smart drop-outs, and stubs are defined.
*/
#define FT_OUTLINE_NONE 0x0
@@ -875,7 +871,7 @@ FT_BEGIN_HEADER
*/
typedef struct FT_Span_
{
- unsigned short x;
+ short x;
unsigned short len;
unsigned char coverage;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftincrem.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftincrem.h
index 2233044754..816581b78e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftincrem.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftincrem.h
@@ -4,7 +4,7 @@
*
* FreeType incremental loading (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlcdfil.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlcdfil.h
index 37bb5e1b8f..25274dc4ac 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlcdfil.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlcdfil.h
@@ -5,7 +5,7 @@
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -145,10 +145,16 @@ FT_BEGIN_HEADER
*
* FT_LCD_FILTER_LEGACY ::
* FT_LCD_FILTER_LEGACY1 ::
- * The legacy libXft color filter is no longer supported and ignored.
+ * This filter corresponds to the original libXft color filter. It
+ * provides high contrast output but can exhibit really bad color
+ * fringes if glyphs are not extremely well hinted to the pixel grid.
+ * This filter is only provided for comparison purposes, and might be
+ * disabled or stay unsupported in the future. The second value is
+ * provided for compatibility with FontConfig, which historically used
+ * different enumeration, sometimes incorrectly forwarded to FreeType.
*
* @since:
- * 2.3.0
+ * 2.3.0 (`FT_LCD_FILTER_LEGACY1` since 2.6.2)
*/
typedef enum FT_LcdFilter_
{
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlist.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlist.h
index 14958b0ff3..972fbfa2fe 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlist.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlist.h
@@ -4,7 +4,7 @@
*
* Generic list support for FreeType (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlogging.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlogging.h
index d155171136..1813cfc2c2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlogging.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftlogging.h
@@ -4,7 +4,7 @@
*
* Additional debugging APIs.
*
- * Copyright (C) 2020-2025 by
+ * Copyright (C) 2020-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmac.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmac.h
index c5ac49101a..e4efde33dd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmac.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmac.h
@@ -4,7 +4,7 @@
*
* Additional Mac-specific API.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmm.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmm.h
index ff0bbab59f..35ed039c89 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmm.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmm.h
@@ -2,9 +2,9 @@
*
* ftmm.h
*
- * FreeType variation font interface (specification).
+ * FreeType Multiple Master font interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -37,79 +37,24 @@ FT_BEGIN_HEADER
* multiple_masters
*
* @title:
- * OpenType Font Variations, TrueType GX, and Adobe MM Fonts
+ * Multiple Masters
*
* @abstract:
- * How to manage variable fonts with multiple design axes.
+ * How to manage Multiple Masters fonts.
*
* @description:
- * The following types and functions manage OpenType Font Variations,
- * Adobe Multiple Master (MM) fonts, and Apple TrueType GX fonts. These
- * formats have in common that they allow the selection of specific
- * design instances by setting design coordinates for one or more axes
- * like font weight or width.
- *
- * For historical reasons there are two interfaces. The first, older one
- * can be used with Adobe MM fonts only, and the second, newer one is a
- * unified interface that handles all three font formats. However, some
- * differences remain and are documented accordingly; in particular,
- * Adobe MM fonts don't have named instances (see below).
- *
- * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For TrueType GX
- * and OpenType Font Variations, it returns true.
- *
- * We use mostly the terminology of the OpenType standard. Here are some
- * important technical terms.
- *
- * * A 'named instance' is a tuple of design coordinates that has a
- * string ID (i.e., an index into the font's 'name' table) associated
- * with it. The font can tell the user that, for example,
- * [Weight=700,Width=110] is 'Bold'. Another name for 'named instance'
- * is 'named style'.
- *
- * Adobe MM fonts don't have named instances.
- *
- * * The 'default instance' of a variation font is that instance for
- * which the nth axis coordinate is equal to the nth default axis
- * coordinate (i.e., `axis[n].def` as specified in the @FT_MM_Var
- * structure), with~n covering all axes. In TrueType GX and OpenType
- * Font Variations, the default instance is explicitly given. In Adobe
- * MM fonts, the `WeightVector` entry as found in the font file is
- * taken as the default instance.
- *
- * For TrueType GX and OpenType Font Variations, FreeType synthesizes
- * a named instance for the default instance if the font does not
- * contain such an entry.
- *
- * * 'Design coordinates' are the axis values found in a variation font
- * file. Their meaning is specified by the font designer and the
- * values are rather arbitrary.
- *
- * For example, the 'weight' axis in design coordinates might vary
- * between 100 (thin) and 900 (heavy) in font~A, while font~B
- * contains values between 400 (normal) and 800 (extra bold).
- *
- * * 'Normalized coordinates' are design coordinates mapped to a standard
- * range; they are also called 'blend coordinates'.
- *
- * For TrueType GX and OpenType Font Variations, the range is [-1;1],
- * with the minimum mapped to value~-1, the default mapped to
- * value~0, and the maximum mapped to value~1, and all other
- * coordinates mapped to intervening points. Please look up the
- * [OpenType
- * specification](https://learn.microsoft.com/en-us/typography/opentype/spec/otvaroverview)
- * on how this mapping works in detail.
- *
- * For Adobe MM fonts, this standard range is [0;1], with the minimum
- * mapped to value~0 and the maximum mapped to value~1, and all other
- * coordinates mapped to intervening points. Please look up [Adobe
- * TechNote
- * #5015](https://adobe-type-tools.github.io/font-tech-notes/pdfs/5015.Type1_Supp.pdf)
- * on how this mapping works in detail.
- *
- * Assuming that the two fonts in the previous example are OpenType
- * Font Variations, both font~A's [100;900] and font~B's [400;800]
- * coordinate ranges get mapped to [-1;1].
+ * The following types and functions are used to manage Multiple Master
+ * fonts, i.e., the selection of specific design instances by setting
+ * design axis coordinates.
+ *
+ * Besides Adobe MM fonts, the interface supports Apple's TrueType GX and
+ * OpenType variation fonts. Some of the routines only work with Adobe
+ * MM fonts, others will work with all three types. They are similar
+ * enough that a consistent interface makes sense.
+ *
+ * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For GX and
+ * OpenType variation fonts, it returns true.
+ *
*/
@@ -119,14 +64,14 @@ FT_BEGIN_HEADER
* T1_MAX_MM_XXX
*
* @description:
- * Adobe MM font limits as defined in their specifications.
+ * Multiple Masters limits as defined in their specifications.
*
* @values:
* T1_MAX_MM_AXIS ::
- * The maximum number of Adobe MM font axes.
+ * The maximum number of Multiple Masters axes.
*
* T1_MAX_MM_DESIGNS ::
- * The maximum number of Adobe MM font designs.
+ * The maximum number of Multiple Masters designs.
*
* T1_MAX_MM_MAP_POINTS ::
* The maximum number of elements in a design map.
@@ -143,10 +88,11 @@ FT_BEGIN_HEADER
* FT_MM_Axis
*
* @description:
- * A structure to model a given axis in design space for Adobe MM fonts.
+ * A structure to model a given axis in design space for Multiple Masters
+ * fonts.
*
- * This structure can't be used with TrueType GX or OpenType Font
- * Variations.
+ * This structure can't be used for TrueType GX or OpenType variation
+ * fonts.
*
* @fields:
* name ::
@@ -173,17 +119,17 @@ FT_BEGIN_HEADER
* FT_Multi_Master
*
* @description:
- * A structure to model the axes and space of an Adobe MM font.
+ * A structure to model the axes and space of a Multiple Masters font.
*
- * This structure can't be used with TrueType GX or OpenType Font
- * Variations.
+ * This structure can't be used for TrueType GX or OpenType variation
+ * fonts.
*
* @fields:
* num_axis ::
* Number of axes. Cannot exceed~4.
*
* num_designs ::
- * Number of designs; should be normally `2^num_axis` even though the
+ * Number of designs; should be normally 2^num_axis even though the
* Type~1 specification strangely allows for intermediate designs to be
* present. This number cannot exceed~16.
*
@@ -205,13 +151,13 @@ FT_BEGIN_HEADER
* FT_Var_Axis
*
* @description:
- * A structure to model a given axis in design space for Adobe MM fonts,
- * TrueType GX, and OpenType Font Variations.
+ * A structure to model a given axis in design space for Multiple
+ * Masters, TrueType GX, and OpenType variation fonts.
*
* @fields:
* name ::
* The axis's name. Not always meaningful for TrueType GX or OpenType
- * Font Variations.
+ * variation fonts.
*
* minimum ::
* The axis's minimum design coordinate.
@@ -225,17 +171,17 @@ FT_BEGIN_HEADER
*
* tag ::
* The axis's tag (the equivalent to 'name' for TrueType GX and
- * OpenType Font Variations). FreeType provides default values for
+ * OpenType variation fonts). FreeType provides default values for
* Adobe MM fonts if possible.
*
* strid ::
* The axis name entry in the font's 'name' table. This is another
* (and often better) version of the 'name' field for TrueType GX or
- * OpenType Font Variations. Not meaningful for Adobe MM fonts.
+ * OpenType variation fonts. Not meaningful for Adobe MM fonts.
*
* @note:
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
- * for TrueType GX and OpenType Font Variations. For Adobe MM fonts, the
+ * for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
* values are whole numbers (i.e., the fractional part is zero).
*/
typedef struct FT_Var_Axis_
@@ -259,7 +205,7 @@ FT_BEGIN_HEADER
*
* @description:
* A structure to model a named instance in a TrueType GX or OpenType
- * Font Variations.
+ * variation font.
*
* This structure can't be used for Adobe MM fonts.
*
@@ -269,11 +215,11 @@ FT_BEGIN_HEADER
* entry for each axis.
*
* strid ::
- * An index into the 'name' table identifying this instance.
+ * The entry in 'name' table identifying this instance.
*
* psid ::
- * An index into the 'name' table identifying a PostScript name for
- * this instance. Value 0xFFFF indicates a missing entry.
+ * The entry in 'name' table identifying a PostScript name for this
+ * instance. Value 0xFFFF indicates a missing entry.
*/
typedef struct FT_Var_Named_Style_
{
@@ -290,33 +236,39 @@ FT_BEGIN_HEADER
* FT_MM_Var
*
* @description:
- * A structure to model the axes and space of Adobe MM fonts, TrueType
- * GX, or OpenType Font Variations.
+ * A structure to model the axes and space of an Adobe MM, TrueType GX,
+ * or OpenType variation font.
*
* Some fields are specific to one format and not to the others.
*
* @fields:
* num_axis ::
* The number of axes. The maximum value is~4 for Adobe MM fonts; no
- * limit in TrueType GX or OpenType Font Variations.
+ * limit in TrueType GX or OpenType variation fonts.
*
* num_designs ::
- * The number of designs; should be normally `2^num_axis` for Adobe MM
- * fonts. Not meaningful for TrueType GX or OpenType Font Variations
+ * The number of designs; should be normally 2^num_axis for Adobe MM
+ * fonts. Not meaningful for TrueType GX or OpenType variation fonts
* (where every glyph could have a different number of designs).
*
* num_namedstyles ::
- * The number of named instances. For Adobe MM fonts, this value is
- * always zero.
+ * The number of named styles; a 'named style' is a tuple of design
+ * coordinates that has a string ID (in the 'name' table) associated
+ * with it. The font can tell the user that, for example,
+ * [Weight=1.5,Width=1.1] is 'Bold'. Another name for 'named style' is
+ * 'named instance'.
+ *
+ * For Adobe Multiple Masters fonts, this value is always zero because
+ * the format does not support named styles.
*
* axis ::
- * An axis descriptor table. TrueType GX and OpenType Font Variations
+ * An axis descriptor table. TrueType GX and OpenType variation fonts
* contain slightly more data than Adobe MM fonts. Memory management
* of this pointer is done internally by FreeType.
*
* namedstyle ::
- * An array of named instances. Only meaningful for TrueType GX and
- * OpenType Font Variations. Memory management of this pointer is done
+ * A named style (instance) table. Only meaningful for TrueType GX and
+ * OpenType variation fonts. Memory management of this pointer is done
* internally by FreeType.
*/
typedef struct FT_MM_Var_
@@ -338,8 +290,8 @@ FT_BEGIN_HEADER
* @description:
* Retrieve a variation descriptor of a given Adobe MM font.
*
- * This function can't be used with TrueType GX or OpenType Font
- * Variations.
+ * This function can't be used with TrueType GX or OpenType variation
+ * fonts.
*
* @input:
* face ::
@@ -347,7 +299,7 @@ FT_BEGIN_HEADER
*
* @output:
* amaster ::
- * The Adobe MM font's variation descriptor.
+ * The Multiple Masters descriptor.
*
* @return:
* FreeType error code. 0~means success.
@@ -414,8 +366,8 @@ FT_BEGIN_HEADER
* For Adobe MM fonts, choose an interpolated font design through design
* coordinates.
*
- * This function can't be used with TrueType GX or OpenType Font
- * Variations.
+ * This function can't be used with TrueType GX or OpenType variation
+ * fonts.
*
* @inout:
* face ::
@@ -439,8 +391,8 @@ FT_BEGIN_HEADER
*
* [Since 2.9] If `num_coords` is larger than zero, this function sets
* the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
- * (i.e., @FT_IS_VARIATION returns true). If `num_coords` is zero, this
- * bit flag gets unset.
+ * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
+ * this bit flag gets unset.
*/
FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face,
@@ -476,7 +428,7 @@ FT_BEGIN_HEADER
*
* @note:
* The design coordinates are 16.16 fractional values for TrueType GX and
- * OpenType Font Variations. For Adobe MM fonts, the values are supposed
+ * OpenType variation fonts. For Adobe MM fonts, the values are supposed
* to be whole numbers (i.e., the fractional part is zero).
*
* [Since 2.8.1] To reset all axes to the default values, call the
@@ -486,14 +438,8 @@ FT_BEGIN_HEADER
*
* [Since 2.9] If `num_coords` is larger than zero, this function sets
* the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
- * (i.e., @FT_IS_VARIATION returns true). If `num_coords` is zero, this
- * bit flag gets unset.
- *
- * [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit
- * in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION returns
- * true) if any of the provided coordinates is different from the face's
- * default value for the corresponding axis, that is, the set up face is
- * not at its default position.
+ * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
+ * this bit flag gets unset.
*/
FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face,
@@ -522,14 +468,14 @@ FT_BEGIN_HEADER
*
* @output:
* coords ::
- * The design coordinates array, which must be allocated by the user.
+ * The design coordinates array.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The design coordinates are 16.16 fractional values for TrueType GX and
- * OpenType Font Variations. For Adobe MM fonts, the values are whole
+ * OpenType variation fonts. For Adobe MM fonts, the values are whole
* numbers (i.e., the fractional part is zero).
*
* @since:
@@ -547,7 +493,8 @@ FT_BEGIN_HEADER
* FT_Set_MM_Blend_Coordinates
*
* @description:
- * Choose an interpolated font design through normalized coordinates.
+ * Choose an interpolated font design through normalized blend
+ * coordinates.
*
* This function works with all supported variation formats.
*
@@ -562,10 +509,9 @@ FT_BEGIN_HEADER
* the number of axes, use default values for the remaining axes.
*
* coords ::
- * The normalized coordinates array. Each element is a 16.16
- * fractional value and must be between 0 and 1.0 for Adobe MM fonts,
- * and between -1.0 and 1.0 for TrueType GX and OpenType Font
- * Variations.
+ * The design coordinates array. Each element is a 16.16 fractional
+ * value and must be between 0 and 1.0 for Adobe MM fonts, and between
+ * -1.0 and 1.0 for TrueType GX and OpenType variation fonts.
*
* @return:
* FreeType error code. 0~means success.
@@ -578,14 +524,8 @@ FT_BEGIN_HEADER
*
* [Since 2.9] If `num_coords` is larger than zero, this function sets
* the @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field
- * (i.e., @FT_IS_VARIATION returns true). If `num_coords` is zero, this
- * bit flag gets unset.
- *
- * [Since 2.14] This function also sets the @FT_FACE_FLAG_VARIATION bit
- * in @FT_Face's `face_flags` field (i.e., @FT_IS_VARIATION returns
- * true) if any of the provided coordinates is different from the face's
- * default value for the corresponding axis, that is, the set up face is
- * not at its default position.
+ * (i.e., @FT_IS_VARIATION will return true). If `num_coords` is zero,
+ * this bit flag gets unset.
*/
FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face,
@@ -599,8 +539,8 @@ FT_BEGIN_HEADER
* FT_Get_MM_Blend_Coordinates
*
* @description:
- * Get the normalized coordinates of the currently selected interpolated
- * font.
+ * Get the normalized blend coordinates of the currently selected
+ * interpolated font.
*
* This function works with all supported variation formats.
*
@@ -609,14 +549,14 @@ FT_BEGIN_HEADER
* A handle to the source face.
*
* num_coords ::
- * The number of normalized coordinates to retrieve. If it is larger
- * than the number of axes, set the excess values to~0.5 for Adobe MM
- * fonts, and to~0 for TrueType GX and OpenType Font Variations.
+ * The number of normalized blend coordinates to retrieve. If it is
+ * larger than the number of axes, set the excess values to~0.5 for
+ * Adobe MM fonts, and to~0 for TrueType GX and OpenType variation
+ * fonts.
*
* @output:
* coords ::
- * The normalized coordinates array (as 16.16 fractional values), which
- * must be allocated by the user.
+ * The normalized blend coordinates array (as 16.16 fractional values).
*
* @return:
* FreeType error code. 0~means success.
@@ -670,8 +610,8 @@ FT_BEGIN_HEADER
* For Adobe MM fonts, choose an interpolated font design by directly
* setting the weight vector.
*
- * This function can't be used with TrueType GX or OpenType Font
- * Variations.
+ * This function can't be used with TrueType GX or OpenType variation
+ * fonts.
*
* @inout:
* face ::
@@ -690,16 +630,16 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * Adobe MM fonts limit the number of designs, and thus the length of the
- * weight vector, to 16~elements.
+ * Adobe Multiple Master fonts limit the number of designs, and thus the
+ * length of the weight vector to 16~elements.
*
* If `len` is larger than zero, this function sets the
* @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e.,
- * @FT_IS_VARIATION returns true). If `len` is zero, this bit flag is
- * unset and the weight vector array is reset to the default values.
+ * @FT_IS_VARIATION will return true). If `len` is zero, this bit flag
+ * is unset and the weight vector array is reset to the default values.
*
* The Adobe documentation also states that the values in the
- * `WeightVector` array must total 1.0 +/-~0.001. In practice this does
+ * WeightVector array must total 1.0 +/-~0.001. In practice this does
* not seem to be enforced, so is not enforced here, either.
*
* @since:
@@ -719,8 +659,8 @@ FT_BEGIN_HEADER
* @description:
* For Adobe MM fonts, retrieve the current weight vector of the font.
*
- * This function can't be used with TrueType GX or OpenType Font
- * Variations.
+ * This function can't be used with TrueType GX or OpenType variation
+ * fonts.
*
* @inout:
* face ::
@@ -737,14 +677,14 @@ FT_BEGIN_HEADER
*
* @output:
* weightvector ::
- * An array to be filled; it must be allocated by the user.
+ * An array to be filled.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
- * Adobe MM fonts limit the number of designs, and thus the length of the
- * weight vector, to~16 elements.
+ * Adobe Multiple Master fonts limit the number of designs, and thus the
+ * length of the WeightVector to~16.
*
* @since:
* 2.10
@@ -820,8 +760,8 @@ FT_BEGIN_HEADER
* A handle to the source face.
*
* instance_index ::
- * The index of the requested instance, starting with value~1. If set
- * to value~0, FreeType switches to font access without a named
+ * The index of the requested instance, starting with value 1. If set
+ * to value 0, FreeType switches to font access without a named
* instance.
*
* @return:
@@ -831,11 +771,11 @@ FT_BEGIN_HEADER
* The function uses the value of `instance_index` to set bits 16-30 of
* the face's `face_index` field. It also resets any variation applied
* to the font, and the @FT_FACE_FLAG_VARIATION bit of the face's
- * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION returns
- * false).
+ * `face_flags` field gets reset to zero (i.e., @FT_IS_VARIATION will
+ * return false).
*
- * For Adobe MM fonts, this function resets the current face to the
- * default instance.
+ * For Adobe MM fonts (which don't have named instances) this function
+ * simply resets the current face to the default instance.
*
* @since:
* 2.9
@@ -854,6 +794,10 @@ FT_BEGIN_HEADER
* Retrieve the index of the default named instance, to be used with
* @FT_Set_Named_Instance.
*
+ * The default instance of a variation font is that instance for which
+ * the nth axis coordinate is equal to `axis[n].def` (as specified in the
+ * @FT_MM_Var structure), with~n covering all axes.
+ *
* FreeType synthesizes a named instance for the default instance if the
* font does not contain such an entry.
*
@@ -869,8 +813,8 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * For Adobe MM fonts, this function always returns zero for
- * `instance_index`.
+ * For Adobe MM fonts (which don't have named instances) this function
+ * always returns zero for `instance_index`.
*
* @since:
* 2.13.1
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmodapi.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmodapi.h
index 2669e4a03b..0ee715898f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmodapi.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
*
* FreeType modules public interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmoderr.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmoderr.h
index 8e2ef2f01f..6722fbf8b7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmoderr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
*
* FreeType module error offsets (specification).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftoutln.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftoutln.h
index 2545ca8486..44e94b4f5b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftoutln.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftoutln.h
@@ -5,7 +5,7 @@
* Support for the FT_Outline type used to store glyph shapes of
* most scalable font formats (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftparams.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftparams.h
index 94dcd6399a..43bf69c202 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftparams.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftparams.h
@@ -4,7 +4,7 @@
*
* FreeType API for possible FT_Parameter tags (specification only).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -133,8 +133,11 @@ FT_BEGIN_HEADER
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
- * Overriding global LCD filter weights with custom values for a given
- * face is no longer supported and ignored.
+ * An @FT_Parameter tag to be used with @FT_Face_Properties. The
+ * corresponding argument specifies the five LCD filter weights for a
+ * given face (if using @FT_LOAD_TARGET_LCD, for example), overriding the
+ * global default values or the values set up with
+ * @FT_Library_SetLcdFilterWeights.
*
* @since:
* 2.8
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftrender.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftrender.h
index cc3102073b..dc5018a1b5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftrender.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
*
* FreeType renderer modules public interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsizes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsizes.h
index fdb89f24cc..4ef5c7955d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsizes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsizes.h
@@ -4,7 +4,7 @@
*
* FreeType size objects management (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsnames.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsnames.h
index 99728574db..d5d5cd9310 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsnames.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsnames.h
@@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftstroke.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftstroke.h
index 2c4761c768..41626dc9d7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftstroke.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftstroke.h
@@ -4,7 +4,7 @@
*
* FreeType path stroker (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsynth.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsynth.h
index 93499a4b4f..43081b6c33 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsynth.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsynth.h
@@ -5,7 +5,7 @@
* FreeType synthesizing code for emboldening and slanting
* (specification).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsystem.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsystem.h
index 1de9f8e603..1eacb3af39 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsystem.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ftsystem.h
@@ -4,7 +4,7 @@
*
* FreeType low-level system interface definition (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttrigon.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttrigon.h
index ed7bd06a78..a5299e938d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttrigon.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
*
* FreeType trigonometric functions (specification).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttypes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttypes.h
index e207c5ebe0..27815143a6 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
*
* FreeType simple types definitions (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/autohint.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/autohint.h
index 987e704e9b..8865d53b38 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/autohint.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/autohint.h
@@ -4,7 +4,7 @@
*
* High-level 'autohint' module-specific interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cffotypes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cffotypes.h
index 26ee43bb9a..36b0390a5a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cffotypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cffotypes.h
@@ -4,7 +4,7 @@
*
* Basic OpenType/CFF object type definitions (specification).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cfftypes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cfftypes.h
index 754122fa64..ef2e8e7569 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cfftypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/cfftypes.h
@@ -5,7 +5,7 @@
* Basic OpenType/CFF type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -191,8 +191,8 @@ FT_BEGIN_HEADER
FT_UInt weight;
FT_Bool is_fixed_pitch;
FT_Fixed italic_angle;
- FT_Short underline_position;
- FT_UShort underline_thickness;
+ FT_Fixed underline_position;
+ FT_Fixed underline_thickness;
FT_Int paint_type;
FT_Int charstring_type;
FT_Matrix font_matrix;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/compiler-macros.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/compiler-macros.h
index e6d0166d88..876f66e256 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/compiler-macros.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/compiler-macros.h
@@ -4,7 +4,7 @@
*
* Compiler-specific macro definitions used internally by FreeType.
*
- * Copyright (C) 2020-2025 by
+ * Copyright (C) 2020-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -128,8 +128,8 @@ FT_BEGIN_HEADER
* before a function declaration.
*/
- /* Visual C, MinGW, Cygwin */
-#if defined( _WIN32 ) || defined( __CYGWIN__ )
+ /* Visual C, mingw */
+#if defined( _WIN32 )
#define FT_INTERNAL_FUNCTION_ATTRIBUTE /* empty */
/* gcc, clang */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftcalc.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftcalc.h
index 16a732224e..71128a2df9 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftcalc.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
*
* Arithmetic computations (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -27,87 +27,17 @@
FT_BEGIN_HEADER
- /*
- * The following macros have two purposes.
- *
- * - Tag places where overflow is expected and harmless.
- *
- * - Avoid run-time undefined behavior sanitizer errors.
- *
- * Use with care!
- */
-#define ADD_INT( a, b ) \
- (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
-#define SUB_INT( a, b ) \
- (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
-#define MUL_INT( a, b ) \
- (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
-#define NEG_INT( a ) \
- (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
-
-#define ADD_LONG( a, b ) \
- (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
-#define SUB_LONG( a, b ) \
- (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
-#define MUL_LONG( a, b ) \
- (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
-#define NEG_LONG( a ) \
- (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
-
-#define ADD_INT32( a, b ) \
- (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
-#define SUB_INT32( a, b ) \
- (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
-#define MUL_INT32( a, b ) \
- (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
-#define NEG_INT32( a ) \
- (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
-
-#ifdef FT_INT64
-
-#define ADD_INT64( a, b ) \
- (FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
-#define SUB_INT64( a, b ) \
- (FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
-#define MUL_INT64( a, b ) \
- (FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
-#define NEG_INT64( a ) \
- (FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
-
-#endif /* FT_INT64 */
-
-
/**************************************************************************
*
* FT_MulDiv() and FT_MulFix() are declared in freetype.h.
*
*/
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
-
-#ifdef FT_INT64
-
- static inline FT_Long
- FT_MulFix_64( FT_Long a,
- FT_Long b )
- {
- FT_Int64 ab = MUL_INT64( a, b );
-
-
- ab = ADD_INT64( ab, 0x8000 + ( ab >> 63 ) ); /* rounding phase */
-
- return (FT_Long)( ab >> 16 );
- }
-
-
-#define FT_MulFix( a, b ) FT_MulFix_64( a, b )
-
-#elif !defined( FT_CONFIG_OPTION_NO_ASSEMBLER )
- /* Provide 32-bit assembler fragments for optimized FT_MulFix. */
- /* These must be defined `static __inline__' or similar. */
+#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
+ /* Provide assembler fragments for performance-critical functions. */
+ /* These must be defined `static __inline__' with GCC. */
-#if defined( __arm__ ) && \
- ( defined( __thumb2__ ) || !defined( __thumb__ ) )
+#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
@@ -119,7 +49,6 @@ FT_BEGIN_HEADER
{
FT_Int32 t, t2;
-#if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */
__asm
{
@@ -131,8 +60,28 @@ FT_BEGIN_HEADER
mov a, t2, lsr #16 /* a = t2 >> 16 */
orr a, a, t, lsl #16 /* a |= t << 16 */
}
+ return a;
+ }
+
+#endif /* __CC_ARM || __ARMCC__ */
+
+
+#ifdef __GNUC__
+
+#if defined( __arm__ ) && \
+ ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \
+ !( defined( __CC_ARM ) || defined( __ARMCC__ ) )
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_arm
+
+ /* documentation is in freetype.h */
+
+ static __inline__ FT_Int32
+ FT_MulFix_arm( FT_Int32 a,
+ FT_Int32 b )
+ {
+ FT_Int32 t, t2;
-#elif defined( __GNUC__ )
__asm__ __volatile__ (
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
@@ -149,25 +98,26 @@ FT_BEGIN_HEADER
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b)
: "cc" );
-
-#endif
-
return a;
}
-#elif defined( __i386__ ) || defined( _M_IX86 )
+#endif /* __arm__ && */
+ /* ( __thumb2__ || !__thumb__ ) && */
+ /* !( __CC_ARM || __ARMCC__ ) */
+
+
+#if defined( __i386__ )
#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
/* documentation is in freetype.h */
- static __inline FT_Int32
+ static __inline__ FT_Int32
FT_MulFix_i386( FT_Int32 a,
FT_Int32 b )
{
FT_Int32 result;
-#if defined( __GNUC__ )
__asm__ __volatile__ (
"imul %%edx\n"
@@ -182,8 +132,27 @@ FT_BEGIN_HEADER
: "=a"(result), "=d"(b)
: "a"(a), "d"(b)
: "%ecx", "cc" );
+ return result;
+ }
+
+#endif /* i386 */
+
+#endif /* __GNUC__ */
+
+
+#ifdef _MSC_VER /* Visual C++ */
-#elif defined( _MSC_VER )
+#ifdef _M_IX86
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_i386
+
+ /* documentation is in freetype.h */
+
+ static __inline FT_Int32
+ FT_MulFix_i386( FT_Int32 a,
+ FT_Int32 b )
+ {
+ FT_Int32 result;
__asm
{
@@ -200,21 +169,81 @@ FT_BEGIN_HEADER
add eax, edx
mov result, eax
}
+ return result;
+ }
+
+#endif /* _M_IX86 */
+#endif /* _MSC_VER */
+
+
+#if defined( __GNUC__ ) && defined( __x86_64__ )
+
+#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64
+
+ static __inline__ FT_Int32
+ FT_MulFix_x86_64( FT_Int32 a,
+ FT_Int32 b )
+ {
+ /* Temporarily disable the warning that C90 doesn't support */
+ /* `long long'. */
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wlong-long"
#endif
- return result;
- }
+#if 1
+ /* Technically not an assembly fragment, but GCC does a really good */
+ /* job at inlining it and generating good machine code for it. */
+ long long ret, tmp;
-#endif /* __i386__ || _M_IX86 */
-#ifdef FT_MULFIX_ASSEMBLER
-#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
+ ret = (long long)a * b;
+ tmp = ret >> 63;
+ ret += 0x8000 + tmp;
+
+ return (FT_Int32)( ret >> 16 );
+#else
+
+ /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */
+ /* code from the lines below. The main issue is that `wide_a' is not */
+ /* properly initialized by sign-extending `a'. Instead, the generated */
+ /* machine code assumes that the register that contains `a' on input */
+ /* can be used directly as a 64-bit value, which is wrong most of the */
+ /* time. */
+ long long wide_a = (long long)a;
+ long long wide_b = (long long)b;
+ long long result;
+
+
+ __asm__ __volatile__ (
+ "imul %2, %1\n"
+ "mov %1, %0\n"
+ "sar $63, %0\n"
+ "lea 0x8000(%1, %0), %0\n"
+ "sar $16, %0\n"
+ : "=&r"(result), "=&r"(wide_a)
+ : "r"(wide_b)
+ : "cc" );
+
+ return (FT_Int32)result;
+#endif
+
+#if __GNUC__ > 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ >= 6 )
+#pragma GCC diagnostic pop
#endif
+ }
+
+#endif /* __GNUC__ && __x86_64__ */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
-#endif /* FT_CONFIG_OPTION_INLINE_MULFIX */
+
+#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
+#ifdef FT_MULFIX_ASSEMBLER
+#define FT_MulFix( a, b ) FT_MULFIX_ASSEMBLER( (FT_Int32)(a), (FT_Int32)(b) )
+#endif
+#endif
/**************************************************************************
@@ -249,6 +278,40 @@ FT_BEGIN_HEADER
FT_Long c );
+ /**************************************************************************
+ *
+ * @function:
+ * FT_MulAddFix
+ *
+ * @description:
+ * Compute `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`, where `s[n]` is
+ * usually a 16.16 scalar.
+ *
+ * @input:
+ * s ::
+ * The array of scalars.
+ * f ::
+ * The array of factors.
+ * count ::
+ * The number of entries in the array.
+ *
+ * @return:
+ * The result of `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`.
+ *
+ * @note:
+ * This function is currently used for the scaled delta computation of
+ * variation stores. It internally uses 64-bit data types when
+ * available, otherwise it emulates 64-bit math by using 32-bit
+ * operations, which produce a correct result but most likely at a slower
+ * performance in comparison to the implementation base on `int64_t`.
+ *
+ */
+ FT_BASE( FT_Int32 )
+ FT_MulAddFix( FT_Fixed* s,
+ FT_Int32* f,
+ FT_UInt count );
+
+
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
* idea is that both `a' and `b' are scaled by factors of 10 so that the
@@ -392,10 +455,6 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) FT_MSB_i386( x )
-#elif defined( __CC_ARM )
-
-#define FT_MSB( x ) ( 31 - __clz( x ) )
-
#elif defined( __SunOS_5_11 )
#include <string.h>
@@ -467,6 +526,55 @@ FT_BEGIN_HEADER
#define ROUND_F26DOT6( x ) ( ( (x) + 32 - ( x < 0 ) ) & -64 )
+ /*
+ * The following macros have two purposes.
+ *
+ * - Tag places where overflow is expected and harmless.
+ *
+ * - Avoid run-time sanitizer errors.
+ *
+ * Use with care!
+ */
+#define ADD_INT( a, b ) \
+ (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
+#define SUB_INT( a, b ) \
+ (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
+#define MUL_INT( a, b ) \
+ (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
+#define NEG_INT( a ) \
+ (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
+
+#define ADD_LONG( a, b ) \
+ (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
+#define SUB_LONG( a, b ) \
+ (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
+#define MUL_LONG( a, b ) \
+ (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
+#define NEG_LONG( a ) \
+ (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
+
+#define ADD_INT32( a, b ) \
+ (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
+#define SUB_INT32( a, b ) \
+ (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
+#define MUL_INT32( a, b ) \
+ (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
+#define NEG_INT32( a ) \
+ (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
+
+#ifdef FT_INT64
+
+#define ADD_INT64( a, b ) \
+ (FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
+#define SUB_INT64( a, b ) \
+ (FT_Int64)( (FT_UInt64)(a) - (FT_UInt64)(b) )
+#define MUL_INT64( a, b ) \
+ (FT_Int64)( (FT_UInt64)(a) * (FT_UInt64)(b) )
+#define NEG_INT64( a ) \
+ (FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
+
+#endif /* FT_INT64 */
+
FT_END_HEADER
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdebug.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdebug.h
index d7facf40d1..d7fa8dc93c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdebug.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
*
* Debugging and logging component (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdrv.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdrv.h
index 24be4dad36..5609b3ef12 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdrv.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftdrv.h
@@ -4,7 +4,7 @@
*
* FreeType internal font driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftgloadr.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftgloadr.h
index 8f2a54c015..f1c155b162 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftgloadr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph loader (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fthash.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fthash.h
index 642d21e21c..622ec76bb9 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fthash.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fthash.h
@@ -117,18 +117,6 @@ FT_BEGIN_HEADER
FT_Hash hash,
FT_Memory memory );
- FT_Error
- ft_hash_str_insert_no_overwrite( const char* key,
- size_t data,
- FT_Hash hash,
- FT_Memory memory );
-
- FT_Error
- ft_hash_num_insert_no_overwrite( FT_Int num,
- size_t data,
- FT_Hash hash,
- FT_Memory memory );
-
size_t*
ft_hash_str_lookup( const char* key,
FT_Hash hash );
@@ -137,17 +125,6 @@ FT_BEGIN_HEADER
ft_hash_num_lookup( FT_Int num,
FT_Hash hash );
- FT_Bool
- ft_hash_num_iterator( FT_UInt *idx,
- FT_Int *key,
- size_t *value,
- FT_Hash hash );
-
- FT_Bool
- ft_hash_str_iterator( FT_UInt *idx,
- const char* *key,
- size_t *value,
- FT_Hash hash );
FT_END_HEADER
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmemory.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmemory.h
index c75c33f289..4e05a29f13 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmemory.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
*
* The FreeType memory management macros (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmmtypes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmmtypes.h
index be3747bbf9..8449e7a010 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmmtypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftmmtypes.h
@@ -5,7 +5,7 @@
* OpenType Variations type definitions for internal use
* with the multi-masters service (specification).
*
- * Copyright (C) 2022-2025 by
+ * Copyright (C) 2022-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
* Dominik Röttsches.
*
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftobjs.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftobjs.h
index d4d7bc00fe..a1e93298fd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftobjs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -275,28 +275,6 @@ FT_BEGIN_HEADER
FT_GlyphSlot slot,
FT_Render_Mode mode );
-
- /**************************************************************************
- *
- * @Function:
- * find_unicode_charmap
- *
- * @Description:
- * This function finds a Unicode charmap, if there is one. And if there
- * is more than one, it tries to favour the more extensive one, i.e., one
- * that supports UCS-4 against those which are limited to the BMP (UCS-2
- * encoding.)
- *
- * If a unicode charmap is found, `face->charmap` is set to it.
- *
- * This function is called from `open_face`, from `FT_Select_Charmap(...,
- * FT_ENCODING_UNICODE)`, and also from `afadjust.c` in the 'autofit'
- * module.
- */
- FT_BASE( FT_Error )
- find_unicode_charmap( FT_Face face );
-
-
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
@@ -365,6 +343,11 @@ FT_BEGIN_HEADER
* Value~0 means to use the font's value. Value~-1 means to use the
* CFF driver's default.
*
+ * lcd_weights ::
+ * lcd_filter_func ::
+ * These fields specify the LCD filtering weights and callback function
+ * for ClearType-style subpixel rendering.
+ *
* refcount ::
* A counter initialized to~1 at the time an @FT_Face structure is
* created. @FT_Reference_Face increments this counter, and
@@ -386,6 +369,11 @@ FT_BEGIN_HEADER
FT_Char no_stem_darkening;
FT_Int32 random_seed;
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
+ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
+#endif
+
FT_Int refcount;
} FT_Face_InternalRec;
@@ -510,9 +498,9 @@ FT_BEGIN_HEADER
*/
typedef struct FT_ModuleRec_
{
- const FT_Module_Class* clazz;
- FT_Library library;
- FT_Memory memory;
+ FT_Module_Class* clazz;
+ FT_Library library;
+ FT_Memory memory;
} FT_ModuleRec;
@@ -714,9 +702,9 @@ FT_BEGIN_HEADER
const FT_Vector* origin );
/* Allocate a new bitmap buffer in a glyph slot. */
- /* Dimensions must be preset in advance. */
FT_BASE( FT_Error )
- ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot );
+ ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
+ FT_ULong size );
/* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
@@ -879,6 +867,10 @@ FT_BEGIN_HEADER
* lcd_weights ::
* The LCD filter weights for ClearType-style subpixel rendering.
*
+ * lcd_filter_func ::
+ * The LCD filtering callback function for for ClearType-style subpixel
+ * rendering.
+ *
* lcd_geometry ::
* This array specifies LCD subpixel geometry and controls Harmony LCD
* rendering technique, alternative to ClearType.
@@ -912,6 +904,7 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
+ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
#else
FT_Vector lcd_geometry[3]; /* RGB subpixel positions */
#endif
@@ -980,6 +973,17 @@ FT_BEGIN_HEADER
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
+ /* Define default raster's interface. The default raster is located in */
+ /* `src/base/ftraster.c'. */
+ /* */
+ /* Client applications can register new rasters through the */
+ /* FT_Set_Raster() API. */
+
+#ifndef FT_NO_DEFAULT_RASTER
+ FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
+#endif
+
+
/**************************************************************************
*
* @macro:
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftpsprop.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftpsprop.h
index 18a954d22f..4f11aa16ba 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftpsprop.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftpsprop.h
@@ -4,7 +4,7 @@
*
* Get and set properties of PostScript drivers (specification).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftrfork.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftrfork.h
index e077f98bfb..05c1d6c48b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftrfork.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (specification).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* Masatake YAMATO and Redhat K.K.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftserv.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftserv.h
index ce11bba19b..8c35dbd713 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftserv.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
*
* The FreeType services (specification only).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftstream.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftstream.h
index 20c1dd7c4b..fd52f767ef 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftstream.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
*
* Stream handling (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fttrace.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fttrace.h
index 3fd592800e..42595a29ff 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fttrace.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
*
* Tracing handling (specification only).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,7 +19,7 @@
/* definitions of trace levels for FreeType 2 */
/* the maximum string length (if the argument to `FT_TRACE_DEF` */
- /* gets used as a string) plus one character for ':' plus */
+ /* gets used as a string) plus one charachter for ':' plus */
/* another one for the trace level */
#define FT_MAX_TRACE_LEVEL_LENGTH (9 + 1 + 1)
@@ -159,7 +159,6 @@ FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvtrak )
/* autofit components */
-FT_TRACE_DEF( afadjust )
FT_TRACE_DEF( afcjk )
FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afhints )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftvalid.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftvalid.h
index 03a726c82c..a1312f2aba 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftvalid.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
*
* FreeType validation support (specification).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/psaux.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/psaux.h
index 344be0f19a..745d2cb56b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/psaux.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/psaux.h
@@ -5,7 +5,7 @@
* Auxiliary functions and data structures related to PostScript fonts
* (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/pshints.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/pshints.h
index 96c5d84f05..dba6c7303f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/pshints.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/pshints.h
@@ -6,7 +6,7 @@
* recorders (specification only). These are used to support native
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svbdf.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svbdf.h
index 5bd51da23f..89e9c2e5de 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svbdf.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svbdf.h
@@ -4,7 +4,7 @@
*
* The FreeType BDF services (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcfftl.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcfftl.h
index c97bf84fb2..3cb483c344 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcfftl.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcfftl.h
@@ -4,7 +4,7 @@
*
* The FreeType CFF tables loader service (specification).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcid.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcid.h
index 748a8caf88..8362cb8724 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcid.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svcid.h
@@ -4,7 +4,7 @@
*
* The FreeType CID font services (specification).
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svfntfmt.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svfntfmt.h
index 690fdc2a24..6b837e79fc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svfntfmt.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svfntfmt.h
@@ -4,7 +4,7 @@
*
* The FreeType font format service (specification only).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgldict.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgldict.h
index 7128d6f3d7..6126ec9ada 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgldict.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgldict.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph dictionary services (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgxval.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgxval.h
index 1ca3e0a031..29cf552818 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgxval.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svgxval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svkern.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svkern.h
index 8a3d59bec6..ac1bc30c41 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svkern.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svkern.h
@@ -4,7 +4,7 @@
*
* The FreeType Kerning service (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmetric.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmetric.h
index 4dde3a8151..8b3563b25c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmetric.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmetric.h
@@ -4,7 +4,7 @@
*
* The FreeType services for metrics variations (specification).
*
- * Copyright (C) 2016-2025 by
+ * Copyright (C) 2016-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -77,7 +77,7 @@ FT_BEGIN_HEADER
typedef void
(*FT_Metrics_Adjust_Func)( FT_Face face );
- typedef void
+ typedef FT_Error
(*FT_Size_Reset_Func)( FT_Size size );
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmm.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmm.h
index 9be133e2db..5288fadf37 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmm.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svmm.h
@@ -4,7 +4,7 @@
*
* The FreeType Multiple Masters and GX var services (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svotval.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svotval.h
index 933e5de98d..7aea7ec11f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svotval.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svotval.h
@@ -4,7 +4,7 @@
*
* The FreeType OpenType validation service (specification).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpfr.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpfr.h
index c81b6a68a8..b2fac6d086 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpfr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpfr.h
@@ -4,7 +4,7 @@
*
* Internal PFR service functions (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpostnm.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpostnm.h
index 33864ebc34..d19f3adc6d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpostnm.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpostnm.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript name services (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svprop.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svprop.h
index 0eb79c885d..ba39c0dd4d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svprop.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svprop.h
@@ -4,7 +4,7 @@
*
* The FreeType property service (specification).
*
- * Copyright (C) 2012-2025 by
+ * Copyright (C) 2012-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpscmap.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpscmap.h
index 8f85d12157..d4908ee41a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpscmap.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpscmap.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript charmap service (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpsinfo.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpsinfo.h
index 83de04478d..2aadcdd02a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpsinfo.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svpsinfo.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript info service (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svsfnt.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svsfnt.h
index 9bf5e3473c..9e0f4ff202 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svsfnt.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
*
* The FreeType SFNT table loading service (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttcmap.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttcmap.h
index fc9b0aeb8e..250886bcc5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttcmap.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttcmap.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType/sfnt cmap extra information service.
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* Masatake YAMATO, Redhat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svtteng.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svtteng.h
index 979e9ea102..14967529a9 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svtteng.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svtteng.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType engine query service (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttglyf.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttglyf.h
index e4f54c1003..f190b3985d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttglyf.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svttglyf.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType glyph service.
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svwinfnt.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svwinfnt.h
index ff887ffdc0..49f3fb7f77 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svwinfnt.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/services/svwinfnt.h
@@ -4,7 +4,7 @@
*
* The FreeType Windows FNT/FONT service (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/sfnt.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/sfnt.h
index adba217887..35e4e73af0 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/sfnt.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
*
* High-level 'sfnt' driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -612,7 +612,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if a ClipBox is found. If no clip box is found or an
- * error occurred, value~0 is returned.
+ * error occured, value~0 is returned.
*/
typedef FT_Bool
( *TT_Get_Color_Glyph_ClipBox_Func )( TT_Face face,
@@ -707,7 +707,7 @@ FT_BEGIN_HEADER
*
* @return:
* Value~1 if everything is OK. Value~0 if no details can be found for
- * this paint or any other error occurred.
+ * this paint or any other error occured.
*/
typedef FT_Bool
( *TT_Get_Paint_Func )( TT_Face face,
@@ -808,7 +808,7 @@ FT_BEGIN_HEADER
* corresponding (1,0) Apple entry.
*
* @return:
- * 1 if there is either a win or apple entry (or both), 0 otherwise.
+ * 1 if there is either a win or apple entry (or both), 0 otheriwse.
*/
typedef FT_Bool
(*TT_Get_Name_ID_Func)( TT_Face face,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/svginterface.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/svginterface.h
index 20c73b2fbd..68c99efb10 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/svginterface.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/svginterface.h
@@ -4,7 +4,7 @@
*
* Interface of ot-svg module (specification only).
*
- * Copyright (C) 2022-2025 by
+ * Copyright (C) 2022-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/t1types.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/t1types.h
index 5b26e4620d..1821ae5cc8 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/t1types.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
* Basic Type1/Type2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/tttypes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/tttypes.h
index d0e5eee89b..7053e656a7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/tttypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -930,8 +930,8 @@ FT_BEGIN_HEADER
* resolution and scaling independent parts of a TrueType font resource.
*
* @note:
- * The TT_Face structure is also used for CFF support; see file
- * `cffotypes.h`.
+ * The TT_Face structure is also used as a 'parent class' for the
+ * OpenType-CFF class (T2_Face).
*/
typedef struct TT_FaceRec_* TT_Face;
@@ -1276,6 +1276,10 @@ FT_BEGIN_HEADER
*
* If varied by the `CVAR' table, non-integer values are possible.
*
+ * interpreter ::
+ * A pointer to the TrueType bytecode interpreters field is also used
+ * to hook the debugger in 'ttdebug'.
+ *
* extra ::
* Reserved for third-party font drivers.
*
@@ -1517,6 +1521,10 @@ FT_BEGIN_HEADER
FT_ULong cvt_size;
FT_Int32* cvt;
+ /* A pointer to the bytecode interpreter to use. This is also */
+ /* used to hook the debugger for the `ttdebug' utility. */
+ TT_Interpreter interpreter;
+
/************************************************************************
*
@@ -1574,6 +1582,11 @@ FT_BEGIN_HEADER
FT_UInt32 kern_avail_bits;
FT_UInt32 kern_order_bits;
+#ifdef TT_CONFIG_OPTION_GPOS_KERNING
+ FT_Byte* gpos_table;
+ FT_Bool gpos_kerning_available;
+#endif
+
#ifdef TT_CONFIG_OPTION_BDF
TT_BDFRec bdf;
#endif /* TT_CONFIG_OPTION_BDF */
@@ -1595,15 +1608,6 @@ FT_BEGIN_HEADER
/* since 2.12 */
void* svg;
-#ifdef TT_CONFIG_OPTION_GPOS_KERNING
- /* since 2.13.3 */
- FT_Byte* gpos_table;
- /* since 2.14 */
- /* This is actually an array of GPOS lookup subtables. */
- FT_UInt32* gpos_lookups_kerning;
- FT_UInt num_gpos_lookups_kerning;
-#endif
-
} TT_FaceRec;
@@ -1617,6 +1621,15 @@ FT_BEGIN_HEADER
* coordinates.
*
* @fields:
+ * memory ::
+ * A handle to the memory manager.
+ *
+ * max_points ::
+ * The maximum size in points of the zone.
+ *
+ * max_contours ::
+ * Max size in links contours of the zone.
+ *
* n_points ::
* The current number of points in the zone.
*
@@ -1640,6 +1653,9 @@ FT_BEGIN_HEADER
*/
typedef struct TT_GlyphZoneRec_
{
+ FT_Memory memory;
+ FT_UShort max_points;
+ FT_UShort max_contours;
FT_UShort n_points; /* number of points in zone */
FT_UShort n_contours; /* number of contours */
@@ -1698,6 +1714,7 @@ FT_BEGIN_HEADER
TT_GlyphZoneRec zone;
TT_ExecContext exec;
+ FT_Byte* instructions;
FT_ULong ins_pos;
/* for possible extensibility in other formats */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/wofftypes.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/wofftypes.h
index 7d5b7df0fa..4a169d12f5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/wofftypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/internal/wofftypes.h
@@ -5,7 +5,7 @@
* Basic WOFF/WOFF2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/otsvg.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/otsvg.h
index 326bbcd015..9d356938cc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/otsvg.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/otsvg.h
@@ -4,7 +4,7 @@
*
* Interface for OT-SVG support related things (specification).
*
- * Copyright (C) 2022-2025 by
+ * Copyright (C) 2022-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/t1tables.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/t1tables.h
index fe769f607f..fbd558aa34 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/t1tables.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/t1tables.h
@@ -5,7 +5,7 @@
* Basic Type 1/Type 2 tables definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
FT_String* full_name;
FT_String* family_name;
FT_String* weight;
- FT_Fixed italic_angle;
+ FT_Long italic_angle;
FT_Bool is_fixed_pitch;
FT_Short underline_position;
FT_UShort underline_thickness;
@@ -645,7 +645,7 @@ FT_BEGIN_HEADER
PS_DICT_UNDERLINE_POSITION, /* FT_Short */
PS_DICT_UNDERLINE_THICKNESS, /* FT_UShort */
PS_DICT_FS_TYPE, /* FT_UShort */
- PS_DICT_ITALIC_ANGLE, /* FT_Fixed */
+ PS_DICT_ITALIC_ANGLE, /* FT_Long */
PS_DICT_MAX = PS_DICT_ITALIC_ANGLE
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ttnameid.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ttnameid.h
index 3ef61091cc..d5d470e380 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ttnameid.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/ttnameid.h
@@ -4,7 +4,7 @@
*
* TrueType name ID definitions (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -436,7 +436,7 @@ FT_BEGIN_HEADER
*
* The canonical source for Microsoft's IDs is
*
- * https://learn.microsoft.com/windows/win32/intl/language-identifier-constants-and-strings ,
+ * https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings ,
*
* however, we only provide macros for language identifiers present in
* the OpenType specification: Microsoft has abandoned the concept of
@@ -847,113 +847,113 @@ FT_BEGIN_HEADER
/* --------------- */
/* Bit 0 Basic Latin */
-#define TT_UCR_BASIC_LATIN (1UL << 0) /* U+0020-U+007E */
+#define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */
/* Bit 1 C1 Controls and Latin-1 Supplement */
-#define TT_UCR_LATIN1_SUPPLEMENT (1UL << 1) /* U+0080-U+00FF */
+#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */
/* Bit 2 Latin Extended-A */
-#define TT_UCR_LATIN_EXTENDED_A (1UL << 2) /* U+0100-U+017F */
+#define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */
/* Bit 3 Latin Extended-B */
-#define TT_UCR_LATIN_EXTENDED_B (1UL << 3) /* U+0180-U+024F */
+#define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */
/* Bit 4 IPA Extensions */
/* Phonetic Extensions */
/* Phonetic Extensions Supplement */
-#define TT_UCR_IPA_EXTENSIONS (1UL << 4) /* U+0250-U+02AF */
+#define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */
/* U+1D00-U+1D7F */
/* U+1D80-U+1DBF */
/* Bit 5 Spacing Modifier Letters */
/* Modifier Tone Letters */
-#define TT_UCR_SPACING_MODIFIER (1UL << 5) /* U+02B0-U+02FF */
+#define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */
/* U+A700-U+A71F */
/* Bit 6 Combining Diacritical Marks */
/* Combining Diacritical Marks Supplement */
-#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1UL << 6) /* U+0300-U+036F */
+#define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */
/* U+1DC0-U+1DFF */
/* Bit 7 Greek and Coptic */
-#define TT_UCR_GREEK (1UL << 7) /* U+0370-U+03FF */
+#define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */
/* Bit 8 Coptic */
-#define TT_UCR_COPTIC (1UL << 8) /* U+2C80-U+2CFF */
+#define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */
/* Bit 9 Cyrillic */
/* Cyrillic Supplement */
/* Cyrillic Extended-A */
/* Cyrillic Extended-B */
-#define TT_UCR_CYRILLIC (1UL << 9) /* U+0400-U+04FF */
+#define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */
/* U+0500-U+052F */
/* U+2DE0-U+2DFF */
/* U+A640-U+A69F */
/* Bit 10 Armenian */
-#define TT_UCR_ARMENIAN (1UL << 10) /* U+0530-U+058F */
+#define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */
/* Bit 11 Hebrew */
-#define TT_UCR_HEBREW (1UL << 11) /* U+0590-U+05FF */
+#define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */
/* Bit 12 Vai */
-#define TT_UCR_VAI (1UL << 12) /* U+A500-U+A63F */
+#define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */
/* Bit 13 Arabic */
/* Arabic Supplement */
-#define TT_UCR_ARABIC (1UL << 13) /* U+0600-U+06FF */
+#define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */
/* U+0750-U+077F */
/* Bit 14 NKo */
-#define TT_UCR_NKO (1UL << 14) /* U+07C0-U+07FF */
+#define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */
/* Bit 15 Devanagari */
-#define TT_UCR_DEVANAGARI (1UL << 15) /* U+0900-U+097F */
- /* Bit 16 Bangla (Bengali) */
-#define TT_UCR_BENGALI (1UL << 16) /* U+0980-U+09FF */
+#define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */
+ /* Bit 16 Bengali */
+#define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */
/* Bit 17 Gurmukhi */
-#define TT_UCR_GURMUKHI (1UL << 17) /* U+0A00-U+0A7F */
+#define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */
/* Bit 18 Gujarati */
-#define TT_UCR_GUJARATI (1UL << 18) /* U+0A80-U+0AFF */
- /* Bit 19 Oriya (Odia) */
-#define TT_UCR_ORIYA (1UL << 19) /* U+0B00-U+0B7F */
+#define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */
+ /* Bit 19 Oriya */
+#define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */
/* Bit 20 Tamil */
-#define TT_UCR_TAMIL (1UL << 20) /* U+0B80-U+0BFF */
+#define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */
/* Bit 21 Telugu */
-#define TT_UCR_TELUGU (1UL << 21) /* U+0C00-U+0C7F */
+#define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */
/* Bit 22 Kannada */
-#define TT_UCR_KANNADA (1UL << 22) /* U+0C80-U+0CFF */
+#define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */
/* Bit 23 Malayalam */
-#define TT_UCR_MALAYALAM (1UL << 23) /* U+0D00-U+0D7F */
+#define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */
/* Bit 24 Thai */
-#define TT_UCR_THAI (1UL << 24) /* U+0E00-U+0E7F */
+#define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */
/* Bit 25 Lao */
-#define TT_UCR_LAO (1UL << 25) /* U+0E80-U+0EFF */
+#define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */
/* Bit 26 Georgian */
/* Georgian Supplement */
-#define TT_UCR_GEORGIAN (1UL << 26) /* U+10A0-U+10FF */
+#define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */
/* U+2D00-U+2D2F */
/* Bit 27 Balinese */
-#define TT_UCR_BALINESE (1UL << 27) /* U+1B00-U+1B7F */
+#define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */
/* Bit 28 Hangul Jamo */
-#define TT_UCR_HANGUL_JAMO (1UL << 28) /* U+1100-U+11FF */
+#define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */
/* Bit 29 Latin Extended Additional */
/* Latin Extended-C */
/* Latin Extended-D */
-#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1UL << 29) /* U+1E00-U+1EFF */
+#define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */
/* U+2C60-U+2C7F */
/* U+A720-U+A7FF */
/* Bit 30 Greek Extended */
-#define TT_UCR_GREEK_EXTENDED (1UL << 30) /* U+1F00-U+1FFF */
+#define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */
/* Bit 31 General Punctuation */
/* Supplemental Punctuation */
-#define TT_UCR_GENERAL_PUNCTUATION (1UL << 31) /* U+2000-U+206F */
+#define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */
/* U+2E00-U+2E7F */
/* ulUnicodeRange2 */
/* --------------- */
/* Bit 32 Superscripts And Subscripts */
-#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1UL << 0) /* U+2070-U+209F */
+#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */
/* Bit 33 Currency Symbols */
-#define TT_UCR_CURRENCY_SYMBOLS (1UL << 1) /* U+20A0-U+20CF */
+#define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */
/* Bit 34 Combining Diacritical Marks For Symbols */
#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \
- (1UL << 2) /* U+20D0-U+20FF */
+ (1L << 2) /* U+20D0-U+20FF */
/* Bit 35 Letterlike Symbols */
-#define TT_UCR_LETTERLIKE_SYMBOLS (1UL << 3) /* U+2100-U+214F */
+#define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */
/* Bit 36 Number Forms */
-#define TT_UCR_NUMBER_FORMS (1UL << 4) /* U+2150-U+218F */
+#define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */
/* Bit 37 Arrows */
/* Supplemental Arrows-A */
/* Supplemental Arrows-B */
/* Miscellaneous Symbols and Arrows */
-#define TT_UCR_ARROWS (1UL << 5) /* U+2190-U+21FF */
+#define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */
/* U+27F0-U+27FF */
/* U+2900-U+297F */
/* U+2B00-U+2BFF */
@@ -961,52 +961,52 @@ FT_BEGIN_HEADER
/* Supplemental Mathematical Operators */
/* Miscellaneous Mathematical Symbols-A */
/* Miscellaneous Mathematical Symbols-B */
-#define TT_UCR_MATHEMATICAL_OPERATORS (1UL << 6) /* U+2200-U+22FF */
+#define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */
/* U+2A00-U+2AFF */
/* U+27C0-U+27EF */
/* U+2980-U+29FF */
/* Bit 39 Miscellaneous Technical */
-#define TT_UCR_MISCELLANEOUS_TECHNICAL (1UL << 7) /* U+2300-U+23FF */
+#define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */
/* Bit 40 Control Pictures */
-#define TT_UCR_CONTROL_PICTURES (1UL << 8) /* U+2400-U+243F */
+#define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */
/* Bit 41 Optical Character Recognition */
-#define TT_UCR_OCR (1UL << 9) /* U+2440-U+245F */
+#define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */
/* Bit 42 Enclosed Alphanumerics */
-#define TT_UCR_ENCLOSED_ALPHANUMERICS (1UL << 10) /* U+2460-U+24FF */
+#define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */
/* Bit 43 Box Drawing */
-#define TT_UCR_BOX_DRAWING (1UL << 11) /* U+2500-U+257F */
+#define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */
/* Bit 44 Block Elements */
-#define TT_UCR_BLOCK_ELEMENTS (1UL << 12) /* U+2580-U+259F */
+#define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */
/* Bit 45 Geometric Shapes */
-#define TT_UCR_GEOMETRIC_SHAPES (1UL << 13) /* U+25A0-U+25FF */
+#define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */
/* Bit 46 Miscellaneous Symbols */
-#define TT_UCR_MISCELLANEOUS_SYMBOLS (1UL << 14) /* U+2600-U+26FF */
+#define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */
/* Bit 47 Dingbats */
-#define TT_UCR_DINGBATS (1UL << 15) /* U+2700-U+27BF */
+#define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */
/* Bit 48 CJK Symbols and Punctuation */
-#define TT_UCR_CJK_SYMBOLS (1UL << 16) /* U+3000-U+303F */
+#define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */
/* Bit 49 Hiragana */
-#define TT_UCR_HIRAGANA (1UL << 17) /* U+3040-U+309F */
+#define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */
/* Bit 50 Katakana */
/* Katakana Phonetic Extensions */
-#define TT_UCR_KATAKANA (1UL << 18) /* U+30A0-U+30FF */
+#define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */
/* U+31F0-U+31FF */
/* Bit 51 Bopomofo */
/* Bopomofo Extended */
-#define TT_UCR_BOPOMOFO (1UL << 19) /* U+3100-U+312F */
+#define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */
/* U+31A0-U+31BF */
/* Bit 52 Hangul Compatibility Jamo */
-#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1UL << 20) /* U+3130-U+318F */
+#define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */
/* Bit 53 Phags-Pa */
-#define TT_UCR_PHAGSPA (1UL << 21) /* U+A840-U+A87F */
-#define TT_UCR_KANBUN TT_UCR_PHAGSPA /* deprecated */
-#define TT_UCR_CJK_MISC TT_UCR_PHAGSPA /* deprecated */
+#define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */
+#define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */
+#define TT_UCR_PHAGSPA
/* Bit 54 Enclosed CJK Letters and Months */
-#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1UL << 22) /* U+3200-U+32FF */
+#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */
/* Bit 55 CJK Compatibility */
-#define TT_UCR_CJK_COMPATIBILITY (1UL << 23) /* U+3300-U+33FF */
+#define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */
/* Bit 56 Hangul Syllables */
-#define TT_UCR_HANGUL (1UL << 24) /* U+AC00-U+D7A3 */
+#define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */
/* Bit 57 High Surrogates */
/* High Private Use Surrogates */
/* Low Surrogates */
@@ -1017,12 +1017,12 @@ FT_BEGIN_HEADER
/* Basic Multilingual Plane that is */
/* supported by this font. So it really */
/* means >= U+10000. */
-#define TT_UCR_SURROGATES (1UL << 25) /* U+D800-U+DB7F */
+#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */
/* U+DB80-U+DBFF */
/* U+DC00-U+DFFF */
#define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES
/* Bit 58 Phoenician */
-#define TT_UCR_PHOENICIAN (1UL << 26) /*U+10900-U+1091F*/
+#define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/
/* Bit 59 CJK Unified Ideographs */
/* CJK Radicals Supplement */
/* Kangxi Radicals */
@@ -1030,7 +1030,7 @@ FT_BEGIN_HEADER
/* CJK Unified Ideographs Extension A */
/* CJK Unified Ideographs Extension B */
/* Kanbun */
-#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1UL << 27) /* U+4E00-U+9FFF */
+#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */
/* U+2E80-U+2EFF */
/* U+2F00-U+2FDF */
/* U+2FF0-U+2FFF */
@@ -1038,178 +1038,178 @@ FT_BEGIN_HEADER
/*U+20000-U+2A6DF*/
/* U+3190-U+319F */
/* Bit 60 Private Use */
-#define TT_UCR_PRIVATE_USE (1UL << 28) /* U+E000-U+F8FF */
+#define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */
/* Bit 61 CJK Strokes */
/* CJK Compatibility Ideographs */
/* CJK Compatibility Ideographs Supplement */
-#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1UL << 29) /* U+31C0-U+31EF */
+#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */
/* U+F900-U+FAFF */
/*U+2F800-U+2FA1F*/
/* Bit 62 Alphabetic Presentation Forms */
-#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1UL << 30) /* U+FB00-U+FB4F */
+#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */
/* Bit 63 Arabic Presentation Forms-A */
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1UL << 31) /* U+FB50-U+FDFF */
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */
/* ulUnicodeRange3 */
/* --------------- */
/* Bit 64 Combining Half Marks */
-#define TT_UCR_COMBINING_HALF_MARKS (1UL << 0) /* U+FE20-U+FE2F */
+#define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */
/* Bit 65 Vertical forms */
/* CJK Compatibility Forms */
-#define TT_UCR_CJK_COMPATIBILITY_FORMS (1UL << 1) /* U+FE10-U+FE1F */
+#define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */
/* U+FE30-U+FE4F */
/* Bit 66 Small Form Variants */
-#define TT_UCR_SMALL_FORM_VARIANTS (1UL << 2) /* U+FE50-U+FE6F */
+#define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */
/* Bit 67 Arabic Presentation Forms-B */
-#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1UL << 3) /* U+FE70-U+FEFF */
+#define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */
/* Bit 68 Halfwidth and Fullwidth Forms */
-#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1UL << 4) /* U+FF00-U+FFEF */
+#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */
/* Bit 69 Specials */
-#define TT_UCR_SPECIALS (1UL << 5) /* U+FFF0-U+FFFF */
+#define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */
/* Bit 70 Tibetan */
-#define TT_UCR_TIBETAN (1UL << 6) /* U+0F00-U+0FFF */
+#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */
/* Bit 71 Syriac */
-#define TT_UCR_SYRIAC (1UL << 7) /* U+0700-U+074F */
+#define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */
/* Bit 72 Thaana */
-#define TT_UCR_THAANA (1UL << 8) /* U+0780-U+07BF */
+#define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */
/* Bit 73 Sinhala */
-#define TT_UCR_SINHALA (1UL << 9) /* U+0D80-U+0DFF */
+#define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */
/* Bit 74 Myanmar */
-#define TT_UCR_MYANMAR (1UL << 10) /* U+1000-U+109F */
+#define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */
/* Bit 75 Ethiopic */
/* Ethiopic Supplement */
/* Ethiopic Extended */
-#define TT_UCR_ETHIOPIC (1UL << 11) /* U+1200-U+137F */
+#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */
/* U+1380-U+139F */
/* U+2D80-U+2DDF */
/* Bit 76 Cherokee */
-#define TT_UCR_CHEROKEE (1UL << 12) /* U+13A0-U+13FF */
+#define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */
/* Bit 77 Unified Canadian Aboriginal Syllabics */
-#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1UL << 13) /* U+1400-U+167F */
+#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */
/* Bit 78 Ogham */
-#define TT_UCR_OGHAM (1UL << 14) /* U+1680-U+169F */
+#define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */
/* Bit 79 Runic */
-#define TT_UCR_RUNIC (1UL << 15) /* U+16A0-U+16FF */
+#define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */
/* Bit 80 Khmer */
/* Khmer Symbols */
-#define TT_UCR_KHMER (1UL << 16) /* U+1780-U+17FF */
+#define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */
/* U+19E0-U+19FF */
/* Bit 81 Mongolian */
-#define TT_UCR_MONGOLIAN (1UL << 17) /* U+1800-U+18AF */
+#define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */
/* Bit 82 Braille Patterns */
-#define TT_UCR_BRAILLE (1UL << 18) /* U+2800-U+28FF */
+#define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */
/* Bit 83 Yi Syllables */
/* Yi Radicals */
-#define TT_UCR_YI (1UL << 19) /* U+A000-U+A48F */
+#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */
/* U+A490-U+A4CF */
/* Bit 84 Tagalog */
/* Hanunoo */
/* Buhid */
/* Tagbanwa */
-#define TT_UCR_PHILIPPINE (1UL << 20) /* U+1700-U+171F */
+#define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */
/* U+1720-U+173F */
/* U+1740-U+175F */
/* U+1760-U+177F */
/* Bit 85 Old Italic */
-#define TT_UCR_OLD_ITALIC (1UL << 21) /*U+10300-U+1032F*/
+#define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/
/* Bit 86 Gothic */
-#define TT_UCR_GOTHIC (1UL << 22) /*U+10330-U+1034F*/
+#define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/
/* Bit 87 Deseret */
-#define TT_UCR_DESERET (1UL << 23) /*U+10400-U+1044F*/
+#define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/
/* Bit 88 Byzantine Musical Symbols */
/* Musical Symbols */
/* Ancient Greek Musical Notation */
-#define TT_UCR_MUSICAL_SYMBOLS (1UL << 24) /*U+1D000-U+1D0FF*/
+#define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/
/*U+1D100-U+1D1FF*/
/*U+1D200-U+1D24F*/
/* Bit 89 Mathematical Alphanumeric Symbols */
-#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1UL << 25) /*U+1D400-U+1D7FF*/
+#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/
/* Bit 90 Private Use (plane 15) */
/* Private Use (plane 16) */
-#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1UL << 26) /*U+F0000-U+FFFFD*/
+#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/
/*U+100000-U+10FFFD*/
/* Bit 91 Variation Selectors */
/* Variation Selectors Supplement */
-#define TT_UCR_VARIATION_SELECTORS (1UL << 27) /* U+FE00-U+FE0F */
+#define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */
/*U+E0100-U+E01EF*/
/* Bit 92 Tags */
-#define TT_UCR_TAGS (1UL << 28) /*U+E0000-U+E007F*/
+#define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/
/* Bit 93 Limbu */
-#define TT_UCR_LIMBU (1UL << 29) /* U+1900-U+194F */
+#define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */
/* Bit 94 Tai Le */
-#define TT_UCR_TAI_LE (1UL << 30) /* U+1950-U+197F */
+#define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */
/* Bit 95 New Tai Lue */
-#define TT_UCR_NEW_TAI_LUE (1UL << 31) /* U+1980-U+19DF */
+#define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */
/* ulUnicodeRange4 */
/* --------------- */
/* Bit 96 Buginese */
-#define TT_UCR_BUGINESE (1UL << 0) /* U+1A00-U+1A1F */
+#define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */
/* Bit 97 Glagolitic */
-#define TT_UCR_GLAGOLITIC (1UL << 1) /* U+2C00-U+2C5F */
+#define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */
/* Bit 98 Tifinagh */
-#define TT_UCR_TIFINAGH (1UL << 2) /* U+2D30-U+2D7F */
+#define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */
/* Bit 99 Yijing Hexagram Symbols */
-#define TT_UCR_YIJING (1UL << 3) /* U+4DC0-U+4DFF */
+#define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */
/* Bit 100 Syloti Nagri */
-#define TT_UCR_SYLOTI_NAGRI (1UL << 4) /* U+A800-U+A82F */
+#define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */
/* Bit 101 Linear B Syllabary */
/* Linear B Ideograms */
/* Aegean Numbers */
-#define TT_UCR_LINEAR_B (1UL << 5) /*U+10000-U+1007F*/
+#define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/
/*U+10080-U+100FF*/
/*U+10100-U+1013F*/
/* Bit 102 Ancient Greek Numbers */
-#define TT_UCR_ANCIENT_GREEK_NUMBERS (1UL << 6) /*U+10140-U+1018F*/
+#define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/
/* Bit 103 Ugaritic */
-#define TT_UCR_UGARITIC (1UL << 7) /*U+10380-U+1039F*/
+#define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/
/* Bit 104 Old Persian */
-#define TT_UCR_OLD_PERSIAN (1UL << 8) /*U+103A0-U+103DF*/
+#define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/
/* Bit 105 Shavian */
-#define TT_UCR_SHAVIAN (1UL << 9) /*U+10450-U+1047F*/
+#define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/
/* Bit 106 Osmanya */
-#define TT_UCR_OSMANYA (1UL << 10) /*U+10480-U+104AF*/
+#define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/
/* Bit 107 Cypriot Syllabary */
-#define TT_UCR_CYPRIOT_SYLLABARY (1UL << 11) /*U+10800-U+1083F*/
+#define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/
/* Bit 108 Kharoshthi */
-#define TT_UCR_KHAROSHTHI (1UL << 12) /*U+10A00-U+10A5F*/
+#define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/
/* Bit 109 Tai Xuan Jing Symbols */
-#define TT_UCR_TAI_XUAN_JING (1UL << 13) /*U+1D300-U+1D35F*/
+#define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/
/* Bit 110 Cuneiform */
/* Cuneiform Numbers and Punctuation */
-#define TT_UCR_CUNEIFORM (1UL << 14) /*U+12000-U+123FF*/
+#define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/
/*U+12400-U+1247F*/
/* Bit 111 Counting Rod Numerals */
-#define TT_UCR_COUNTING_ROD_NUMERALS (1UL << 15) /*U+1D360-U+1D37F*/
+#define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/
/* Bit 112 Sundanese */
-#define TT_UCR_SUNDANESE (1UL << 16) /* U+1B80-U+1BBF */
+#define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */
/* Bit 113 Lepcha */
-#define TT_UCR_LEPCHA (1UL << 17) /* U+1C00-U+1C4F */
+#define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */
/* Bit 114 Ol Chiki */
-#define TT_UCR_OL_CHIKI (1UL << 18) /* U+1C50-U+1C7F */
+#define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */
/* Bit 115 Saurashtra */
-#define TT_UCR_SAURASHTRA (1UL << 19) /* U+A880-U+A8DF */
+#define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */
/* Bit 116 Kayah Li */
-#define TT_UCR_KAYAH_LI (1UL << 20) /* U+A900-U+A92F */
+#define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */
/* Bit 117 Rejang */
-#define TT_UCR_REJANG (1UL << 21) /* U+A930-U+A95F */
+#define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */
/* Bit 118 Cham */
-#define TT_UCR_CHAM (1UL << 22) /* U+AA00-U+AA5F */
+#define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */
/* Bit 119 Ancient Symbols */
-#define TT_UCR_ANCIENT_SYMBOLS (1UL << 23) /*U+10190-U+101CF*/
+#define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/
/* Bit 120 Phaistos Disc */
-#define TT_UCR_PHAISTOS_DISC (1UL << 24) /*U+101D0-U+101FF*/
+#define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/
/* Bit 121 Carian */
/* Lycian */
/* Lydian */
-#define TT_UCR_OLD_ANATOLIAN (1UL << 25) /*U+102A0-U+102DF*/
+#define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/
/*U+10280-U+1029F*/
/*U+10920-U+1093F*/
/* Bit 122 Domino Tiles */
/* Mahjong Tiles */
-#define TT_UCR_GAME_TILES (1UL << 26) /*U+1F030-U+1F09F*/
+#define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/
/*U+1F000-U+1F02F*/
/* Bit 123-127 Reserved for process-internal usage */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttables.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttables.h
index aa4336435d..2cf0ff1bc6 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttables.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttables.h
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType tables definitions and interface
* (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -192,7 +192,7 @@ FT_BEGIN_HEADER
* A pointer into the 'hmtx' table.
*
* @note:
- * For OpenType Font Variations, the values of the following fields can
+ * For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `caret_Slope_Rise`,
* `caret_Slope_Run`, and `caret_Offset`.
@@ -310,7 +310,7 @@ FT_BEGIN_HEADER
* A pointer into the 'vmtx' table.
*
* @note:
- * For OpenType Font Variations, the values of the following fields can
+ * For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `Ascender`, `Descender`,
* `Line_Gap`, `caret_Slope_Rise`, `caret_Slope_Run`, and `caret_Offset`.
@@ -359,7 +359,7 @@ FT_BEGIN_HEADER
* table. In this case, the `version` field is always set to 0xFFFF.
*
* @note:
- * For OpenType Font Variations, the values of the following fields can
+ * For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `sCapHeight`, `sTypoAscender`,
* `sTypoDescender`, `sTypoLineGap`, `sxHeight`, `usWinAscent`,
@@ -442,7 +442,7 @@ FT_BEGIN_HEADER
* them.
*
* @note:
- * For OpenType Font Variations, the values of the following fields can
+ * For an OpenType variation font, the values of the following fields can
* change after a call to @FT_Set_Var_Design_Coordinates (and friends) if
* the font contains an 'MVAR' table: `underlinePosition` and
* `underlineThickness`.
@@ -705,9 +705,6 @@ FT_BEGIN_HEADER
* definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new
* one with @FT_MAKE_TAG.
*
- * [Since 2.14] Use value~1 if you want to access the table directory
- * of the (currently selected) font.
- *
* offset ::
* The starting offset in the table (or file if tag~==~0).
*
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttags.h b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttags.h
index 56bb0a3ee5..da0af5d3f2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttags.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
*
* Tags for TrueType and OpenType tables (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/include/ft2build.h b/jdk/src/share/native/sun/awt/libfreetype/include/ft2build.h
index 3008aea7cf..d3d7685039 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/include/ft2build.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/include/ft2build.h
@@ -4,7 +4,7 @@
*
* FreeType 2 build and setup macros.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afadjust.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afadjust.c
deleted file mode 100644
index a1aa45914d..0000000000
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afadjust.c
+++ /dev/null
@@ -1,1621 +0,0 @@
-/****************************************************************************
- *
- * afadjust.c
- *
- * Auto-fitter routines to adjust components based on charcode (body).
- *
- * Copyright (C) 2023-2025 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- * Written by Craig White <gerzytet@gmail.com>.
- *
- * This file is part of the FreeType project, and may only be used,
- * modified, and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- */
-
-#include "afadjust.h"
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
-# include "afgsub.h"
-#endif
-
-#include <freetype/freetype.h>
-#include <freetype/internal/ftobjs.h>
-#include <freetype/internal/ftmemory.h>
-#include <freetype/internal/ftdebug.h>
-
-#define AF_ADJUSTMENT_DATABASE_LENGTH \
- ( sizeof ( adjustment_database ) / \
- sizeof ( adjustment_database[0] ) )
-
-#undef FT_COMPONENT
-#define FT_COMPONENT afadjust
-
-
- typedef struct AF_AdjustmentDatabaseEntry_
- {
- FT_UInt32 codepoint;
- FT_UInt32 flags;
-
- } AF_AdjustmentDatabaseEntry;
-
-
- /*
- All entries in this list must be sorted by ascending Unicode code
- points. The table entries are 3 numbers consisting of:
-
- - Unicode code point.
- - The vertical adjustment type. This should be a combination of the
- AF_ADJUST_XXX and AF_IGNORE_XXX macros.
- */
- static AF_AdjustmentDatabaseEntry adjustment_database[] =
- {
- /* C0 Controls and Basic Latin */
- { 0x21, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ! */
- { 0x51, AF_IGNORE_CAPITAL_BOTTOM } , /* Q */
- { 0x3F, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ? */
- { 0x69, AF_ADJUST_UP }, /* i */
- { 0x6A, AF_ADJUST_UP }, /* j */
-#if 0
- /* XXX TODO */
- { 0x7E, AF_ADJUST_TILDE_TOP }, /* ~ */
-#endif
-
- /* C1 Controls and Latin-1 Supplement */
- { 0xA1, AF_ADJUST_UP }, /* ¡ */
- { 0xA6, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ¦ */
- { 0xAA, AF_ADJUST_UP }, /* ª */
- { 0xBA, AF_ADJUST_UP }, /* º */
- { 0xBF, AF_ADJUST_UP }, /* ¿ */
-
- { 0xC0, AF_ADJUST_UP }, /* À */
- { 0xC1, AF_ADJUST_UP }, /* Á */
- { 0xC2, AF_ADJUST_UP }, /* Â */
- { 0xC3, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ã */
- { 0xC4, AF_ADJUST_UP }, /* Ä */
- { 0xC5, AF_ADJUST_UP }, /* Å */
- { 0xC7, AF_IGNORE_CAPITAL_BOTTOM }, /* Ç */
- { 0xC8, AF_ADJUST_UP }, /* È */
- { 0xC9, AF_ADJUST_UP }, /* É */
- { 0xCA, AF_ADJUST_UP }, /* Ê */
- { 0xCB, AF_ADJUST_UP }, /* Ë */
- { 0xCC, AF_ADJUST_UP }, /* Ì */
- { 0xCD, AF_ADJUST_UP }, /* Í */
- { 0xCE, AF_ADJUST_UP }, /* Î */
- { 0xCF, AF_ADJUST_UP }, /* Ï */
-
- { 0xD1, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ñ */
- { 0xD2, AF_ADJUST_UP }, /* Ò */
- { 0xD3, AF_ADJUST_UP }, /* Ó */
- { 0xD4, AF_ADJUST_UP }, /* Ô */
- { 0xD5, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Õ */
- { 0xD6, AF_ADJUST_UP }, /* Ö */
- { 0xD8, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ø */
- { 0xD9, AF_ADJUST_UP }, /* Ù */
- { 0xDA, AF_ADJUST_UP }, /* Ú */
- { 0xDB, AF_ADJUST_UP }, /* Û */
- { 0xDC, AF_ADJUST_UP }, /* Ü */
- { 0xDD, AF_ADJUST_UP }, /* Ý */
-
- { 0xE0, AF_ADJUST_UP }, /* à */
- { 0xE1, AF_ADJUST_UP }, /* á */
- { 0xE2, AF_ADJUST_UP }, /* â */
- { 0xE3, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ã */
- { 0xE4, AF_ADJUST_UP }, /* ä */
- { 0xE5, AF_ADJUST_UP }, /* å */
- { 0xE7, AF_IGNORE_SMALL_BOTTOM }, /* ç */
- { 0xE8, AF_ADJUST_UP }, /* è */
- { 0xE9, AF_ADJUST_UP }, /* é */
- { 0xEA, AF_ADJUST_UP }, /* ê */
- { 0xEB, AF_ADJUST_UP }, /* ë */
- { 0xEC, AF_ADJUST_UP }, /* ì */
- { 0xED, AF_ADJUST_UP }, /* í */
- { 0xEE, AF_ADJUST_UP }, /* î */
- { 0xEF, AF_ADJUST_UP }, /* ï */
-
- { 0xF1, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ñ */
- { 0xF2, AF_ADJUST_UP }, /* ò */
- { 0xF3, AF_ADJUST_UP }, /* ó */
- { 0xF4, AF_ADJUST_UP }, /* ô */
- { 0xF5, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* õ */
- { 0xF6, AF_ADJUST_UP }, /* ö */
- { 0xF8, AF_IGNORE_SMALL_TOP | AF_IGNORE_SMALL_BOTTOM }, /* ø */
- { 0xF9, AF_ADJUST_UP }, /* ù */
- { 0xFA, AF_ADJUST_UP }, /* ú */
- { 0xFB, AF_ADJUST_UP }, /* û */
- { 0xFC, AF_ADJUST_UP }, /* ü */
- { 0xFD, AF_ADJUST_UP }, /* ý */
- { 0xFF, AF_ADJUST_UP }, /* ÿ */
-
- /* Latin Extended-A */
- { 0x100, AF_ADJUST_UP }, /* Ā */
- { 0x101, AF_ADJUST_UP }, /* ā */
- { 0x102, AF_ADJUST_UP }, /* Ă */
- { 0x103, AF_ADJUST_UP }, /* ă */
- { 0x104, AF_IGNORE_CAPITAL_BOTTOM }, /* Ą */
- { 0x105, AF_IGNORE_SMALL_BOTTOM }, /* ą */
- { 0x106, AF_ADJUST_UP }, /* Ć */
- { 0x107, AF_ADJUST_UP }, /* ć */
- { 0x108, AF_ADJUST_UP }, /* Ĉ */
- { 0x109, AF_ADJUST_UP }, /* ĉ */
- { 0x10A, AF_ADJUST_UP }, /* Ċ */
- { 0x10B, AF_ADJUST_UP }, /* ċ */
- { 0x10C, AF_ADJUST_UP }, /* Č */
- { 0x10D, AF_ADJUST_UP }, /* č */
- { 0x10E, AF_ADJUST_UP }, /* Ď */
-
- { 0x112, AF_ADJUST_UP }, /* Ē */
- { 0x113, AF_ADJUST_UP }, /* ē */
- { 0x114, AF_ADJUST_UP }, /* Ĕ */
- { 0x115, AF_ADJUST_UP }, /* ĕ */
- { 0x116, AF_ADJUST_UP }, /* Ė */
- { 0x117, AF_ADJUST_UP }, /* ė */
- { 0x118, AF_IGNORE_CAPITAL_BOTTOM }, /* Ę */
- { 0x119, AF_IGNORE_SMALL_BOTTOM }, /* ę */
- { 0x11A, AF_ADJUST_UP }, /* Ě */
- { 0x11B, AF_ADJUST_UP }, /* ě */
- { 0x11C, AF_ADJUST_UP }, /* Ĝ */
- { 0x11D, AF_ADJUST_UP }, /* ĝ */
- { 0x11E, AF_ADJUST_UP }, /* Ğ */
- { 0x11F, AF_ADJUST_UP }, /* ğ */
-
- { 0x120, AF_ADJUST_UP }, /* Ġ */
- { 0x121, AF_ADJUST_UP }, /* ġ */
- { 0x122, AF_ADJUST_DOWN }, /* Ģ */
- { 0x123, AF_ADJUST_UP }, /* ģ */
- { 0x124, AF_ADJUST_UP }, /* Ĥ */
- { 0x125, AF_ADJUST_UP }, /* ĥ */
- { 0x128, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ĩ */
- { 0x129, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ĩ */
- { 0x12A, AF_ADJUST_UP }, /* Ī */
- { 0x12B, AF_ADJUST_UP }, /* ī */
- { 0x12C, AF_ADJUST_UP }, /* Ĭ */
- { 0x12D, AF_ADJUST_UP }, /* ĭ */
- { 0x12E, AF_IGNORE_CAPITAL_BOTTOM }, /* Į */
- { 0x12F, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* į */
-
- { 0x130, AF_ADJUST_UP }, /* İ */
- { 0x133, AF_ADJUST_UP }, /* ij */
- { 0x134, AF_ADJUST_UP }, /* Ĵ */
- { 0x135, AF_ADJUST_UP }, /* ĵ */
- { 0x136, AF_ADJUST_DOWN }, /* Ķ */
- { 0x137, AF_ADJUST_DOWN }, /* ķ */
- { 0x139, AF_ADJUST_UP }, /* Ĺ */
- { 0x13A, AF_ADJUST_UP }, /* ĺ */
- { 0x13B, AF_ADJUST_DOWN }, /* Ļ */
- { 0x13C, AF_ADJUST_DOWN }, /* ļ */
-
- { 0x143, AF_ADJUST_UP }, /* Ń */
- { 0x144, AF_ADJUST_UP }, /* ń */
- { 0x145, AF_ADJUST_DOWN }, /* Ņ */
- { 0x146, AF_ADJUST_DOWN }, /* ņ */
- { 0x147, AF_ADJUST_UP }, /* Ň */
- { 0x148, AF_ADJUST_UP }, /* ň */
- { 0x14C, AF_ADJUST_UP }, /* Ō */
- { 0x14D, AF_ADJUST_UP }, /* ō */
- { 0x14E, AF_ADJUST_UP }, /* Ŏ */
- { 0x14F, AF_ADJUST_UP }, /* ŏ */
-
- { 0x150, AF_ADJUST_UP }, /* Ő */
- { 0x151, AF_ADJUST_UP }, /* ő */
- { 0x154, AF_ADJUST_UP }, /* Ŕ */
- { 0x155, AF_ADJUST_UP }, /* ŕ */
- { 0x156, AF_ADJUST_DOWN }, /* Ŗ */
- { 0x157, AF_ADJUST_DOWN }, /* ŗ */
- { 0x158, AF_ADJUST_UP }, /* Ř */
- { 0x159, AF_ADJUST_UP }, /* ř */
- { 0x15A, AF_ADJUST_UP }, /* Ś */
- { 0x15B, AF_ADJUST_UP }, /* ś */
- { 0x15C, AF_ADJUST_UP }, /* Ŝ */
- { 0x15D, AF_ADJUST_UP }, /* ŝ */
- { 0x15E, AF_IGNORE_CAPITAL_BOTTOM }, /* Ş */
- { 0x15F, AF_IGNORE_SMALL_BOTTOM }, /* ş */
-
- { 0x160, AF_ADJUST_UP }, /* Š */
- { 0x161, AF_ADJUST_UP }, /* š */
- { 0x162, AF_IGNORE_CAPITAL_BOTTOM }, /* Ţ */
- { 0x163, AF_IGNORE_SMALL_BOTTOM }, /* ţ */
- { 0x164, AF_ADJUST_UP }, /* Ť */
- { 0x168, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ũ */
- { 0x169, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ũ */
- { 0x16A, AF_ADJUST_UP }, /* Ū */
- { 0x16B, AF_ADJUST_UP }, /* ū */
- { 0x16C, AF_ADJUST_UP }, /* Ŭ */
- { 0x16D, AF_ADJUST_UP }, /* ŭ */
- { 0x16E, AF_ADJUST_UP }, /* Ů */
- { 0x16F, AF_ADJUST_UP }, /* ů */
-
- { 0x170, AF_ADJUST_UP }, /* Ű */
- { 0x171, AF_ADJUST_UP }, /* ű */
- { 0x172, AF_IGNORE_CAPITAL_BOTTOM }, /* Ų */
- { 0x173, AF_IGNORE_SMALL_BOTTOM }, /* ų */
- { 0x174, AF_ADJUST_UP }, /* Ŵ */
- { 0x175, AF_ADJUST_UP }, /* ŵ */
- { 0x176, AF_ADJUST_UP }, /* Ŷ */
- { 0x177, AF_ADJUST_UP }, /* ŷ */
- { 0x178, AF_ADJUST_UP }, /* Ÿ */
- { 0x179, AF_ADJUST_UP }, /* Ź */
- { 0x17A, AF_ADJUST_UP }, /* ź */
- { 0x17B, AF_ADJUST_UP }, /* Ż */
- { 0x17C, AF_ADJUST_UP }, /* ż */
- { 0x17D, AF_ADJUST_UP }, /* Ž */
- { 0x17E, AF_ADJUST_UP }, /* ž */
-
- /* Latin Extended-B */
- { 0x187, AF_IGNORE_CAPITAL_TOP }, /* Ƈ */
- { 0x188, AF_IGNORE_SMALL_TOP }, /* ƈ */
-
- { 0x1A0, AF_IGNORE_CAPITAL_TOP }, /* Ơ */
- { 0x1A1, AF_IGNORE_SMALL_TOP }, /* ơ */
- { 0x1A5, AF_IGNORE_SMALL_TOP }, /* ƥ */
- { 0x1AB, AF_IGNORE_SMALL_BOTTOM }, /* ƫ */
- { 0x1AE, AF_IGNORE_CAPITAL_BOTTOM }, /* Ʈ */
- { 0x1AF, AF_IGNORE_CAPITAL_TOP }, /* Ư */
-
- { 0x1B0, AF_IGNORE_SMALL_TOP }, /* ư */
- { 0x1B4, AF_IGNORE_SMALL_TOP }, /* ƴ */
-
- { 0x1C3, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ǃ */
- { 0x1C4, AF_ADJUST_UP }, /* DŽ */
-#if 0
- { 0x1C5, AF_ADJUST_UP }, /* Dž */
- { 0x1C6, AF_ADJUST_UP }, /* dž */
- { 0x1C8, AF_ADJUST_UP }, /* Lj */
- { 0x1C9, AF_ADJUST_UP }, /* lj */
- { 0x1CB, AF_ADJUST_UP }, /* Nj */
-#endif
- { 0x1CC, AF_ADJUST_UP }, /* nj */
- { 0x1CD, AF_ADJUST_UP }, /* Ǎ */
- { 0x1CE, AF_ADJUST_UP }, /* ǎ */
- { 0x1CF, AF_ADJUST_UP }, /* Ǐ */
-
- { 0x1D0, AF_ADJUST_UP }, /* ǐ */
- { 0x1D1, AF_ADJUST_UP }, /* Ǒ */
- { 0x1D2, AF_ADJUST_UP }, /* ǒ */
- { 0x1D3, AF_ADJUST_UP }, /* Ǔ */
- { 0x1D4, AF_ADJUST_UP }, /* ǔ */
- { 0x1D5, AF_ADJUST_UP2 }, /* Ǖ */
- { 0x1D6, AF_ADJUST_UP2 }, /* ǖ */
- { 0x1D7, AF_ADJUST_UP2 }, /* Ǘ */
- { 0x1D8, AF_ADJUST_UP2 }, /* ǘ */
- { 0x1D9, AF_ADJUST_UP2 }, /* Ǚ */
- { 0x1DA, AF_ADJUST_UP2 }, /* ǚ */
- { 0x1DB, AF_ADJUST_UP2 }, /* Ǜ */
- { 0x1DC, AF_ADJUST_UP2 }, /* ǜ */
- { 0x1DE, AF_ADJUST_UP2 }, /* Ǟ */
- { 0x1DF, AF_ADJUST_UP2 }, /* ǟ */
-
- { 0x1E0, AF_ADJUST_UP2 }, /* Ǡ */
- { 0x1E1, AF_ADJUST_UP2 }, /* ǡ */
- { 0x1E2, AF_ADJUST_UP }, /* Ǣ */
- { 0x1E3, AF_ADJUST_UP }, /* ǣ */
- { 0x1E6, AF_ADJUST_UP }, /* Ǧ */
- { 0x1E7, AF_ADJUST_UP }, /* ǧ */
- { 0x1E8, AF_ADJUST_UP }, /* Ǩ */
- { 0x1E9, AF_ADJUST_UP }, /* ǩ */
- { 0x1EA, AF_IGNORE_CAPITAL_BOTTOM }, /* Ǫ */
- { 0x1EB, AF_IGNORE_SMALL_BOTTOM }, /* ǫ */
- { 0x1EC, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ǭ */
- { 0x1ED, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* ǭ */
- { 0x1EE, AF_ADJUST_UP }, /* Ǯ */
- { 0x1EF, AF_ADJUST_UP }, /* ǯ */
-
- { 0x1F0, AF_ADJUST_UP }, /* ǰ */
- { 0x1F4, AF_ADJUST_UP }, /* Ǵ */
- { 0x1F5, AF_ADJUST_UP }, /* ǵ */
- { 0x1F8, AF_ADJUST_UP }, /* Ǹ */
- { 0x1F9, AF_ADJUST_UP }, /* ǹ */
- { 0x1FA, AF_ADJUST_UP2 }, /* Ǻ */
- { 0x1FB, AF_ADJUST_UP2 }, /* ǻ */
- { 0x1FC, AF_ADJUST_UP }, /* Ǽ */
- { 0x1FD, AF_ADJUST_UP }, /* ǽ */
- { 0x1FE, AF_ADJUST_UP }, /* Ǿ */
- { 0x1FF, AF_ADJUST_UP }, /* ǿ */
-
- { 0x200, AF_ADJUST_UP }, /* Ȁ */
- { 0x201, AF_ADJUST_UP }, /* ȁ */
- { 0x202, AF_ADJUST_UP }, /* Ȃ */
- { 0x203, AF_ADJUST_UP }, /* ȃ */
- { 0x204, AF_ADJUST_UP }, /* Ȅ */
- { 0x205, AF_ADJUST_UP }, /* ȅ */
- { 0x206, AF_ADJUST_UP }, /* Ȇ */
- { 0x207, AF_ADJUST_UP }, /* ȇ */
- { 0x208, AF_ADJUST_UP }, /* Ȉ */
- { 0x209, AF_ADJUST_UP }, /* ȉ */
- { 0x20A, AF_ADJUST_UP }, /* Ȋ */
- { 0x20B, AF_ADJUST_UP }, /* ȋ */
- { 0x20C, AF_ADJUST_UP }, /* Ȍ */
- { 0x20D, AF_ADJUST_UP }, /* ȍ */
- { 0x20E, AF_ADJUST_UP }, /* Ȏ */
- { 0x20F, AF_ADJUST_UP }, /* ȏ */
-
- { 0x210, AF_ADJUST_UP }, /* Ȑ */
- { 0x211, AF_ADJUST_UP }, /* ȑ */
- { 0x212, AF_ADJUST_UP }, /* Ȓ */
- { 0x213, AF_ADJUST_UP }, /* ȓ */
- { 0x214, AF_ADJUST_UP }, /* Ȕ */
- { 0x215, AF_ADJUST_UP }, /* ȕ */
- { 0x216, AF_ADJUST_UP }, /* Ȗ */
- { 0x217, AF_ADJUST_UP }, /* ȗ */
- { 0x218, AF_ADJUST_DOWN }, /* Ș */
- { 0x219, AF_ADJUST_DOWN }, /* ș */
- { 0x21A, AF_ADJUST_DOWN }, /* Ț */
- { 0x21B, AF_ADJUST_DOWN }, /* ț */
- { 0x21E, AF_ADJUST_UP }, /* Ȟ */
- { 0x21F, AF_ADJUST_UP }, /* ȟ */
-
- { 0x224, AF_IGNORE_CAPITAL_BOTTOM }, /* Ȥ */
- { 0x225, AF_IGNORE_SMALL_BOTTOM }, /* ȥ */
- { 0x226, AF_ADJUST_UP }, /* Ȧ */
- { 0x227, AF_ADJUST_UP }, /* ȧ */
- { 0x228, AF_IGNORE_CAPITAL_BOTTOM }, /* Ȩ */
- { 0x229, AF_IGNORE_SMALL_BOTTOM }, /* ȩ */
- { 0x22A, AF_ADJUST_UP2 }, /* Ȫ */
- { 0x22B, AF_ADJUST_UP2 }, /* ȫ */
- { 0x22C, AF_ADJUST_UP2 }, /* Ȭ */
- { 0x22D, AF_ADJUST_UP2 }, /* ȭ */
- { 0x22E, AF_ADJUST_UP }, /* Ȯ */
- { 0x22F, AF_ADJUST_UP }, /* ȯ */
-
- { 0x230, AF_ADJUST_UP2 }, /* Ȱ */
- { 0x231, AF_ADJUST_UP2 }, /* ȱ */
- { 0x232, AF_ADJUST_UP }, /* Ȳ */
- { 0x233, AF_ADJUST_UP }, /* ȳ */
- { 0x23A, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ⱥ */
- { 0x23B, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ȼ */
- { 0x23F, AF_IGNORE_SMALL_BOTTOM }, /* ȿ */
-
- { 0x240, AF_IGNORE_SMALL_BOTTOM }, /* ɀ */
- { 0x249, AF_ADJUST_UP }, /* ɉ */
-
- /* IPA Extensions */
- { 0x256, AF_IGNORE_SMALL_BOTTOM }, /* ɖ */
-
- { 0x260, AF_IGNORE_SMALL_TOP }, /* ɠ */
- { 0x267, AF_IGNORE_SMALL_BOTTOM }, /* ɧ */
- { 0x268, AF_ADJUST_UP }, /* ɨ */
-
- { 0x272, AF_IGNORE_SMALL_BOTTOM }, /* ɲ */
- { 0x273, AF_IGNORE_SMALL_BOTTOM }, /* ɳ */
- { 0x27B, AF_IGNORE_SMALL_BOTTOM }, /* ɻ */
- { 0x27D, AF_IGNORE_SMALL_BOTTOM }, /* ɽ */
-
- { 0x282, AF_IGNORE_SMALL_BOTTOM }, /* ʂ */
- { 0x288, AF_IGNORE_SMALL_BOTTOM }, /* ʈ */
-
- { 0x290, AF_IGNORE_SMALL_BOTTOM }, /* ʐ */
- { 0x29B, AF_IGNORE_SMALL_TOP }, /* ʛ */
-
- { 0x2A0, AF_IGNORE_SMALL_TOP }, /* ʠ */
-
- /* Spacing Modifier Letters */
- { 0x2B2, AF_ADJUST_UP }, /* ʲ */
- { 0x2B5, AF_IGNORE_SMALL_BOTTOM }, /* ʵ */
-
- /* Greek and Coptic */
- { 0x390, AF_ADJUST_UP2 }, /* ΐ */
-
- { 0x3AA, AF_ADJUST_UP }, /* Ϊ */
- { 0x3AB, AF_ADJUST_UP }, /* Ϋ */
- { 0x3AC, AF_ADJUST_UP }, /* ά */
- { 0x3AD, AF_ADJUST_UP }, /* έ */
- { 0x3AE, AF_ADJUST_UP }, /* ή */
- { 0x3AF, AF_ADJUST_UP }, /* ί */
-
- { 0x3B0, AF_ADJUST_UP2 }, /* ΰ */
-
- { 0x3CA, AF_ADJUST_UP }, /* ϊ */
- { 0x3CB, AF_ADJUST_UP }, /* ϋ */
- { 0x3CC, AF_ADJUST_UP }, /* ό */
- { 0x3CD, AF_ADJUST_UP }, /* ύ */
- { 0x3CE, AF_ADJUST_UP }, /* ώ */
- { 0x3CF, AF_IGNORE_CAPITAL_BOTTOM }, /* Ϗ */
-
- { 0x3D4, AF_ADJUST_UP }, /* ϔ */
- { 0x3D7, AF_IGNORE_SMALL_BOTTOM }, /* ϗ */
- { 0x3D9, AF_IGNORE_SMALL_BOTTOM }, /* ϙ */
-
- { 0x3E2, AF_IGNORE_CAPITAL_BOTTOM }, /* Ϣ */
- { 0x3E3, AF_IGNORE_SMALL_BOTTOM }, /* ϣ */
-
- { 0x3F3, AF_ADJUST_UP }, /* ϳ */
-
- /* Cyrillic */
- { 0x400, AF_ADJUST_UP }, /* Ѐ */
- { 0x401, AF_ADJUST_UP }, /* Ё */
- { 0x403, AF_ADJUST_UP }, /* Ѓ */
- { 0x407, AF_ADJUST_UP }, /* Ї */
- { 0x40C, AF_ADJUST_UP }, /* Ќ */
- { 0x40D, AF_ADJUST_UP }, /* Ѝ */
- { 0x40E, AF_ADJUST_UP }, /* Ў */
- { 0x40F, AF_IGNORE_CAPITAL_BOTTOM }, /* Џ */
-
- { 0x419, AF_ADJUST_UP }, /* Й */
-
- { 0x426, AF_IGNORE_CAPITAL_BOTTOM }, /* Ц */
- { 0x429, AF_IGNORE_CAPITAL_BOTTOM }, /* Щ */
-
- { 0x439, AF_ADJUST_UP }, /* й */
-
- { 0x446, AF_IGNORE_SMALL_BOTTOM }, /* ц */
- { 0x449, AF_IGNORE_SMALL_BOTTOM }, /* щ */
-
- { 0x450, AF_ADJUST_UP }, /* ѐ */
- { 0x451, AF_ADJUST_UP }, /* ё */
- { 0x453, AF_ADJUST_UP }, /* ѓ */
- { 0x456, AF_ADJUST_UP }, /* і */
- { 0x457, AF_ADJUST_UP }, /* ї */
- { 0x458, AF_ADJUST_UP }, /* ј */
- { 0x45C, AF_ADJUST_UP }, /* ќ */
- { 0x45D, AF_ADJUST_UP }, /* ѝ */
- { 0x45E, AF_ADJUST_UP }, /* ў */
- { 0x45F, AF_IGNORE_SMALL_BOTTOM }, /* џ */
-
- { 0x476, AF_ADJUST_UP }, /* Ѷ */
- { 0x477, AF_ADJUST_UP }, /* ѷ */
- { 0x47C, AF_ADJUST_UP2 }, /* Ѽ */
- { 0x47D, AF_ADJUST_UP2 }, /* ѽ */
- { 0x47E, AF_ADJUST_UP }, /* Ѿ */
- { 0x47F, AF_ADJUST_UP }, /* ѿ */
-
- { 0x480, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҁ */
- { 0x481, AF_IGNORE_SMALL_BOTTOM }, /* ҁ */
- { 0x48A, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ҋ */
- { 0x48B, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* ҋ */
-
- { 0x490, AF_IGNORE_CAPITAL_TOP }, /* Ґ */
- { 0x491, AF_IGNORE_SMALL_TOP }, /* ґ */
- { 0x496, AF_IGNORE_CAPITAL_BOTTOM }, /* Җ */
- { 0x497, AF_IGNORE_SMALL_BOTTOM }, /* җ */
- { 0x498, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҙ */
- { 0x499, AF_IGNORE_SMALL_BOTTOM }, /* ҙ */
- { 0x49A, AF_IGNORE_CAPITAL_BOTTOM }, /* Қ */
- { 0x49B, AF_IGNORE_SMALL_BOTTOM }, /* қ */
-
- { 0x4A2, AF_IGNORE_CAPITAL_BOTTOM }, /* Ң */
- { 0x4A3, AF_IGNORE_SMALL_BOTTOM }, /* ң */
- { 0x4AA, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҫ */
- { 0x4AB, AF_IGNORE_SMALL_BOTTOM }, /* ҫ */
- { 0x4AC, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҭ */
- { 0x4AD, AF_IGNORE_SMALL_BOTTOM }, /* ҭ */
-
- { 0x4B2, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҳ */
- { 0x4B3, AF_IGNORE_SMALL_BOTTOM }, /* ҳ */
- { 0x4B4, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҵ */
- { 0x4B5, AF_IGNORE_SMALL_BOTTOM }, /* ҵ */
- { 0x4B6, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҷ */
- { 0x4B7, AF_IGNORE_SMALL_BOTTOM }, /* ҷ */
- { 0x4BE, AF_IGNORE_CAPITAL_BOTTOM }, /* Ҿ */
- { 0x4BF, AF_IGNORE_SMALL_BOTTOM }, /* ҿ */
-
- { 0x4C1, AF_ADJUST_UP }, /* Ӂ */
- { 0x4C2, AF_ADJUST_UP }, /* ӂ */
- { 0x4C5, AF_IGNORE_CAPITAL_BOTTOM }, /* Ӆ */
- { 0x4C6, AF_IGNORE_SMALL_BOTTOM }, /* ӆ */
- { 0x4C9, AF_IGNORE_CAPITAL_BOTTOM }, /* Ӊ */
- { 0x4CA, AF_IGNORE_SMALL_BOTTOM }, /* ӊ */
- { 0x4CB, AF_IGNORE_CAPITAL_BOTTOM }, /* Ӌ */
- { 0x4CC, AF_IGNORE_SMALL_BOTTOM }, /* ӌ */
- { 0x4CD, AF_IGNORE_CAPITAL_BOTTOM }, /* Ӎ */
- { 0x4CE, AF_IGNORE_SMALL_BOTTOM }, /* ӎ */
-
- { 0x4D0, AF_ADJUST_UP }, /* Ӑ */
- { 0x4D1, AF_ADJUST_UP }, /* ӑ */
- { 0x4D2, AF_ADJUST_UP }, /* Ӓ */
- { 0x4D3, AF_ADJUST_UP }, /* ӓ */
- { 0x4D6, AF_ADJUST_UP }, /* Ӗ */
- { 0x4D7, AF_ADJUST_UP }, /* ӗ */
- { 0x4DA, AF_ADJUST_UP }, /* Ӛ */
- { 0x4DB, AF_ADJUST_UP }, /* ӛ */
- { 0x4DC, AF_ADJUST_UP }, /* Ӝ */
- { 0x4DD, AF_ADJUST_UP }, /* ӝ */
- { 0x4DE, AF_ADJUST_UP }, /* Ӟ */
- { 0x4DF, AF_ADJUST_UP }, /* ӟ */
-
- { 0x4E2, AF_ADJUST_UP }, /* Ӣ */
- { 0x4E3, AF_ADJUST_UP }, /* ӣ */
- { 0x4E4, AF_ADJUST_UP }, /* Ӥ */
- { 0x4E5, AF_ADJUST_UP }, /* ӥ */
- { 0x4E6, AF_ADJUST_UP }, /* Ӧ */
- { 0x4E7, AF_ADJUST_UP }, /* ӧ */
- { 0x4EA, AF_ADJUST_UP }, /* Ӫ */
- { 0x4EB, AF_ADJUST_UP }, /* ӫ */
- { 0x4EC, AF_ADJUST_UP }, /* Ӭ */
- { 0x4ED, AF_ADJUST_UP }, /* ӭ */
- { 0x4EE, AF_ADJUST_UP }, /* Ӯ */
- { 0x4EF, AF_ADJUST_UP }, /* ӯ */
-
- { 0x4F0, AF_ADJUST_UP }, /* Ӱ */
- { 0x4F1, AF_ADJUST_UP }, /* ӱ */
- { 0x4F2, AF_ADJUST_UP }, /* Ӳ */
- { 0x4F3, AF_ADJUST_UP }, /* ӳ */
- { 0x4F4, AF_ADJUST_UP }, /* Ӵ */
- { 0x4F5, AF_ADJUST_UP }, /* ӵ */
- { 0x4F6, AF_IGNORE_CAPITAL_BOTTOM }, /* Ӷ */
- { 0x4F7, AF_IGNORE_SMALL_BOTTOM }, /* ӷ */
- { 0x4F8, AF_ADJUST_UP }, /* Ӹ */
- { 0x4F9, AF_ADJUST_UP }, /* ӹ */
- { 0x4FA, AF_IGNORE_CAPITAL_BOTTOM }, /* Ӻ */
- { 0x4FB, AF_IGNORE_SMALL_BOTTOM }, /* ӻ */
-
- /* Cyrillic Supplement */
- { 0x506, AF_IGNORE_CAPITAL_BOTTOM }, /* Ԇ */
- { 0x507, AF_IGNORE_SMALL_BOTTOM }, /* ԇ */
-
- { 0x524, AF_IGNORE_CAPITAL_BOTTOM }, /* Ԥ */
- { 0x525, AF_IGNORE_SMALL_BOTTOM }, /* ԥ */
- { 0x526, AF_IGNORE_CAPITAL_BOTTOM }, /* Ԧ */
- { 0x527, AF_IGNORE_SMALL_BOTTOM }, /* ԧ */
- { 0x52E, AF_IGNORE_CAPITAL_BOTTOM }, /* Ԯ */
- { 0x52F, AF_IGNORE_SMALL_BOTTOM }, /* ԯ */
-
- /* Cherokee */
- { 0x13A5, AF_ADJUST_UP }, /* Ꭵ */
-
- /* Phonetic Extensions */
- { 0x1D09, AF_ADJUST_DOWN }, /* ᴉ */
-
- { 0x1D4E, AF_ADJUST_DOWN }, /* ᵎ */
-
- { 0x1D51, AF_IGNORE_SMALL_BOTTOM }, /* ᵑ */
-
- { 0x1D62, AF_ADJUST_UP }, /* ᵢ */
-
- /* Phonetic Extensions Supplement */
- { 0x1D80, AF_IGNORE_SMALL_BOTTOM }, /* ᶀ */
- { 0x1D81, AF_IGNORE_SMALL_BOTTOM }, /* ᶁ */
- { 0x1D82, AF_IGNORE_SMALL_BOTTOM }, /* ᶂ */
- { 0x1D84, AF_IGNORE_SMALL_BOTTOM }, /* ᶄ */
- { 0x1D85, AF_IGNORE_SMALL_BOTTOM }, /* ᶅ */
- { 0x1D86, AF_IGNORE_SMALL_BOTTOM }, /* ᶆ */
- { 0x1D87, AF_IGNORE_SMALL_BOTTOM }, /* ᶇ */
- { 0x1D89, AF_IGNORE_SMALL_BOTTOM }, /* ᶉ */
- { 0x1D8A, AF_IGNORE_SMALL_BOTTOM }, /* ᶊ */
- { 0x1D8C, AF_IGNORE_SMALL_BOTTOM }, /* ᶌ */
- { 0x1D8D, AF_IGNORE_SMALL_BOTTOM }, /* ᶍ */
- { 0x1D8E, AF_IGNORE_SMALL_BOTTOM }, /* ᶎ */
- { 0x1D8F, AF_IGNORE_SMALL_BOTTOM }, /* ᶏ */
-
- { 0x1D90, AF_IGNORE_SMALL_BOTTOM }, /* ᶐ */
- { 0x1D91, AF_IGNORE_SMALL_BOTTOM }, /* ᶑ */
- { 0x1D92, AF_IGNORE_SMALL_BOTTOM }, /* ᶒ */
- { 0x1D93, AF_IGNORE_SMALL_BOTTOM }, /* ᶓ */
- { 0x1D94, AF_IGNORE_SMALL_BOTTOM }, /* ᶔ */
- { 0x1D95, AF_IGNORE_SMALL_BOTTOM }, /* ᶕ */
- { 0x1D96, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* ᶖ */
- { 0x1D97, AF_IGNORE_SMALL_BOTTOM }, /* ᶗ */
- { 0x1D98, AF_IGNORE_SMALL_BOTTOM }, /* ᶘ */
- { 0x1D99, AF_IGNORE_SMALL_BOTTOM }, /* ᶙ */
- { 0x1D9A, AF_IGNORE_SMALL_BOTTOM }, /* ᶚ */
-
- { 0x1DA4, AF_ADJUST_UP }, /* ᶤ */
- { 0x1DA8, AF_ADJUST_UP }, /* ᶨ */
- { 0x1DA9, AF_IGNORE_SMALL_BOTTOM }, /* ᶩ */
- { 0x1DAA, AF_IGNORE_SMALL_BOTTOM }, /* ᶪ */
- { 0x1DAC, AF_IGNORE_SMALL_BOTTOM }, /* ᶬ */
- { 0x1DAE, AF_IGNORE_SMALL_BOTTOM }, /* ᶮ */
- { 0x1DAF, AF_IGNORE_SMALL_BOTTOM }, /* ᶯ */
-
- { 0x1DB3, AF_IGNORE_SMALL_BOTTOM }, /* ᶳ */
- { 0x1DB5, AF_IGNORE_SMALL_BOTTOM }, /* ᶵ */
- { 0x1DBC, AF_IGNORE_SMALL_BOTTOM }, /* ᶼ */
-
- /* Latin Extended Additional */
- { 0x1E00, AF_ADJUST_DOWN }, /* Ḁ */
- { 0x1E01, AF_ADJUST_DOWN }, /* ḁ */
- { 0x1E02, AF_ADJUST_UP }, /* Ḃ */
- { 0x1E03, AF_ADJUST_UP }, /* ḃ */
- { 0x1E04, AF_ADJUST_DOWN }, /* Ḅ */
- { 0x1E05, AF_ADJUST_DOWN }, /* ḅ */
- { 0x1E06, AF_ADJUST_DOWN }, /* Ḇ */
- { 0x1E07, AF_ADJUST_DOWN }, /* ḇ */
- { 0x1E08, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ḉ */
- { 0x1E09, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* ḉ */
- { 0x1E0A, AF_ADJUST_UP }, /* Ḋ */
- { 0x1E0B, AF_ADJUST_UP }, /* ḋ */
- { 0x1E0C, AF_ADJUST_DOWN }, /* Ḍ */
- { 0x1E0D, AF_ADJUST_DOWN }, /* ḍ */
- { 0x1E0E, AF_ADJUST_DOWN }, /* Ḏ */
- { 0x1E0F, AF_ADJUST_DOWN }, /* ḏ */
-
- { 0x1E10, AF_ADJUST_DOWN }, /* Ḑ */
- { 0x1E11, AF_ADJUST_DOWN }, /* ḑ */
- { 0x1E12, AF_ADJUST_DOWN }, /* Ḓ */
- { 0x1E13, AF_ADJUST_DOWN }, /* ḓ */
- { 0x1E14, AF_ADJUST_UP2 }, /* Ḕ */
- { 0x1E15, AF_ADJUST_UP2 }, /* ḕ */
- { 0x1E16, AF_ADJUST_UP2 }, /* Ḗ */
- { 0x1E17, AF_ADJUST_UP2 }, /* ḗ */
- { 0x1E18, AF_ADJUST_DOWN }, /* Ḙ */
- { 0x1E19, AF_ADJUST_DOWN }, /* ḙ */
- { 0x1E1A, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* Ḛ */
- { 0x1E1B, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* ḛ */
- { 0x1E1C, AF_ADJUST_UP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ḝ */
- { 0x1E1D, AF_ADJUST_UP | AF_IGNORE_SMALL_BOTTOM }, /* ḝ */
- { 0x1E1E, AF_ADJUST_UP }, /* Ḟ */
- { 0x1E1F, AF_ADJUST_UP }, /* ḟ */
-
- { 0x1E20, AF_ADJUST_UP }, /* Ḡ */
- { 0x1E21, AF_ADJUST_UP }, /* ḡ */
- { 0x1E22, AF_ADJUST_UP }, /* Ḣ */
- { 0x1E23, AF_ADJUST_UP }, /* ḣ */
- { 0x1E24, AF_ADJUST_DOWN }, /* Ḥ */
- { 0x1E25, AF_ADJUST_DOWN }, /* ḥ */
- { 0x1E26, AF_ADJUST_UP }, /* Ḧ */
- { 0x1E27, AF_ADJUST_UP }, /* ḧ */
- { 0x1E28, AF_IGNORE_CAPITAL_BOTTOM }, /* Ḩ */
- { 0x1E29, AF_IGNORE_SMALL_BOTTOM }, /* ḩ */
- { 0x1E2A, AF_ADJUST_DOWN }, /* Ḫ */
- { 0x1E2B, AF_ADJUST_DOWN }, /* ḫ */
- { 0x1E2C, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* Ḭ */
- { 0x1E2D, AF_ADJUST_UP | AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* ḭ */
- { 0x1E2E, AF_ADJUST_UP2 }, /* Ḯ */
- { 0x1E2F, AF_ADJUST_UP2 }, /* ḯ */
-
- { 0x1E30, AF_ADJUST_UP }, /* Ḱ */
- { 0x1E31, AF_ADJUST_UP }, /* ḱ */
- { 0x1E32, AF_ADJUST_DOWN }, /* Ḳ */
- { 0x1E33, AF_ADJUST_DOWN }, /* ḳ */
- { 0x1E34, AF_ADJUST_DOWN }, /* Ḵ */
- { 0x1E35, AF_ADJUST_DOWN }, /* ḵ */
- { 0x1E36, AF_ADJUST_DOWN }, /* Ḷ */
- { 0x1E37, AF_ADJUST_DOWN }, /* ḷ */
- { 0x1E38, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ḹ */
- { 0x1E39, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ḹ */
- { 0x1E3A, AF_ADJUST_DOWN }, /* Ḻ */
- { 0x1E3B, AF_ADJUST_DOWN }, /* ḻ */
- { 0x1E3C, AF_ADJUST_DOWN }, /* Ḽ */
- { 0x1E3D, AF_ADJUST_DOWN }, /* ḽ */
- { 0x1E3E, AF_ADJUST_UP }, /* Ḿ */
- { 0x1E3F, AF_ADJUST_UP }, /* ḿ */
-
- { 0x1E40, AF_ADJUST_UP }, /* Ṁ */
- { 0x1E41, AF_ADJUST_UP }, /* ṁ */
- { 0x1E42, AF_ADJUST_DOWN }, /* Ṃ */
- { 0x1E43, AF_ADJUST_DOWN }, /* ṃ */
- { 0x1E44, AF_ADJUST_UP }, /* Ṅ */
- { 0x1E45, AF_ADJUST_UP }, /* ṅ */
- { 0x1E46, AF_ADJUST_DOWN }, /* Ṇ */
- { 0x1E47, AF_ADJUST_DOWN }, /* ṇ */
- { 0x1E48, AF_ADJUST_DOWN }, /* Ṉ */
- { 0x1E49, AF_ADJUST_DOWN }, /* ṉ */
- { 0x1E4A, AF_ADJUST_DOWN }, /* Ṋ */
- { 0x1E4B, AF_ADJUST_DOWN }, /* ṋ */
- { 0x1E4C, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* Ṍ */
- { 0x1E4D, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* ṍ */
- { 0x1E4E, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* Ṏ */
- { 0x1E4F, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* ṏ */
-
- { 0x1E50, AF_ADJUST_UP2 }, /* Ṑ */
- { 0x1E51, AF_ADJUST_UP2 }, /* ṑ */
- { 0x1E52, AF_ADJUST_UP2 }, /* Ṓ */
- { 0x1E53, AF_ADJUST_UP2 }, /* ṓ */
- { 0x1E54, AF_ADJUST_UP }, /* Ṕ */
- { 0x1E55, AF_ADJUST_UP }, /* ṕ */
- { 0x1E56, AF_ADJUST_UP }, /* Ṗ */
- { 0x1E57, AF_ADJUST_UP }, /* ṗ */
- { 0x1E58, AF_ADJUST_UP }, /* Ṙ */
- { 0x1E59, AF_ADJUST_UP }, /* ṙ */
- { 0x1E5A, AF_ADJUST_DOWN }, /* Ṛ */
- { 0x1E5B, AF_ADJUST_DOWN }, /* ṛ */
- { 0x1E5C, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ṝ */
- { 0x1E5D, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ṝ */
- { 0x1E5E, AF_ADJUST_DOWN }, /* Ṟ */
- { 0x1E5F, AF_ADJUST_DOWN }, /* ṟ */
-
- { 0x1E60, AF_ADJUST_UP }, /* Ṡ */
- { 0x1E61, AF_ADJUST_UP }, /* ṡ */
- { 0x1E62, AF_ADJUST_DOWN }, /* Ṣ */
- { 0x1E63, AF_ADJUST_DOWN }, /* ṣ */
- { 0x1E64, AF_ADJUST_UP }, /* Ṥ */
- { 0x1E65, AF_ADJUST_UP }, /* ṥ */
- { 0x1E66, AF_ADJUST_UP }, /* Ṧ */
- { 0x1E67, AF_ADJUST_UP }, /* ṧ */
- { 0x1E68, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ṩ */
- { 0x1E69, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ṩ */
- { 0x1E6A, AF_ADJUST_UP }, /* Ṫ */
- { 0x1E6B, AF_ADJUST_UP }, /* ṫ */
- { 0x1E6C, AF_ADJUST_DOWN }, /* Ṭ */
- { 0x1E6D, AF_ADJUST_DOWN }, /* ṭ */
- { 0x1E6E, AF_ADJUST_DOWN }, /* Ṯ */
- { 0x1E6F, AF_ADJUST_DOWN }, /* ṯ */
-
- { 0x1E70, AF_ADJUST_DOWN }, /* Ṱ */
- { 0x1E71, AF_ADJUST_DOWN }, /* ṱ */
- { 0x1E72, AF_ADJUST_DOWN }, /* Ṳ */
- { 0x1E73, AF_ADJUST_DOWN }, /* ṳ */
- { 0x1E74, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* Ṵ */
- { 0x1E75, AF_ADJUST_DOWN | AF_ADJUST_TILDE_BOTTOM }, /* ṵ */
- { 0x1E76, AF_ADJUST_DOWN }, /* Ṷ */
- { 0x1E77, AF_ADJUST_DOWN }, /* ṷ */
- { 0x1E78, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* Ṹ */
- { 0x1E79, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP2 }, /* ṹ */
- { 0x1E7A, AF_ADJUST_UP2 }, /* Ṻ */
- { 0x1E7B, AF_ADJUST_UP2 }, /* ṻ */
- { 0x1E7C, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ṽ */
- { 0x1E7D, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ṽ */
- { 0x1E7E, AF_ADJUST_DOWN }, /* Ṿ */
- { 0x1E7F, AF_ADJUST_DOWN }, /* ṿ */
-
- { 0x1E80, AF_ADJUST_UP }, /* Ẁ */
- { 0x1E81, AF_ADJUST_UP }, /* ẁ */
- { 0x1E82, AF_ADJUST_UP }, /* Ẃ */
- { 0x1E83, AF_ADJUST_UP }, /* ẃ */
- { 0x1E84, AF_ADJUST_UP }, /* Ẅ */
- { 0x1E85, AF_ADJUST_UP }, /* ẅ */
- { 0x1E86, AF_ADJUST_UP }, /* Ẇ */
- { 0x1E87, AF_ADJUST_UP }, /* ẇ */
- { 0x1E88, AF_ADJUST_DOWN }, /* Ẉ */
- { 0x1E89, AF_ADJUST_DOWN }, /* ẉ */
- { 0x1E8A, AF_ADJUST_UP }, /* Ẋ */
- { 0x1E8B, AF_ADJUST_UP }, /* ẋ */
- { 0x1E8C, AF_ADJUST_UP }, /* Ẍ */
- { 0x1E8D, AF_ADJUST_UP }, /* ẍ */
- { 0x1E8E, AF_ADJUST_UP }, /* Ẏ */
- { 0x1E8F, AF_ADJUST_UP }, /* ẏ */
-
- { 0x1E90, AF_ADJUST_UP }, /* Ẑ */
- { 0x1E91, AF_ADJUST_UP }, /* ẑ */
- { 0x1E92, AF_ADJUST_DOWN }, /* Ẓ */
- { 0x1E93, AF_ADJUST_DOWN }, /* ẓ */
- { 0x1E94, AF_ADJUST_DOWN }, /* Ẕ */
- { 0x1E95, AF_ADJUST_DOWN }, /* ẕ */
- { 0x1E96, AF_ADJUST_DOWN }, /* ẖ */
- { 0x1E97, AF_ADJUST_UP }, /* ẗ */
- { 0x1E98, AF_ADJUST_UP }, /* ẘ */
- { 0x1E99, AF_ADJUST_UP }, /* ẙ */
- { 0x1E9A, AF_ADJUST_UP }, /* ẚ */
- { 0x1E9B, AF_ADJUST_UP }, /* ẛ */
-
- { 0x1EA0, AF_ADJUST_DOWN }, /* Ạ */
- { 0x1EA1, AF_ADJUST_DOWN }, /* ạ */
- { 0x1EA2, AF_ADJUST_UP }, /* Ả */
- { 0x1EA3, AF_ADJUST_UP }, /* ả */
- { 0x1EA4, AF_ADJUST_UP2 }, /* Ấ */
- { 0x1EA5, AF_ADJUST_UP2 }, /* ấ */
- { 0x1EA6, AF_ADJUST_UP2 }, /* Ầ */
- { 0x1EA7, AF_ADJUST_UP2 }, /* ầ */
- { 0x1EA8, AF_ADJUST_UP2 }, /* Ẩ */
- { 0x1EA9, AF_ADJUST_UP2 }, /* ẩ */
- { 0x1EAA, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ẫ */
- { 0x1EAB, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ẫ */
- { 0x1EAC, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ậ */
- { 0x1EAD, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ậ */
- { 0x1EAE, AF_ADJUST_UP2 }, /* Ắ */
- { 0x1EAF, AF_ADJUST_UP2 }, /* ắ */
-
- { 0x1EB0, AF_ADJUST_UP2 }, /* Ằ */
- { 0x1EB1, AF_ADJUST_UP2 }, /* ằ */
- { 0x1EB2, AF_ADJUST_UP2 }, /* Ẳ */
- { 0x1EB3, AF_ADJUST_UP2 }, /* ẳ */
- { 0x1EB4, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ẵ */
- { 0x1EB5, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ẵ */
- { 0x1EB6, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ặ */
- { 0x1EB7, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ặ */
- { 0x1EB8, AF_ADJUST_DOWN }, /* Ẹ */
- { 0x1EB9, AF_ADJUST_DOWN }, /* ẹ */
- { 0x1EBA, AF_ADJUST_UP }, /* Ẻ */
- { 0x1EBB, AF_ADJUST_UP }, /* ẻ */
- { 0x1EBC, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ẽ */
- { 0x1EBD, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ẽ */
- { 0x1EBE, AF_ADJUST_UP2 }, /* Ế */
- { 0x1EBF, AF_ADJUST_UP2 }, /* ế */
-
- { 0x1EC0, AF_ADJUST_UP2 }, /* Ề */
- { 0x1EC1, AF_ADJUST_UP2 }, /* ề */
- { 0x1EC2, AF_ADJUST_UP2 }, /* Ể */
- { 0x1EC3, AF_ADJUST_UP2 }, /* ể */
- { 0x1EC4, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ễ */
- { 0x1EC5, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ễ */
- { 0x1EC6, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ệ */
- { 0x1EC7, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ệ */
- { 0x1EC8, AF_ADJUST_UP }, /* Ỉ */
- { 0x1EC9, AF_ADJUST_UP }, /* ỉ */
- { 0x1ECA, AF_ADJUST_DOWN }, /* Ị */
- { 0x1ECB, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ị */
- { 0x1ECC, AF_ADJUST_DOWN }, /* Ọ */
- { 0x1ECD, AF_ADJUST_DOWN }, /* ọ */
- { 0x1ECE, AF_ADJUST_UP }, /* Ỏ */
- { 0x1ECF, AF_ADJUST_UP }, /* ỏ */
-
- { 0x1ED0, AF_ADJUST_UP2 }, /* Ố */
- { 0x1ED1, AF_ADJUST_UP2 }, /* ố */
- { 0x1ED2, AF_ADJUST_UP2 }, /* Ồ */
- { 0x1ED3, AF_ADJUST_UP2 }, /* ồ */
- { 0x1ED4, AF_ADJUST_UP2 }, /* Ổ */
- { 0x1ED5, AF_ADJUST_UP2 }, /* ổ */
- { 0x1ED6, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* Ỗ */
- { 0x1ED7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ỗ */
- { 0x1ED8, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* Ộ */
- { 0x1ED9, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ộ */
- { 0x1EDA, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ớ */
- { 0x1EDB, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ớ */
- { 0x1EDC, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ờ */
- { 0x1EDD, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ờ */
- { 0x1EDE, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ở */
- { 0x1EDF, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ở */
-
- { 0x1EE0, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_CAPITAL_TOP }, /* Ỡ */
- { 0x1EE1, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_SMALL_TOP }, /* ỡ */
- { 0x1EE2, AF_ADJUST_DOWN | AF_IGNORE_CAPITAL_TOP }, /* Ợ */
- { 0x1EE3, AF_ADJUST_DOWN | AF_IGNORE_SMALL_TOP }, /* ợ */
- { 0x1EE4, AF_ADJUST_DOWN }, /* Ụ */
- { 0x1EE5, AF_ADJUST_DOWN }, /* ụ */
- { 0x1EE6, AF_ADJUST_UP }, /* Ủ */
- { 0x1EE7, AF_ADJUST_UP }, /* ủ */
- { 0x1EE8, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ứ */
- { 0x1EE9, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ứ */
- { 0x1EEA, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ừ */
- { 0x1EEB, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ừ */
- { 0x1EEC, AF_ADJUST_UP | AF_IGNORE_CAPITAL_TOP }, /* Ử */
- { 0x1EED, AF_ADJUST_UP | AF_IGNORE_SMALL_TOP }, /* ử */
- { 0x1EEE, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_CAPITAL_TOP }, /* Ữ */
- { 0x1EEF, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_IGNORE_SMALL_TOP }, /* ữ */
-
- { 0x1EF0, AF_ADJUST_DOWN | AF_IGNORE_CAPITAL_TOP }, /* Ự */
- { 0x1EF1, AF_ADJUST_DOWN | AF_IGNORE_SMALL_TOP }, /* ự */
- { 0x1EF2, AF_ADJUST_UP }, /* Ỳ */
- { 0x1EF3, AF_ADJUST_UP }, /* ỳ */
- { 0x1EF4, AF_ADJUST_DOWN }, /* Ỵ */
- { 0x1EF5, AF_ADJUST_DOWN }, /* ỵ */
- { 0x1EF6, AF_ADJUST_UP }, /* Ỷ */
- { 0x1EF7, AF_ADJUST_UP }, /* ỷ */
- { 0x1EF8, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* Ỹ */
- { 0x1EF9, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ỹ */
-
- /* Greek Extended */
- { 0x1F00, AF_ADJUST_UP }, /* ἀ */
- { 0x1F01, AF_ADJUST_UP }, /* ἁ */
- { 0x1F02, AF_ADJUST_UP }, /* ἂ */
- { 0x1F03, AF_ADJUST_UP }, /* ἃ */
- { 0x1F04, AF_ADJUST_UP }, /* ἄ */
- { 0x1F05, AF_ADJUST_UP }, /* ἅ */
- { 0x1F06, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἆ */
- { 0x1F07, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἇ */
-
- { 0x1F10, AF_ADJUST_UP }, /* ἐ */
- { 0x1F11, AF_ADJUST_UP }, /* ἑ */
- { 0x1F12, AF_ADJUST_UP }, /* ἒ */
- { 0x1F13, AF_ADJUST_UP }, /* ἓ */
- { 0x1F14, AF_ADJUST_UP }, /* ἔ */
- { 0x1F15, AF_ADJUST_UP }, /* ἕ */
-
- { 0x1F20, AF_ADJUST_UP }, /* ἠ */
- { 0x1F21, AF_ADJUST_UP }, /* ἡ */
- { 0x1F22, AF_ADJUST_UP }, /* ἢ */
- { 0x1F23, AF_ADJUST_UP }, /* ἣ */
- { 0x1F24, AF_ADJUST_UP }, /* ἤ */
- { 0x1F25, AF_ADJUST_UP }, /* ἥ */
- { 0x1F26, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἦ */
- { 0x1F27, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἧ */
-
- { 0x1F30, AF_ADJUST_UP }, /* ἰ */
- { 0x1F31, AF_ADJUST_UP }, /* ἱ */
- { 0x1F32, AF_ADJUST_UP }, /* ἲ */
- { 0x1F33, AF_ADJUST_UP }, /* ἳ */
- { 0x1F34, AF_ADJUST_UP }, /* ἴ */
- { 0x1F35, AF_ADJUST_UP }, /* ἵ */
- { 0x1F36, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἶ */
- { 0x1F37, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ἷ */
-
- { 0x1F40, AF_ADJUST_UP }, /* ὀ */
- { 0x1F41, AF_ADJUST_UP }, /* ὁ */
- { 0x1F42, AF_ADJUST_UP }, /* ὂ */
- { 0x1F43, AF_ADJUST_UP }, /* ὃ */
- { 0x1F44, AF_ADJUST_UP }, /* ὄ */
- { 0x1F45, AF_ADJUST_UP }, /* ὅ */
-
- { 0x1F50, AF_ADJUST_UP }, /* ὐ */
- { 0x1F51, AF_ADJUST_UP }, /* ὑ */
- { 0x1F52, AF_ADJUST_UP }, /* ὒ */
- { 0x1F53, AF_ADJUST_UP }, /* ὓ */
- { 0x1F54, AF_ADJUST_UP }, /* ὔ */
- { 0x1F55, AF_ADJUST_UP }, /* ὕ */
- { 0x1F56, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ὖ */
- { 0x1F57, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ὗ */
-
- { 0x1F60, AF_ADJUST_UP }, /* ὠ */
- { 0x1F61, AF_ADJUST_UP }, /* ὡ */
- { 0x1F62, AF_ADJUST_UP }, /* ὢ */
- { 0x1F63, AF_ADJUST_UP }, /* ὣ */
- { 0x1F64, AF_ADJUST_UP }, /* ὤ */
- { 0x1F65, AF_ADJUST_UP }, /* ὥ */
- { 0x1F66, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ὦ */
- { 0x1F67, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ὧ */
-
- { 0x1F70, AF_ADJUST_UP }, /* ὰ */
- { 0x1F71, AF_ADJUST_UP }, /* ά */
- { 0x1F72, AF_ADJUST_UP }, /* ὲ */
- { 0x1F73, AF_ADJUST_UP }, /* έ */
- { 0x1F74, AF_ADJUST_UP }, /* ὴ */
- { 0x1F75, AF_ADJUST_UP }, /* ή */
- { 0x1F76, AF_ADJUST_UP }, /* ὶ */
- { 0x1F77, AF_ADJUST_UP }, /* ί */
- { 0x1F78, AF_ADJUST_UP }, /* ὸ */
- { 0x1F79, AF_ADJUST_UP }, /* ό */
- { 0x1F7A, AF_ADJUST_UP }, /* ὺ */
- { 0x1F7B, AF_ADJUST_UP }, /* ύ */
- { 0x1F7C, AF_ADJUST_UP }, /* ὼ */
- { 0x1F7D, AF_ADJUST_UP }, /* ώ */
-
- { 0x1F80, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾀ */
- { 0x1F81, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾁ */
- { 0x1F82, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾂ */
- { 0x1F83, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾃ */
- { 0x1F84, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾄ */
- { 0x1F85, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾅ */
- { 0x1F86, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾆ */
- { 0x1F87, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾇ */
- { 0x1F88, AF_ADJUST_DOWN }, /* ᾈ */
- { 0x1F89, AF_ADJUST_DOWN }, /* ᾉ */
- { 0x1F8A, AF_ADJUST_DOWN }, /* ᾊ */
- { 0x1F8B, AF_ADJUST_DOWN }, /* ᾋ */
- { 0x1F8C, AF_ADJUST_DOWN }, /* ᾌ */
- { 0x1F8D, AF_ADJUST_DOWN }, /* ᾍ */
- { 0x1F8E, AF_ADJUST_DOWN }, /* ᾎ */
- { 0x1F8F, AF_ADJUST_DOWN }, /* ᾏ */
-
- { 0x1F90, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾐ */
- { 0x1F91, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾑ */
- { 0x1F92, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾒ */
- { 0x1F93, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾓ */
- { 0x1F94, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾔ */
- { 0x1F95, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾕ */
- { 0x1F96, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾖ */
- { 0x1F97, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾗ */
- { 0x1F98, AF_ADJUST_DOWN }, /* ᾘ */
- { 0x1F99, AF_ADJUST_DOWN }, /* ᾙ */
- { 0x1F9A, AF_ADJUST_DOWN }, /* ᾚ */
- { 0x1F9B, AF_ADJUST_DOWN }, /* ᾛ */
- { 0x1F9C, AF_ADJUST_DOWN }, /* ᾜ */
- { 0x1F9D, AF_ADJUST_DOWN }, /* ᾝ */
- { 0x1F9E, AF_ADJUST_DOWN }, /* ᾞ */
- { 0x1F9F, AF_ADJUST_DOWN }, /* ᾟ */
-
- { 0x1FA0, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾠ */
- { 0x1FA1, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾡ */
- { 0x1FA2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾢ */
- { 0x1FA3, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾣ */
- { 0x1FA4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾤ */
- { 0x1FA5, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾥ */
- { 0x1FA6, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾦ */
- { 0x1FA7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾧ */
- { 0x1FA8, AF_ADJUST_DOWN }, /* ᾨ */
- { 0x1FA9, AF_ADJUST_DOWN }, /* ᾩ */
- { 0x1FAA, AF_ADJUST_DOWN }, /* ᾪ */
- { 0x1FAB, AF_ADJUST_DOWN }, /* ᾫ */
- { 0x1FAC, AF_ADJUST_DOWN }, /* ᾬ */
- { 0x1FAD, AF_ADJUST_DOWN }, /* ᾭ */
- { 0x1FAE, AF_ADJUST_DOWN }, /* ᾮ */
- { 0x1FAF, AF_ADJUST_DOWN }, /* ᾯ */
-
- { 0x1FB0, AF_ADJUST_UP }, /* ᾰ */
- { 0x1FB1, AF_ADJUST_UP }, /* ᾱ */
- { 0x1FB2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾲ */
- { 0x1FB3, AF_ADJUST_DOWN }, /* ᾳ */
- { 0x1FB4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ᾴ */
- { 0x1FB6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ᾶ */
- { 0x1FB7, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ᾷ */
- { 0x1FB8, AF_ADJUST_UP }, /* Ᾰ */
- { 0x1FB9, AF_ADJUST_UP }, /* Ᾱ */
- { 0x1FBC, AF_ADJUST_DOWN }, /* ᾼ */
-
- { 0x1FC2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ῂ */
- { 0x1FC3, AF_ADJUST_DOWN }, /* ῃ */
- { 0x1FC4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ῄ */
- { 0x1FC6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ῆ */
- { 0x1FC7, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ῇ */
- { 0x1FCC, AF_ADJUST_DOWN }, /* ῌ */
-
- { 0x1FD0, AF_ADJUST_UP }, /* ῐ */
- { 0x1FD1, AF_ADJUST_UP }, /* ῑ */
- { 0x1FD2, AF_ADJUST_UP2 }, /* ῒ */
- { 0x1FD3, AF_ADJUST_UP2 }, /* ΐ */
- { 0x1FD6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ῖ */
- { 0x1FD7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ῗ */
- { 0x1FD8, AF_ADJUST_UP }, /* Ῐ */
- { 0x1FD9, AF_ADJUST_UP }, /* Ῑ */
-
- { 0x1FE0, AF_ADJUST_UP }, /* ῠ */
- { 0x1FE1, AF_ADJUST_UP }, /* ῡ */
- { 0x1FE2, AF_ADJUST_UP2 }, /* ῢ */
- { 0x1FE3, AF_ADJUST_UP2 }, /* ΰ */
- { 0x1FE4, AF_ADJUST_UP }, /* ῤ */
- { 0x1FE5, AF_ADJUST_UP }, /* ῥ */
- { 0x1FE6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ῦ */
- { 0x1FE7, AF_ADJUST_UP2 | AF_ADJUST_TILDE_TOP }, /* ῧ */
- { 0x1FE8, AF_ADJUST_UP }, /* Ῠ */
- { 0x1FE9, AF_ADJUST_UP }, /* Ῡ */
- { 0x1FF2, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ῲ */
- { 0x1FF3, AF_ADJUST_DOWN }, /* ῳ */
- { 0x1FF4, AF_ADJUST_UP | AF_ADJUST_DOWN }, /* ῴ */
- { 0x1FF6, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP }, /* ῶ */
- { 0x1FF7, AF_ADJUST_UP | AF_ADJUST_TILDE_TOP | AF_ADJUST_DOWN }, /* ῷ */
- { 0x1FFC, AF_ADJUST_DOWN }, /* ῼ */
-
- /* General Punctuation */
- { 0x203C, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ‼ */
- { 0x203D, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ‽ */
-
- { 0x2047, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ⁇ */
- { 0x2048, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ⁈ */
- { 0x2049, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ⁉ */
-
- /* Superscripts and Subscripts */
- { 0x2071, AF_ADJUST_UP }, /* ⁱ */
-
- /* Currency Symbols */
- { 0x20AB, AF_ADJUST_DOWN }, /* ₫ */
-
- { 0x20C0, AF_ADJUST_DOWN }, /* ⃀ */
-
- /* Number Forms */
- { 0x2170, AF_ADJUST_UP }, /* ⅰ */
- { 0x2171, AF_ADJUST_UP }, /* ⅱ */
- { 0x2172, AF_ADJUST_UP }, /* ⅲ */
- { 0x2173, AF_ADJUST_UP }, /* ⅳ */
- { 0x2175, AF_ADJUST_UP }, /* ⅵ */
- { 0x2176, AF_ADJUST_UP }, /* ⅶ */
- { 0x2177, AF_ADJUST_UP }, /* ⅷ */
- { 0x2178, AF_ADJUST_UP }, /* ⅸ */
- { 0x217A, AF_ADJUST_UP }, /* ⅺ */
- { 0x217B, AF_ADJUST_UP }, /* ⅻ */
-
- /* Latin Extended-C */
- { 0x2C64, AF_IGNORE_CAPITAL_BOTTOM } , /* Ɽ */
- { 0x2C67, AF_IGNORE_CAPITAL_BOTTOM } , /* Ⱨ */
- { 0x2C68, AF_IGNORE_SMALL_BOTTOM } , /* ⱨ */
- { 0x2C69, AF_IGNORE_CAPITAL_BOTTOM } , /* Ⱪ */
- { 0x2C6A, AF_IGNORE_SMALL_BOTTOM } , /* ⱪ */
- { 0x2C6B, AF_IGNORE_CAPITAL_BOTTOM } , /* Ⱬ */
- { 0x2C6C, AF_IGNORE_SMALL_BOTTOM } , /* ⱬ */
- { 0x2C6E, AF_IGNORE_CAPITAL_BOTTOM } , /* Ɱ */
-
- { 0x2C7C, AF_ADJUST_UP }, /* ⱼ */
- { 0x2C7E, AF_IGNORE_CAPITAL_BOTTOM } , /* Ȿ */
- { 0x2C7F, AF_IGNORE_CAPITAL_BOTTOM } , /* Ɀ */
-
- /* Coptic */
- { 0x2CC2, AF_ADJUST_UP }, /* Ⳃ */
- { 0x2CC3, AF_ADJUST_UP }, /* ⳃ */
-
- /* Supplemental Punctuation */
- { 0x2E18, AF_ADJUST_UP }, /* ⸘ */
-
- { 0x2E2E, AF_ADJUST_UP | AF_ADJUST_NO_HEIGHT_CHECK }, /* ⸮ */
-
- /* Cyrillic Extended-B */
- { 0xA640, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꙁ */
- { 0xA641, AF_IGNORE_SMALL_BOTTOM } , /* ꙁ */
- { 0xA642, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꙃ */
- { 0xA643, AF_IGNORE_SMALL_BOTTOM } , /* ꙃ */
-
- { 0xA680, AF_IGNORE_CAPITAL_TOP } , /* Ꚁ */
- { 0xA681, AF_IGNORE_SMALL_TOP } , /* ꚁ */
- { 0xA688, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚉ */
- { 0xA689, AF_IGNORE_SMALL_BOTTOM } , /* ꚉ */
- { 0xA68A, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚋ */
- { 0xA68B, AF_IGNORE_SMALL_BOTTOM } , /* ꚋ */
- { 0xA68E, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚏ */
- { 0xA68F, AF_IGNORE_SMALL_BOTTOM } , /* ꚏ */
-
- { 0xA690, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚑ */
- { 0xA691, AF_IGNORE_SMALL_BOTTOM } , /* ꚑ */
- { 0xA696, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꚗ */
- { 0xA697, AF_IGNORE_SMALL_BOTTOM } , /* ꚗ */
-
- /* Latin Extended-D */
- { 0xA726, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꜧ */
- { 0xA727, AF_IGNORE_SMALL_BOTTOM } , /* ꜧ */
-
- { 0xA756, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꝗ */
- { 0xA758, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꝙ */
-
- { 0xA771, AF_IGNORE_SMALL_BOTTOM } , /* ꝱ */
- { 0xA772, AF_IGNORE_SMALL_BOTTOM } , /* ꝲ */
- { 0xA773, AF_IGNORE_SMALL_BOTTOM } , /* ꝳ */
- { 0xA774, AF_IGNORE_SMALL_BOTTOM } , /* ꝴ */
- { 0xA776, AF_IGNORE_SMALL_BOTTOM } , /* ꝶ */
-
- { 0xA790, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꞑ */
- { 0xA791, AF_IGNORE_SMALL_BOTTOM } , /* ꞑ */
- { 0xA794, AF_IGNORE_SMALL_BOTTOM } , /* ꞔ */
- { 0xA795, AF_IGNORE_SMALL_BOTTOM } , /* ꞕ */
-
- { 0xA7C0, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* Ꟁ */
- { 0xA7C1, AF_IGNORE_SMALL_TOP | AF_IGNORE_SMALL_BOTTOM }, /* ꟁ */
- { 0xA7C4, AF_IGNORE_CAPITAL_BOTTOM } , /* Ꞔ */
- { 0xA7C5, AF_IGNORE_CAPITAL_BOTTOM } , /* Ʂ */
- { 0xA7C6, AF_IGNORE_CAPITAL_BOTTOM } , /* Ᶎ */
- { 0xA7CC, AF_IGNORE_CAPITAL_TOP | AF_IGNORE_CAPITAL_BOTTOM }, /* */
- { 0xA7CD, AF_IGNORE_SMALL_TOP | AF_IGNORE_SMALL_BOTTOM }, /* */
-
- /* Latin Extended-E */
- { 0xAB3C, AF_IGNORE_SMALL_BOTTOM } , /* ꬼ */
-
- { 0xAB46, AF_IGNORE_SMALL_BOTTOM } , /* ꭆ */
-
- { 0xAB5C, AF_IGNORE_SMALL_BOTTOM } , /* ꭜ */
-
- { 0xAB66, AF_IGNORE_SMALL_BOTTOM } , /* ꭦ */
- { 0xAB67, AF_IGNORE_SMALL_BOTTOM } , /* ꭧ */
- };
-
-
- FT_LOCAL_DEF( FT_UInt32 )
- af_adjustment_database_lookup( FT_UInt32 codepoint )
- {
- /* Binary search for database entry */
- FT_Offset low = 0;
- FT_Offset high = AF_ADJUSTMENT_DATABASE_LENGTH - 1;
-
-
- while ( high >= low )
- {
- FT_Offset mid = ( low + high ) / 2;
- FT_UInt32 mid_codepoint = adjustment_database[mid].codepoint;
-
-
- if ( mid_codepoint < codepoint )
- low = mid + 1;
- else if ( mid_codepoint > codepoint )
- high = mid - 1;
- else
- return adjustment_database[mid].flags;
- }
-
- return 0;
- }
-
-
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
-
- static FT_Error
- add_substitute( FT_Int glyph_idx,
- size_t value,
- FT_UInt32 codepoint,
- FT_Hash reverse_map,
- FT_Hash subst_map,
- FT_Memory memory )
- {
- FT_Error error;
-
- FT_Int first_substitute = (FT_Int)( value & 0xFFFF );
-
- FT_UInt used = reverse_map->used;
-
-
- /*
- OpenType features like 'unic' map lowercase letter glyphs to uppercase
- forms (and vice versa), which could lead to the use of wrong entries
- in the adjustment database. For this reason we don't overwrite,
- prioritizing cmap entries.
-
- XXX Note, however, that this cannot cover all cases since there might
- be contradictory entries for glyphs not in the cmap. A possible
- solution might be to specially mark pairs of related lowercase and
- uppercase characters in the adjustment database that have diacritics
- on different vertical sides (for example, U+0122 'Ģ' and U+0123 'ģ').
- The auto-hinter could then perform a topological analysis to do the
- right thing.
- */
- error = ft_hash_num_insert_no_overwrite( first_substitute, codepoint,
- reverse_map, memory );
- if ( error )
- return error;
-
- if ( reverse_map->used > used )
- {
- size_t* subst = ft_hash_num_lookup( first_substitute, subst_map );
-
-
- if ( subst )
- {
- error = add_substitute( first_substitute, *subst, codepoint,
- reverse_map, subst_map, memory );
- if ( error )
- return error;
- }
- }
-
- /* The remaining substitutes. */
- if ( value & 0xFFFF0000U )
- {
- FT_UInt num_substitutes = value >> 16;
-
- FT_UInt i;
-
-
- for ( i = 1; i <= num_substitutes; i++ )
- {
- FT_Int idx = glyph_idx + (FT_Int)( i << 16 );
- size_t* substitute = ft_hash_num_lookup( idx, subst_map );
-
-
- used = reverse_map->used;
-
- error = ft_hash_num_insert_no_overwrite( *substitute,
- codepoint,
- reverse_map,
- memory );
- if ( error )
- return error;
-
- if ( reverse_map->used > used )
- {
- size_t* subst = ft_hash_num_lookup( *substitute, subst_map );
-
-
- if ( subst )
- {
- error = add_substitute( *substitute, *subst, codepoint,
- reverse_map, subst_map, memory );
- if ( error )
- return error;
- }
- }
- }
- }
-
- return FT_Err_Ok;
- }
-
-#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */
-
-
- /* Construct a 'reverse cmap' (i.e., a mapping from glyph indices to */
- /* character codes) for all glyphs that an input code point could turn */
- /* into. */
- /* */
- /* If HarfBuzz support is not available, this is the direct inversion */
- /* of the cmap table, otherwise the mapping gets extended with data */
- /* from the 'GSUB' table. */
- FT_LOCAL_DEF( FT_Error )
- af_reverse_character_map_new( FT_Hash *map,
- AF_StyleMetrics metrics )
- {
- FT_Error error;
-
- AF_FaceGlobals globals = metrics->globals;
- FT_Face face = globals->face;
- FT_Memory memory = face->memory;
-
- FT_CharMap old_charmap;
-
- FT_UInt32 codepoint;
- FT_Offset i;
-
-
- FT_TRACE4(( "af_reverse_character_map_new:"
- " building reverse character map (style `%s')\n",
- af_style_names[metrics->style_class->style] ));
-
- /* Search for a unicode charmap. */
- /* If there isn't one, create a blank map. */
-
- /* Back up `face->charmap` because `find_unicode_charmap` sets it. */
- old_charmap = face->charmap;
-
- if ( ( error = find_unicode_charmap( face ) ) )
- goto Exit;
-
- *map = NULL;
- if ( FT_QNEW( *map ) )
- goto Exit;
-
- error = ft_hash_num_init( *map, memory );
- if ( error )
- goto Exit;
-
- /* Initialize reverse cmap with data directly from the cmap table. */
- for ( i = 0; i < AF_ADJUSTMENT_DATABASE_LENGTH; i++ )
- {
- FT_Int cmap_glyph;
-
-
- /*
- We cannot restrict `codepoint` to character ranges; we have no
- control what data the script-specific portion of the GSUB table
- actually holds.
-
- An example is `arial.ttf` version 7.00; in this font, there are
- lookups for Cyrillic (lookup 43), Greek (lookup 44), and Latin
- (lookup 45) that map capital letter glyphs to small capital glyphs.
- It is tempting to expect that script-specific versions of the 'c2sc'
- feature only use script-specific lookups. However, this is not the
- case in this font: the feature uses all three lookups regardless of
- the script.
-
- The auto-hinter, while assigning glyphs to styles, uses the first
- coverage result it encounters for a particular glyph. For example,
- if the coverage for Cyrillic is tested before Latin (as is currently
- the case), glyphs without a cmap entry that are covered in 'c2sc'
- are treated as Cyrillic.
-
- If we now look at glyph 3498, which is a small-caps version of the
- Latin character 'A grave' (U+00C0, glyph 172), we can see that it is
- registered as belonging to a Cyrillic style due to the algorithm
- just described. As a result, checking only for characters from the
- Latin range would miss this glyph; we thus have to test all
- character codes in the database.
- */
- codepoint = adjustment_database[i].codepoint;
-
- cmap_glyph = (FT_Int)FT_Get_Char_Index( face, codepoint );
- if ( cmap_glyph == 0 )
- continue;
-
- error = ft_hash_num_insert( cmap_glyph, codepoint, *map, memory );
- if ( error )
- goto Exit;
- }
-
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
-
- if ( ft_hb_enabled( globals ) )
- {
- hb_font_t *hb_font;
- hb_face_t *hb_face;
-
- hb_set_t *gsub_lookups;
- hb_script_t script;
-
- unsigned int script_count = 1;
- hb_tag_t script_tags[2] = { HB_TAG_NONE, HB_TAG_NONE };
-
- FT_Hash subst_map = NULL;
-
- hb_codepoint_t idx;
- FT_UInt hash_idx;
- FT_Int glyph_idx;
- size_t value;
-
-
- /* No need to check whether HarfBuzz has allocation issues; */
- /* it continues to work in such cases and simply returns */
- /* 'empty' objects that do nothing. */
-
- hb_font = globals->hb_font;
- hb_face = hb( font_get_face )( hb_font );
-
- gsub_lookups = hb( set_create )();
-
- script = af_hb_scripts[metrics->style_class->script];
-
- hb( ot_tags_from_script_and_language )( script, NULL,
- &script_count, script_tags,
- NULL, NULL );
-
- /* Compute set of all script-specific GSUB lookups. */
- hb( ot_layout_collect_lookups )( hb_face,
- HB_OT_TAG_GSUB,
- script_tags, NULL, NULL,
- gsub_lookups );
-
-#ifdef FT_DEBUG_LEVEL_TRACE
- {
- FT_Bool have_idx = FALSE;
-
-
- FT_TRACE4(( " GSUB lookups to check:\n" ));
-
- FT_TRACE4(( " " ));
- idx = HB_SET_VALUE_INVALID;
- while ( hb( set_next )( gsub_lookups, &idx ) )
- if ( idx < globals->gsub_lookup_count &&
- globals->gsub_lookups_single_alternate[idx] )
- {
- have_idx = TRUE;
- FT_TRACE4(( " %u", idx ));
- }
- if ( !have_idx )
- FT_TRACE4(( " (none)" ));
- FT_TRACE4(( "\n" ));
-
- FT_TRACE4(( "\n" ));
- }
-#endif
-
- if ( FT_QNEW( subst_map ) )
- goto Exit_HarfBuzz;
-
- error = ft_hash_num_init( subst_map, memory );
- if ( error )
- goto Exit_HarfBuzz;
-
- idx = HB_SET_VALUE_INVALID;
- while ( hb( set_next )( gsub_lookups, &idx ) )
- {
- FT_UInt32 offset;
-
-
- /* HarfBuzz only validates lookup indices while */
- /* processing lookups, not while collecting them, */
- /* so we have to do that by ourselves. */
- if ( idx < globals->gsub_lookup_count )
- offset = globals->gsub_lookups_single_alternate[idx];
- else
- offset = 0;
-
- /* Put all substitutions into a single hash table. Note that */
- /* the hash values usually contain more than a single character */
- /* code; this can happen if different 'SingleSubst' subtables */
- /* map a given glyph index to different substitutions, or if */
- /* 'AlternateSubst' subtable entries are present. */
- if ( offset )
- af_map_lookup( globals, subst_map, offset );
- }
-
- /*
- Now iterate over the collected substitution data in `subst_map`
- (using recursion to resolve one-to-many mappings) and insert the
- data into the reverse cmap.
-
- As an example, suppose we have the following cmap and substitution
- data:
-
- cmap: X -> a
- Y -> b
- Z -> c
-
- substitutions: a -> b
- b -> c, d
- d -> e
-
- The reverse map now becomes as follows.
-
- a -> X
- b -> Y
- c -> Z (via cmap, ignoring mapping from 'b')
- d -> Y (via 'b')
- e -> Y (via 'b' and 'd')
- */
-
- hash_idx = 0;
- while ( ft_hash_num_iterator( &hash_idx,
- &glyph_idx,
- &value,
- subst_map ) )
- {
- size_t* val;
-
-
- /* Ignore keys that do not point to the first substitute. */
- if ( (FT_UInt)glyph_idx & 0xFFFF0000U )
- continue;
-
- /* Ignore glyph indices that are not related to accents. */
- val = ft_hash_num_lookup( glyph_idx, *map );
- if ( !val )
- continue;
-
- codepoint = *val;
-
- error = add_substitute( glyph_idx, value, codepoint,
- *map, subst_map, memory );
- if ( error )
- break;
- }
-
- Exit_HarfBuzz:
- hb( set_destroy )( gsub_lookups );
-
- ft_hash_num_free( subst_map, memory );
- FT_FREE( subst_map );
-
- if ( error )
- goto Exit;
- }
-
-#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */
-
- FT_TRACE4(( " reverse character map built successfully"
- " with %u entries\n", ( *map )->used ));
-
-#ifdef FT_DEBUG_LEVEL_TRACE
-
- {
- FT_UInt cnt;
-
-
- FT_TRACE7(( " gidx code flags\n" ));
- /* " XXXXX 0xXXXX XXXXXXXXXXX..." */
- FT_TRACE7(( " ------------------------------\n" ));
-
- for ( cnt = 0; cnt < globals->glyph_count; cnt++ )
- {
- size_t* val;
- FT_UInt32 adj_type;
-
- const char* flag_names[] =
- {
- "up", /* AF_ADJUST_UP */
- "down", /* AF_ADJUST_DOWN */
- "double up", /* AF_ADJUST_UP2 */
- "double down", /* AF_ADJUST_DOWN2 */
-
- "top tilde", /* AF_ADJUST_TILDE_TOP */
- "bottom tilde", /* AF_ADJUST_TILDE_BOTTOM */
- "below-top tilde", /* AF_ADJUST_TILDE_TOP2 */
- "above-bottom tilde", /* AF_ADJUST_TILDE_BOTTOM2 */
-
- "ignore capital top", /* AF_IGNORE_CAPITAL_TOP */
- "ignore capital bottom", /* AF_IGNORE_CAPITAL_BOTTOM */
- "ignore small top", /* AF_IGNORE_SMALL_TOP */
- "ignore small bottom", /* AF_IGNORE_SMALL_BOTTOM */
- };
- size_t flag_names_size = sizeof ( flag_names ) / sizeof ( char* );
-
- char flag_str[256];
- int need_comma;
-
- size_t j;
-
-
- val = ft_hash_num_lookup( (FT_Int)cnt, *map );
- if ( !val )
- continue;
- codepoint = *val;
-
- adj_type = af_adjustment_database_lookup( codepoint );
- if ( !adj_type )
- continue;
-
- flag_str[0] = '\0';
- need_comma = 0;
-
- for ( j = 0; j < flag_names_size; j++ )
- {
- if ( adj_type & (1 << j ) )
- {
- if ( !need_comma )
- need_comma = 1;
- else
- strcat( flag_str, ", " );
- strcat( flag_str, flag_names[j] );
- }
- }
-
- FT_TRACE7(( " %5u 0x%04X %s\n", cnt, codepoint, flag_str ));
- }
- }
-
-#endif /* FT_DEBUG_LEVEL_TRACE */
-
-
- Exit:
- face->charmap = old_charmap;
-
- if ( error )
- {
- FT_TRACE4(( " error while building reverse character map."
- " Using blank map.\n" ));
-
- if ( *map )
- ft_hash_num_free( *map, memory );
-
- FT_FREE( *map );
- *map = NULL;
- return error;
- }
-
- return FT_Err_Ok;
- }
-
-
- FT_LOCAL_DEF( FT_Error )
- af_reverse_character_map_done( FT_Hash map,
- FT_Memory memory )
- {
- if ( map )
- ft_hash_num_free( map, memory );
- FT_FREE( map );
-
- return FT_Err_Ok;
- }
-
-
-/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afadjust.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afadjust.h
deleted file mode 100644
index 4837451ae4..0000000000
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afadjust.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
- *
- * afadjust.h
- *
- * Auto-fitter routines to adjust components based on charcode (header).
- *
- * Copyright (C) 2023-2025 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
- *
- * Written by Craig White <gerzytet@gmail.com>.
- *
- * This file is part of the FreeType project, and may only be used,
- * modified, and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- */
-
-
-#ifndef AFADJUST_H_
-#define AFADJUST_H_
-
-#include <freetype/fttypes.h>
-
-#include "afglobal.h"
-#include "aftypes.h"
-
-
-FT_BEGIN_HEADER
-
- /*
- * Adjustment type flags.
- *
- * They also specify topological constraints that the auto-hinter relies
- * on. For example, using `AF_ADJUST_UP` implies that we have two
- * enclosing contours, one for the base glyph and one for the diacritic
- * above, and no other contour inbetween or above. With 'enclosing' it is
- * meant that such a contour can contain more inner contours.
- *
- */
-
- /* Find the topmost contour and push it up until its lowest point is */
- /* one pixel above the highest point not enclosed by that contour. */
-#define AF_ADJUST_UP 0x01
-
- /* Find the bottommost contour and push it down until its highest point */
- /* is one pixel below the lowest point not enclosed by that contour. */
-#define AF_ADJUST_DOWN 0x02
-
- /* Find the contour below the topmost contour and push it up, together */
- /* with the topmost contour, until its lowest point is one pixel above */
- /* the highest point not enclosed by that contour. This flag is */
- /* mutually exclusive with `AF_ADJUST_UP`. */
-#define AF_ADJUST_UP2 0x04
-
- /* Find the contour above the bottommost contour and push it down, */
- /* together with the bottommost contour, until its highest point is */
- /* one pixel below the lowest point not enclosed by that contour. */
- /* This flag is mutually exclusive with `AF_ADJUST_DOWN`. */
-#define AF_ADJUST_DOWN2 0x08
-
- /* The topmost contour is a tilde. Enlarge it vertically so that it */
- /* stays legible at small sizes, not degenerating to a horizontal line. */
-#define AF_ADJUST_TILDE_TOP 0x10
-
- /* The bottommost contour is a tilde. Enlarge it vertically so that it */
- /* stays legible at small sizes, not degenerating to a horizontal line. */
-#define AF_ADJUST_TILDE_BOTTOM 0x20
-
- /* The contour below the topmost contour is a tilde. Enlarge it */
- /* vertically so that it stays legible at small sizes, not degenerating */
- /* to a horizontal line. To be used with `AF_ADJUST_UP2` only. */
-#define AF_ADJUST_TILDE_TOP2 0x40
-
- /* The contour above the bottommost contour is a tilde. Enlarge it */
- /* vertically so that it stays legible at small sizes, not degenerating */
- /* to a horizontal line. To be used with `AF_ADJUST_DOWN2` only. */
-#define AF_ADJUST_TILDE_BOTTOM2 0x80
-
- /* Make the auto-hinter ignore any diacritic (either a separate contour */
- /* or part of the base character outline) that is attached to the top */
- /* of an uppercase base character. */
-#define AF_IGNORE_CAPITAL_TOP 0x100
-
- /* Make the auto-hinter ignore any diacritic (either a separate contour */
- /* or part of the base character outline) that is attached to the */
- /* bottom of an uppercase base character. */
-#define AF_IGNORE_CAPITAL_BOTTOM 0x200
-
- /* Make the auto-hinter ignore any diacritic (either a separate contour */
- /* or part of the base character outline) that is attached to the top */
- /* of a lowercase base character. */
-#define AF_IGNORE_SMALL_TOP 0x400
-
- /* Make the auto-hinter ignore any diacritic (either a separate contour */
- /* or part of the base character outline) that is attached to the */
- /* bottom of a lowercase base character. */
-#define AF_IGNORE_SMALL_BOTTOM 0x800
-
- /* By default, the AF_ADJUST_XXX flags are applied only if diacritics */
- /* have a 'small' height (based on some heuristic checks). If this */
- /* flag is set, no such check is performed. */
-#define AF_ADJUST_NO_HEIGHT_CHECK 0x1000
-
- /* No adjustment, i.e., no flag is set. */
-#define AF_ADJUST_NONE 0x00
-
-
- FT_LOCAL( FT_UInt32 )
- af_adjustment_database_lookup( FT_UInt32 codepoint );
-
- /* Allocate and populate the reverse character map, */
- /* using the character map within the face. */
- FT_LOCAL( FT_Error )
- af_reverse_character_map_new( FT_Hash *map,
- AF_StyleMetrics metrics );
-
- /* Free the reverse character map. */
- FT_LOCAL( FT_Error )
- af_reverse_character_map_done( FT_Hash map,
- FT_Memory memory );
-
-
-FT_END_HEADER
-
-#endif /* AFADJUST_H_ */
-
-
-/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.c
index a6219bdfe4..ea83969cdc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.c
@@ -7,7 +7,7 @@
*
* Auto-fitter data for blue strings (body).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -467,24 +467,24 @@
af_blue_stringsets[] =
{
/* */
- { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
+ { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ARABIC_BOTTOM, 0 },
{ AF_BLUE_STRING_ARABIC_JOIN, AF_BLUE_PROPERTY_LATIN_NEUTRAL },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_AVESTAN_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -508,14 +508,14 @@
{ AF_BLUE_STRING_CHAKMA_BOTTOM, 0 },
{ AF_BLUE_STRING_CHAKMA_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 },
{ AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CARIAN_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -527,24 +527,24 @@
{ AF_BLUE_STRING_CHEROKEE_SMALL, 0 },
{ AF_BLUE_STRING_CHEROKEE_SMALL_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
+ { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CYPRIOT_BOTTOM, 0 },
{ AF_BLUE_STRING_CYPRIOT_SMALL, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_CYPRIOT_SMALL, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
+ { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_CYRILLIC_SMALL, 0 },
- { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_CYRILLIC_SMALL, 0 },
+ { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_DEVANAGARI_HEAD, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_DEVANAGARI_BASE, AF_BLUE_PROPERTY_LATIN_TOP |
@@ -553,12 +553,12 @@
{ AF_BLUE_STRING_DEVANAGARI_BASE, 0 },
{ AF_BLUE_STRING_DEVANAGARI_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
+ { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_ETHIOPIC_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -578,23 +578,23 @@
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GEORGIAN_NUSKHURI_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 },
{ AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GOTHIC_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_GREEK_SMALL, 0 },
- { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_GREEK_SMALL, 0 },
+ { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
{ AF_BLUE_STRING_GUJARATI_BOTTOM, 0 },
@@ -643,45 +643,45 @@
{ AF_BLUE_STRING_LAO_LARGE_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LAO_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 },
- { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 },
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 },
- { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 },
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_LISU_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MALAYALAM_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MALAYALAM_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MONGOLIAN_BOTTOM_BASE, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -691,12 +691,12 @@
{ AF_BLUE_STRING_MYANMAR_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_MYANMAR_DESCENDER, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_NKO_BOTTOM, 0 },
+ { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_NKO_BOTTOM, 0 },
{ AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_NKO_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_OL_CHIKI, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_OL_CHIKI, 0 },
@@ -704,15 +704,15 @@
{ AF_BLUE_STRING_OLD_TURKIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_OLD_TURKIC_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM },
- { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 },
- { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 },
- { AF_BLUE_STRING_MAX, 0 },
+ { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 },
+ { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 },
+ { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_OSMANYA_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
@@ -723,13 +723,13 @@
{ AF_BLUE_STRING_SAURASHTRA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_SAURASHTRA_BOTTOM, 0 },
{ AF_BLUE_STRING_MAX, 0 },
- { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
- { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 },
- { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 },
+ { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
+ { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 },
+ { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 },
{ AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
- { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM },
- { AF_BLUE_STRING_MAX, 0 },
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT },
+ { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 },
+ { AF_BLUE_STRING_MAX, 0 },
{ AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP },
{ AF_BLUE_STRING_SINHALA_BOTTOM, 0 },
{ AF_BLUE_STRING_SINHALA_DESCENDER, 0 },
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.cin b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.cin
index 786c6b3b9e..d2270fac74 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.cin
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.cin
@@ -4,7 +4,7 @@
*
* Auto-fitter data for blue strings (body).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.dat b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.dat
index f6e96ff818..88bab2632a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.dat
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.dat
@@ -2,7 +2,7 @@
//
// Auto-fitter data for blue strings.
//
-// Copyright (C) 2013-2025 by
+// Copyright (C) 2013-2024 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
@@ -699,12 +699,12 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
AF_BLUE_STRINGSET_ADLM
- { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
+ { AF_BLUE_STRING_ADLAM_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_ADLAM_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_ADLAM_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_ADLAM_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_ARAB
{ AF_BLUE_STRING_ARABIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -713,14 +713,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_ARMN
- { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_ARMENIAN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_ARMENIAN_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_ARMENIAN_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_ARMENIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_ARMENIAN_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_ARMENIAN_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_AVST
{ AF_BLUE_STRING_AVESTAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -756,14 +756,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CANS
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_BOTTOM, 0 }
{ AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CANADIAN_SYLLABICS_SUPS_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CARI
{ AF_BLUE_STRING_CARIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -781,12 +781,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_COPT
- { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
+ { AF_BLUE_STRING_COPTIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_COPTIC_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_COPTIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_COPTIC_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CPRT
{ AF_BLUE_STRING_CYPRIOT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -796,13 +796,13 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_CYRL
- { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
+ { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }
- { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }
+ { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_DEVA
{ AF_BLUE_STRING_DEVANAGARI_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -815,12 +815,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_DSRT
- { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
+ { AF_BLUE_STRING_DESERET_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_DESERET_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_DESERET_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_DESERET_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_ETHI
{ AF_BLUE_STRING_ETHIOPIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -848,12 +848,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GLAG
- { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_GLAGOLITIC_CAPITAL_BOTTOM, 0 }
{ AF_BLUE_STRING_GLAGOLITIC_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_GLAGOLITIC_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GOTH
{ AF_BLUE_STRING_GOTHIC_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -861,14 +861,14 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GREK
- { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_GREEK_SMALL, 0 }
- { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_GREEK_SMALL, 0 }
+ { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_GUJR
{ AF_BLUE_STRING_GUJARATI_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
@@ -935,34 +935,34 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_LATN
- { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_LATIN_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_LATB
- { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_SUBS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 }
- { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL, 0 }
+ { AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_LATP
- { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_LATIN_SUPS_SMALL, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }
- { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL, 0 }
+ { AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_LISU
{ AF_BLUE_STRING_LISU_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -975,15 +975,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_MEDF
- { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_MEDEFAIDRIN_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
{ AF_BLUE_STRING_MEDEFAIDRIN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MEDEFAIDRIN_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MEDEFAIDRIN_DIGIT_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_MONG
{ AF_BLUE_STRING_MONGOLIAN_TOP_BASE, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -999,12 +999,12 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_NKOO
- { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_NKO_BOTTOM, 0 }
+ { AF_BLUE_STRING_NKO_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_NKO_BOTTOM, 0 }
{ AF_BLUE_STRING_NKO_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_NKO_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_NKO_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_NONE
{ AF_BLUE_STRING_MAX, 0 }
@@ -1020,15 +1020,15 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_OSGE
- { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM }
- { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 }
- { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 }
- { AF_BLUE_STRING_MAX, 0 }
+ { AF_BLUE_STRING_OSAGE_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OSAGE_CAPITAL_BOTTOM, 0 }
+ { AF_BLUE_STRING_OSAGE_CAPITAL_DESCENDER, 0 }
+ { AF_BLUE_STRING_OSAGE_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_OSAGE_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_OSAGE_SMALL_ASCENDER, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_OSAGE_SMALL_DESCENDER, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_OSMA
{ AF_BLUE_STRING_OSMANYA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
@@ -1047,13 +1047,13 @@ AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN:
{ AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_SHAW
- { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
- { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 }
- { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 }
+ { AF_BLUE_STRING_SHAVIAN_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
+ { AF_BLUE_STRING_SHAVIAN_BOTTOM, 0 }
+ { AF_BLUE_STRING_SHAVIAN_DESCENDER, 0 }
{ AF_BLUE_STRING_SHAVIAN_SMALL_TOP, AF_BLUE_PROPERTY_LATIN_TOP |
- AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
- { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM }
- { AF_BLUE_STRING_MAX, 0 }
+ AF_BLUE_PROPERTY_LATIN_X_HEIGHT }
+ { AF_BLUE_STRING_SHAVIAN_SMALL_BOTTOM, 0 }
+ { AF_BLUE_STRING_MAX, 0 }
AF_BLUE_STRINGSET_SINH
{ AF_BLUE_STRING_SINHALA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.h
index 5bb8406dc2..2aa9d0984e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.h
@@ -7,7 +7,7 @@
*
* Auto-fitter data for blue strings (specification).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -314,17 +314,14 @@ FT_BEGIN_HEADER
/* Properties are specific to a writing system. We assume that a given */
/* blue string can't be used in more than a single writing system, which */
/* is a safe bet. */
-#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must be value 1 */
+#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */
#define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 )
#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 )
#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 )
#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 )
-#define AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM ( 1U << 5 )
-#define AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM ( 1U << 6 )
-
-#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must be value 1 */
-#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must be value 2 */
+#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */
+#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */
#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.hin b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.hin
index dbac14548d..38031505a8 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.hin
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afblue.hin
@@ -4,7 +4,7 @@
*
* Auto-fitter data for blue strings (specification).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -99,17 +99,14 @@ FT_BEGIN_HEADER
/* Properties are specific to a writing system. We assume that a given */
/* blue string can't be used in more than a single writing system, which */
/* is a safe bet. */
-#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must be value 1 */
+#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */
#define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 )
#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 )
#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 )
#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 )
-#define AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM ( 1U << 5 )
-#define AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM ( 1U << 6 )
-
-#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must be value 1 */
-#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must be value 2 */
+#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */
+#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */
#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.c
index 7086601838..869b60487c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for CJK writing system (body).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -90,8 +90,12 @@
/* If HarfBuzz is not available, we need a pointer to a single */
/* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
FT_ULong shaper_buf_;
void* shaper_buf = &shaper_buf_;
+#endif
const char* p;
@@ -101,8 +105,9 @@
p = script_class->standard_charstring;
- if ( ft_hb_enabled( metrics->root.globals ) )
- shaper_buf = af_shaper_buf_create( metrics->root.globals );
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
/* We check a list of standard characters. The first match wins. */
@@ -139,7 +144,7 @@
break;
}
- af_shaper_buf_destroy( metrics->root.globals, shaper_buf );
+ af_shaper_buf_destroy( face, shaper_buf );
if ( !glyph_index )
goto Exit;
@@ -147,7 +152,7 @@
if ( !glyph_index )
goto Exit;
- FT_TRACE5(( "standard character: U+%04lX (glyph index %lu)\n",
+ FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n",
ch, glyph_index ));
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
@@ -292,8 +297,12 @@
/* If HarfBuzz is not available, we need a pointer to a single */
/* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
FT_ULong shaper_buf_;
void* shaper_buf = &shaper_buf_;
+#endif
/* we walk over the blue character strings as specified in the */
@@ -304,8 +313,9 @@
FT_TRACE5(( "==========================\n" ));
FT_TRACE5(( "\n" ));
- if ( ft_hb_enabled( metrics->root.globals ) )
- shaper_buf = af_shaper_buf_create( metrics->root.globals );
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
{
@@ -330,7 +340,7 @@
};
- FT_TRACE5(( "blue zone %u (%s):\n",
+ FT_TRACE5(( "blue zone %d (%s):\n",
axis->blue_count,
cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) |
AF_CJK_IS_TOP_BLUE( bs ) ] ));
@@ -543,7 +553,7 @@
} /* end for loop */
- af_shaper_buf_destroy( metrics->root.globals, shaper_buf );
+ af_shaper_buf_destroy( face, shaper_buf );
FT_TRACE5(( "\n" ));
@@ -562,20 +572,23 @@
/* If HarfBuzz is not available, we need a pointer to a single */
/* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
FT_ULong shaper_buf_;
void* shaper_buf = &shaper_buf_;
+#endif
/* in all supported charmaps, digits have character codes 0x30-0x39 */
const char digits[] = "0 1 2 3 4 5 6 7 8 9";
const char* p;
- FT_UNUSED( face );
-
p = digits;
- if ( ft_hb_enabled( metrics->root.globals ) )
- shaper_buf = af_shaper_buf_create( metrics->root.globals );
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
while ( *p )
{
@@ -611,7 +624,7 @@
}
}
- af_shaper_buf_destroy( metrics->root.globals, shaper_buf );
+ af_shaper_buf_destroy( face, shaper_buf );
metrics->root.digits_have_same_width = same_width;
}
@@ -697,7 +710,7 @@
FT_Pos delta1, delta2;
- blue->ref.fit = FT_PIX_ROUND( blue->ref.cur );
+ blue->ref.fit = FT_PIX_ROUND( blue->ref.cur );
/* shoot is under shoot for cjk */
delta1 = FT_DivFix( blue->ref.fit, scale ) - blue->shoot.org;
@@ -723,7 +736,7 @@
blue->shoot.fit = blue->ref.fit - delta2;
- FT_TRACE5(( ">> active cjk blue zone %c%u[%ld/%ld]:\n",
+ FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]:\n",
( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V',
nn, blue->ref.org, blue->shoot.org ));
FT_TRACE5(( " ref: cur=%.2f fit=%.2f\n",
@@ -1365,7 +1378,7 @@
}
- /* Initialize hinting engine. */
+ /* Initalize hinting engine. */
FT_LOCAL_DEF( FT_Error )
af_cjk_hints_init( AF_GlyphHints hints,
@@ -2172,7 +2185,7 @@
af_cjk_align_edge_points( AF_GlyphHints hints,
AF_Dimension dim )
{
- AF_AxisHints axis = &hints->axis[dim];
+ AF_AxisHints axis = & hints->axis[dim];
AF_Edge edges = axis->edges;
AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
AF_Edge edge;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.h
index bd1b39358e..bc5aaf12e6 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for CJK writing system (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcover.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcover.h
index b93bcd1a2c..7980cf2e97 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcover.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afcover.h
@@ -4,7 +4,7 @@
*
* Auto-fitter coverages (specification only).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.c
index 8613544f91..ad667d2edc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.c
@@ -5,7 +5,7 @@
* Auto-fitter dummy routines to be used if no hinting should be
* performed (body).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.h
index 78a79439d9..613c2f88a3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afdummy.h
@@ -5,7 +5,7 @@
* Auto-fitter dummy routines to be used if no hinting should be
* performed (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aferrors.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aferrors.h
index f3093fc90d..ae584ff06d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aferrors.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aferrors.h
@@ -4,7 +4,7 @@
*
* Autofitter error codes (specification only).
*
- * Copyright (C) 2005-2025 by
+ * Copyright (C) 2005-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.c
index e74d814116..b7403fa65e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
*
* Auto-fitter routines to compute global hinting values (body).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -22,11 +22,6 @@
#include "afws-decl.h"
#include <freetype/internal/ftdebug.h>
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
-# include "afgsub.h"
-# include "ft-hb-ft.h"
-#endif
-
/**************************************************************************
*
@@ -189,7 +184,7 @@
if ( gindex != 0 &&
gindex < globals->glyph_count &&
( gstyles[gindex] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED )
- gstyles[gindex] = ss | AF_HAS_CMAP_ENTRY;
+ gstyles[gindex] = ss;
for (;;)
{
@@ -200,7 +195,7 @@
if ( gindex < globals->glyph_count &&
( gstyles[gindex] & AF_STYLE_MASK ) == AF_STYLE_UNASSIGNED )
- gstyles[gindex] = ss | AF_HAS_CMAP_ENTRY;
+ gstyles[gindex] = ss;
}
}
@@ -306,7 +301,7 @@
if ( !( count % 10 ) )
FT_TRACE4(( " " ));
- FT_TRACE4(( " %u", idx ));
+ FT_TRACE4(( " %d", idx ));
count++;
if ( !( count % 10 ) )
@@ -361,21 +356,8 @@
globals->scale_down_factor = 0;
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled ( globals ) )
- {
- globals->hb_font = ft_hb_ft_font_create( globals );
- globals->hb_buf = hb( buffer_create )();
-
- af_parse_gsub( globals );
- }
- else
- {
- globals->hb_font = NULL;
- globals->hb_buf = NULL;
-
- globals->gsub = NULL;
- globals->gsub_lookups_single_alternate = NULL;
- }
+ globals->hb_font = hb_ft_font_create_( face, NULL );
+ globals->hb_buf = hb_buffer_create();
#endif
error = af_face_globals_compute_style_coverage( globals );
@@ -423,14 +405,8 @@
}
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled ( globals ) )
- {
- hb( font_destroy )( globals->hb_font );
- hb( buffer_destroy )( globals->hb_buf );
-
- FT_FREE( globals->gsub );
- FT_FREE( globals->gsub_lookups_single_alternate );
- }
+ hb_font_destroy( globals->hb_font );
+ hb_buffer_destroy( globals->hb_buf );
#endif
/* no need to free `globals->glyph_styles'; */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.h
index dc06115949..ddb54c89b2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afglobal.h
@@ -5,7 +5,7 @@
* Auto-fitter routines to compute global hinting values
* (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -73,17 +73,15 @@ FT_BEGIN_HEADER
/* default script for OpenType; ignored if HarfBuzz isn't used */
#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN
- /* a bit mask for AF_DIGIT, AF_NONBASE, and AF_HAS_CMAP_ENTRY */
-#define AF_STYLE_MASK 0x1FFF
+ /* a bit mask for AF_DIGIT and AF_NONBASE */
+#define AF_STYLE_MASK 0x3FFF
/* an uncovered glyph */
#define AF_STYLE_UNASSIGNED AF_STYLE_MASK
- /* if this flag is set, we have an ASCII digit */
+ /* if this flag is set, we have an ASCII digit */
#define AF_DIGIT 0x8000U
/* if this flag is set, we have a non-base character */
#define AF_NONBASE 0x4000U
- /* if this flag is set, the glyph has a (direct) cmap entry */
-#define AF_HAS_CMAP_ENTRY 0x2000U
/* `increase-x-height' property */
#define AF_PROP_INCREASE_X_HEIGHT_MIN 6
@@ -113,13 +111,6 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
hb_font_t* hb_font;
hb_buffer_t* hb_buf; /* for feature comparison */
-
- /* The GSUB table. */
- FT_Byte* gsub;
- /* An array of lookup offsets (of `gsub_lookup_count` elements), */
- /* with only SingleSubst and AlternateSubst lookups non-NULL. */
- FT_UShort gsub_lookup_count;
- FT_UInt32* gsub_lookups_single_alternate;
#endif
/* per-face auto-hinter properties */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.c
index 11faa655f6..96ffe343aa 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines (body).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -840,10 +840,6 @@
if ( hints->contours != hints->embedded.contours )
FT_FREE( hints->contours );
- if ( hints->contour_y_minima != hints->embedded.contour_y_minima )
- FT_FREE( hints->contour_y_minima );
- if ( hints->contour_y_maxima != hints->embedded.contour_y_maxima )
- FT_FREE( hints->contour_y_maxima );
hints->max_contours = 0;
hints->num_contours = 0;
@@ -900,30 +896,19 @@
{
if ( !hints->contours )
{
- hints->contours = hints->embedded.contours;
- hints->contour_y_minima = hints->embedded.contour_y_minima;
- hints->contour_y_maxima = hints->embedded.contour_y_maxima;
-
+ hints->contours = hints->embedded.contours;
hints->max_contours = AF_CONTOURS_EMBEDDED;
}
}
else if ( new_max > old_max )
{
if ( hints->contours == hints->embedded.contours )
- {
- hints->contours = NULL;
- hints->contour_y_minima = NULL;
- hints->contour_y_maxima = NULL;
- }
+ hints->contours = NULL;
new_max = ( new_max + 3 ) & ~3; /* round up to a multiple of 4 */
if ( FT_RENEW_ARRAY( hints->contours, old_max, new_max ) )
goto Exit;
- if ( FT_RENEW_ARRAY( hints->contour_y_minima, old_max, new_max ) )
- goto Exit;
- if ( FT_RENEW_ARRAY( hints->contour_y_maxima, old_max, new_max ) )
- goto Exit;
hints->max_contours = new_max;
}
@@ -1339,7 +1324,7 @@
af_glyph_hints_align_edge_points( AF_GlyphHints hints,
AF_Dimension dim )
{
- AF_AxisHints axis = &hints->axis[dim];
+ AF_AxisHints axis = & hints->axis[dim];
AF_Segment segments = axis->segments;
AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments );
AF_Segment seg;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.h
index 46b3ed3366..76fe83006a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afhints.h
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -222,9 +222,6 @@ FT_BEGIN_HEADER
/* the distance to the next point is very small */
#define AF_FLAG_NEAR ( 1U << 5 )
- /* prevent the auto-hinter from adding such a point to a segment */
-#define AF_FLAG_IGNORE ( 1U << 6 )
-
/* edge hint flags */
#define AF_EDGE_NORMAL 0
@@ -232,7 +229,6 @@ FT_BEGIN_HEADER
#define AF_EDGE_SERIF ( 1U << 1 )
#define AF_EDGE_DONE ( 1U << 2 )
#define AF_EDGE_NEUTRAL ( 1U << 3 ) /* edge aligns to a neutral blue zone */
-#define AF_EDGE_NO_BLUE ( 1U << 4 ) /* do not align edge to blue zone */
typedef struct AF_PointRec_* AF_Point;
@@ -307,7 +303,6 @@ FT_BEGIN_HEADER
} AF_EdgeRec;
-
#define AF_SEGMENTS_EMBEDDED 18 /* number of embedded segments */
#define AF_EDGES_EMBEDDED 12 /* number of embedded edges */
@@ -351,11 +346,9 @@ FT_BEGIN_HEADER
FT_Int num_points; /* number of used points */
AF_Point points; /* points array */
- FT_Int max_contours; /* number of allocated contours */
- FT_Int num_contours; /* number of used contours */
- AF_Point* contours; /* contours array */
- FT_Pos* contour_y_minima; /* array with y maxima of contours */
- FT_Pos* contour_y_maxima; /* array with y minima of contours */
+ FT_Int max_contours; /* number of allocated contours */
+ FT_Int num_contours; /* number of used contours */
+ AF_Point* contours; /* contours array */
AF_AxisHintsRec axis[AF_DIMENSION_MAX];
@@ -364,13 +357,11 @@ FT_BEGIN_HEADER
/* implementations */
AF_StyleMetrics metrics;
- /* Some arrays to avoid allocation penalty. */
+ /* Two arrays to avoid allocation penalty. */
/* The `embedded' structure must be the last element! */
struct
{
AF_Point contours[AF_CONTOURS_EMBEDDED];
- FT_Pos contour_y_minima[AF_CONTOURS_EMBEDDED];
- FT_Pos contour_y_maxima[AF_CONTOURS_EMBEDDED];
AF_PointRec points[AF_POINTS_EMBEDDED];
} embedded;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.c
index a2cd14f881..c6d23efd86 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for Indic writing system (body).
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.h
index a2e825e9f8..a7f73f2515 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afindic.h
@@ -5,7 +5,7 @@
* Auto-fitter hinting routines for Indic writing system
* (specification).
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.c
index 4a42d91947..89287f7ea5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for latin writing system (body).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -22,7 +22,6 @@
#include "afglobal.h"
#include "aflatin.h"
#include "aferrors.h"
-#include "afadjust.h"
/**************************************************************************
@@ -82,8 +81,12 @@
/* If HarfBuzz is not available, we need a pointer to a single */
/* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
FT_ULong shaper_buf_;
void* shaper_buf = &shaper_buf_;
+#endif
const char* p;
@@ -94,9 +97,9 @@
p = script_class->standard_charstring;
- if ( ft_hb_enabled ( metrics->root.globals ) )
- shaper_buf = af_shaper_buf_create( metrics->root.globals );
-
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
/*
* We check a list of standard characters to catch features like
* `c2sc' (small caps from caps) that don't contain lowercase letters
@@ -137,7 +140,7 @@
break;
}
- af_shaper_buf_destroy( metrics->root.globals, shaper_buf );
+ af_shaper_buf_destroy( face, shaper_buf );
if ( !glyph_index )
{
@@ -146,7 +149,7 @@
goto Exit;
}
- FT_TRACE5(( "standard character: U+%04lX (glyph index %lu)\n",
+ FT_TRACE5(( "standard character: U+%04lX (glyph index %ld)\n",
ch, glyph_index ));
error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
@@ -331,8 +334,12 @@
/* If HarfBuzz is not available, we need a pointer to a single */
/* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
FT_ULong shaper_buf_;
void* shaper_buf = &shaper_buf_;
+#endif
/* we walk over the blue character strings as specified in the */
@@ -342,8 +349,9 @@
FT_TRACE5(( "============================\n" ));
FT_TRACE5(( "\n" ));
- if ( ft_hb_enabled ( metrics->root.globals ) )
- shaper_buf = af_shaper_buf_create( metrics->root.globals );
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ )
{
@@ -359,7 +367,7 @@
FT_Bool have_flag = 0;
- FT_TRACE5(( "blue zone %u", axis->blue_count ));
+ FT_TRACE5(( "blue zone %d", axis->blue_count ));
if ( bs->properties )
{
@@ -399,20 +407,6 @@
FT_TRACE5(( "long" ));
}
- if ( AF_LATIN_IS_CAPITAL_BOTTOM_BLUE( bs ) )
- {
- if ( have_flag )
- FT_TRACE5(( ", " ));
- FT_TRACE5(( "capital bottom" ));
- }
-
- if ( AF_LATIN_IS_SMALL_BOTTOM_BLUE( bs ) )
- {
- if ( have_flag )
- FT_TRACE5(( ", " ));
- FT_TRACE5(( "small bottom" ));
- }
-
FT_TRACE5(( ")" ));
}
@@ -460,9 +454,9 @@
}
if ( AF_LATIN_IS_TOP_BLUE( bs ) )
- best_y_extremum = FT_LONG_MIN;
+ best_y_extremum = FT_INT_MIN;
else
- best_y_extremum = FT_LONG_MAX;
+ best_y_extremum = FT_INT_MAX;
/* iterate over all glyph elements of the character cluster */
/* and get the data of the `biggest' one */
@@ -493,7 +487,7 @@
if ( num_idx == 1 )
FT_TRACE5(( " U+%04lX contains no (usable) outlines\n", ch ));
else
- FT_TRACE5(( " component %u of cluster starting with U+%04lX"
+ FT_TRACE5(( " component %d of cluster starting with U+%04lX"
" contains no (usable) outlines\n", i, ch ));
#endif
continue;
@@ -831,7 +825,7 @@
if ( num_idx == 1 )
FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y ));
else
- FT_TRACE5(( " component %u of cluster starting with U+%04lX:"
+ FT_TRACE5(( " component %d of cluster starting with U+%04lX:"
" best_y = %5ld", i, ch, best_y ));
#endif
@@ -885,8 +879,8 @@
} /* end for loop */
- if ( !( best_y_extremum == FT_LONG_MIN ||
- best_y_extremum == FT_LONG_MAX ) )
+ if ( !( best_y_extremum == FT_INT_MIN ||
+ best_y_extremum == FT_INT_MAX ) )
{
if ( best_round )
rounds[num_rounds++] = best_y_extremum;
@@ -965,10 +959,6 @@
blue->flags |= AF_LATIN_BLUE_SUB_TOP;
if ( AF_LATIN_IS_NEUTRAL_BLUE( bs ) )
blue->flags |= AF_LATIN_BLUE_NEUTRAL;
- if ( AF_LATIN_IS_CAPITAL_BOTTOM_BLUE( bs ) )
- blue->flags |= AF_LATIN_BLUE_BOTTOM;
- if ( AF_LATIN_IS_SMALL_BOTTOM_BLUE( bs ) )
- blue->flags |= AF_LATIN_BLUE_BOTTOM_SMALL;
/*
* The following flag is used later to adjust the y and x scales
@@ -983,7 +973,7 @@
} /* end for loop */
- af_shaper_buf_destroy( metrics->root.globals, shaper_buf );
+ af_shaper_buf_destroy( face, shaper_buf );
if ( axis->blue_count )
{
@@ -1080,20 +1070,23 @@
/* If HarfBuzz is not available, we need a pointer to a single */
/* unsigned long value. */
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ void* shaper_buf;
+#else
FT_ULong shaper_buf_;
void* shaper_buf = &shaper_buf_;
+#endif
/* in all supported charmaps, digits have character codes 0x30-0x39 */
const char digits[] = "0 1 2 3 4 5 6 7 8 9";
const char* p;
- FT_UNUSED( face );
-
p = digits;
- if ( ft_hb_enabled ( metrics->root.globals ) )
- shaper_buf = af_shaper_buf_create( metrics->root.globals );
+#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+ shaper_buf = af_shaper_buf_create( face );
+#endif
while ( *p )
{
@@ -1129,7 +1122,7 @@
}
}
- af_shaper_buf_destroy( metrics->root.globals, shaper_buf );
+ af_shaper_buf_destroy( face, shaper_buf );
metrics->root.digits_have_same_width = same_width;
}
@@ -1162,9 +1155,6 @@
af_latin_metrics_check_digits( metrics, face );
}
- af_reverse_character_map_new( &metrics->root.reverse_charmap,
- &metrics->root );
-
Exit:
face->charmap = oldmap;
return error;
@@ -1273,7 +1263,7 @@
max_height = FT_MAX( max_height, -Axis->blues[nn].descender );
}
- dist = FT_MulFix( max_height, new_scale - scale );
+ dist = FT_MulFix( max_height, new_scale - scale );
if ( -128 < dist && dist < 128 )
{
@@ -1476,13 +1466,13 @@
AF_LatinBlue blue = &axis->blues[nn];
- FT_TRACE5(( " reference %u: %ld scaled to %.2f%s\n",
+ FT_TRACE5(( " reference %d: %ld scaled to %.2f%s\n",
nn,
blue->ref.org,
(double)blue->ref.fit / 64,
( blue->flags & AF_LATIN_BLUE_ACTIVE ) ? ""
: " (inactive)" ));
- FT_TRACE5(( " overshoot %u: %ld scaled to %.2f%s\n",
+ FT_TRACE5(( " overshoot %d: %ld scaled to %.2f%s\n",
nn,
blue->shoot.org,
(double)blue->shoot.fit / 64,
@@ -1494,17 +1484,6 @@
}
- FT_CALLBACK_DEF( void )
- af_latin_metrics_done( AF_StyleMetrics metrics_ )
- {
- AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_;
-
-
- af_reverse_character_map_done( metrics->root.reverse_charmap,
- metrics->root.globals->face->memory );
- }
-
-
/* Scale global values in both directions. */
FT_LOCAL_DEF( void )
@@ -1638,8 +1617,7 @@
FT_Pos prev_max_on_coord = max_on_coord;
- if ( !( point->flags & AF_FLAG_IGNORE ) &&
- FT_ABS( last->out_dir ) == major_dir &&
+ if ( FT_ABS( last->out_dir ) == major_dir &&
FT_ABS( point->out_dir ) == major_dir )
{
/* we are already on an edge, try to locate its start */
@@ -1698,17 +1676,13 @@
max_on_coord = v;
}
- if ( point->flags & AF_FLAG_IGNORE ||
- point->out_dir != segment_dir ||
- point == last )
+ if ( point->out_dir != segment_dir || point == last )
{
/* check whether the new segment's start point is identical to */
/* the previous segment's end point; for example, this might */
/* happen for spikes */
- if ( point->flags & AF_FLAG_IGNORE ||
- !prev_segment ||
- segment->first != prev_segment->last )
+ if ( !prev_segment || segment->first != prev_segment->last )
{
/* points are different: we are just leaving an edge, thus */
/* record a new segment */
@@ -1868,8 +1842,7 @@
/* if we are not on an edge, check whether the major direction */
/* coincides with the current point's `out' direction, or */
/* whether we have a single-point contour */
- if ( !( point->flags & AF_FLAG_IGNORE ) &&
- !on_edge &&
+ if ( !on_edge &&
( FT_ABS( point->out_dir ) == major_dir ||
point == point->prev ) )
{
@@ -2548,9 +2521,6 @@
FT_Pos best_dist; /* initial threshold */
- if ( edge->flags & AF_EDGE_NO_BLUE )
- continue;
-
/* compute the initial threshold as a fraction of the EM size */
/* (the value 40 is heuristic) */
best_dist = FT_MulFix( metrics->units_per_em / 40, scale );
@@ -2640,7 +2610,7 @@
}
- /* Initialize hinting engine. */
+ /* Initalize hinting engine. */
static FT_Error
af_latin_hints_init( AF_GlyphHints hints,
@@ -2767,1437 +2737,245 @@
}
-#undef FT_COMPONENT
-#define FT_COMPONENT afadjust
-
+ /* Compute the snapped width of a given stem, ignoring very thin ones. */
+ /* There is a lot of voodoo in this function; changing the hard-coded */
+ /* parameters influence the whole hinting process. */
- static void
- af_move_contour_vertically( AF_Point contour,
- FT_Int movement )
+ static FT_Pos
+ af_latin_compute_stem_width( AF_GlyphHints hints,
+ AF_Dimension dim,
+ FT_Pos width,
+ FT_Pos base_delta,
+ FT_UInt base_flags,
+ FT_UInt stem_flags )
{
- AF_Point point = contour;
- AF_Point first_point = point;
-
-
- if ( point )
- {
- do
- {
- point->y += movement;
- point = point->next;
-
- } while ( point != first_point );
- }
- }
-
+ AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics;
+ AF_LatinAxis axis = &metrics->axis[dim];
+ FT_Pos dist = width;
+ FT_Int sign = 0;
+ FT_Int vertical = ( dim == AF_DIMENSION_VERT );
- /* Move all contours higher than `limit` by `delta`. */
- static void
- af_move_contours_up( AF_GlyphHints hints,
- FT_Pos limit,
- FT_Pos delta )
- {
- FT_Int contour;
+ if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
+ axis->extra_light )
+ return width;
- for ( contour = 0; contour < hints->num_contours; contour++ )
+ if ( dist < 0 )
{
- FT_Pos min_y = hints->contour_y_minima[contour];
- FT_Pos max_y = hints->contour_y_maxima[contour];
-
-
- if ( min_y < max_y &&
- min_y > limit )
- af_move_contour_vertically( hints->contours[contour],
- delta );
+ dist = -width;
+ sign = 1;
}
- }
-
-
- static void
- af_move_contours_down( AF_GlyphHints hints,
- FT_Pos limit,
- FT_Pos delta )
- {
- FT_Int contour;
-
- for ( contour = 0; contour < hints->num_contours; contour++ )
+ if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
+ ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )
{
- FT_Pos min_y = hints->contour_y_minima[contour];
- FT_Pos max_y = hints->contour_y_maxima[contour];
+ /* smooth hinting process: very lightly quantize the stem width */
+ /* leave the widths of serifs alone */
+ if ( ( stem_flags & AF_EDGE_SERIF ) &&
+ vertical &&
+ ( dist < 3 * 64 ) )
+ goto Done_Width;
- if ( min_y < max_y &&
- max_y < limit )
- af_move_contour_vertically( hints->contours[contour],
- -delta );
- }
- }
+ else if ( base_flags & AF_EDGE_ROUND )
+ {
+ if ( dist < 80 )
+ dist = 64;
+ }
+ else if ( dist < 56 )
+ dist = 56;
+ if ( axis->width_count > 0 )
+ {
+ FT_Pos delta;
- /* Compute vertical extrema of all contours and store them in the */
- /* `contour_y_minima` and `contour_y_maxima` arrays of `hints`. */
- static void
- af_compute_vertical_extrema( AF_GlyphHints hints )
- {
- FT_Int contour;
+ /* compare to standard width */
+ delta = dist - axis->widths[0].cur;
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos min_y = FT_LONG_MAX;
- FT_Pos max_y = FT_LONG_MIN;
+ if ( delta < 0 )
+ delta = -delta;
- AF_Point first_point = hints->contours[contour];
- AF_Point point = first_point;
+ if ( delta < 40 )
+ {
+ dist = axis->widths[0].cur;
+ if ( dist < 48 )
+ dist = 48;
+ goto Done_Width;
+ }
- if ( !first_point || first_point->next->next == first_point )
- goto End_loop;
+ if ( dist < 3 * 64 )
+ {
+ delta = dist & 63;
+ dist &= -64;
- do
- {
- if ( point->y < min_y )
- min_y = point->y;
- if ( point->y > max_y )
- max_y = point->y;
+ if ( delta < 10 )
+ dist += delta;
- point = point->next;
+ else if ( delta < 32 )
+ dist += 10;
- } while ( point != first_point );
+ else if ( delta < 54 )
+ dist += 54;
- End_loop:
- hints->contour_y_minima[contour] = min_y;
- hints->contour_y_maxima[contour] = max_y;
- }
- }
+ else
+ dist += delta;
+ }
+ else
+ {
+ /* A stem's end position depends on two values: the start */
+ /* position and the stem length. The former gets usually */
+ /* rounded to the grid, while the latter gets rounded also if it */
+ /* exceeds a certain length (see below in this function). This */
+ /* `double rounding' can lead to a great difference to the */
+ /* original, unhinted position; this normally doesn't matter for */
+ /* large PPEM values, but for small sizes it can easily make */
+ /* outlines collide. For this reason, we adjust the stem length */
+ /* by a small amount depending on the PPEM value in case the */
+ /* former and latter rounding both point into the same */
+ /* direction. */
+ FT_Pos bdelta = 0;
- static FT_Int
- af_find_highest_contour( AF_GlyphHints hints )
- {
- FT_Int highest_contour = 0;
- FT_Pos highest_min_y = FT_LONG_MAX;
- FT_Pos highest_max_y = FT_LONG_MIN;
- FT_Int contour;
+ if ( ( ( width > 0 ) && ( base_delta > 0 ) ) ||
+ ( ( width < 0 ) && ( base_delta < 0 ) ) )
+ {
+ FT_UInt ppem = metrics->root.scaler.face->size->metrics.x_ppem;
- /* At this point we have one 'lower' (usually the base glyph) */
- /* and one 'upper' object (usually the diacritic glyph). If */
- /* there are more contours, they must be enclosed within either */
- /* 'lower' or 'upper'. To find this enclosing 'upper' contour */
- /* it is thus sufficient to search for the contour with the */
- /* highest y maximum value. */
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos current_min_y = hints->contour_y_minima[contour];
- FT_Pos current_max_y = hints->contour_y_maxima[contour];
+ if ( ppem < 10 )
+ bdelta = base_delta;
+ else if ( ppem < 30 )
+ bdelta = ( base_delta * (FT_Pos)( 30 - ppem ) ) / 20;
+ if ( bdelta < 0 )
+ bdelta = -bdelta;
+ }
- /* If we have two contours with the same maximum value, take */
- /* the one that has a smaller height. */
- if ( current_max_y > highest_max_y ||
- ( current_max_y == highest_max_y &&
- current_min_y > highest_min_y ) )
- {
- highest_min_y = current_min_y;
- highest_max_y = current_max_y;
- highest_contour = contour;
+ dist = ( dist - bdelta + 32 ) & ~63;
+ }
}
}
+ else
+ {
+ /* strong hinting process: snap the stem width to integer pixels */
- return highest_contour;
- }
-
+ FT_Pos org_dist = dist;
- static FT_Int
- af_find_second_highest_contour( AF_GlyphHints hints )
- {
- FT_Int highest_contour;
- FT_Pos highest_min_y;
- FT_Int second_highest_contour = 0;
- FT_Pos second_highest_max_y = FT_LONG_MIN;
+ dist = af_latin_snap_width( axis->widths, axis->width_count, dist );
- FT_Int contour;
+ if ( vertical )
+ {
+ /* in the case of vertical hinting, always round */
+ /* the stem heights to integer pixels */
+ if ( dist >= 64 )
+ dist = ( dist + 16 ) & ~63;
+ else
+ dist = 64;
+ }
+ else
+ {
+ if ( AF_LATIN_HINTS_DO_MONO( hints ) )
+ {
+ /* monochrome horizontal hinting: snap widths to integer pixels */
+ /* with a different threshold */
- if ( hints->num_contours < 3 )
- return 0;
+ if ( dist < 64 )
+ dist = 64;
+ else
+ dist = ( dist + 32 ) & ~63;
+ }
+ else
+ {
+ /* for horizontal anti-aliased hinting, we adopt a more subtle */
+ /* approach: we strengthen small stems, round stems whose size */
+ /* is between 1 and 2 pixels to an integer, otherwise nothing */
- highest_contour = af_find_highest_contour( hints );
- highest_min_y = hints->contour_y_minima[highest_contour];
+ if ( dist < 48 )
+ dist = ( dist + 64 ) >> 1;
- /* Search the contour with the largest vertical maximum that has a */
- /* vertical minimum lower than the vertical minimum of the topmost */
- /* contour. */
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos current_min_y;
- FT_Pos current_max_y;
+ else if ( dist < 128 )
+ {
+ /* We only round to an integer width if the corresponding */
+ /* distortion is less than 1/4 pixel. Otherwise this */
+ /* makes everything worse since the diagonals, which are */
+ /* not hinted, appear a lot bolder or thinner than the */
+ /* vertical stems. */
+ FT_Pos delta;
- if ( contour == highest_contour )
- continue;
- current_min_y = hints->contour_y_minima[contour];
- current_max_y = hints->contour_y_maxima[contour];
+ dist = ( dist + 22 ) & ~63;
+ delta = dist - org_dist;
+ if ( delta < 0 )
+ delta = -delta;
- if ( current_max_y > second_highest_max_y &&
- current_min_y < highest_min_y )
- {
- second_highest_max_y = current_max_y;
- second_highest_contour = contour;
+ if ( delta >= 16 )
+ {
+ dist = org_dist;
+ if ( dist < 48 )
+ dist = ( dist + 64 ) >> 1;
+ }
+ }
+ else
+ /* round otherwise to prevent color fringes in LCD mode */
+ dist = ( dist + 32 ) & ~63;
+ }
}
}
- return second_highest_contour;
+ Done_Width:
+ if ( sign )
+ dist = -dist;
+
+ return dist;
}
- static FT_Int
- af_find_lowest_contour( AF_GlyphHints hints )
+ /* Align one stem edge relative to the previous stem edge. */
+
+ static void
+ af_latin_align_linked_edge( AF_GlyphHints hints,
+ AF_Dimension dim,
+ AF_Edge base_edge,
+ AF_Edge stem_edge )
{
- FT_Int lowest_contour = 0;
- FT_Pos lowest_min_y = FT_LONG_MAX;
- FT_Pos lowest_max_y = FT_LONG_MIN;
+ FT_Pos dist, base_delta;
+ FT_Pos fitted_width;
- FT_Int contour;
+ dist = stem_edge->opos - base_edge->opos;
+ base_delta = base_edge->pos - base_edge->opos;
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos current_min_y = hints->contour_y_minima[contour];
- FT_Pos current_max_y = hints->contour_y_maxima[contour];
+ fitted_width = af_latin_compute_stem_width( hints, dim,
+ dist, base_delta,
+ base_edge->flags,
+ stem_edge->flags );
- if ( current_min_y < lowest_min_y ||
- ( current_min_y == lowest_min_y &&
- current_max_y < lowest_max_y ) )
- {
- lowest_min_y = current_min_y;
- lowest_max_y = current_max_y;
- lowest_contour = contour;
- }
- }
+ stem_edge->pos = base_edge->pos + fitted_width;
- return lowest_contour;
+ FT_TRACE5(( " LINK: edge %td (opos=%.2f) linked to %.2f,"
+ " dist was %.2f, now %.2f\n",
+ stem_edge - hints->axis[dim].edges,
+ (double)stem_edge->opos / 64, (double)stem_edge->pos / 64,
+ (double)dist / 64, (double)fitted_width / 64 ));
}
- static FT_Int
- af_find_second_lowest_contour( AF_GlyphHints hints )
- {
- FT_Int lowest_contour;
- FT_Pos lowest_max_y;
+ /* Shift the coordinates of the `serif' edge by the same amount */
+ /* as the corresponding `base' edge has been moved already. */
- FT_Int second_lowest_contour = 0;
- FT_Pos second_lowest_min_y = FT_LONG_MAX;
-
- FT_Int contour;
-
-
- if ( hints->num_contours < 3 )
- return 0;
-
- lowest_contour = af_find_lowest_contour( hints );
- lowest_max_y = hints->contour_y_maxima[lowest_contour];
-
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos current_min_y;
- FT_Pos current_max_y;
-
-
- if ( contour == lowest_contour )
- continue;
-
- current_min_y = hints->contour_y_minima[contour];
- current_max_y = hints->contour_y_maxima[contour];
-
- if ( current_min_y < second_lowest_min_y &&
- current_max_y > lowest_max_y )
- {
- second_lowest_min_y = current_min_y;
- second_lowest_contour = contour;
- }
- }
-
- return second_lowest_contour;
- }
-
-
- /* While aligning edges to blue zones, make the auto-hinter */
- /* ignore the ones that are higher than `pos`. */
- static void
- af_prevent_top_blue_alignment( AF_GlyphHints hints,
- FT_Pos pos )
- {
- AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT];
-
- AF_Edge edges = axis->edges;
- AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
- AF_Edge edge;
-
-
- for ( edge = edges; edge < edge_limit; edge++ )
- if ( edge->pos > pos )
- edge->flags |= AF_EDGE_NO_BLUE;
- }
-
-
- static void
- af_prevent_bottom_blue_alignment( AF_GlyphHints hints,
- FT_Pos pos )
- {
- AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT];
-
- AF_Edge edges = axis->edges;
- AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
- AF_Edge edge;
-
-
- for ( edge = edges; edge < edge_limit; edge++ )
- if ( edge->pos < pos )
- edge->flags |= AF_EDGE_NO_BLUE;
- }
-
-
- static void
- af_latin_get_base_glyph_blues( AF_GlyphHints hints,
- FT_Bool is_capital,
- AF_LatinBlue* top,
- AF_LatinBlue* bottom )
- {
- AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics;
- AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT];
-
- FT_UInt top_flag;
- FT_UInt bottom_flag;
-
- FT_UInt i;
-
-
- top_flag = is_capital ? AF_LATIN_BLUE_TOP
- : AF_LATIN_BLUE_ADJUSTMENT;
- top_flag |= AF_LATIN_BLUE_ACTIVE;
-
- for ( i = 0; i < axis->blue_count; i++ )
- if ( ( axis->blues[i].flags & top_flag ) == top_flag )
- break;
- if ( i < axis->blue_count )
- *top = &axis->blues[i];
-
- bottom_flag = is_capital ? AF_LATIN_BLUE_BOTTOM
- : AF_LATIN_BLUE_BOTTOM_SMALL;
- bottom_flag |= AF_LATIN_BLUE_ACTIVE;
-
- for ( i = 0; i < axis->blue_count; i++ )
- if ( ( axis->blues[i].flags & bottom_flag ) == bottom_flag )
- break;
- if ( i < axis->blue_count )
- *bottom = &axis->blues[i];
- }
-
-
- /* Make the auto-hinter ignore top blue zones while aligning edges. */
- /* This affects everything that is higher than a vertical position */
- /* based on the lowercase or uppercase top and bottom blue zones */
- /* (depending on `is_capital`). */
- static void
- af_latin_ignore_top( AF_GlyphHints hints,
- AF_LatinBlue top_blue,
- AF_LatinBlue bottom_blue )
- {
- FT_Pos base_glyph_height;
- FT_Pos limit;
-
-
- /* Ignore blue zones that are higher than a heuristic threshold */
- /* (value 7 corresponds to approx. 14%, which should be sufficient */
- /* to exceed the height of uppercase serifs. We also add a quarter */
- /* of a pixel as a safety measure. */
- base_glyph_height = top_blue->shoot.cur - bottom_blue->shoot.cur;
- limit = top_blue->shoot.cur + base_glyph_height / 7 + 16;
-
- af_prevent_top_blue_alignment( hints, limit );
- }
-
-
- static void
- af_latin_ignore_bottom( AF_GlyphHints hints,
- AF_LatinBlue top_blue,
- AF_LatinBlue bottom_blue )
- {
- FT_Pos base_glyph_height;
- FT_Pos limit;
-
-
- base_glyph_height = top_blue->shoot.cur - bottom_blue->shoot.cur;
- limit = bottom_blue->shoot.cur - base_glyph_height / 7 - 16;
-
- af_prevent_bottom_blue_alignment( hints, limit );
- }
-
-
- static void
- af_touch_contour( AF_GlyphHints hints,
- FT_Int contour )
- {
- AF_Point first_point = hints->contours[contour];
- AF_Point p = first_point;
-
-
- do
- {
- p = p->next;
-
- p->flags |= AF_FLAG_IGNORE;
- if ( !( p->flags & AF_FLAG_CONTROL ) )
- p->flags |= AF_FLAG_TOUCH_Y;
-
- } while ( p != first_point );
- }
-
-
- static void
- af_touch_top_contours( AF_GlyphHints hints,
- FT_Int limit_contour )
- {
- FT_Pos limit = hints->contour_y_minima[limit_contour];
-
- FT_Int contour;
-
-
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos min_y = hints->contour_y_minima[contour];
- FT_Pos max_y = hints->contour_y_maxima[contour];
-
-
- if ( min_y < max_y &&
- min_y >= limit )
- af_touch_contour( hints, contour );
- }
- }
-
-
- static void
- af_touch_bottom_contours( AF_GlyphHints hints,
- FT_Int limit_contour )
- {
- FT_Pos limit = hints->contour_y_minima[limit_contour];
-
- FT_Int contour;
-
-
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos min_y = hints->contour_y_minima[contour];
- FT_Pos max_y = hints->contour_y_maxima[contour];
-
-
- if ( min_y < max_y &&
- max_y <= limit )
- af_touch_contour( hints, contour );
- }
- }
-
-
- /* Stretch tilde vertically, if necessary, and return the height */
- /* difference between the original and the stretched outline. */
- static FT_Pos
- af_latin_stretch_top_tilde( AF_GlyphHints hints,
- FT_Int tilde_contour )
- {
- AF_Point p = hints->contours[tilde_contour];
- AF_Point first_point = p;
-
- FT_Pos min_y = hints->contour_y_minima[tilde_contour];
- FT_Pos max_y = hints->contour_y_maxima[tilde_contour];
-
- FT_Pos min_measurement = FT_LONG_MAX;
- FT_Bool measurement_taken = FALSE;
-
- FT_Pos height;
- FT_Pos extremum_threshold;
- FT_Pos target_height;
-
-
- if ( min_y == max_y )
- return 0;
-
- FT_TRACE4(( "af_latin_stretch_top_tilde: min y: %ld, max y: %ld\n",
- min_y, max_y ));
-
- height = SUB_LONG( max_y, min_y );
- extremum_threshold = height / 8; /* Value 8 is heuristic. */
-
- /* Find points that are local vertical round extrema, and which */
- /* do not coincide with the vertical extreme values (i.e., we */
- /* search for the 'other' wiggles in the tilde), then measure the */
- /* distance to the vertical extreme values. Try to find the one */
- /* with the smallest distance. */
- /* */
- /* The algorithm only works for tilde shapes that don't deviate */
- /* from the standard shape too much. In particular, the wiggles */
- /* must be round extrema. */
- do
- {
- p = p->next;
-
- if ( !( p->flags & AF_FLAG_CONTROL ) &&
- p->prev->y == p->y && p->next->y == p->y &&
- p->y != min_y && p->y != max_y &&
- p->prev->flags & AF_FLAG_CONTROL &&
- p->next->flags & AF_FLAG_CONTROL )
- {
- /* This point could be a candidate. Find the next and previous */
- /* on-curve points, and make sure they are both either above or */
- /* below the point, then make the measurement. */
- AF_Point prev_on = p->prev;
- AF_Point next_on = p->next;
-
- FT_Pos measurement;
-
-
- while ( prev_on->flags & AF_FLAG_CONTROL )
- prev_on = prev_on->prev;
- while ( next_on->flags & AF_FLAG_CONTROL )
- next_on = next_on->next;
-
- if ( next_on->y > p->y && prev_on->y > p->y )
- measurement = SUB_LONG( p->y, min_y );
- else if ( next_on->y < p->y && prev_on->y < p->y )
- measurement = SUB_LONG( max_y, p->y );
- else
- continue;
-
- /* Ignore hits that are too near to a vertical extremum. */
- if ( measurement < extremum_threshold )
- continue;
-
- if ( !measurement_taken || measurement < min_measurement )
- {
- measurement_taken = TRUE;
- min_measurement = measurement;
- }
- }
-
- } while ( p != first_point );
-
- if ( !measurement_taken )
- min_measurement = 0;
-
- FT_TRACE4(( "af_latin_stretch_top_tilde: min measurement %ld\n",
- min_measurement ));
-
- /* To preserve the stretched shape we prevent that the tilde */
- /* gets auto-hinted; we do this for all contours equal or */
- /* above the vertical minimum of `tilde_contour`. */
- af_touch_top_contours( hints, tilde_contour );
-
- /* XXX This is an important element of the algorithm; */
- /* we need a description. */
- target_height = min_measurement + 64;
- if ( height >= target_height )
- return 0;
-
- /* Do the scaling. */
- p = first_point;
- do
- {
- p = p->next;
- /* We adjust the height of the diacritic only, which means */
- /* we are never dealing with (valid) large numbers and can */
- /* thus avoid `FT_MulFix`. */
- p->y = ADD_LONG( MUL_LONG( SUB_LONG( p->y,
- min_y ),
- target_height ) / height,
- min_y );
-
- } while ( p != first_point );
-
- return target_height - height;
- }
-
-
- static FT_Pos
- af_latin_stretch_bottom_tilde( AF_GlyphHints hints,
- FT_Int tilde_contour )
- {
- AF_Point p = hints->contours[tilde_contour];
- AF_Point first_point = p;
-
- FT_Pos min_y = hints->contour_y_minima[tilde_contour];
- FT_Pos max_y = hints->contour_y_maxima[tilde_contour];
-
- FT_Pos min_measurement = FT_LONG_MAX;
- FT_Bool measurement_taken = FALSE;
-
- FT_Pos height;
- FT_Pos extremum_threshold;
- FT_Pos target_height;
-
-
- if ( min_y == max_y )
- return 0;
-
- FT_TRACE4(( "af_latin_stretch_bottom_tilde: min y: %ld, max y: %ld\n",
- min_y, max_y ));
-
- height = SUB_LONG( max_y, min_y );
- extremum_threshold = height / 8;
-
- do
- {
- p = p->next;
-
- if ( !( p->flags & AF_FLAG_CONTROL ) &&
- p->prev->y == p->y && p->next->y == p->y &&
- p->y != min_y && p->y != max_y &&
- p->prev->flags & AF_FLAG_CONTROL &&
- p->next->flags & AF_FLAG_CONTROL )
- {
- AF_Point prev_on = p->prev;
- AF_Point next_on = p->next;
-
- FT_Pos measurement;
-
-
- while ( prev_on->flags & AF_FLAG_CONTROL )
- prev_on = prev_on->prev;
- while ( next_on->flags & AF_FLAG_CONTROL )
- next_on = next_on->next;
-
- if ( next_on->y > p->y && prev_on->y > p->y )
- measurement = SUB_LONG( p->y, min_y );
- else if ( next_on->y < p->y && prev_on->y < p->y )
- measurement = SUB_LONG( max_y, p->y );
- else
- continue;
-
- if ( measurement < extremum_threshold )
- continue;
-
- if ( !measurement_taken || measurement < min_measurement )
- {
- measurement_taken = TRUE;
- min_measurement = measurement;
- }
- }
-
- } while ( p != first_point );
-
- if ( !measurement_taken )
- min_measurement = 0;
-
- FT_TRACE4(( "af_latin_stretch_bottom_tilde: min measurement %ld\n",
- min_measurement ));
-
- af_touch_bottom_contours( hints, tilde_contour );
-
- target_height = min_measurement + 64;
- if ( height >= target_height )
- return 0;
-
- p = first_point;
- do
- {
- p = p->next;
- p->y = ADD_LONG( MUL_LONG( SUB_LONG( p->y,
- max_y ),
- target_height ) / height,
- max_y );
-
- } while ( p != first_point );
-
- return target_height - height;
- }
-
-
- /*
- As part of `af_latin_stretch_top_tilde`, normally all points in the
- tilde are marked as touched, so the existing grid fitting will leave the
- tilde misaligned with the grid.
-
- This function moves the tilde contour down to be grid-fitted. We assume
- that if moving the tilde down would cause it to touch or overlap another
- countour, the vertical adjustment step will fix it.
-
- Because the vertical adjustment step comes after all other grid-fitting
- steps, the top edge of the contour under the tilde is usually aligned
- with a horizontal grid line. The vertical gap enforced by the vertical
- adjustment is exactly one pixel, so if the top edge of the contour below
- the tilde is on a grid line, the resulting tilde contour will also be
- grid-aligned.
-
- But in cases where the gap is already big enough so that the vertical
- adjustment does nothing, this function ensures that even without the
- intervention of the vertical adjustment step, the tilde will be
- grid-aligned.
-
- Return the vertical alignment amount.
- */
- static FT_Pos
- af_latin_align_top_tilde( AF_GlyphHints hints,
- FT_Int tilde_contour )
- {
- AF_Point p = hints->contours[tilde_contour];
- AF_Point first_point = p;
-
- FT_Pos min_y = p->y;
- FT_Pos max_y = p->y;
-
- FT_Pos min_y_rounded;
- FT_Pos delta;
- FT_Pos height;
-
-
- /* Find vertical extrema of the (now stretched) tilde contour. */
- do
- {
- p = p->next;
- if ( p->y < min_y )
- min_y = p->y;
- if ( p->y > max_y )
- max_y = p->y;
-
- } while ( p != first_point );
-
- /* Align bottom of the tilde to the grid. */
- min_y_rounded = FT_PIX_ROUND_LONG( min_y );
- delta = SUB_LONG( min_y_rounded, min_y );
- height = SUB_LONG( max_y, min_y );
-
- /* If the tilde is less than 3 pixels tall, snap the center of it */
- /* to the grid instead of the bottom to improve readability. */
- if ( height < 64 * 3 )
- delta += ( FT_PIX_ROUND( height ) - height ) / 2;
-
- af_move_contour_vertically( first_point, delta );
-
- return delta;
- }
-
-
- static FT_Pos
- af_latin_align_bottom_tilde( AF_GlyphHints hints,
- FT_Int tilde_contour )
- {
- AF_Point p = hints->contours[tilde_contour];
- AF_Point first_point = p;
-
- FT_Pos min_y = p->y;
- FT_Pos max_y = p->y;
-
- FT_Pos max_y_rounded;
- FT_Pos delta;
- FT_Pos height;
-
-
- do
- {
- p = p->next;
- if ( p->y < min_y )
- min_y = p->y;
- if ( p->y > max_y )
- max_y = p->y;
-
- } while ( p != first_point );
-
- max_y_rounded = FT_PIX_ROUND_LONG( max_y );
- delta = SUB_LONG( max_y_rounded, max_y );
- height = SUB_LONG( max_y, min_y );
-
- if ( height < 64 * 3 )
- delta -= ( FT_PIX_ROUND( height ) - height ) / 2;
-
- af_move_contour_vertically( first_point, delta );
-
- return delta;
- }
-
-
- /* Return 1 if the given contour overlaps horizontally with the bounding */
- /* box of all other contours combined. This is a helper for function */
- /* `af_glyph_hints_apply_vertical_separation_adjustments`. */
- static FT_Bool
- af_check_contour_horizontal_overlap( AF_GlyphHints hints,
- FT_Int contour_index )
- {
- FT_Pos contour_max_x = FT_LONG_MIN;
- FT_Pos contour_min_x = FT_LONG_MAX;
- FT_Pos others_max_x = FT_LONG_MIN;
- FT_Pos others_min_x = FT_LONG_MAX;
-
- FT_Int contour;
-
- FT_Bool horizontal_overlap;
-
-
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- AF_Point first_point = hints->contours[contour];
- AF_Point p = first_point;
-
-
- /* Ignore dimensionless contours (i.e., contours with only one or */
- /* two points). */
- if ( first_point->next->next == first_point )
- continue;
-
- do
- {
- p = p->next;
-
- if ( contour == contour_index )
- {
- if ( p->x < contour_min_x )
- contour_min_x = p->x;
- if ( p->x > contour_max_x )
- contour_max_x = p->x;
- }
- else
- {
- if ( p->x < others_min_x )
- others_min_x = p->x;
- if ( p->x > others_max_x )
- others_max_x = p->x;
- }
- } while ( p != first_point );
- }
-
- horizontal_overlap =
- ( others_min_x <= contour_max_x && contour_max_x <= others_max_x ) ||
- ( others_min_x <= contour_min_x && contour_min_x <= others_max_x ) ||
- ( contour_max_x >= others_max_x && contour_min_x <= others_min_x );
-
- return horizontal_overlap;
- }
-
-
- static void
- af_glyph_hints_apply_vertical_separation_adjustments(
- AF_GlyphHints hints,
- AF_Dimension dim,
- FT_UInt glyph_index,
- FT_Pos accent_height_limit,
- FT_Hash reverse_charmap )
- {
- FT_Bool adjust_top = FALSE;
- FT_Bool adjust_below_top = FALSE;
-
- FT_Bool adjust_bottom = FALSE;
- FT_Bool adjust_above_bottom = FALSE;
-
- size_t* val;
- FT_UInt32 adj_type = AF_ADJUST_NONE;
-
-
- FT_TRACE4(( "Entering"
- " af_glyph_hints_apply_vertical_separation_adjustments\n" ));
-
- if ( dim != AF_DIMENSION_VERT )
- return;
-
- val = ft_hash_num_lookup( (FT_Int)glyph_index, reverse_charmap );
- if ( val )
- {
- FT_UInt codepoint = *val;
-
-
- adj_type = af_adjustment_database_lookup( codepoint );
-
- if ( adj_type )
- {
- adjust_top = !!( adj_type & AF_ADJUST_UP );
- adjust_below_top = !!( adj_type & AF_ADJUST_UP2 );
-
- adjust_bottom = !!( adj_type & AF_ADJUST_DOWN );
- adjust_above_bottom = !!( adj_type & AF_ADJUST_DOWN2 );
- }
- }
-
- if ( ( ( adjust_top || adjust_bottom ) &&
- hints->num_contours >= 2 ) ||
- ( ( adjust_below_top || adjust_above_bottom ) &&
- hints->num_contours >= 3 ) )
- {
- /* Recompute vertical extrema, this time acting on already */
- /* auto-hinted outlines. */
- af_compute_vertical_extrema( hints );
- }
-
- if ( ( adjust_top && hints->num_contours >= 2 ) ||
- ( adjust_below_top && hints->num_contours >= 3 ) )
- {
- FT_Int high_contour;
- FT_Pos high_min_y;
- FT_Pos high_max_y;
- FT_Pos high_height;
-
- FT_Int tilde_contour;
- FT_Pos tilde_min_y;
- FT_Pos tilde_max_y;
- FT_Pos tilde_height;
-
- FT_Int contour;
- FT_Bool horizontal_overlap;
-
- FT_Pos min_distance = 64;
- FT_Pos adjustment_amount;
- FT_Pos calculated_amount;
- FT_Pos centering_adjustment = 0;
- FT_Pos pos;
-
- FT_Bool is_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP );
- FT_Bool is_below_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP2 );
-
-
- FT_TRACE4(( "af_glyph_hints_apply_vertical_separation_adjustments:\n"
- " Applying vertical adjustment: %s\n",
- adjust_top ? "AF_ADJUST_TOP" : "AF_ADJUST_TOP2" ));
-
- high_contour = adjust_below_top
- ? af_find_second_highest_contour( hints )
- : af_find_highest_contour( hints );
-
- /* Check for a horizontal overlap between the high contour and the */
- /* rest. If there is no overlap, do not adjust. */
- horizontal_overlap =
- af_check_contour_horizontal_overlap( hints, high_contour );
- if ( !horizontal_overlap )
- {
- FT_TRACE4(( " High contour does not horizontally overlap"
- " with other contours.\n"
- " Skipping adjustment.\n" ));
- return;
- }
-
- high_min_y = hints->contour_y_minima[high_contour];
- high_max_y = hints->contour_y_maxima[high_contour];
- high_height = SUB_LONG( high_max_y, high_min_y );
-
- if ( high_height > accent_height_limit )
- {
- FT_TRACE4(( " High contour height (%.2f) exceeds accent height"
- " limit (%.2f).\n"
- " Skipping adjustment.\n",
- (double)high_height / 64,
- (double)accent_height_limit / 64 ));
- return;
- }
-
- /* If the difference between the vertical minimum of the high */
- /* contour and the vertical maximum of another contour is less */
- /* than a pixel, shift up the high contour to make the distance */
- /* one pixel. */
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos min_y;
- FT_Pos max_y;
- FT_Pos distance;
-
-
- if ( contour == high_contour )
- continue;
-
- min_y = hints->contour_y_minima[contour];
- max_y = hints->contour_y_maxima[contour];
-
- /* We also check that the y minimum of the 'other' contour */
- /* is below the high contour to avoid potential false hits */
- /* with contours enclosed in the high one. */
- distance = SUB_LONG( high_min_y, max_y );
- if ( distance < 64 &&
- distance < min_distance &&
- min_y < high_min_y )
- min_distance = distance;
- }
-
- adjustment_amount = 64 - min_distance;
-
- if ( is_top_tilde || is_below_top_tilde )
- {
- tilde_contour = adjust_top
- ? high_contour
- : ( is_below_top_tilde
- ? high_contour
- : af_find_highest_contour( hints ) );
-
- tilde_min_y = hints->contour_y_minima[tilde_contour];
- tilde_max_y = hints->contour_y_maxima[tilde_contour];
- tilde_height = SUB_LONG( tilde_max_y, tilde_min_y);
-
- /* The vertical separation adjustment potentially undoes a */
- /* tilde center alignment. If it would grid-align a tilde */
- /* less than 3 pixels in height, shift additionally to */
- /* re-center the tilde. */
-
- pos = ADD_LONG( high_min_y, adjustment_amount );
- if ( adjust_below_top && is_top_tilde )
- pos += high_height;
-
- if ( pos % 64 == 0 && tilde_height < 3 * 64 )
- {
- centering_adjustment = ( FT_PIX_ROUND( tilde_height ) -
- tilde_height ) / 2;
-
- FT_TRACE4(( " Additional tilde centering adjustment: %ld\n",
- centering_adjustment ));
- }
- }
-
- if ( ( adjust_top && is_top_tilde ) ||
- ( adjust_below_top && is_below_top_tilde ) )
- calculated_amount = adjustment_amount + centering_adjustment;
- else
- calculated_amount = adjustment_amount;
-
- /* allow a delta of 2/64px to handle rounding differences */
- FT_TRACE4(( " Calculated adjustment amount: %ld%s\n",
- calculated_amount,
- ( calculated_amount < -2 ||
- ( adjustment_amount > 66 && calculated_amount > 66 ) )
- ? " (out of range [-2;66], not adjusting)" : "" ));
-
- if ( calculated_amount != 0 &&
- calculated_amount >= -2 &&
- ( calculated_amount <= 66 || adjustment_amount <= 66 ) )
- {
- /* Value 8 is heuristic. */
- FT_Pos height_delta = high_height / 8;
- FT_Pos min_y_limit = SUB_LONG( high_min_y, height_delta );
-
-
- FT_TRACE4(( " Pushing high contour %ld units up\n",
- calculated_amount ));
-
- /* While we use only a single contour (the 'high' one) for */
- /* computing `adjustment_amount`, we apply it to all contours */
- /* that are (approximately) in the same vertical range or */
- /* higher. This covers, for example, the inner contour of */
- /* the Czech ring accent or the second acute accent in the */
- /* Hungarian double acute accent. */
- af_move_contours_up( hints, min_y_limit, adjustment_amount );
-
- if ( adjust_below_top && is_top_tilde )
- {
- FT_TRACE4(( " Pushing top tilde %ld units up\n",
- centering_adjustment ));
-
- af_move_contours_up( hints,
- ADD_LONG( min_y_limit, high_height ),
- centering_adjustment );
- }
- }
- }
-
- if ( ( adjust_bottom && hints->num_contours >= 2 ) ||
- ( adjust_above_bottom && hints->num_contours >= 3 ) )
- {
- FT_Int low_contour;
- FT_Pos low_min_y;
- FT_Pos low_max_y;
- FT_Pos low_height;
-
- FT_Int tilde_contour;
- FT_Pos tilde_min_y;
- FT_Pos tilde_max_y;
- FT_Pos tilde_height;
-
- FT_Int contour;
- FT_Bool horizontal_overlap;
-
- FT_Pos min_distance = 64;
- FT_Pos adjustment_amount;
- FT_Pos calculated_amount;
- FT_Pos centering_adjustment = 0;
- FT_Pos pos;
-
- FT_Bool is_bottom_tilde =
- !!( adj_type & AF_ADJUST_TILDE_BOTTOM );
- FT_Bool is_above_bottom_tilde =
- !!( adj_type & AF_ADJUST_TILDE_BOTTOM2 );
-
-
- FT_TRACE4(( "af_glyph_hints_apply_vertical_separation_adjustments:\n"
- " Applying vertical adjustment: %s\n",
- adjust_bottom ? "AF_ADJUST_DOWN": "AF_ADJUST_DOWN2" ));
-
- low_contour = adjust_above_bottom
- ? af_find_second_lowest_contour( hints )
- : af_find_lowest_contour( hints );
-
- horizontal_overlap =
- af_check_contour_horizontal_overlap( hints, low_contour );
- if ( !horizontal_overlap )
- {
- FT_TRACE4(( " Low contour does not horizontally overlap"
- " with other contours.\n"
- " Skipping adjustment.\n" ));
- return;
- }
-
- low_min_y = hints->contour_y_minima[low_contour];
- low_max_y = hints->contour_y_maxima[low_contour];
- low_height = SUB_LONG( low_max_y, low_min_y );
-
- if ( low_height > accent_height_limit )
- {
- FT_TRACE4(( " Low contour height (%.2f) exceeds accent height"
- " limit (%.2f).\n"
- " Skipping adjustment.\n",
- (double)low_height / 64,
- (double)accent_height_limit / 64 ));
- return;
- }
-
- for ( contour = 0; contour < hints->num_contours; contour++ )
- {
- FT_Pos min_y;
- FT_Pos max_y;
- FT_Pos distance;
-
-
- if ( contour == low_contour )
- continue;
-
- min_y = hints->contour_y_minima[contour];
- max_y = hints->contour_y_maxima[contour];
-
- distance = SUB_LONG( min_y, low_max_y );
- if ( distance < 64 &&
- distance < min_distance &&
- max_y > low_max_y )
- min_distance = distance;
- }
-
- adjustment_amount = 64 - min_distance;
-
- if ( is_bottom_tilde || is_above_bottom_tilde )
- {
- tilde_contour = adjust_bottom
- ? low_contour
- : ( is_above_bottom_tilde
- ? low_contour
- : af_find_lowest_contour( hints ) );
-
- tilde_min_y = hints->contour_y_minima[tilde_contour];
- tilde_max_y = hints->contour_y_maxima[tilde_contour];
- tilde_height = SUB_LONG( tilde_max_y, tilde_min_y );
-
- pos = SUB_LONG( low_max_y, adjustment_amount );
- if ( adjust_above_bottom && is_bottom_tilde )
- pos -= low_height;
-
- if ( pos % 64 == 0 && tilde_height < 3 * 64 )
- {
- centering_adjustment = ( FT_PIX_ROUND( tilde_height ) -
- tilde_height ) / 2;
-
- FT_TRACE4(( " Additional tilde centering adjustment: %ld\n",
- centering_adjustment ));
- }
- }
-
- if ( ( adjust_bottom && is_bottom_tilde ) ||
- ( adjust_above_bottom && is_above_bottom_tilde ) )
- calculated_amount = adjustment_amount + centering_adjustment;
- else
- calculated_amount = adjustment_amount;
-
- FT_TRACE4(( " Calculated adjustment amount: %ld%s\n",
- calculated_amount,
- ( calculated_amount < -2 ||
- ( adjustment_amount > 66 && calculated_amount > 66 ) )
- ? " (out of range [-2;66], not adjusting)" : "" ));
-
- if ( calculated_amount != 0 &&
- calculated_amount >= -2 &&
- ( calculated_amount <= 66 || adjustment_amount <= 66 ) )
- {
- FT_Pos height_delta = low_height / 8;
- FT_Pos max_y_limit = ADD_LONG( low_max_y, height_delta );
-
-
- FT_TRACE4(( " Pushing low contour %ld units down\n",
- calculated_amount ));
-
- af_move_contours_down( hints, max_y_limit, adjustment_amount );
-
- if ( adjust_above_bottom && is_bottom_tilde )
- {
- FT_TRACE4(( " Pushing bottom tilde %ld units down\n",
- centering_adjustment ));
-
- af_move_contours_down( hints,
- SUB_LONG( max_y_limit, low_height ),
- centering_adjustment );
- }
- }
- }
-
-#ifdef FT_DEBUG_LEVEL_TRACE
- if ( !( ( ( adjust_top || adjust_bottom ) &&
- hints->num_contours >= 2 ) ||
- ( ( adjust_below_top || adjust_above_bottom ) &&
- hints->num_contours >= 3 ) ) )
- FT_TRACE4(( "af_glyph_hints_apply_vertical_separation_adjustments:\n"
- " No vertical adjustment applied\n" ));
-#endif
-
- FT_TRACE4(( "Exiting"
- " af_glyph_hints_apply_vertical_separation_adjustments\n" ));
- }
-
-
-#undef FT_COMPONENT
-#define FT_COMPONENT aflatin
-
-
- /* Compute the snapped width of a given stem, ignoring very thin ones. */
- /* There is a lot of voodoo in this function; changing the hard-coded */
- /* parameters influence the whole hinting process. */
-
- static FT_Pos
- af_latin_compute_stem_width( AF_GlyphHints hints,
- AF_Dimension dim,
- FT_Pos width,
- FT_Pos base_delta,
- FT_UInt base_flags,
- FT_UInt stem_flags )
- {
- AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics;
- AF_LatinAxis axis = &metrics->axis[dim];
- FT_Pos dist = width;
- FT_Int sign = 0;
- FT_Int vertical = ( dim == AF_DIMENSION_VERT );
-
-
- if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
- axis->extra_light )
- return width;
-
- if ( dist < 0 )
- {
- dist = -width;
- sign = 1;
- }
-
- if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
- ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )
- {
- /* smooth hinting process: very lightly quantize the stem width */
-
- /* leave the widths of serifs alone */
- if ( ( stem_flags & AF_EDGE_SERIF ) &&
- vertical &&
- ( dist < 3 * 64 ) )
- goto Done_Width;
-
- else if ( base_flags & AF_EDGE_ROUND )
- {
- if ( dist < 80 )
- dist = 64;
- }
- else if ( dist < 56 )
- dist = 56;
-
- if ( axis->width_count > 0 )
- {
- FT_Pos delta;
-
-
- /* compare to standard width */
- delta = dist - axis->widths[0].cur;
-
- if ( delta < 0 )
- delta = -delta;
-
- if ( delta < 40 )
- {
- dist = axis->widths[0].cur;
- if ( dist < 48 )
- dist = 48;
-
- goto Done_Width;
- }
-
- if ( dist < 3 * 64 )
- {
- delta = dist & 63;
- dist &= -64;
-
- if ( delta < 10 )
- dist += delta;
-
- else if ( delta < 32 )
- dist += 10;
-
- else if ( delta < 54 )
- dist += 54;
-
- else
- dist += delta;
- }
- else
- {
- /* A stem's end position depends on two values: the start */
- /* position and the stem length. The former gets usually */
- /* rounded to the grid, while the latter gets rounded also if it */
- /* exceeds a certain length (see below in this function). This */
- /* `double rounding' can lead to a great difference to the */
- /* original, unhinted position; this normally doesn't matter for */
- /* large PPEM values, but for small sizes it can easily make */
- /* outlines collide. For this reason, we adjust the stem length */
- /* by a small amount depending on the PPEM value in case the */
- /* former and latter rounding both point into the same */
- /* direction. */
-
- FT_Pos bdelta = 0;
-
-
- if ( ( ( width > 0 ) && ( base_delta > 0 ) ) ||
- ( ( width < 0 ) && ( base_delta < 0 ) ) )
- {
- FT_UInt ppem = metrics->root.scaler.face->size->metrics.x_ppem;
-
-
- if ( ppem < 10 )
- bdelta = base_delta;
- else if ( ppem < 30 )
- bdelta = ( base_delta * (FT_Pos)( 30 - ppem ) ) / 20;
-
- if ( bdelta < 0 )
- bdelta = -bdelta;
- }
-
- dist = ( dist - bdelta + 32 ) & ~63;
- }
- }
- }
- else
- {
- /* strong hinting process: snap the stem width to integer pixels */
-
- FT_Pos org_dist = dist;
-
-
- dist = af_latin_snap_width( axis->widths, axis->width_count, dist );
-
- if ( vertical )
- {
- /* in the case of vertical hinting, always round */
- /* the stem heights to integer pixels */
-
- if ( dist >= 64 )
- dist = ( dist + 16 ) & ~63;
- else
- dist = 64;
- }
- else
- {
- if ( AF_LATIN_HINTS_DO_MONO( hints ) )
- {
- /* monochrome horizontal hinting: snap widths to integer pixels */
- /* with a different threshold */
-
- if ( dist < 64 )
- dist = 64;
- else
- dist = ( dist + 32 ) & ~63;
- }
- else
- {
- /* for horizontal anti-aliased hinting, we adopt a more subtle */
- /* approach: we strengthen small stems, round stems whose size */
- /* is between 1 and 2 pixels to an integer, otherwise nothing */
-
- if ( dist < 48 )
- dist = ( dist + 64 ) >> 1;
-
- else if ( dist < 128 )
- {
- /* We only round to an integer width if the corresponding */
- /* distortion is less than 1/4 pixel. Otherwise this */
- /* makes everything worse since the diagonals, which are */
- /* not hinted, appear a lot bolder or thinner than the */
- /* vertical stems. */
-
- FT_Pos delta;
-
-
- dist = ( dist + 22 ) & ~63;
- delta = dist - org_dist;
- if ( delta < 0 )
- delta = -delta;
-
- if ( delta >= 16 )
- {
- dist = org_dist;
- if ( dist < 48 )
- dist = ( dist + 64 ) >> 1;
- }
- }
- else
- /* round otherwise to prevent color fringes in LCD mode */
- dist = ( dist + 32 ) & ~63;
- }
- }
- }
-
- Done_Width:
- if ( sign )
- dist = -dist;
-
- return dist;
- }
-
-
- /* Align one stem edge relative to the previous stem edge. */
-
- static void
- af_latin_align_linked_edge( AF_GlyphHints hints,
- AF_Dimension dim,
- AF_Edge base_edge,
- AF_Edge stem_edge )
- {
- FT_Pos dist, base_delta;
- FT_Pos fitted_width;
-
-
- dist = stem_edge->opos - base_edge->opos;
- base_delta = base_edge->pos - base_edge->opos;
-
- fitted_width = af_latin_compute_stem_width( hints, dim,
- dist, base_delta,
- base_edge->flags,
- stem_edge->flags );
-
-
- stem_edge->pos = base_edge->pos + fitted_width;
-
- FT_TRACE5(( " LINK: edge %td (opos=%.2f) linked to %.2f,"
- " dist was %.2f, now %.2f\n",
- stem_edge - hints->axis[dim].edges,
- (double)stem_edge->opos / 64, (double)stem_edge->pos / 64,
- (double)dist / 64, (double)fitted_width / 64 ));
- }
-
-
- /* Shift the coordinates of the `serif' edge by the same amount */
- /* as the corresponding `base' edge has been moved already. */
-
- static void
- af_latin_align_serif_edge( AF_GlyphHints hints,
- AF_Edge base,
- AF_Edge serif )
- {
- FT_UNUSED( hints );
+ static void
+ af_latin_align_serif_edge( AF_GlyphHints hints,
+ AF_Edge base,
+ AF_Edge serif )
+ {
+ FT_UNUSED( hints );
serif->pos = base->pos + ( serif->opos - base->opos );
}
@@ -4220,15 +2998,13 @@
af_latin_hint_edges( AF_GlyphHints hints,
AF_Dimension dim )
{
- AF_AxisHints axis = &hints->axis[dim];
-
- AF_Edge edges = axis->edges;
- AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
- AF_Edge edge;
- FT_PtrDist n_edges;
-
- AF_Edge anchor = NULL;
- FT_Bool has_non_stem_edges = 0;
+ AF_AxisHints axis = &hints->axis[dim];
+ AF_Edge edges = axis->edges;
+ AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
+ FT_PtrDist n_edges;
+ AF_Edge edge;
+ AF_Edge anchor = NULL;
+ FT_Int has_serifs = 0;
AF_StyleClass style_class = hints->metrics->style_class;
AF_ScriptClass script_class = af_script_classes[style_class->script];
@@ -4355,7 +3131,7 @@
edge2 = edge->link;
if ( !edge2 )
{
- has_non_stem_edges = TRUE;
+ has_serifs++;
continue;
}
@@ -4632,7 +3408,7 @@
}
}
- if ( has_non_stem_edges || !anchor )
+ if ( has_serifs || !anchor )
{
/*
* now hint the remaining edges (serifs and single) in order
@@ -4650,75 +3426,9 @@
if ( edge->serif )
{
- AF_Edge e, top, bottom;
- FT_Pos min_pos, max_pos;
-
-
- /* Check whether we have a real serif -- if there are */
- /* other edges with overlapping (or enclosed) segments */
- /* between the primary and serif edge, we have not. */
- /* */
- /* Such a situation might happen if an accent is very */
- /* near to its base glyph (for example, Vietnamese */
- /* uppercase letters with two accents in `arial.ttf`), */
- /* and the segment detection algorithm classifies the */
- /* top of the accent incorrectly as a serif. */
delta = edge->serif->opos - edge->opos;
if ( delta < 0 )
- {
delta = -delta;
-
- top = edge;
- bottom = edge->serif;
- }
- else
- {
- top = edge->serif;
- bottom = edge;
- }
-
- if ( delta < 64 + 32 )
- {
- /* take care of outline orientation while computing extrema */
- min_pos = FT_MIN( FT_MIN( FT_MIN( top->first->first->v,
- top->first->last->v ),
- FT_MIN( top->last->first->v,
- top->last->last->v ) ),
- FT_MIN( FT_MIN( bottom->first->first->v,
- bottom->first->last->v ),
- FT_MIN( bottom->last->first->v,
- bottom->last->last->v ) ) );
- max_pos = FT_MAX( FT_MAX( FT_MAX( top->first->first->v,
- top->first->last->v ),
- FT_MAX( top->last->first->v,
- top->last->last->v ) ),
- FT_MAX( FT_MAX( bottom->first->first->v,
- bottom->first->last->v ),
- FT_MAX( bottom->last->first->v,
- bottom->last->last->v ) ) );
-
- for ( e = bottom + 1; e < top; e++ )
- {
- FT_Pos e_min = FT_MIN( FT_MIN( e->first->first->v,
- e->first->last->v ),
- FT_MIN( e->last->first->v,
- e->last->last->v ) );
- FT_Pos e_max = FT_MAX( FT_MAX( e->first->first->v,
- e->first->last->v ),
- FT_MAX( e->last->first->v,
- e->last->last->v ) );
-
- if ( !( ( e_min < min_pos && e_max < min_pos ) ||
- ( e_min > max_pos && e_max > max_pos ) ) )
- {
- delta = 1000; /* not a real serif */
- break;
- }
- }
-
- if ( delta == 1000 )
- continue;
- }
}
if ( delta < 64 + 16 )
@@ -4852,8 +3562,6 @@
AF_LatinAxis axis;
- FT_Pos accent_height_limit = 0;
-
error = af_glyph_hints_reload( hints, outline );
if ( error )
@@ -4873,172 +3581,11 @@
if ( AF_HINTS_DO_VERTICAL( hints ) )
{
- size_t* val;
-
- FT_Int top_tilde_contour = 0;
- FT_Int bottom_tilde_contour = 0;
-
- FT_Int below_top_tilde_contour = 0;
- FT_Int above_bottom_tilde_contour = 0;
-
- AF_LatinBlue capital_top_blue = NULL;
- AF_LatinBlue capital_bottom_blue = NULL;
-
- AF_LatinBlue small_top_blue = NULL;
- AF_LatinBlue small_bottom_blue = NULL;
-
- FT_Bool have_flags = FALSE;
-
- FT_Bool is_top_tilde = FALSE;
- FT_Bool is_bottom_tilde = FALSE;
-
- FT_Bool is_below_top_tilde = FALSE;
- FT_Bool is_above_bottom_tilde = FALSE;
-
- FT_Bool ignore_capital_top = FALSE;
- FT_Bool ignore_capital_bottom = FALSE;
-
- FT_Bool ignore_small_top = FALSE;
- FT_Bool ignore_small_bottom = FALSE;
-
- FT_Bool do_height_check = TRUE;
-
- FT_Pos limit;
- FT_Pos y_offset;
-
-
- val = ft_hash_num_lookup( (FT_Int)glyph_index,
- metrics->root.reverse_charmap );
- if ( val )
- {
- FT_UInt codepoint = *val;
- FT_UInt32 adj_type = af_adjustment_database_lookup( codepoint );
-
-
- if ( adj_type )
- {
- have_flags = !!adj_type;
-
- is_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP );
- is_bottom_tilde = !!( adj_type & AF_ADJUST_TILDE_BOTTOM );
-
- is_below_top_tilde = !!( adj_type & AF_ADJUST_TILDE_TOP2 );
- is_above_bottom_tilde = !!( adj_type & AF_ADJUST_TILDE_BOTTOM2 );
-
- ignore_capital_top = !!( adj_type & AF_IGNORE_CAPITAL_TOP );
- ignore_capital_bottom = !!( adj_type & AF_IGNORE_CAPITAL_BOTTOM );
-
- ignore_small_top = !!( adj_type & AF_IGNORE_SMALL_TOP );
- ignore_small_bottom = !!( adj_type & AF_IGNORE_SMALL_BOTTOM );
-
- do_height_check = !( adj_type & AF_ADJUST_NO_HEIGHT_CHECK );
- }
- }
-
- if ( is_top_tilde || is_bottom_tilde ||
- is_below_top_tilde || is_above_bottom_tilde )
- af_compute_vertical_extrema( hints );
-
- /* Process inner tilde glyphs first. */
- if ( is_below_top_tilde )
- {
- below_top_tilde_contour = af_find_second_highest_contour( hints );
-
- y_offset = af_latin_stretch_top_tilde(
- hints, below_top_tilde_contour );
- y_offset += af_latin_align_top_tilde(
- hints, below_top_tilde_contour );
-
- limit = hints->contour_y_minima[below_top_tilde_contour];
- af_move_contours_up( hints, limit, y_offset );
- }
- if ( is_above_bottom_tilde )
- {
- above_bottom_tilde_contour = af_find_second_lowest_contour( hints );
-
- y_offset = af_latin_stretch_bottom_tilde(
- hints, above_bottom_tilde_contour );
- y_offset -= af_latin_align_bottom_tilde(
- hints, above_bottom_tilde_contour );
-
- limit = hints->contour_y_maxima[above_bottom_tilde_contour];
- af_move_contours_down( hints, limit, y_offset );
- }
-
- if ( is_top_tilde )
- {
- top_tilde_contour = af_find_highest_contour( hints );
-
- (void)af_latin_stretch_top_tilde( hints, top_tilde_contour );
- (void)af_latin_align_top_tilde( hints, top_tilde_contour );
- }
- if ( is_bottom_tilde )
- {
- bottom_tilde_contour = af_find_lowest_contour( hints );
-
- (void)af_latin_stretch_bottom_tilde( hints, bottom_tilde_contour );
- (void)af_latin_align_bottom_tilde( hints, bottom_tilde_contour );
- }
-
axis = &metrics->axis[AF_DIMENSION_VERT];
error = af_latin_hints_detect_features( hints,
axis->width_count,
axis->widths,
AF_DIMENSION_VERT );
-
- if ( have_flags )
- {
- af_latin_get_base_glyph_blues( hints,
- TRUE,
- &capital_top_blue,
- &capital_bottom_blue );
- af_latin_get_base_glyph_blues( hints,
- FALSE,
- &small_top_blue,
- &small_bottom_blue );
-
- if ( do_height_check )
- {
- /* Set a heuristic limit for the accent height so that */
- /* `af_glyph_hints_apply_vertical_separation_adjustments` */
- /* can correctly ignore the case where an accent is */
- /* unexpectedly not the highest (or lowest) contour. */
-
- /* Either 2/3 of the lowercase blue zone height... */
- if ( small_top_blue && small_bottom_blue )
- accent_height_limit = 2 * ( small_top_blue->shoot.cur -
- small_bottom_blue->shoot.cur ) / 3;
- /* or 1/2 of the uppercase blue zone height... */
- else if ( capital_top_blue && capital_bottom_blue )
- accent_height_limit = ( capital_top_blue->shoot.cur -
- capital_bottom_blue->shoot.cur ) / 2;
- /* or half of the standard PostScript ascender value (8/10) */
- /* of the EM value, scaled. */
- else
- accent_height_limit = FT_MulFix( metrics->units_per_em * 4 / 10,
- metrics->root.scaler.y_scale );
- }
- }
-
- if ( capital_top_blue && capital_bottom_blue )
- {
- if ( ignore_capital_top )
- af_latin_ignore_top( hints,
- capital_top_blue, capital_bottom_blue );
- if ( ignore_capital_bottom )
- af_latin_ignore_bottom( hints,
- capital_top_blue, capital_bottom_blue );
- }
- if ( small_top_blue && small_bottom_blue )
- {
- if ( ignore_small_top )
- af_latin_ignore_top( hints,
- small_top_blue, small_bottom_blue );
- if ( ignore_small_bottom )
- af_latin_ignore_bottom( hints,
- small_top_blue, small_bottom_blue );
- }
-
if ( error )
goto Exit;
@@ -5057,12 +3604,6 @@
af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim );
af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );
af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );
- af_glyph_hints_apply_vertical_separation_adjustments(
- hints,
- (AF_Dimension)dim,
- glyph_index,
- accent_height_limit,
- metrics->root.reverse_charmap );
}
}
@@ -5091,7 +3632,7 @@
(AF_WritingSystem_InitMetricsFunc) af_latin_metrics_init, /* style_metrics_init */
(AF_WritingSystem_ScaleMetricsFunc)af_latin_metrics_scale, /* style_metrics_scale */
- (AF_WritingSystem_DoneMetricsFunc) af_latin_metrics_done, /* style_metrics_done */
+ (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
(AF_WritingSystem_GetStdWidthsFunc)af_latin_get_standard_widths, /* style_metrics_getstdw */
(AF_WritingSystem_InitHintsFunc) af_latin_hints_init, /* style_hints_init */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.h
index 82b4b0d480..54e5061502 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aflatin.h
@@ -5,7 +5,7 @@
* Auto-fitter hinting routines for latin writing system
* (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -61,26 +61,17 @@ FT_BEGIN_HEADER
( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT )
#define AF_LATIN_IS_LONG_BLUE( b ) \
( (b)->properties & AF_BLUE_PROPERTY_LATIN_LONG )
-#define AF_LATIN_IS_CAPITAL_BOTTOM_BLUE( b ) \
- ( (b)->properties & AF_BLUE_PROPERTY_LATIN_CAPITAL_BOTTOM )
-#define AF_LATIN_IS_SMALL_BOTTOM_BLUE( b ) \
- ( (b)->properties & AF_BLUE_PROPERTY_LATIN_SMALL_BOTTOM )
#define AF_LATIN_MAX_WIDTHS 16
-#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
-#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */
-#define AF_LATIN_BLUE_SUB_TOP ( 1U << 2 ) /* we have a subscript */
- /* top blue zone */
-#define AF_LATIN_BLUE_NEUTRAL ( 1U << 3 ) /* we have a neutral blue */
- /* zone */
-#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 4 ) /* used for scale adjustm. */
- /* optimization */
-#define AF_LATIN_BLUE_BOTTOM ( 1U << 5 ) /* we have a capital */
- /* letter bottom blue zone */
-#define AF_LATIN_BLUE_BOTTOM_SMALL ( 1U << 6 ) /* we have a small letter */
- /* bottom blue zone */
+#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
+#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */
+#define AF_LATIN_BLUE_SUB_TOP ( 1U << 2 ) /* we have a subscript top */
+ /* blue zone */
+#define AF_LATIN_BLUE_NEUTRAL ( 1U << 3 ) /* we have neutral blue zone */
+#define AF_LATIN_BLUE_ADJUSTMENT ( 1U << 4 ) /* used for scale adjustment */
+ /* optimization */
typedef struct AF_LatinBlueRec_
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.c
index 4e2ac1f1ce..af1d59a689 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.c
@@ -4,7 +4,7 @@
*
* Auto-fitter glyph loading routines (body).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -524,18 +524,16 @@
bbox.xMin = FT_PIX_FLOOR( bbox.xMin );
bbox.yMin = FT_PIX_FLOOR( bbox.yMin );
- bbox.xMax = FT_PIX_CEIL_LONG( bbox.xMax );
- bbox.yMax = FT_PIX_CEIL_LONG( bbox.yMax );
+ bbox.xMax = FT_PIX_CEIL( bbox.xMax );
+ bbox.yMax = FT_PIX_CEIL( bbox.yMax );
- slot->metrics.width = SUB_LONG( bbox.xMax, bbox.xMin );
- slot->metrics.height = SUB_LONG( bbox.yMax, bbox.yMin );
+ slot->metrics.width = bbox.xMax - bbox.xMin;
+ slot->metrics.height = bbox.yMax - bbox.yMin;
slot->metrics.horiBearingX = bbox.xMin;
slot->metrics.horiBearingY = bbox.yMax;
- slot->metrics.vertBearingX = FT_PIX_FLOOR( ADD_LONG( bbox.xMin,
- vvector.x ) );
- slot->metrics.vertBearingY = FT_PIX_FLOOR( ADD_LONG( bbox.yMax,
- vvector.y ) );
+ slot->metrics.vertBearingX = FT_PIX_FLOOR( bbox.xMin + vvector.x );
+ slot->metrics.vertBearingY = FT_PIX_FLOOR( bbox.yMax + vvector.y );
/* for mono-width fonts (like Andale, Courier, etc.) we need */
/* to keep the original rounded advance width; ditto for */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.h
index a04b4df0b3..99f0e15f92 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afloader.h
@@ -4,7 +4,7 @@
*
* Auto-fitter glyph loading routines (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.c
index 22d85a889e..726f6ca2b7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.c
@@ -4,7 +4,7 @@
*
* Auto-fitter module implementation (body).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -146,7 +146,7 @@
if ( !af_style_classes[ss] )
{
- FT_TRACE2(( "af_property_set: Invalid value %u for property `%s'\n",
+ FT_TRACE2(( "af_property_set: Invalid value %d for property `%s'\n",
*fallback_script, property_name ));
return FT_THROW( Invalid_Argument );
}
@@ -412,11 +412,6 @@
module->darken_params[6] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_X4;
module->darken_params[7] = CFF_CONFIG_OPTION_DARKENING_PARAMETER_Y4;
-#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
- defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
- ft_hb_funcs_init( module );
-#endif
-
return FT_Err_Ok;
}
@@ -426,11 +421,6 @@
{
FT_UNUSED( ft_module );
-#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
- defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
- ft_hb_funcs_done( (AF_Module)ft_module );
-#endif
-
#ifdef FT_DEBUG_AUTOFIT
if ( af_debug_hints_rec_->memory )
af_glyph_hints_done( af_debug_hints_rec_ );
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.h
index c62421ef69..91a1abfef1 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afmodule.h
@@ -4,7 +4,7 @@
*
* Auto-fitter module implementation (specification).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -22,7 +22,6 @@
#include <freetype/internal/ftobjs.h>
#include <freetype/ftmodapi.h>
-#include "ft-hb.h"
FT_BEGIN_HEADER
@@ -41,11 +40,6 @@ FT_BEGIN_HEADER
FT_Bool no_stem_darkening;
FT_Int darken_params[8];
-#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
- defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
- ft_hb_funcs_t* hb_funcs;
-#endif
-
} AF_ModuleRec, *AF_Module;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.c
index fd54948f3a..007b432818 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.c
@@ -4,7 +4,7 @@
*
* Auto-fitter Unicode script ranges (body).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -73,11 +73,9 @@
{
AF_UNIRANGE_REC( 0x0600, 0x06FF ), /* Arabic */
AF_UNIRANGE_REC( 0x0750, 0x07FF ), /* Arabic Supplement */
- AF_UNIRANGE_REC( 0x0870, 0x089F ), /* Arabic Extended-B */
AF_UNIRANGE_REC( 0x08A0, 0x08FF ), /* Arabic Extended-A */
AF_UNIRANGE_REC( 0xFB50, 0xFDFF ), /* Arabic Presentation Forms-A */
AF_UNIRANGE_REC( 0xFE70, 0xFEFF ), /* Arabic Presentation Forms-B */
- AF_UNIRANGE_REC( 0x10EC0, 0x10EFF ), /* Arabic Extended-C */
AF_UNIRANGE_REC( 0x1EE00, 0x1EEFF ), /* Arabic Mathematical Alphabetic Symbols */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -92,9 +90,8 @@
AF_UNIRANGE_REC( 0x06DF, 0x06E4 ),
AF_UNIRANGE_REC( 0x06E7, 0x06E8 ),
AF_UNIRANGE_REC( 0x06EA, 0x06ED ),
- AF_UNIRANGE_REC( 0x0897, 0x089F ),
- AF_UNIRANGE_REC( 0x08CA, 0x08E1 ),
- AF_UNIRANGE_REC( 0x08E3, 0x08FF ),
+ AF_UNIRANGE_REC( 0x08D4, 0x08E1 ),
+ AF_UNIRANGE_REC( 0x08D3, 0x08FF ),
AF_UNIRANGE_REC( 0xFBB2, 0xFBC1 ),
AF_UNIRANGE_REC( 0xFE70, 0xFE70 ),
AF_UNIRANGE_REC( 0xFE72, 0xFE72 ),
@@ -104,7 +101,6 @@
AF_UNIRANGE_REC( 0xFE7A, 0xFE7A ),
AF_UNIRANGE_REC( 0xFE7C, 0xFE7C ),
AF_UNIRANGE_REC( 0xFE7E, 0xFE7E ),
- AF_UNIRANGE_REC( 0x10EFD, 0x10EFF ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -202,9 +198,8 @@
const AF_Script_UniRangeRec af_cans_uniranges[] =
{
- AF_UNIRANGE_REC( 0x1400, 0x167F ), /* Unified Canadian Aboriginal Syllabics */
- AF_UNIRANGE_REC( 0x18B0, 0x18FF ), /* Unified Canadian Aboriginal Syllabics Extended */
- AF_UNIRANGE_REC( 0x11AB0, 0x11ABF ), /* Unified Canadian Aboriginal Syllabics Extended-A */
+ AF_UNIRANGE_REC( 0x1400, 0x167F ), /* Unified Canadian Aboriginal Syllabics */
+ AF_UNIRANGE_REC( 0x18B0, 0x18FF ), /* Unified Canadian Aboriginal Syllabics Extended */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -264,9 +259,6 @@
};
- /* TODO: Split off data for new 'cyrb' (subscript) and 'cyrp' */
- /* (superscript) groups (mainly from the Extended-D block), */
- /* in analogy to 'latb' and 'latp'? */
const AF_Script_UniRangeRec af_cyrl_uniranges[] =
{
AF_UNIRANGE_REC( 0x0400, 0x04FF ), /* Cyrillic */
@@ -274,7 +266,6 @@
AF_UNIRANGE_REC( 0x2DE0, 0x2DFF ), /* Cyrillic Extended-A */
AF_UNIRANGE_REC( 0xA640, 0xA69F ), /* Cyrillic Extended-B */
AF_UNIRANGE_REC( 0x1C80, 0x1C8F ), /* Cyrillic Extended-C */
- AF_UNIRANGE_REC( 0x1E030, 0x1E08F ), /* Cyrillic Extended-D */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -294,16 +285,15 @@
const AF_Script_UniRangeRec af_deva_uniranges[] =
{
- AF_UNIRANGE_REC( 0x0900, 0x093B ), /* Devanagari */
+ AF_UNIRANGE_REC( 0x0900, 0x093B ), /* Devanagari */
/* omitting U+093C nukta */
- AF_UNIRANGE_REC( 0x093D, 0x0950 ), /* ... continued */
+ AF_UNIRANGE_REC( 0x093D, 0x0950 ), /* ... continued */
/* omitting U+0951 udatta, U+0952 anudatta */
- AF_UNIRANGE_REC( 0x0953, 0x0963 ), /* ... continued */
+ AF_UNIRANGE_REC( 0x0953, 0x0963 ), /* ... continued */
/* omitting U+0964 danda, U+0965 double danda */
- AF_UNIRANGE_REC( 0x0966, 0x097F ), /* ... continued */
- AF_UNIRANGE_REC( 0x20B9, 0x20B9 ), /* (new) Rupee sign */
- AF_UNIRANGE_REC( 0xA8E0, 0xA8FF ), /* Devanagari Extended */
- AF_UNIRANGE_REC( 0x11B00, 0x11B5F ), /* Devanagari Extended-A */
+ AF_UNIRANGE_REC( 0x0966, 0x097F ), /* ... continued */
+ AF_UNIRANGE_REC( 0x20B9, 0x20B9 ), /* (new) Rupee sign */
+ AF_UNIRANGE_REC( 0xA8E0, 0xA8FF ), /* Devanagari Extended */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -339,7 +329,6 @@
AF_UNIRANGE_REC( 0x1380, 0x139F ), /* Ethiopic Supplement */
AF_UNIRANGE_REC( 0x2D80, 0x2DDF ), /* Ethiopic Extended */
AF_UNIRANGE_REC( 0xAB00, 0xAB2F ), /* Ethiopic Extended-A */
- AF_UNIRANGE_REC( 0x1E7E0, 0x1E7FF ), /* Ethiopic Extended-B */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -545,7 +534,7 @@
{
AF_UNIRANGE_REC( 0x0EB1, 0x0EB1 ),
AF_UNIRANGE_REC( 0x0EB4, 0x0EBC ),
- AF_UNIRANGE_REC( 0x0EC8, 0x0ECE ),
+ AF_UNIRANGE_REC( 0x0EC8, 0x0ECD ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -578,15 +567,12 @@
AF_UNIRANGE_REC( 0x2C7E, 0x2C7F ), /* ... continued */
AF_UNIRANGE_REC( 0x2E00, 0x2E7F ), /* Supplemental Punctuation */
AF_UNIRANGE_REC( 0xA720, 0xA76F ), /* Latin Extended-D */
- AF_UNIRANGE_REC( 0xA771, 0xA7F0 ), /* ... continued */
- AF_UNIRANGE_REC( 0xA7F2, 0xA7F7 ), /* ... continued */
+ AF_UNIRANGE_REC( 0xA771, 0xA7F7 ), /* ... continued */
AF_UNIRANGE_REC( 0xA7FA, 0xA7FF ), /* ... continued */
AF_UNIRANGE_REC( 0xAB30, 0xAB5B ), /* Latin Extended-E */
- AF_UNIRANGE_REC( 0xAB60, 0xAB68 ), /* ... continued */
- AF_UNIRANGE_REC( 0xAB6A, 0xAB6F ), /* ... continued */
+ AF_UNIRANGE_REC( 0xAB60, 0xAB6F ), /* ... continued */
AF_UNIRANGE_REC( 0xFB00, 0xFB06 ), /* Alphab. Present. Forms (Latin Ligs) */
AF_UNIRANGE_REC( 0x1D400, 0x1D7FF ), /* Mathematical Alphanumeric Symbols */
- AF_UNIRANGE_REC( 0x1DF00, 0x1DFFF ), /* Latin Extended-G */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -602,7 +588,7 @@
AF_UNIRANGE_REC( 0x02B9, 0x02DF ),
AF_UNIRANGE_REC( 0x02E5, 0x02FF ),
AF_UNIRANGE_REC( 0x0300, 0x036F ),
- AF_UNIRANGE_REC( 0x1AB0, 0x1AEB ),
+ AF_UNIRANGE_REC( 0x1AB0, 0x1ABE ),
AF_UNIRANGE_REC( 0x1DC0, 0x1DFF ),
AF_UNIRANGE_REC( 0x2017, 0x2017 ),
AF_UNIRANGE_REC( 0x203E, 0x203E ),
@@ -639,11 +625,8 @@
AF_UNIRANGE_REC( 0x2070, 0x207F ), /* superscript digits and letters */
AF_UNIRANGE_REC( 0x2C7D, 0x2C7D ), /* modifier letter capital v */
AF_UNIRANGE_REC( 0xA770, 0xA770 ), /* modifier letter us */
- AF_UNIRANGE_REC( 0xA7F1, 0xA7F1 ), /* modifier letter capital s */
AF_UNIRANGE_REC( 0xA7F8, 0xA7F9 ), /* more modifier letters */
AF_UNIRANGE_REC( 0xAB5C, 0xAB5F ), /* more modifier letters */
- AF_UNIRANGE_REC( 0xAB69, 0xAB69 ), /* modifier letter small turned w */
- AF_UNIRANGE_REC( 0x10780, 0x107FB ), /* Latin Extended-F */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -655,8 +638,7 @@
const AF_Script_UniRangeRec af_lisu_uniranges[] =
{
- AF_UNIRANGE_REC( 0xA4D0, 0xA4FF ), /* Lisu */
- AF_UNIRANGE_REC( 0x11FB0, 0x11FBF ), /* Lisu Supplement */
+ AF_UNIRANGE_REC( 0xA4D0, 0xA4FF ), /* Lisu */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -714,7 +696,6 @@
AF_UNIRANGE_REC( 0x1000, 0x109F ), /* Myanmar */
AF_UNIRANGE_REC( 0xA9E0, 0xA9FF ), /* Myanmar Extended-B */
AF_UNIRANGE_REC( 0xAA60, 0xAA7F ), /* Myanmar Extended-A */
- AF_UNIRANGE_REC( 0x116D0, 0x116FF ), /* Myanmar Extended-C */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -855,7 +836,6 @@
const AF_Script_UniRangeRec af_sinh_nonbase_uniranges[] =
{
- AF_UNIRANGE_REC( 0x0D81, 0x0D81 ),
AF_UNIRANGE_REC( 0x0DCA, 0x0DCA ),
AF_UNIRANGE_REC( 0x0DD2, 0x0DD6 ),
AF_UNIRANGE_REC( 0, 0 )
@@ -879,8 +859,7 @@
const AF_Script_UniRangeRec af_taml_uniranges[] =
{
- AF_UNIRANGE_REC( 0x0B80, 0x0BFF ), /* Tamil */
- AF_UNIRANGE_REC( 0x11FC0, 0x11FFF ), /* Tamil Supplement */
+ AF_UNIRANGE_REC( 0x0B80, 0x0BFF ), /* Tamil */
AF_UNIRANGE_REC( 0, 0 )
};
@@ -920,7 +899,6 @@
{
AF_UNIRANGE_REC( 0x0C00, 0x0C00 ),
AF_UNIRANGE_REC( 0x0C04, 0x0C04 ),
- AF_UNIRANGE_REC( 0x0C3C, 0x0C3C ),
AF_UNIRANGE_REC( 0x0C3E, 0x0C40 ),
AF_UNIRANGE_REC( 0x0C46, 0x0C56 ),
AF_UNIRANGE_REC( 0x0C62, 0x0C63 ),
@@ -1014,7 +992,6 @@
AF_UNIRANGE_REC( 0xA806, 0xA806 ),
AF_UNIRANGE_REC( 0xA80B, 0xA80B ),
AF_UNIRANGE_REC( 0xA825, 0xA826 ),
- AF_UNIRANGE_REC( 0xA82C, 0xA82C ),
AF_UNIRANGE_REC( 0, 0 )
};
@@ -1071,21 +1048,15 @@
AF_UNIRANGE_REC( 0xFE10, 0xFE1F ), /* Vertical forms */
AF_UNIRANGE_REC( 0xFE30, 0xFE4F ), /* CJK Compatibility Forms */
AF_UNIRANGE_REC( 0xFF00, 0xFFEF ), /* Halfwidth and Fullwidth Forms */
- AF_UNIRANGE_REC( 0x1AFF0, 0x1AFFF ), /* Kana Extended-B */
AF_UNIRANGE_REC( 0x1B000, 0x1B0FF ), /* Kana Supplement */
AF_UNIRANGE_REC( 0x1B100, 0x1B12F ), /* Kana Extended-A */
- AF_UNIRANGE_REC( 0x1B130, 0x1B16F ), /* Small Kana Extension */
AF_UNIRANGE_REC( 0x1D300, 0x1D35F ), /* Tai Xuan Hing Symbols */
AF_UNIRANGE_REC( 0x20000, 0x2A6DF ), /* CJK Unified Ideographs Extension B */
AF_UNIRANGE_REC( 0x2A700, 0x2B73F ), /* CJK Unified Ideographs Extension C */
AF_UNIRANGE_REC( 0x2B740, 0x2B81F ), /* CJK Unified Ideographs Extension D */
AF_UNIRANGE_REC( 0x2B820, 0x2CEAF ), /* CJK Unified Ideographs Extension E */
AF_UNIRANGE_REC( 0x2CEB0, 0x2EBEF ), /* CJK Unified Ideographs Extension F */
- AF_UNIRANGE_REC( 0x2EBF0, 0x2EE5D ), /* CJK Unified Ideographs Extension I */
AF_UNIRANGE_REC( 0x2F800, 0x2FA1F ), /* CJK Compatibility Ideographs Supplement */
- AF_UNIRANGE_REC( 0x30000, 0x3134A ), /* CJK Unified Ideographs Extension G */
- AF_UNIRANGE_REC( 0x31350, 0x323AF ), /* CJK Unified Ideographs Extension H */
- AF_UNIRANGE_REC( 0x323B0, 0x33479 ), /* CJK Unified Ideographs Extension J */
AF_UNIRANGE_REC( 0, 0 )
};
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.h
index fa00eb7504..813b3ee78e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afranges.h
@@ -4,7 +4,7 @@
*
* Auto-fitter Unicode script ranges (specification).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afscript.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afscript.h
index 5c4cbbcb92..0a83d77150 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afscript.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afscript.h
@@ -4,7 +4,7 @@
*
* Auto-fitter scripts (specification only).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.c
index f3c0744fd9..df0f46ada8 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.c
@@ -4,7 +4,7 @@
*
* HarfBuzz interface for accessing OpenType features (body).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -22,9 +22,9 @@
#include "aftypes.h"
#include "afshaper.h"
-
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
+
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
@@ -89,18 +89,17 @@
#define SCRIPT( s, S, d, h, H, ss ) h,
- FT_LOCAL_ARRAY_DEF( hb_script_t )
- af_hb_scripts[] =
+ static const hb_script_t scripts[] =
{
#include "afscript.h"
};
- static FT_Error
- af_shaper_get_coverage_hb( AF_FaceGlobals globals,
- AF_StyleClass style_class,
- FT_UShort* gstyles,
- FT_Bool default_script )
+ FT_Error
+ af_shaper_get_coverage( AF_FaceGlobals globals,
+ AF_StyleClass style_class,
+ FT_UShort* gstyles,
+ FT_Bool default_script )
{
hb_face_t* face;
@@ -125,10 +124,10 @@
if ( !globals || !style_class || !gstyles )
return FT_THROW( Invalid_Argument );
- face = hb( font_get_face )( globals->hb_font );
+ face = hb_font_get_face( globals->hb_font );
coverage_tags = coverages[style_class->coverage];
- script = af_hb_scripts[style_class->script];
+ script = scripts[style_class->script];
/* Convert a HarfBuzz script tag into the corresponding OpenType */
/* tag or tags -- some Indic scripts like Devanagari have an old */
@@ -138,19 +137,19 @@
hb_tag_t tags[3];
- hb( ot_tags_from_script_and_language )( script,
- HB_LANGUAGE_INVALID,
- &tags_count,
- tags,
- NULL,
- NULL );
+ hb_ot_tags_from_script_and_language( script,
+ HB_LANGUAGE_INVALID,
+ &tags_count,
+ tags,
+ NULL,
+ NULL );
script_tags[0] = tags_count > 0 ? tags[0] : HB_TAG_NONE;
script_tags[1] = tags_count > 1 ? tags[1] : HB_TAG_NONE;
script_tags[2] = tags_count > 2 ? tags[2] : HB_TAG_NONE;
}
- /* If the second tag is HB_OT_TAG_DEFAULT_SCRIPT, change that to */
- /* HB_TAG_NONE except for the default script. */
+ /* If the second tag is HB_OT_TAG_DEFAULT_SCRIPT, change that to */
+ /* HB_TAG_NONE except for the default script. */
if ( default_script )
{
if ( script_tags[0] == HB_TAG_NONE )
@@ -171,15 +170,15 @@
goto Exit;
}
- gsub_lookups = hb( set_create )();
- hb( ot_layout_collect_lookups )( face,
- HB_OT_TAG_GSUB,
- script_tags,
- NULL,
- coverage_tags,
- gsub_lookups );
+ gsub_lookups = hb_set_create();
+ hb_ot_layout_collect_lookups( face,
+ HB_OT_TAG_GSUB,
+ script_tags,
+ NULL,
+ coverage_tags,
+ gsub_lookups );
- if ( hb( set_is_empty )( gsub_lookups ) )
+ if ( hb_set_is_empty( gsub_lookups ) )
goto Exit; /* nothing to do */
FT_TRACE4(( "GSUB lookups (style `%s'):\n",
@@ -190,22 +189,22 @@
count = 0;
#endif
- gsub_glyphs = hb( set_create )();
- for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gsub_lookups, &idx ); )
+ gsub_glyphs = hb_set_create();
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE4(( " %u", idx ));
+ FT_TRACE4(( " %d", idx ));
count++;
#endif
/* get output coverage of GSUB feature */
- hb( ot_layout_lookup_collect_glyphs )( face,
- HB_OT_TAG_GSUB,
- idx,
- NULL,
- NULL,
- NULL,
- gsub_glyphs );
+ hb_ot_layout_lookup_collect_glyphs( face,
+ HB_OT_TAG_GSUB,
+ idx,
+ NULL,
+ NULL,
+ NULL,
+ gsub_glyphs );
}
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -219,34 +218,34 @@
af_style_names[style_class->style] ));
FT_TRACE4(( " " ));
- gpos_lookups = hb( set_create )();
- hb( ot_layout_collect_lookups )( face,
- HB_OT_TAG_GPOS,
- script_tags,
- NULL,
- coverage_tags,
- gpos_lookups );
+ gpos_lookups = hb_set_create();
+ hb_ot_layout_collect_lookups( face,
+ HB_OT_TAG_GPOS,
+ script_tags,
+ NULL,
+ coverage_tags,
+ gpos_lookups );
#ifdef FT_DEBUG_LEVEL_TRACE
count = 0;
#endif
- gpos_glyphs = hb( set_create )();
- for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gpos_lookups, &idx ); )
+ gpos_glyphs = hb_set_create();
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gpos_lookups, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE4(( " %u", idx ));
+ FT_TRACE4(( " %d", idx ));
count++;
#endif
/* get input coverage of GPOS feature */
- hb( ot_layout_lookup_collect_glyphs )( face,
- HB_OT_TAG_GPOS,
- idx,
- NULL,
- gpos_glyphs,
- NULL,
- NULL );
+ hb_ot_layout_lookup_collect_glyphs( face,
+ HB_OT_TAG_GPOS,
+ idx,
+ NULL,
+ gpos_glyphs,
+ NULL,
+ NULL );
}
#ifdef FT_DEBUG_LEVEL_TRACE
@@ -282,14 +281,14 @@
GET_UTF8_CHAR( ch, p );
- for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gsub_lookups,
- &idx ); )
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_lookups,
+ &idx ); )
{
hb_codepoint_t gidx = FT_Get_Char_Index( globals->face, ch );
- if ( hb( ot_layout_lookup_would_substitute )( face, idx,
- &gidx, 1, 1 ) )
+ if ( hb_ot_layout_lookup_would_substitute( face, idx,
+ &gidx, 1, 1 ) )
{
found = 1;
break;
@@ -353,14 +352,14 @@
*
*/
if ( style_class->coverage != AF_COVERAGE_DEFAULT )
- hb( set_subtract )( gsub_glyphs, gpos_glyphs );
+ hb_set_subtract( gsub_glyphs, gpos_glyphs );
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE4(( " glyphs without GPOS data (`*' means already assigned)" ));
count = 0;
#endif
- for ( idx = HB_SET_VALUE_INVALID; hb( set_next )( gsub_glyphs, &idx ); )
+ for ( idx = HB_SET_VALUE_INVALID; hb_set_next( gsub_glyphs, &idx ); )
{
#ifdef FT_DEBUG_LEVEL_TRACE
if ( !( count % 10 ) )
@@ -369,7 +368,7 @@
FT_TRACE4(( " " ));
}
- FT_TRACE4(( " %u", idx ));
+ FT_TRACE4(( " %d", idx ));
count++;
#endif
@@ -398,10 +397,10 @@
#endif
Exit:
- hb( set_destroy )( gsub_lookups );
- hb( set_destroy )( gsub_glyphs );
- hb( set_destroy )( gpos_lookups );
- hb( set_destroy )( gpos_glyphs );
+ hb_set_destroy( gsub_lookups );
+ hb_set_destroy( gsub_glyphs );
+ hb_set_destroy( gpos_lookups );
+ hb_set_destroy( gpos_glyphs );
return FT_Err_Ok;
}
@@ -438,33 +437,31 @@
};
- static void*
- af_shaper_buf_create_hb( AF_FaceGlobals globals )
+ void*
+ af_shaper_buf_create( FT_Face face )
{
- FT_UNUSED( globals );
+ FT_UNUSED( face );
- return (void*)hb( buffer_create )();
+ return (void*)hb_buffer_create();
}
- static void
- af_shaper_buf_destroy_hb( AF_FaceGlobals globals,
- void* buf )
+ void
+ af_shaper_buf_destroy( FT_Face face,
+ void* buf )
{
- FT_UNUSED( globals );
+ FT_UNUSED( face );
- hb( buffer_destroy )( (hb_buffer_t*)buf );
+ hb_buffer_destroy( (hb_buffer_t*)buf );
}
- static const char*
- af_shaper_get_cluster_hb( const char* p,
- AF_StyleMetrics metrics,
- void* buf_,
- unsigned int* count )
+ const char*
+ af_shaper_get_cluster( const char* p,
+ AF_StyleMetrics metrics,
+ void* buf_,
+ unsigned int* count )
{
- AF_FaceGlobals globals = metrics->globals;
-
AF_StyleClass style_class;
const hb_feature_t* feature;
FT_Int upem;
@@ -475,8 +472,6 @@
hb_font_t* font;
hb_codepoint_t dummy;
- FT_UNUSED( globals );
-
upem = (FT_Int)metrics->globals->face->units_per_EM;
style_class = metrics->style_class;
@@ -485,7 +480,7 @@
font = metrics->globals->hb_font;
/* we shape at a size of units per EM; this means font units */
- hb( font_set_scale )( font, upem, upem );
+ hb_font_set_scale( font, upem, upem );
while ( *p == ' ' )
p++;
@@ -497,15 +492,15 @@
len = (int)( q - p );
/* feed character(s) to the HarfBuzz buffer */
- hb( buffer_clear_contents )( buf );
- hb( buffer_add_utf8 )( buf, p, len, 0, len );
+ hb_buffer_clear_contents( buf );
+ hb_buffer_add_utf8( buf, p, len, 0, len );
/* we let HarfBuzz guess the script and writing direction */
- hb( buffer_guess_segment_properties )( buf );
+ hb_buffer_guess_segment_properties( buf );
/* shape buffer, which means conversion from character codes to */
/* glyph indices, possibly applying a feature */
- hb( shape )( font, buf, feature, feature ? 1 : 0 );
+ hb_shape( font, buf, feature, feature ? 1 : 0 );
if ( feature )
{
@@ -522,13 +517,13 @@
/* glyph indices; otherwise the affected glyph or glyphs aren't */
/* available at all in the feature */
- hb( buffer_clear_contents )( hb_buf );
- hb( buffer_add_utf8 )( hb_buf, p, len, 0, len );
- hb( buffer_guess_segment_properties )( hb_buf );
- hb( shape )( font, hb_buf, NULL, 0 );
+ hb_buffer_clear_contents( hb_buf );
+ hb_buffer_add_utf8( hb_buf, p, len, 0, len );
+ hb_buffer_guess_segment_properties( hb_buf );
+ hb_shape( font, hb_buf, NULL, 0 );
- ginfo = hb( buffer_get_glyph_infos )( buf, &gcount );
- hb_ginfo = hb( buffer_get_glyph_infos )( hb_buf, &hb_gcount );
+ ginfo = hb_buffer_get_glyph_infos( buf, &gcount );
+ hb_ginfo = hb_buffer_get_glyph_infos( hb_buf, &hb_gcount );
if ( gcount == hb_gcount )
{
@@ -542,12 +537,12 @@
if ( i == gcount )
{
/* both buffers have identical glyph indices */
- hb( buffer_clear_contents )( buf );
+ hb_buffer_clear_contents( buf );
}
}
}
- *count = hb( buffer_get_length )( buf );
+ *count = hb_buffer_get_length( buf );
#ifdef FT_DEBUG_LEVEL_TRACE
if ( feature && *count > 1 )
@@ -559,25 +554,23 @@
}
- static FT_ULong
- af_shaper_get_elem_hb( AF_StyleMetrics metrics,
- void* buf_,
- unsigned int idx,
- FT_Long* advance,
- FT_Long* y_offset )
+ FT_ULong
+ af_shaper_get_elem( AF_StyleMetrics metrics,
+ void* buf_,
+ unsigned int idx,
+ FT_Long* advance,
+ FT_Long* y_offset )
{
- AF_FaceGlobals globals = metrics->globals;
-
hb_buffer_t* buf = (hb_buffer_t*)buf_;
hb_glyph_info_t* ginfo;
hb_glyph_position_t* gpos;
unsigned int gcount;
- FT_UNUSED( globals );
+ FT_UNUSED( metrics );
- ginfo = hb( buffer_get_glyph_infos )( buf, &gcount );
- gpos = hb( buffer_get_glyph_positions )( buf, &gcount );
+ ginfo = hb_buffer_get_glyph_infos( buf, &gcount );
+ gpos = hb_buffer_get_glyph_positions( buf, &gcount );
if ( idx >= gcount )
return 0;
@@ -591,14 +584,14 @@
}
-#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */
+#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
- static FT_Error
- af_shaper_get_coverage_nohb( AF_FaceGlobals globals,
- AF_StyleClass style_class,
- FT_UShort* gstyles,
- FT_Bool default_script )
+ FT_Error
+ af_shaper_get_coverage( AF_FaceGlobals globals,
+ AF_StyleClass style_class,
+ FT_UShort* gstyles,
+ FT_Bool default_script )
{
FT_UNUSED( globals );
FT_UNUSED( style_class );
@@ -609,29 +602,29 @@
}
- static void*
- af_shaper_buf_create_nohb( AF_FaceGlobals globals )
+ void*
+ af_shaper_buf_create( FT_Face face )
{
- FT_UNUSED( globals );
+ FT_UNUSED( face );
return NULL;
}
- static void
- af_shaper_buf_destroy_nohb( AF_FaceGlobals globals,
- void* buf )
+ void
+ af_shaper_buf_destroy( FT_Face face,
+ void* buf )
{
- FT_UNUSED( globals );
+ FT_UNUSED( face );
FT_UNUSED( buf );
}
- static const char*
- af_shaper_get_cluster_nohb( const char* p,
- AF_StyleMetrics metrics,
- void* buf_,
- unsigned int* count )
+ const char*
+ af_shaper_get_cluster( const char* p,
+ AF_StyleMetrics metrics,
+ void* buf_,
+ unsigned int* count )
{
FT_Face face = metrics->globals->face;
FT_ULong ch, dummy = 0;
@@ -663,12 +656,12 @@
}
- static FT_ULong
- af_shaper_get_elem_nohb( AF_StyleMetrics metrics,
- void* buf_,
- unsigned int idx,
- FT_Long* advance,
- FT_Long* y_offset )
+ FT_ULong
+ af_shaper_get_elem( AF_StyleMetrics metrics,
+ void* buf_,
+ unsigned int idx,
+ FT_Long* advance,
+ FT_Long* y_offset )
{
FT_Face face = metrics->globals->face;
FT_ULong glyph_index = *(FT_ULong*)buf_;
@@ -691,90 +684,7 @@
}
- /********************************************************************/
-
- FT_Error
- af_shaper_get_coverage( AF_FaceGlobals globals,
- AF_StyleClass style_class,
- FT_UShort* gstyles,
- FT_Bool default_script )
- {
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled( globals ) )
- return af_shaper_get_coverage_hb( globals,
- style_class,
- gstyles,
- default_script );
- else
-#endif
- return af_shaper_get_coverage_nohb( globals,
- style_class,
- gstyles,
- default_script );
- }
-
-
- void*
- af_shaper_buf_create( AF_FaceGlobals globals )
- {
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled( globals ) )
- return af_shaper_buf_create_hb( globals );
- else
-#endif
- return af_shaper_buf_create_nohb( globals );
- }
-
-
- void
- af_shaper_buf_destroy( AF_FaceGlobals globals,
- void* buf )
- {
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled( globals ) )
- af_shaper_buf_destroy_hb( globals, buf );
- else
-#endif
- af_shaper_buf_destroy_nohb( globals, buf );
- }
-
-
- const char*
- af_shaper_get_cluster( const char* p,
- AF_StyleMetrics metrics,
- void* buf_,
- unsigned int* count )
- {
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled( metrics->globals ) )
- return af_shaper_get_cluster_hb( p, metrics, buf_, count );
- else
-#endif
- return af_shaper_get_cluster_nohb( p, metrics, buf_, count );
- }
-
-
- FT_ULong
- af_shaper_get_elem( AF_StyleMetrics metrics,
- void* buf_,
- unsigned int idx,
- FT_Long* advance,
- FT_Long* y_offset )
- {
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- if ( ft_hb_enabled( metrics->globals ) )
- return af_shaper_get_elem_hb( metrics,
- buf_,
- idx,
- advance,
- y_offset );
-#endif
- return af_shaper_get_elem_nohb( metrics,
- buf_,
- idx,
- advance,
- y_offset );
- }
+#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.h
index 757368fc9c..2eb03bb5d9 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afshaper.h
@@ -4,7 +4,7 @@
*
* HarfBuzz interface for accessing OpenType features (specification).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -23,14 +23,17 @@
#include <freetype/freetype.h>
-FT_BEGIN_HEADER
-
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- FT_LOCAL_ARRAY( hb_script_t )
- af_hb_scripts[];
+
+#include <hb.h>
+#include <hb-ot.h>
+#include "ft-hb.h"
+
#endif
+FT_BEGIN_HEADER
+
FT_Error
af_shaper_get_coverage( AF_FaceGlobals globals,
AF_StyleClass style_class,
@@ -39,11 +42,11 @@ FT_BEGIN_HEADER
void*
- af_shaper_buf_create( AF_FaceGlobals globals );
+ af_shaper_buf_create( FT_Face face );
void
- af_shaper_buf_destroy( AF_FaceGlobals globals,
- void* buf );
+ af_shaper_buf_destroy( FT_Face face,
+ void* buf );
const char*
af_shaper_get_cluster( const char* p,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afstyles.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afstyles.h
index 206232efe2..7a33f37a85 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afstyles.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afstyles.h
@@ -4,7 +4,7 @@
*
* Auto-fitter styles (specification only).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -50,36 +50,36 @@
AF_COVERAGE_ ## C )
#undef META_STYLE_LATIN
-#define META_STYLE_LATIN( s, S, ds ) \
- STYLE_LATIN( s, S, c2cp, C2CP, ds, \
+#define META_STYLE_LATIN( s, S, ds ) \
+ STYLE_LATIN( s, S, c2cp, C2CP, ds, \
"petite capitals from capitals", \
- PETITE_CAPITALS_FROM_CAPITALS ) \
- STYLE_LATIN( s, S, c2sc, C2SC, ds, \
+ PETITE_CAPITALS_FROM_CAPITALS ) \
+ STYLE_LATIN( s, S, c2sc, C2SC, ds, \
"small capitals from capitals", \
- SMALL_CAPITALS_FROM_CAPITALS ) \
- STYLE_LATIN( s, S, ordn, ORDN, ds, \
- "ordinals", \
- ORDINALS ) \
- STYLE_LATIN( s, S, pcap, PCAP, ds, \
- "petite capitals", \
- PETITE_CAPITALS ) \
- STYLE_LATIN( s, S, sinf, SINF, ds, \
- "scientific inferiors", \
- SCIENTIFIC_INFERIORS ) \
- STYLE_LATIN( s, S, smcp, SMCP, ds, \
- "small capitals", \
- SMALL_CAPITALS ) \
- STYLE_LATIN( s, S, subs, SUBS, ds, \
- "subscript", \
- SUBSCRIPT ) \
- STYLE_LATIN( s, S, sups, SUPS, ds, \
- "superscript", \
- SUPERSCRIPT ) \
- STYLE_LATIN( s, S, titl, TITL, ds, \
- "titling", \
- TITLING ) \
- STYLE_LATIN( s, S, dflt, DFLT, ds, \
- "default", \
+ SMALL_CAPITALS_FROM_CAPITALS ) \
+ STYLE_LATIN( s, S, ordn, ORDN, ds, \
+ "ordinals", \
+ ORDINALS ) \
+ STYLE_LATIN( s, S, pcap, PCAP, ds, \
+ "petite capitals", \
+ PETITE_CAPITALS ) \
+ STYLE_LATIN( s, S, sinf, SINF, ds, \
+ "scientific inferiors", \
+ SCIENTIFIC_INFERIORS ) \
+ STYLE_LATIN( s, S, smcp, SMCP, ds, \
+ "small capitals", \
+ SMALL_CAPITALS ) \
+ STYLE_LATIN( s, S, subs, SUBS, ds, \
+ "subscript", \
+ SUBSCRIPT ) \
+ STYLE_LATIN( s, S, sups, SUPS, ds, \
+ "superscript", \
+ SUPERSCRIPT ) \
+ STYLE_LATIN( s, S, titl, TITL, ds, \
+ "titling", \
+ TITLING ) \
+ STYLE_LATIN( s, S, dflt, DFLT, ds, \
+ "default", \
DEFAULT )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aftypes.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aftypes.h
index 959640a12e..27e4185e9f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aftypes.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
*
* Auto-fitter types (specification only).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -35,7 +35,6 @@
#include <freetype/freetype.h>
#include <freetype/ftoutln.h>
-#include <freetype/internal/fthash.h>
#include <freetype/internal/ftobjs.h>
#include <freetype/internal/ftdebug.h>
@@ -407,7 +406,6 @@ extern void* af_debug_hints_;
typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals;
-
/* This is the main structure that combines everything. Autofit modules */
/* specific to writing systems derive their structures from it, for */
/* example `AF_LatinMetrics'. */
@@ -420,8 +418,6 @@ extern void* af_debug_hints_;
AF_FaceGlobals globals; /* to access properties */
- FT_Hash reverse_charmap;
-
} AF_StyleMetricsRec;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-decl.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-decl.h
index 12fa7a27a2..b78745af74 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-decl.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-decl.h
@@ -4,7 +4,7 @@
*
* Auto-fitter writing system declarations (specification only).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-iter.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-iter.h
index 1752697b37..c86d609a35 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-iter.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/afws-iter.h
@@ -4,7 +4,7 @@
*
* Auto-fitter writing systems iterator (specification only).
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/ft-hb.c b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/ft-hb.c
deleted file mode 100644
index 3c145d0464..0000000000
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/ft-hb.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/****************************************************************************
- *
- * ft-hb.c
- *
- * FreeType-HarfBuzz bridge (body).
- *
- * Copyright (C) 2025 by
- * Behdad Esfahbod.
- *
- * This file is part of the FreeType project, and may only be used,
- * modified, and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- */
-
-
-#if !defined( _WIN32 ) && !defined( _GNU_SOURCE )
-# define _GNU_SOURCE 1 /* for RTLD_DEFAULT */
-#endif
-
-#include <freetype/freetype.h>
-#include <freetype/internal/ftmemory.h>
-
-#include "afglobal.h"
-
-#include "ft-hb.h"
-
-
-#if defined( FT_CONFIG_OPTION_USE_HARFBUZZ ) && \
- defined( FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC )
-
-#ifndef FT_LIBHARFBUZZ
-# ifdef _WIN32
-# define FT_LIBHARFBUZZ "libharfbuzz-0.dll"
-# else
-# ifdef __APPLE__
-# define FT_LIBHARFBUZZ "libharfbuzz.0.dylib"
-# else
-# define FT_LIBHARFBUZZ "libharfbuzz.so.0"
-# endif
-# endif
-#endif
-
-#ifdef _WIN32
-
-# include <windows.h>
-
-#else /* !_WIN32 */
-
-# include <dlfcn.h>
-
- /* The GCC pragma suppresses the warning "ISO C forbids */
- /* assignment between function pointer and 'void *'", which */
- /* inevitably gets emitted with `-Wpedantic`; see the man */
- /* page of function `dlsym` for more information. */
-# if defined( __GNUC__ )
-# pragma GCC diagnostic push
-# ifndef __cplusplus
-# pragma GCC diagnostic ignored "-Wpedantic"
-# endif
-# endif
-
-#endif /* !_WIN32 */
-
-
- FT_LOCAL_DEF( void )
- ft_hb_funcs_init( struct AF_ModuleRec_ *af_module )
- {
- FT_Memory memory = af_module->root.memory;
- FT_Error error;
-
- ft_hb_funcs_t *funcs = NULL;
- ft_hb_version_atleast_func_t version_atleast = NULL;
-
-#ifdef _WIN32
- HANDLE lib;
-# define DLSYM( lib, name ) \
- (ft_ ## name ## _func_t)GetProcAddress( lib, #name )
-#else
- void *lib;
-# define DLSYM( lib, name ) \
- (ft_ ## name ## _func_t)dlsym( lib, #name )
-#endif
-
-
- af_module->hb_funcs = NULL;
-
- if ( FT_NEW( funcs ) )
- return;
- FT_ZERO( funcs );
-
-#ifdef _WIN32
-
- lib = LoadLibraryA( FT_LIBHARFBUZZ );
- if ( !lib )
- goto Fail;
- version_atleast = DLSYM( lib, hb_version_atleast );
-
-#else /* !_WIN32 */
-
-# ifdef RTLD_DEFAULT
-# define FT_RTLD_FLAGS RTLD_LAZY | RTLD_GLOBAL
- lib = RTLD_DEFAULT;
- version_atleast = DLSYM( lib, hb_version_atleast );
-# else
-# define FT_RTLD_FLAGS RTLD_LAZY
-# endif
-
- if ( !version_atleast )
- {
- /* Load the HarfBuzz library.
- *
- * We never close the library, since we opened it with RTLD_GLOBAL.
- * This is important for the case where we are using HarfBuzz as a
- * shared library, and we want to use the symbols from the library in
- * other shared libraries or clients. HarfBuzz holds onto global
- * variables, and closing the library will cause them to be
- * invalidated.
- */
- lib = dlopen( FT_LIBHARFBUZZ, FT_RTLD_FLAGS );
- if ( !lib )
- goto Fail;
- version_atleast = DLSYM( lib, hb_version_atleast );
- }
-
-#endif /* !_WIN32 */
-
- if ( !version_atleast )
- goto Fail;
-
- /* Load all symbols we use. */
-#define HB_EXTERN( ret, name, args ) \
- { \
- funcs->name = DLSYM( lib, name ); \
- if ( !funcs->name ) \
- goto Fail; \
- }
-#include "ft-hb-decls.h"
-#undef HB_EXTERN
-
-#undef DLSYM
-
- af_module->hb_funcs = funcs;
- return;
-
- Fail:
- if ( funcs )
- FT_FREE( funcs );
- }
-
-
- FT_LOCAL_DEF( void )
- ft_hb_funcs_done( struct AF_ModuleRec_ *af_module )
- {
- FT_Memory memory = af_module->root.memory;
-
-
- if ( af_module->hb_funcs )
- {
- FT_FREE( af_module->hb_funcs );
- af_module->hb_funcs = NULL;
- }
- }
-
-
- FT_LOCAL_DEF( FT_Bool )
- ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals )
- {
- return globals->module->hb_funcs != NULL;
- }
-
-#ifndef _WIN32
-# if defined( __GNUC__ )
-# pragma GCC diagnostic pop
-# endif
-#endif
-
-#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
-
- FT_LOCAL_DEF( FT_Bool )
- ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals )
- {
- FT_UNUSED( globals );
-
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
- return TRUE;
-#else
- return FALSE;
-#endif
- }
-
-#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
-
-
-/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/ft-hb.h b/jdk/src/share/native/sun/awt/libfreetype/src/autofit/ft-hb.h
deleted file mode 100644
index 95914deb8d..0000000000
--- a/jdk/src/share/native/sun/awt/libfreetype/src/autofit/ft-hb.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
- *
- * ft-hb.h
- *
- * FreeType-HarfBuzz bridge (specification).
- *
- * Copyright (C) 2025 by
- * Behdad Esfahbod.
- *
- * This file is part of the FreeType project, and may only be used,
- * modified, and distributed under the terms of the FreeType project
- * license, LICENSE.TXT. By continuing to use, modify, or distribute
- * this file you indicate that you have read the license and
- * understand and accept it fully.
- *
- */
-
-
-#ifndef FT_HB_H
-#define FT_HB_H
-
-#include <freetype/internal/compiler-macros.h>
-#include <freetype/freetype.h>
-
-
-FT_BEGIN_HEADER
-
-#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
-
-# include "ft-hb-types.h"
-
-# ifdef FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC
-
-# define HB_EXTERN( ret, name, args ) \
- typedef ret (*ft_ ## name ## _func_t) args;
-# include "ft-hb-decls.h"
-# undef HB_EXTERN
-
- typedef struct ft_hb_funcs_t
- {
-# define HB_EXTERN( ret, name, args ) \
- ft_ ## name ## _func_t name;
-# include "ft-hb-decls.h"
-# undef HB_EXTERN
- } ft_hb_funcs_t;
-
- struct AF_ModuleRec_;
-
- FT_LOCAL( void )
- ft_hb_funcs_init( struct AF_ModuleRec_ *af_module );
-
- FT_LOCAL( void )
- ft_hb_funcs_done( struct AF_ModuleRec_ *af_module );
-
-# define hb( x ) globals->module->hb_funcs->hb_ ## x
-
-# else /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
-
-# define HB_EXTERN( ret, name, args ) \
- ret name args;
-# include "ft-hb-decls.h"
-# undef HB_EXTERN
-
-# define hb( x ) hb_ ## x
-
-# endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ_DYNAMIC */
-
-#endif /* FT_CONFIG_OPTION_USE_HARFBUZZ */
-
-
- struct AF_FaceGlobalsRec_;
-
- FT_LOCAL( FT_Bool )
- ft_hb_enabled( struct AF_FaceGlobalsRec_ *globals );
-
-
-FT_END_HEADER
-
-#endif /* FT_HB_H */
-
-
-/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftadvanc.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftadvanc.c
index 7b965c62d5..717f7d08b3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftadvanc.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftadvanc.c
@@ -4,7 +4,7 @@
*
* Quick computation of advance widths (body).
*
- * Copyright (C) 2008-2025 by
+ * Copyright (C) 2008-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -20,7 +20,6 @@
#include <freetype/ftadvanc.h>
#include <freetype/internal/ftobjs.h>
-#include <freetype/internal/ftcalc.h>
static FT_Error
@@ -48,43 +47,11 @@
/* (see `FT_Load_Glyph' implementation in src/base/ftobjs.c) */
for ( nn = 0; nn < count; nn++ )
- advances[nn] = FT_MulFix( 1024 * advances[nn], scale );
+ advances[nn] = FT_MulDiv( advances[nn], scale, 64 );
return FT_Err_Ok;
}
- /* loading (and hinting) to calculate the advances is slow */
- /* unless TrueType hdmx table is provided as an accelerator */
- static FT_Error
- ft_load_advances( FT_Face face,
- FT_UInt gindex,
- FT_UInt count,
- FT_Int32 flags,
- FT_Fixed *padvances )
- {
- FT_UInt nn;
- FT_Error error = FT_Err_Ok;
- FT_Pos factor = flags & FT_LOAD_NO_SCALE ? 1 : 1024;
- FT_Pos* advance = flags & FT_LOAD_VERTICAL_LAYOUT
- ? &face->glyph->advance.y
- : &face->glyph->advance.x;
-
-
- flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
-
- for ( nn = 0; nn < count; nn++ )
- {
- error = FT_Load_Glyph( face, gindex + nn, flags );
- if ( error )
- break;
-
- /* scale from 26.6 to 16.16, unless NO_SCALE was requested */
- padvances[nn] = *advance * factor;
- }
-
- return error;
- }
-
/* at the moment, we can perform fast advance retrieval only in */
/* the following cases: */
@@ -135,10 +102,7 @@
return error;
}
- if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
- return FT_THROW( Unimplemented_Feature );
-
- return ft_load_advances( face, gindex, 1, flags, padvance );
+ return FT_Get_Advances( face, gindex, 1, flags, padvance );
}
@@ -151,9 +115,12 @@
FT_Int32 flags,
FT_Fixed *padvances )
{
+ FT_Error error = FT_Err_Ok;
+
FT_Face_GetAdvancesFunc func;
- FT_UInt num, end;
+ FT_UInt num, end, nn;
+ FT_Int factor;
if ( !face )
@@ -173,9 +140,6 @@
func = face->driver->clazz->get_advances;
if ( func && LOAD_ADVANCE_FAST_CHECK( face, flags ) )
{
- FT_Error error;
-
-
error = func( face, start, count, flags, padvances );
if ( !error )
return ft_face_scale_advances_( face, padvances, count, flags );
@@ -184,10 +148,26 @@
return error;
}
+ error = FT_Err_Ok;
+
if ( flags & FT_ADVANCE_FLAG_FAST_ONLY )
return FT_THROW( Unimplemented_Feature );
- return ft_load_advances( face, start, count, flags, padvances );
+ flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
+ factor = ( flags & FT_LOAD_NO_SCALE ) ? 1 : 1024;
+ for ( nn = 0; nn < count; nn++ )
+ {
+ error = FT_Load_Glyph( face, start + nn, flags );
+ if ( error )
+ break;
+
+ /* scale from 26.6 to 16.16, unless NO_SCALE was requested */
+ padvances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
+ ? face->glyph->advance.y * factor
+ : face->glyph->advance.x * factor;
+ }
+
+ return error;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbase.h b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbase.h
index 66f091165f..1d98b26dd5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbase.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbase.h
@@ -4,7 +4,7 @@
*
* Private functions used in the `base' module (specification).
*
- * Copyright (C) 2008-2025 by
+ * Copyright (C) 2008-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
*
* This file is part of the FreeType project, and may only be used,
@@ -34,7 +34,7 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_MAC_FONTS
/* MacOS resource fork cannot exceed 16MB at least for Carbon code; */
- /* see https://jeffpar.github.io/kbarchive/kb/130/Q130437/ */
+ /* see https://support.microsoft.com/en-us/kb/130437 */
#define FT_MAC_RFORK_MAX_LEN 0x00FFFFFFUL
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbbox.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbbox.c
index feccdee5dd..d6aa5d56df 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbbox.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
*
* FreeType bbox computation (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbitmap.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbitmap.c
index 364f881e43..4be145679f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbitmap.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftbitmap.c
@@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (body).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -876,13 +876,13 @@
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE5(( "FT_Bitmap_Blend:\n" ));
- FT_TRACE5(( " source bitmap: (%ld, %ld) -- (%ld, %ld); %u x %u\n",
+ FT_TRACE5(( " source bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
source_llx / 64, source_lly / 64,
source_urx / 64, source_ury / 64,
source_->width, source_->rows ));
if ( target->width && target->rows )
- FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %u x %u\n",
+ FT_TRACE5(( " target bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
target_llx / 64, target_lly / 64,
target_urx / 64, target_ury / 64,
target->width, target->rows ));
@@ -890,7 +890,7 @@
FT_TRACE5(( " target bitmap: empty\n" ));
if ( final_width && final_rows )
- FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %u x %u\n",
+ FT_TRACE5(( " final bitmap: (%ld, %ld) -- (%ld, %ld); %d x %d\n",
final_llx / 64, final_lly / 64,
final_urx / 64, final_ury / 64,
final_width, final_rows ));
@@ -922,7 +922,14 @@
target->pitch = (int)final_width * 4;
target->num_grays = 256;
- if ( FT_ALLOC_MULT( target->buffer, target->rows, target->pitch ) )
+ if ( FT_LONG_MAX / target->pitch < (int)target->rows )
+ {
+ FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
+ final_width, final_rows ));
+ return FT_THROW( Invalid_Argument );
+ }
+
+ if ( FT_ALLOC( target->buffer, target->pitch * (int)target->rows ) )
return error;
free_target_bitmap_on_error = 1;
@@ -943,9 +950,16 @@
new_pitch = (int)final_width * 4;
+ if ( FT_LONG_MAX / new_pitch < (int)final_rows )
+ {
+ FT_TRACE5(( "FT_Blend_Bitmap: target bitmap too large (%d x %d)\n",
+ final_width, final_rows ));
+ return FT_THROW( Invalid_Argument );
+ }
+
/* TODO: provide an in-buffer solution for large bitmaps */
/* to avoid allocation of a new buffer */
- if ( FT_ALLOC_MULT( buffer, final_rows, new_pitch ) )
+ if ( FT_ALLOC( buffer, new_pitch * (int)final_rows ) )
goto Error;
/* copy data to new buffer */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcalc.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcalc.c
index 7d6e12e254..92de09ed87 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcalc.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcalc.c
@@ -4,7 +4,7 @@
*
* Arithmetic computations (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -38,11 +38,24 @@
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftobjs.h>
- /* cancel inlining macro from internal/ftcalc.h */
-#ifdef FT_MulFix
-# undef FT_MulFix
+
+#ifdef FT_MULFIX_ASSEMBLER
+#undef FT_MulFix
#endif
+/* we need to emulate a 64-bit data type if a real one isn't available */
+
+#ifndef FT_INT64
+
+ typedef struct FT_Int64_
+ {
+ FT_UInt32 lo;
+ FT_UInt32 hi;
+
+ } FT_Int64;
+
+#endif /* !FT_INT64 */
+
/**************************************************************************
*
@@ -75,7 +88,7 @@
FT_EXPORT_DEF( FT_Fixed )
FT_RoundFix( FT_Fixed a )
{
- return ADD_LONG( a, 0x8000L - ( a < 0 ) ) & ~0xFFFFL;
+ return ( ADD_LONG( a, 0x8000L - ( a < 0 ) ) ) & ~0xFFFFL;
}
@@ -84,7 +97,7 @@
FT_EXPORT_DEF( FT_Fixed )
FT_CeilFix( FT_Fixed a )
{
- return ADD_LONG( a, 0xFFFFL ) & ~0xFFFFL;
+ return ( ADD_LONG( a, 0xFFFFL ) ) & ~0xFFFFL;
}
@@ -212,18 +225,18 @@
FT_MulFix( FT_Long a_,
FT_Long b_ )
{
-#ifdef FT_CONFIG_OPTION_INLINE_MULFIX
+#ifdef FT_MULFIX_ASSEMBLER
- return FT_MulFix_64( a_, b_ );
+ return FT_MULFIX_ASSEMBLER( (FT_Int32)a_, (FT_Int32)b_ );
#else
- FT_Int64 ab = MUL_INT64( a_, b_ );
+ FT_Int64 ab = (FT_Int64)a_ * (FT_Int64)b_;
/* this requires arithmetic right shift of signed numbers */
- return (FT_Long)( ( ab + 0x8000L + ( ab >> 63 ) ) >> 16 );
+ return (FT_Long)( ( ab + 0x8000L - ( ab < 0 ) ) >> 16 );
-#endif /* FT_CONFIG_OPTION_INLINE_MULFIX */
+#endif /* FT_MULFIX_ASSEMBLER */
}
@@ -962,36 +975,43 @@
#else
- FT_Int64 z1, z2;
- FT_Int result;
+ FT_Int result;
- if ( (FT_ULong)FT_ABS( in_x ) + (FT_ULong)FT_ABS( out_y ) <= 92681UL )
+ if ( ADD_LONG( FT_ABS( in_x ), FT_ABS( out_y ) ) <= 131071L &&
+ ADD_LONG( FT_ABS( in_y ), FT_ABS( out_x ) ) <= 131071L )
{
- z1.lo = (FT_UInt32)in_x * (FT_UInt32)out_y;
- z1.hi = (FT_UInt32)( (FT_Int32)z1.lo >> 31 ); /* sign-expansion */
- }
- else
- ft_multo64( (FT_UInt32)in_x, (FT_UInt32)out_y, &z1 );
+ FT_Long z1 = MUL_LONG( in_x, out_y );
+ FT_Long z2 = MUL_LONG( in_y, out_x );
- if ( (FT_ULong)FT_ABS( in_y ) + (FT_ULong)FT_ABS( out_x ) <= 92681UL )
- {
- z2.lo = (FT_UInt32)in_y * (FT_UInt32)out_x;
- z2.hi = (FT_UInt32)( (FT_Int32)z2.lo >> 31 ); /* sign-expansion */
+
+ if ( z1 > z2 )
+ result = +1;
+ else if ( z1 < z2 )
+ result = -1;
+ else
+ result = 0;
}
- else
+ else /* products might overflow 32 bits */
+ {
+ FT_Int64 z1, z2;
+
+
+ /* XXX: this function does not allow 64-bit arguments */
+ ft_multo64( (FT_UInt32)in_x, (FT_UInt32)out_y, &z1 );
ft_multo64( (FT_UInt32)in_y, (FT_UInt32)out_x, &z2 );
- if ( (FT_Int32)z1.hi > (FT_Int32)z2.hi )
- result = +1;
- else if ( (FT_Int32)z1.hi < (FT_Int32)z2.hi )
- result = -1;
- else if ( z1.lo > z2.lo )
- result = +1;
- else if ( z1.lo < z2.lo )
- result = -1;
- else
- result = 0;
+ if ( z1.hi > z2.hi )
+ result = +1;
+ else if ( z1.hi < z2.hi )
+ result = -1;
+ else if ( z1.lo > z2.lo )
+ result = +1;
+ else if ( z1.lo < z2.lo )
+ result = -1;
+ else
+ result = 0;
+ }
/* XXX: only the sign of return value, +1/0/-1 must be used */
return result;
@@ -1045,4 +1065,62 @@
}
+ FT_BASE_DEF( FT_Int32 )
+ FT_MulAddFix( FT_Fixed* s,
+ FT_Int32* f,
+ FT_UInt count )
+ {
+ FT_UInt i;
+ FT_Int64 temp;
+
+
+#ifdef FT_INT64
+ temp = 0;
+
+ for ( i = 0; i < count; ++i )
+ temp += (FT_Int64)s[i] * f[i];
+
+ return (FT_Int32)( ( temp + 0x8000 ) >> 16 );
+#else
+ temp.hi = 0;
+ temp.lo = 0;
+
+ for ( i = 0; i < count; ++i )
+ {
+ FT_Int64 multResult;
+
+ FT_Int sign = 1;
+ FT_UInt32 carry = 0;
+
+ FT_UInt32 scalar;
+ FT_UInt32 factor;
+
+
+ FT_MOVE_SIGN( FT_UInt32, s[i], scalar, sign );
+ FT_MOVE_SIGN( FT_UInt32, f[i], factor, sign );
+
+ ft_multo64( scalar, factor, &multResult );
+
+ if ( sign < 0 )
+ {
+ /* Emulated `FT_Int64` negation. */
+ carry = ( multResult.lo == 0 );
+
+ multResult.lo = ~multResult.lo + 1;
+ multResult.hi = ~multResult.hi + carry;
+ }
+
+ FT_Add64( &temp, &multResult, &temp );
+ }
+
+ /* Shift and round value. */
+ return (FT_Int32)( ( ( temp.hi << 16 ) | ( temp.lo >> 16 ) )
+ + ( 1 & ( temp.lo >> 15 ) ) );
+
+
+#endif /* !FT_INT64 */
+
+ }
+
+
/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcid.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcid.c
index 35cd0fcd2b..4f2deb19a0 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcid.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcid.c
@@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information.
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcolor.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcolor.c
index 90b02b7d2d..c6bf2a3cd1 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcolor.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftcolor.c
@@ -4,7 +4,7 @@
*
* FreeType's glyph color management (body).
*
- * Copyright (C) 2018-2025 by
+ * Copyright (C) 2018-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -56,7 +56,9 @@
FT_Color* *apalette )
{
FT_Error error;
- TT_Face ttface = (TT_Face)face;
+
+ TT_Face ttface;
+ SFNT_Service sfnt;
if ( !face )
@@ -70,17 +72,14 @@
return FT_Err_Ok;
}
- if ( palette_index != ttface->palette_index )
- {
- SFNT_Service sfnt = (SFNT_Service)ttface->sfnt;
-
+ ttface = (TT_Face)face;
+ sfnt = (SFNT_Service)ttface->sfnt;
- error = sfnt->set_palette( ttface, palette_index );
- if ( error )
- return error;
+ error = sfnt->set_palette( ttface, palette_index );
+ if ( error )
+ return error;
- ttface->palette_index = palette_index;
- }
+ ttface->palette_index = palette_index;
if ( apalette )
*apalette = ttface->palette;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdbgmem.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdbgmem.c
index 7f54e759b1..902a5dc8bb 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdbgmem.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
*
* Memory debugger (body).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -139,6 +139,7 @@
} FT_MemTableRec;
+#define FT_MEM_SIZE_MIN 7
#define FT_MEM_SIZE_MAX 13845163
#define FT_FILENAME( x ) ( (x) ? (x) : "unknown file" )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdebug.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdebug.c
index c615f29e52..11307eaace 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdebug.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftdebug.c
@@ -4,7 +4,7 @@
*
* Debugging and logging component (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -64,7 +64,7 @@
* with the actual log message if set to true.
*
* 5. The flag `ft_timestamp_flag` prints time along with the actual log
- * message if set to true.
+ * message if set to ture.
*
* 6. `ft_have_newline_char` is used to differentiate between a log
* message with and without a trailing newline character.
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfntfmt.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfntfmt.c
index 7f4f14ffdb..77b4089e7e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfntfmt.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfntfmt.c
@@ -4,7 +4,7 @@
*
* FreeType utility file for font formats (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfstype.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfstype.c
index 3a95752ffa..1565c3b7e2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfstype.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftfstype.c
@@ -4,7 +4,7 @@
*
* FreeType utility file to access FSType data (body).
*
- * Copyright (C) 2008-2025 by
+ * Copyright (C) 2008-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgasp.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgasp.c
index 2202240b57..c63d30e978 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgasp.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgasp.c
@@ -4,7 +4,7 @@
*
* Access of TrueType's `gasp' table (body).
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgloadr.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgloadr.c
index 47781bc4d5..484d98f172 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgloadr.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftgloadr.c
@@ -4,7 +4,7 @@
*
* The FreeType glyph loader (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftglyph.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftglyph.c
index 6138cfeec2..1b5849f99a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftglyph.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftglyph.c
@@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -62,7 +62,7 @@
FT_GlyphSlot slot )
{
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
- FT_Error error;
+ FT_Error error = FT_Err_Ok;
FT_Library library = FT_GLYPH( glyph )->library;
@@ -75,8 +75,17 @@
glyph->left = slot->bitmap_left;
glyph->top = slot->bitmap_top;
- FT_Bitmap_Init( &glyph->bitmap );
- error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
+ /* do lazy copying whenever possible */
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
+ {
+ glyph->bitmap = slot->bitmap;
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+ }
+ else
+ {
+ FT_Bitmap_Init( &glyph->bitmap );
+ error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
+ }
Exit:
return error;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/fthash.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/fthash.c
index ab248ace8b..313bbbb4b2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/fthash.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/fthash.c
@@ -41,7 +41,6 @@
#include <freetype/internal/fthash.h>
#include <freetype/internal/ftmemory.h>
-#include <freetype/internal/ftobjs.h>
#define INITIAL_HT_SIZE 241
@@ -234,8 +233,7 @@
hash_insert( FT_Hashkey key,
size_t data,
FT_Hash hash,
- FT_Memory memory,
- FT_Bool overwrite )
+ FT_Memory memory )
{
FT_Hashnode nn;
FT_Hashnode* bp = hash_bucket( key, hash );
@@ -261,7 +259,7 @@
hash->used++;
}
- else if ( overwrite )
+ else
nn->data = data;
Exit:
@@ -280,7 +278,7 @@
hk.str = key;
- return hash_insert( hk, data, hash, memory, TRUE );
+ return hash_insert( hk, data, hash, memory );
}
@@ -295,37 +293,7 @@
hk.num = num;
- return hash_insert( hk, data, hash, memory, TRUE );
- }
-
-
- FT_Error
- ft_hash_str_insert_no_overwrite( const char* key,
- size_t data,
- FT_Hash hash,
- FT_Memory memory )
- {
- FT_Hashkey hk;
-
-
- hk.str = key;
-
- return hash_insert( hk, data, hash, memory, FALSE );
- }
-
-
- FT_Error
- ft_hash_num_insert_no_overwrite( FT_Int num,
- size_t data,
- FT_Hash hash,
- FT_Memory memory )
- {
- FT_Hashkey hk;
-
-
- hk.num = num;
-
- return hash_insert( hk, data, hash, memory, FALSE );
+ return hash_insert( hk, data, hash, memory );
}
@@ -367,68 +335,4 @@
}
- FT_Bool
- ft_hash_num_iterator( FT_UInt *idx,
- FT_Int *key,
- size_t *value,
- FT_Hash hash )
- {
- FT_Hashnode nn = NULL;
-
-
- while ( 1 )
- {
- if ( *idx >= hash->size )
- return 0;
-
- nn = hash->table[*idx];
- if ( nn )
- break;
-
- (*idx)++;
- }
-
- if ( key )
- *key = nn->key.num;
- if ( value )
- *value = nn->data;
-
- (*idx)++;
-
- return 1;
- }
-
-
- FT_Bool
- ft_hash_str_iterator( FT_UInt *idx,
- const char* *key,
- size_t *value,
- FT_Hash hash )
- {
- FT_Hashnode nn = NULL;
-
-
- while ( 1 )
- {
- if ( *idx >= hash->size )
- return 0;
-
- nn = hash->table[*idx];
- if ( nn )
- break;
-
- (*idx)++;
- }
-
- if ( key )
- *key = nn->key.str;
- if ( value )
- *value = nn->data;
-
- (*idx)++;
-
- return 1;
- }
-
-
/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftinit.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftinit.c
index 37d7f87bcb..9a6c00e13e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftinit.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftinit.c
@@ -4,7 +4,7 @@
*
* FreeType initialization layer (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftlcdfil.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftlcdfil.c
index 51c6fd48a1..1e69d4da70 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftlcdfil.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
*
* FreeType API for color filtering of subpixel bitmap glyphs (body).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -25,28 +25,265 @@
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- /* add padding sufficient for a 5-tap filter, */
- /* which is 2/3 of a pixel */
+/* define USE_LEGACY to implement the legacy filter */
+#define USE_LEGACY
+
+#define FT_SHIFTCLAMP( x ) ( x >>= 8, (FT_Byte)( x > 255 ? 255 : x ) )
+
+
+ /* add padding according to filter weights */
FT_BASE_DEF( void )
ft_lcd_padding( FT_BBox* cbox,
FT_GlyphSlot slot,
FT_Render_Mode mode )
{
- FT_UNUSED( slot );
+ FT_Byte* lcd_weights;
+ FT_Bitmap_LcdFilterFunc lcd_filter_func;
- if ( mode == FT_RENDER_MODE_LCD )
+
+ /* Per-face LCD filtering takes priority if set up. */
+ if ( slot->face && slot->face->internal->lcd_filter_func )
{
- cbox->xMin -= 43;
- cbox->xMax += 43;
+ lcd_weights = slot->face->internal->lcd_weights;
+ lcd_filter_func = slot->face->internal->lcd_filter_func;
}
- else if ( mode == FT_RENDER_MODE_LCD_V )
+ else
+ {
+ lcd_weights = slot->library->lcd_weights;
+ lcd_filter_func = slot->library->lcd_filter_func;
+ }
+
+ if ( lcd_filter_func == ft_lcd_filter_fir )
+ {
+ if ( mode == FT_RENDER_MODE_LCD )
+ {
+ cbox->xMin -= lcd_weights[0] ? 43 :
+ lcd_weights[1] ? 22 : 0;
+ cbox->xMax += lcd_weights[4] ? 43 :
+ lcd_weights[3] ? 22 : 0;
+ }
+ else if ( mode == FT_RENDER_MODE_LCD_V )
+ {
+ cbox->yMin -= lcd_weights[0] ? 43 :
+ lcd_weights[1] ? 22 : 0;
+ cbox->yMax += lcd_weights[4] ? 43 :
+ lcd_weights[3] ? 22 : 0;
+ }
+ }
+ }
+
+
+ /* FIR filter used by the default and light filters */
+ FT_BASE_DEF( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_LcdFiveTapFilter weights )
+ {
+ FT_UInt width = (FT_UInt)bitmap->width;
+ FT_UInt height = (FT_UInt)bitmap->rows;
+ FT_Int pitch = bitmap->pitch;
+ FT_Byte* origin = bitmap->buffer;
+ FT_Byte mode = bitmap->pixel_mode;
+
+
+ /* take care of bitmap flow */
+ if ( pitch > 0 && height > 0 )
+ origin += pitch * (FT_Int)( height - 1 );
+
+ /* horizontal in-place FIR filter */
+ if ( mode == FT_PIXEL_MODE_LCD && width >= 2 )
+ {
+ FT_Byte* line = origin;
+
+
+ /* `fir' must be at least 32 bit wide, since the sum of */
+ /* the values in `weights' can exceed 0xFF */
+
+ for ( ; height > 0; height--, line -= pitch )
+ {
+ FT_UInt fir[5];
+ FT_UInt val, xx;
+
+
+ val = line[0];
+ fir[2] = weights[2] * val;
+ fir[3] = weights[3] * val;
+ fir[4] = weights[4] * val;
+
+ val = line[1];
+ fir[1] = fir[2] + weights[1] * val;
+ fir[2] = fir[3] + weights[2] * val;
+ fir[3] = fir[4] + weights[3] * val;
+ fir[4] = weights[4] * val;
+
+ for ( xx = 2; xx < width; xx++ )
+ {
+ val = line[xx];
+ fir[0] = fir[1] + weights[0] * val;
+ fir[1] = fir[2] + weights[1] * val;
+ fir[2] = fir[3] + weights[2] * val;
+ fir[3] = fir[4] + weights[3] * val;
+ fir[4] = weights[4] * val;
+
+ line[xx - 2] = FT_SHIFTCLAMP( fir[0] );
+ }
+
+ line[xx - 2] = FT_SHIFTCLAMP( fir[1] );
+ line[xx - 1] = FT_SHIFTCLAMP( fir[2] );
+ }
+ }
+
+ /* vertical in-place FIR filter */
+ else if ( mode == FT_PIXEL_MODE_LCD_V && height >= 2 )
{
- cbox->yMin -= 43;
- cbox->yMax += 43;
+ FT_Byte* column = origin;
+
+
+ for ( ; width > 0; width--, column++ )
+ {
+ FT_Byte* col = column;
+ FT_UInt fir[5];
+ FT_UInt val, yy;
+
+
+ val = col[0];
+ fir[2] = weights[2] * val;
+ fir[3] = weights[3] * val;
+ fir[4] = weights[4] * val;
+ col -= pitch;
+
+ val = col[0];
+ fir[1] = fir[2] + weights[1] * val;
+ fir[2] = fir[3] + weights[2] * val;
+ fir[3] = fir[4] + weights[3] * val;
+ fir[4] = weights[4] * val;
+ col -= pitch;
+
+ for ( yy = 2; yy < height; yy++, col -= pitch )
+ {
+ val = col[0];
+ fir[0] = fir[1] + weights[0] * val;
+ fir[1] = fir[2] + weights[1] * val;
+ fir[2] = fir[3] + weights[2] * val;
+ fir[3] = fir[4] + weights[3] * val;
+ fir[4] = weights[4] * val;
+
+ col[pitch * 2] = FT_SHIFTCLAMP( fir[0] );
+ }
+
+ col[pitch * 2] = FT_SHIFTCLAMP( fir[1] );
+ col[pitch] = FT_SHIFTCLAMP( fir[2] );
+ }
}
}
+#ifdef USE_LEGACY
+
+ /* intra-pixel filter used by the legacy filter */
+ static void
+ _ft_lcd_filter_legacy( FT_Bitmap* bitmap,
+ FT_Byte* weights )
+ {
+ FT_UInt width = (FT_UInt)bitmap->width;
+ FT_UInt height = (FT_UInt)bitmap->rows;
+ FT_Int pitch = bitmap->pitch;
+ FT_Byte* origin = bitmap->buffer;
+ FT_Byte mode = bitmap->pixel_mode;
+
+ static const unsigned int filters[3][3] =
+ {
+ { 65538 * 9/13, 65538 * 1/6, 65538 * 1/13 },
+ { 65538 * 3/13, 65538 * 4/6, 65538 * 3/13 },
+ { 65538 * 1/13, 65538 * 1/6, 65538 * 9/13 }
+ };
+
+ FT_UNUSED( weights );
+
+
+ /* take care of bitmap flow */
+ if ( pitch > 0 && height > 0 )
+ origin += pitch * (FT_Int)( height - 1 );
+
+ /* horizontal in-place intra-pixel filter */
+ if ( mode == FT_PIXEL_MODE_LCD && width >= 3 )
+ {
+ FT_Byte* line = origin;
+
+
+ for ( ; height > 0; height--, line -= pitch )
+ {
+ FT_UInt xx;
+
+
+ for ( xx = 0; xx < width; xx += 3 )
+ {
+ FT_UInt r, g, b;
+ FT_UInt p;
+
+
+ p = line[xx];
+ r = filters[0][0] * p;
+ g = filters[0][1] * p;
+ b = filters[0][2] * p;
+
+ p = line[xx + 1];
+ r += filters[1][0] * p;
+ g += filters[1][1] * p;
+ b += filters[1][2] * p;
+
+ p = line[xx + 2];
+ r += filters[2][0] * p;
+ g += filters[2][1] * p;
+ b += filters[2][2] * p;
+
+ line[xx] = (FT_Byte)( r / 65536 );
+ line[xx + 1] = (FT_Byte)( g / 65536 );
+ line[xx + 2] = (FT_Byte)( b / 65536 );
+ }
+ }
+ }
+ else if ( mode == FT_PIXEL_MODE_LCD_V && height >= 3 )
+ {
+ FT_Byte* column = origin;
+
+
+ for ( ; width > 0; width--, column++ )
+ {
+ FT_Byte* col = column - 2 * pitch;
+
+
+ for ( ; height > 0; height -= 3, col -= 3 * pitch )
+ {
+ FT_UInt r, g, b;
+ FT_UInt p;
+
+
+ p = col[0];
+ r = filters[0][0] * p;
+ g = filters[0][1] * p;
+ b = filters[0][2] * p;
+
+ p = col[pitch];
+ r += filters[1][0] * p;
+ g += filters[1][1] * p;
+ b += filters[1][2] * p;
+
+ p = col[pitch * 2];
+ r += filters[2][0] * p;
+ g += filters[2][1] * p;
+ b += filters[2][2] * p;
+
+ col[0] = (FT_Byte)( r / 65536 );
+ col[pitch] = (FT_Byte)( g / 65536 );
+ col[pitch * 2] = (FT_Byte)( b / 65536 );
+ }
+ }
+ }
+ }
+
+#endif /* USE_LEGACY */
+
+
/* documentation in ftlcdfil.h */
FT_EXPORT_DEF( FT_Error )
@@ -60,6 +297,7 @@
return FT_THROW( Invalid_Argument );
ft_memcpy( library->lcd_weights, weights, FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
return FT_Err_Ok;
}
@@ -83,23 +321,32 @@
switch ( filter )
{
case FT_LCD_FILTER_NONE:
- ft_memset( library->lcd_weights,
- 0,
- FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = NULL;
break;
case FT_LCD_FILTER_DEFAULT:
ft_memcpy( library->lcd_weights,
default_weights,
FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
break;
case FT_LCD_FILTER_LIGHT:
ft_memcpy( library->lcd_weights,
light_weights,
FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
break;
+#ifdef USE_LEGACY
+
+ case FT_LCD_FILTER_LEGACY:
+ case FT_LCD_FILTER_LEGACY1:
+ library->lcd_filter_func = _ft_lcd_filter_legacy;
+ break;
+
+#endif
+
default:
return FT_THROW( Invalid_Argument );
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmac.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmac.c
index 37d97be183..e8e35627b5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmac.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmac.c
@@ -8,7 +8,7 @@
* This file is for Mac OS X only; see builds/mac/ftoldmac.c for
* classic platforms built by MPW.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmm.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmm.c
index 9e67001406..cc4ca22fba 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmm.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftmm.c
@@ -4,7 +4,7 @@
*
* Multiple Master font support (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -292,9 +292,6 @@
if ( num_coords && !coords )
return FT_THROW( Invalid_Argument );
- if ( !num_coords && !FT_IS_VARIATION( face ) )
- return FT_Err_Ok; /* nothing to be done */
-
error = ft_face_get_mm_service( face, &service_mm );
if ( !error )
{
@@ -302,21 +299,15 @@
if ( service_mm->set_var_design )
error = service_mm->set_var_design( face, num_coords, coords );
- if ( !error || error == -1 || error == -2 )
+ if ( !error || error == -1 )
{
FT_Bool is_variation_old = FT_IS_VARIATION( face );
- if ( error != -1 )
- {
- if ( error == -2 ) /* -2 means is_variable. */
- {
- face->face_flags |= FT_FACE_FLAG_VARIATION;
- error = FT_Err_Ok;
- }
- else
- face->face_flags &= ~FT_FACE_FLAG_VARIATION;
- }
+ if ( num_coords )
+ face->face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->face_flags &= ~FT_FACE_FLAG_VARIATION;
if ( service_mm->construct_ps_name )
{
@@ -483,21 +474,15 @@
if ( service_mm->set_mm_blend )
error = service_mm->set_mm_blend( face, num_coords, coords );
- if ( !error || error == -1 || error == -2 )
+ if ( !error || error == -1 )
{
FT_Bool is_variation_old = FT_IS_VARIATION( face );
- if ( error != -1 )
- {
- if ( error == -2 ) /* -2 means is_variable. */
- {
- face->face_flags |= FT_FACE_FLAG_VARIATION;
- error = FT_Err_Ok;
- }
- else
- face->face_flags &= ~FT_FACE_FLAG_VARIATION;
- }
+ if ( num_coords )
+ face->face_flags |= FT_FACE_FLAG_VARIATION;
+ else
+ face->face_flags &= ~FT_FACE_FLAG_VARIATION;
if ( service_mm->construct_ps_name )
{
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftobjs.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftobjs.c
index 323dd5efac..9b97820c37 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftobjs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftobjs.c
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -524,28 +524,12 @@
bitmap->rows = (unsigned int)height;
bitmap->pitch = pitch;
- /* Flag the bounding box size unsuitable for rendering. */
- /* FT_Renderer modules should check the return value. */
- /* The limit is based on the ppem value when available. */
+ if ( pbox.xMin < -0x8000 || pbox.xMax > 0x7FFF ||
+ pbox.yMin < -0x8000 || pbox.yMax > 0x7FFF )
{
- FT_Face face = slot->face;
- FT_Pos xlim = 0x8000;
- FT_Pos ylim = 0x8000;
-
-
- if ( face )
- {
- xlim = FT_MIN( xlim, 10 * face->size->metrics.x_ppem );
- ylim = FT_MIN( ylim, 10 * face->size->metrics.y_ppem );
- }
-
- if ( pbox.xMin < -xlim || pbox.xMax >= xlim ||
- pbox.yMin < -ylim || pbox.yMax >= ylim )
- {
- FT_TRACE3(( "ft_glyphslot_preset_bitmap: [%ld %ld %ld %ld]\n",
- pbox.xMin, pbox.yMin, pbox.xMax, pbox.yMax ));
- return 1;
- }
+ FT_TRACE3(( "ft_glyphslot_preset_bitmap: [%ld %ld %ld %ld]\n",
+ pbox.xMin, pbox.yMin, pbox.xMax, pbox.yMax ));
+ return 1;
}
return 0;
@@ -565,7 +549,8 @@
FT_BASE_DEF( FT_Error )
- ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot )
+ ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
+ FT_ULong size )
{
FT_Memory memory = FT_FACE_MEMORY( slot->face );
FT_Error error;
@@ -576,10 +561,7 @@
else
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
- /* dimensions must be preset */
- FT_MEM_ALLOC_MULT( slot->bitmap.buffer,
- slot->bitmap.rows,
- slot->bitmap.pitch );
+ FT_MEM_ALLOC( slot->bitmap.buffer, size );
return error;
}
@@ -923,6 +905,7 @@
FT_Library library;
FT_Bool autohint = FALSE;
FT_Module hinter;
+ TT_Face ttface = (TT_Face)face;
if ( !face || !face->size || !face->glyph )
@@ -1000,7 +983,6 @@
{
FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
FT_Bool is_light_type1;
- TT_Face ttface = (TT_Face)face;
/* only the new Adobe engine (for both CFF and Type 1) is `light'; */
@@ -1012,7 +994,8 @@
/* the check for `num_locations' assures that we actually */
/* test for instructions in a TTF and not in a CFF-based OTF */
/* */
- /* we check the size of the `fpgm' and `prep' tables, too -- */
+ /* since `maxSizeOfInstructions' might be unreliable, we */
+ /* check the size of the `fpgm' and `prep' tables, too -- */
/* the assumption is that there don't exist real TTFs where */
/* both `fpgm' and `prep' tables are missing */
if ( ( mode == FT_RENDER_MODE_LIGHT &&
@@ -1020,8 +1003,9 @@
!is_light_type1 ) ) ||
( FT_IS_SFNT( face ) &&
ttface->num_locations &&
+ ttface->max_profile.maxSizeOfInstructions == 0 &&
ttface->font_program_size == 0 &&
- ttface->cvt_program_size <= 7 ) )
+ ttface->cvt_program_size == 0 ) )
autohint = TRUE;
}
}
@@ -1188,9 +1172,9 @@
}
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_TRACE5(( "FT_Load_Glyph: index %u, flags 0x%x\n",
+ FT_TRACE5(( "FT_Load_Glyph: index %d, flags 0x%x\n",
glyph_index, load_flags ));
- FT_TRACE5(( " bitmap %ux%u %s, %s (mode %d)\n",
+ FT_TRACE5(( " bitmap %dx%d %s, %s (mode %d)\n",
slot->bitmap.width,
slot->bitmap.rows,
slot->outline.points ?
@@ -1269,14 +1253,14 @@
FT_Driver driver = (FT_Driver)driver_;
- /* finalize format-specific stuff */
- if ( driver->clazz->done_size )
- driver->clazz->done_size( size );
-
/* finalize client-specific data */
if ( size->generic.finalizer )
size->generic.finalizer( size );
+ /* finalize format-specific stuff */
+ if ( driver->clazz->done_size )
+ driver->clazz->done_size( size );
+
FT_FREE( size->internal );
FT_FREE( size );
}
@@ -1338,6 +1322,10 @@
driver );
face->size = NULL;
+ /* now discard client data */
+ if ( face->generic.finalizer )
+ face->generic.finalizer( face );
+
/* discard charmaps */
destroy_charmaps( face, memory );
@@ -1352,10 +1340,6 @@
face->stream = NULL;
- /* now discard client data */
- if ( face->generic.finalizer )
- face->generic.finalizer( face );
-
/* get rid of it */
if ( face->internal )
{
@@ -1375,9 +1359,21 @@
}
- /* documentation is in ftobjs.h */
-
- FT_BASE_DEF( FT_Error )
+ /**************************************************************************
+ *
+ * @Function:
+ * find_unicode_charmap
+ *
+ * @Description:
+ * This function finds a Unicode charmap, if there is one.
+ * And if there is more than one, it tries to favour the more
+ * extensive one, i.e., one that supports UCS-4 against those which
+ * are limited to the BMP (said UCS-2 encoding.)
+ *
+ * This function is called from open_face() (just below), and also
+ * from FT_Select_Charmap( ..., FT_ENCODING_UNICODE ).
+ */
+ static FT_Error
find_unicode_charmap( FT_Face face )
{
FT_CharMap* first;
@@ -1431,10 +1427,7 @@
if ( ( cur[0]->platform_id == TT_PLATFORM_MICROSOFT &&
cur[0]->encoding_id == TT_MS_ID_UCS_4 ) ||
( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
- cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) ||
- ( cur[0]->platform_id == TT_PLATFORM_APPLE_UNICODE &&
- cur[0]->encoding_id == TT_APPLE_ID_FULL_UNICODE &&
- FT_Get_CMap_Format( cur[0] ) == 13 ) )
+ cur[0]->encoding_id == TT_APPLE_ID_UNICODE_32 ) )
{
face->charmap = cur[0];
return FT_Err_Ok;
@@ -2132,7 +2125,7 @@
if ( pfb_pos > pfb_len || pfb_pos + rlen > pfb_len )
goto Exit2;
- FT_TRACE3(( " Load POST fragment #%d (%lu byte) to buffer"
+ FT_TRACE3(( " Load POST fragment #%d (%ld byte) to buffer"
" %p + 0x%08lx\n",
i, rlen, (void*)pfb_data, pfb_pos ));
@@ -2405,7 +2398,7 @@
is_darwin_vfs = ft_raccess_rule_by_darwin_vfs( library, i );
if ( is_darwin_vfs && vfs_rfork_has_no_font )
{
- FT_TRACE3(( "Skip rule %u: darwin vfs resource fork"
+ FT_TRACE3(( "Skip rule %d: darwin vfs resource fork"
" is already checked and"
" no font is found\n",
i ));
@@ -2414,7 +2407,7 @@
if ( errors[i] )
{
- FT_TRACE3(( "Error 0x%x has occurred in rule %u\n",
+ FT_TRACE3(( "Error 0x%x has occurred in rule %d\n",
errors[i], i ));
continue;
}
@@ -2422,7 +2415,7 @@
args2.flags = FT_OPEN_PATHNAME;
args2.pathname = file_names[i] ? file_names[i] : args->pathname;
- FT_TRACE3(( "Try rule %u: %s (offset=%ld) ...",
+ FT_TRACE3(( "Try rule %d: %s (offset=%ld) ...",
i, args2.pathname, offsets[i] ));
error = FT_Stream_New( library, &args2, &stream2 );
@@ -2819,6 +2812,11 @@
internal->refcount = 1;
internal->no_stem_darkening = -1;
+
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ /* Per-face filtering can only be set up by FT_Face_Properties */
+ internal->lcd_filter_func = NULL;
+#endif
}
if ( aface )
@@ -4048,8 +4046,18 @@
}
else if ( properties->tag == FT_PARAM_TAG_LCD_FILTER_WEIGHTS )
{
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ if ( properties->data )
+ {
+ ft_memcpy( face->internal->lcd_weights,
+ properties->data,
+ FT_LCD_FILTER_FIVE_TAPS );
+ face->internal->lcd_filter_func = ft_lcd_filter_fir;
+ }
+#else
error = FT_THROW( Unimplemented_Feature );
goto Exit;
+#endif
}
else if ( properties->tag == FT_PARAM_TAG_RANDOM_SEED )
{
@@ -5036,9 +5044,9 @@
static void
Destroy_Module( FT_Module module )
{
- const FT_Module_Class* clazz = module->clazz;
- FT_Library library = module->library;
- FT_Memory memory = module->memory;
+ FT_Memory memory = module->memory;
+ FT_Module_Class* clazz = module->clazz;
+ FT_Library library = module->library;
if ( library && library->auto_hinter == module )
@@ -5117,9 +5125,9 @@
goto Exit;
/* base initialization */
- module->clazz = clazz;
module->library = library;
module->memory = memory;
+ module->clazz = (FT_Module_Class*)clazz;
/* check whether the module is a renderer - this must be performed */
/* before the normal module initialization */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftoutln.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftoutln.c
index 8a15b03eb8..ef699b3c7c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftoutln.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftoutln.c
@@ -4,7 +4,7 @@
*
* FreeType outline management (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpatent.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpatent.c
index 664bc34dee..2055757e02 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpatent.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpatent.c
@@ -5,7 +5,7 @@
* FreeType API for checking patented TrueType bytecode instructions
* (body). Obsolete, retained for backward compatibility.
*
- * Copyright (C) 2007-2025 by
+ * Copyright (C) 2007-2024 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpsprop.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpsprop.c
index 0631cd63f6..37a6cee6cc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpsprop.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftpsprop.c
@@ -5,7 +5,7 @@
* Get and set properties of PostScript drivers (body).
* See `ftdriver.h' for available properties.
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftrfork.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftrfork.c
index 1e241f4f95..dc9b043d8b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftrfork.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftrfork.c
@@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (body).
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* Masatake YAMATO and Redhat K.K.
*
* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are
@@ -269,8 +269,14 @@
* According to Inside Macintosh: More Macintosh Toolbox,
* "Resource IDs" (1-46), there are some reserved IDs.
* However, FreeType2 is not a font synthesizer, no need
- * to check the acceptable resource ID or its attributes.
+ * to check the acceptable resource ID.
*/
+ if ( temp < 0 )
+ {
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
ref[j].offset = temp & 0xFFFFFFL;
FT_TRACE3(( " [%d]:"
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsnames.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsnames.c
index 34a67a148f..f7231fd61c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsnames.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsnames.c
@@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstream.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstream.c
index c04a0506de..6672224612 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstream.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstream.c
@@ -4,7 +4,7 @@
*
* I/O stream support (body).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -242,7 +242,7 @@
FT_ULong read_bytes;
- FT_TRACE7(( "FT_Stream_EnterFrame: %lu bytes\n", count ));
+ FT_TRACE7(( "FT_Stream_EnterFrame: %ld bytes\n", count ));
/* check for nested frame access */
FT_ASSERT( stream && stream->cursor == 0 );
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstroke.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstroke.c
index 591f18eaa8..64f46ce43e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstroke.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftstroke.c
@@ -4,7 +4,7 @@
*
* FreeType path stroker (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -1070,7 +1070,7 @@
if ( theta == FT_ANGLE_PI2 )
theta = -rotate;
- phi = stroker->angle_in + theta + rotate;
+ phi = stroker->angle_in + theta + rotate;
FT_Vector_From_Polar( &sigma, stroker->miter_limit, theta );
@@ -1371,7 +1371,7 @@
arc[1] = *control;
arc[2] = stroker->center;
- do
+ while ( arc >= bez_stack )
{
FT_Angle angle_in, angle_out;
@@ -1524,12 +1524,10 @@
}
}
- stroker->angle_in = angle_out;
-
- if ( arc == bez_stack )
- break;
arc -= 2;
- } while ( 1 );
+
+ stroker->angle_in = angle_out;
+ }
stroker->center = *to;
stroker->line_length = 0;
@@ -1579,7 +1577,7 @@
arc[2] = *control1;
arc[3] = stroker->center;
- do
+ while ( arc >= bez_stack )
{
FT_Angle angle_in, angle_mid, angle_out;
@@ -1743,12 +1741,10 @@
}
}
- stroker->angle_in = angle_out;
-
- if ( arc == bez_stack )
- break;
arc -= 3;
- } while ( 1 );
+
+ stroker->angle_in = angle_out;
+ }
stroker->center = *to;
stroker->line_length = 0;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsynth.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsynth.c
index 08bc174220..ec05bce33a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsynth.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsynth.c
@@ -4,7 +4,7 @@
*
* FreeType synthesizing code for emboldening and slanting (body).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -141,7 +141,7 @@
/*
* XXX: overflow check for 16-bit system, for compatibility
* with FT_GlyphSlot_Embolden() since FreeType 2.1.10.
- * unfortunately, this function returns no information
+ * unfortunately, this function return no informations
* about the cause of error.
*/
if ( ( ystr >> 6 ) > FT_INT_MAX || ( ystr >> 6 ) < FT_INT_MIN )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsystem.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsystem.c
index 186119d558..eee3642334 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsystem.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftsystem.c
@@ -4,7 +4,7 @@
*
* ANSI-specific FreeType low-level system interface (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -280,7 +280,7 @@
stream->close = ft_ansi_stream_close;
FT_TRACE1(( "FT_Stream_Open:" ));
- FT_TRACE1(( " opened `%s' (%lu bytes) successfully\n",
+ FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
filepathname, stream->size ));
return FT_Err_Ok;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/fttrigon.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/fttrigon.c
index 29eff639c5..4b1aced1cb 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/fttrigon.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/fttrigon.c
@@ -4,7 +4,7 @@
*
* FreeType trigonometric functions (body).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/fttype1.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/fttype1.c
index 77978df674..cedf7c4050 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/fttype1.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/fttype1.c
@@ -4,7 +4,7 @@
*
* FreeType utility file for PS names support (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftutil.c b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftutil.c
index f83c439489..b13512f870 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/base/ftutil.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/base/ftutil.c
@@ -4,7 +4,7 @@
*
* FreeType utility file for memory and list management (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -424,10 +424,11 @@
while ( cur )
{
FT_ListNode next = cur->next;
+ void* data = cur->data;
if ( destroy )
- destroy( memory, cur->data, user );
+ destroy( memory, data, user );
FT_FREE( cur );
cur = next;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.c b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.c
index cb69abdb90..ea5f8ed288 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.c
@@ -4,7 +4,7 @@
*
* CFF character mapping table (cmap) support (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.h
index 60e16d9487..1dd8700cd8 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffcmap.h
@@ -4,7 +4,7 @@
*
* CFF character mapping table (cmap) support (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.c b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.c
index 44ff44aecb..f6ebdb3810 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
*
* OpenType font driver implementation (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
*
* This file is part of the FreeType project, and may only be used,
@@ -121,20 +121,7 @@
kerning->y = 0;
if ( sfnt )
- {
- /* Use 'kern' table if available since that can be faster; otherwise */
- /* use GPOS kerning pairs if available. */
- if ( cffface->kern_avail_bits )
- kerning->x = sfnt->get_kerning( cffface,
- left_glyph,
- right_glyph );
-#ifdef TT_CONFIG_OPTION_GPOS_KERNING
- else if ( cffface->num_gpos_lookups_kerning )
- kerning->x = sfnt->get_gpos_kerning( cffface,
- left_glyph,
- right_glyph );
-#endif
- }
+ kerning->x = sfnt->get_kerning( cffface, left_glyph, right_glyph );
return FT_Err_Ok;
}
@@ -181,7 +168,25 @@
CFF_Size cffsize = (CFF_Size)size;
- FT_TRACE1(( "cff_glyph_load: glyph index %u\n", glyph_index ));
+ if ( !cffslot )
+ return FT_THROW( Invalid_Slot_Handle );
+
+ FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index ));
+
+ /* check whether we want a scaled outline or bitmap */
+ if ( !cffsize )
+ load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
+
+ /* reset the size object if necessary */
+ if ( load_flags & FT_LOAD_NO_SCALE )
+ size = NULL;
+
+ if ( size )
+ {
+ /* these two objects must have the same parent */
+ if ( size->face != slot->face )
+ return FT_THROW( Invalid_Face_Handle );
+ }
/* now load the glyph outline if necessary */
error = cff_slot_load( cffslot, cffsize, glyph_index, load_flags );
@@ -200,70 +205,105 @@
FT_Int32 flags,
FT_Fixed* advances )
{
- CFF_Face cffface = (CFF_Face)face;
- FT_Bool horz;
- FT_UInt nn;
+ FT_UInt nn;
+ FT_Error error = FT_Err_Ok;
+ FT_GlyphSlot slot = face->glyph;
- if ( !FT_IS_SFNT( face ) )
- return FT_THROW( Unimplemented_Feature );
-
- horz = !( flags & FT_LOAD_VERTICAL_LAYOUT );
-
- if ( horz )
+ if ( FT_IS_SFNT( face ) )
{
/* OpenType 1.7 mandates that the data from `hmtx' table be used; */
/* it is no longer necessary that those values are identical to */
/* the values in the `CFF' table */
- if ( !cffface->horizontal.number_Of_HMetrics )
- return FT_THROW( Unimplemented_Feature );
+ CFF_Face cffface = (CFF_Face)face;
+ FT_Short dummy;
+
+
+ if ( flags & FT_LOAD_VERTICAL_LAYOUT )
+ {
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /* no fast retrieval for blended MM fonts without HVAR table */
- if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
- !( cffface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
- return FT_THROW( Unimplemented_Feature );
+ /* no fast retrieval for blended MM fonts without VVAR table */
+ if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
+ !( cffface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
+ return FT_THROW( Unimplemented_Feature );
#endif
- }
- else /* vertical */
- {
- /* check whether we have data from the `vmtx' table at all; */
- /* otherwise we extract the info from the CFF glyphstrings */
- /* (instead of synthesizing a global value using the `OS/2' */
- /* table) */
- if ( !cffface->vertical_info )
- return FT_THROW( Unimplemented_Feature );
+ /* check whether we have data from the `vmtx' table at all; */
+ /* otherwise we extract the info from the CFF glyphstrings */
+ /* (instead of synthesizing a global value using the `OS/2' */
+ /* table) */
+ if ( !cffface->vertical_info )
+ goto Missing_Table;
+
+ for ( nn = 0; nn < count; nn++ )
+ {
+ FT_UShort ah;
+
+
+ ( (SFNT_Service)cffface->sfnt )->get_metrics( cffface,
+ 1,
+ start + nn,
+ &dummy,
+ &ah );
+
+ FT_TRACE5(( " idx %d: advance height %d font unit%s\n",
+ start + nn,
+ ah,
+ ah == 1 ? "" : "s" ));
+ advances[nn] = ah;
+ }
+ }
+ else
+ {
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /* no fast retrieval for blended MM fonts without VVAR table */
- if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
- !( cffface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
- return FT_THROW( Unimplemented_Feature );
+ /* no fast retrieval for blended MM fonts without HVAR table */
+ if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
+ !( cffface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
+ return FT_THROW( Unimplemented_Feature );
#endif
+
+ /* check whether we have data from the `hmtx' table at all */
+ if ( !cffface->horizontal.number_Of_HMetrics )
+ goto Missing_Table;
+
+ for ( nn = 0; nn < count; nn++ )
+ {
+ FT_UShort aw;
+
+
+ ( (SFNT_Service)cffface->sfnt )->get_metrics( cffface,
+ 0,
+ start + nn,
+ &dummy,
+ &aw );
+
+ FT_TRACE5(( " idx %d: advance width %d font unit%s\n",
+ start + nn,
+ aw,
+ aw == 1 ? "" : "s" ));
+ advances[nn] = aw;
+ }
+ }
+
+ return error;
}
- /* proceed to fast advances */
+ Missing_Table:
+ flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;
+
for ( nn = 0; nn < count; nn++ )
{
- FT_UShort aw;
- FT_Short dummy;
-
-
- ( (SFNT_Service)cffface->sfnt )->get_metrics( cffface,
- !horz,
- start + nn,
- &dummy,
- &aw );
-
- FT_TRACE5(( " idx %u: advance %s %d font unit%s\n",
- start + nn,
- horz ? "width" : "height",
- aw,
- aw == 1 ? "" : "s" ));
- advances[nn] = aw;
+ error = cff_glyph_load( slot, face->size, start + nn, flags );
+ if ( error )
+ break;
+
+ advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
+ ? slot->linearVertAdvance
+ : slot->linearHoriAdvance;
}
- return FT_Err_Ok;
+ return error;
}
@@ -456,8 +496,8 @@
dict->weight );
font_info->italic_angle = dict->italic_angle;
font_info->is_fixed_pitch = dict->is_fixed_pitch;
- font_info->underline_position = dict->underline_position;
- font_info->underline_thickness = dict->underline_thickness;
+ font_info->underline_position = (FT_Short)dict->underline_position;
+ font_info->underline_thickness = (FT_UShort)dict->underline_thickness;
cff->font_info = font_info;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.h
index 52a1e727a6..fd5bc37ecd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffdrivr.h
@@ -4,7 +4,7 @@
*
* High-level OpenType driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfferrs.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfferrs.h
index 7491886c7b..128adc3b71 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfferrs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfferrs.h
@@ -4,7 +4,7 @@
*
* CFF error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.c b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.c
index e8bab3c1e3..cbb071abdf 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.c
@@ -4,7 +4,7 @@
*
* OpenType Glyph Loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -238,12 +238,24 @@
else if ( glyph_index >= cff->num_glyphs )
return FT_THROW( Invalid_Argument );
+ if ( load_flags & FT_LOAD_NO_RECURSE )
+ load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
+
+ glyph->x_scale = 0x10000L;
+ glyph->y_scale = 0x10000L;
+ if ( size )
+ {
+ glyph->x_scale = size->root.metrics.x_scale;
+ glyph->y_scale = size->root.metrics.y_scale;
+ }
+
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* try to load embedded bitmap if any */
/* */
/* XXX: The convention should be emphasized in */
/* the documents because it can be confusing. */
+ if ( size )
{
CFF_Face cff_face = (CFF_Face)size->root.face;
SFNT_Service sfnt = (SFNT_Service)cff_face->sfnt;
@@ -272,6 +284,9 @@
FT_Short dummy;
+ glyph->root.outline.n_points = 0;
+ glyph->root.outline.n_contours = 0;
+
glyph->root.metrics.width = (FT_Pos)metrics.width * 64;
glyph->root.metrics.height = (FT_Pos)metrics.height * 64;
@@ -408,25 +423,6 @@
#endif /* FT_CONFIG_OPTION_SVG */
- /* top-level code ensures that FT_LOAD_NO_HINTING is set */
- /* if FT_LOAD_NO_SCALE is active */
- hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
- scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
-
- glyph->hint = hinting;
- glyph->scaled = scaled;
-
- if ( scaled )
- {
- glyph->x_scale = size->root.metrics.x_scale;
- glyph->y_scale = size->root.metrics.y_scale;
- }
- else
- {
- glyph->x_scale = 0x10000L;
- glyph->y_scale = 0x10000L;
- }
-
/* if we have a CID subfont, use its matrix (which has already */
/* been multiplied with the root matrix) */
@@ -461,6 +457,18 @@
font_offset = cff->top_font.font_dict.font_offset;
}
+ glyph->root.outline.n_points = 0;
+ glyph->root.outline.n_contours = 0;
+
+ /* top-level code ensures that FT_LOAD_NO_HINTING is set */
+ /* if FT_LOAD_NO_SCALE is active */
+ hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_HINTING ) == 0 );
+ scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
+
+ glyph->hint = hinting;
+ glyph->scaled = scaled;
+ glyph->root.format = FT_GLYPH_FORMAT_OUTLINE; /* by default */
+
{
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
PS_Driver driver = (PS_Driver)FT_FACE_DRIVER( face );
@@ -594,8 +602,10 @@
{
/* Now, set the metrics -- this is rather simple, as */
/* the left side bearing is the xMin, and the top side */
- /* bearing the yMax. For composite glyphs, return only */
- /* left side bearing and advance width. */
+ /* bearing the yMax. */
+
+ /* For composite glyphs, return only left side bearing and */
+ /* advance width. */
if ( load_flags & FT_LOAD_NO_RECURSE )
{
FT_Slot_Internal internal = glyph->root.internal;
@@ -614,12 +624,6 @@
FT_Bool has_vertical_info;
- glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
-
- glyph->root.outline.flags = FT_OUTLINE_REVERSE_FILL;
- if ( size && size->root.metrics.y_ppem < 24 )
- glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION;
-
if ( face->horizontal.number_Of_HMetrics )
{
FT_Short horiBearingX = 0;
@@ -673,6 +677,14 @@
glyph->root.linearVertAdvance = metrics->vertAdvance;
+ glyph->root.format = FT_GLYPH_FORMAT_OUTLINE;
+
+ glyph->root.outline.flags = 0;
+ if ( size && size->root.metrics.y_ppem < 24 )
+ glyph->root.outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+
+ glyph->root.outline.flags |= FT_OUTLINE_REVERSE_FILL;
+
/* apply the font matrix, if any */
if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
font_matrix.xy != 0 || font_matrix.yx != 0 )
@@ -695,7 +707,7 @@
metrics->vertAdvance += font_offset.y;
}
- if ( scaled || force_scaling )
+ if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 || force_scaling )
{
/* scale the outline and the metrics */
FT_Int n;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.h
index 662bb7cff5..346d4b11c3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffgload.h
@@ -4,7 +4,7 @@
*
* OpenType Glyph Loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.c b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.c
index 39d662eb43..979fd45f6c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.c
@@ -4,7 +4,7 @@
*
* OpenType and CFF data/program tables loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -442,7 +442,7 @@
if ( cur_offset != 0 )
{
FT_TRACE0(( "cff_index_get_pointers:"
- " invalid first offset value %lu set to zero\n",
+ " invalid first offset value %ld set to zero\n",
cur_offset ));
cur_offset = 0;
}
@@ -559,8 +559,8 @@
idx->data_offset > stream->size - off2 + 1 )
{
FT_ERROR(( "cff_index_access_element:"
- " offset to next entry (%lu)"
- " exceeds the end of stream (%lu)\n",
+ " offset to next entry (%ld)"
+ " exceeds the end of stream (%ld)\n",
off2, stream->size - idx->data_offset + 1 ));
off2 = stream->size - idx->data_offset + 1;
}
@@ -982,7 +982,7 @@
if ( glyph_sid > 0xFFFFL - nleft )
{
FT_ERROR(( "cff_charset_load: invalid SID range trimmed"
- " nleft=%u -> %ld\n", nleft, 0xFFFFL - glyph_sid ));
+ " nleft=%d -> %ld\n", nleft, 0xFFFFL - glyph_sid ));
nleft = ( FT_UInt )( 0xFFFFL - glyph_sid );
}
@@ -1315,7 +1315,7 @@
if ( numOperands > count )
{
- FT_TRACE4(( " cff_blend_doBlend: Stack underflow %u argument%s\n",
+ FT_TRACE4(( " cff_blend_doBlend: Stack underflow %d argument%s\n",
count,
count == 1 ? "" : "s" ));
@@ -1466,7 +1466,7 @@
if ( master == 0 )
{
blend->BV[master] = FT_FIXED_ONE;
- FT_TRACE4(( " build blend vector len %u\n", len ));
+ FT_TRACE4(( " build blend vector len %d\n", len ));
FT_TRACE4(( " [ %f ", blend->BV[master] / 65536.0 ));
continue;
}
@@ -2014,8 +2014,8 @@
/* set defaults */
FT_ZERO( top );
- top->underline_position = -100;
- top->underline_thickness = 50;
+ top->underline_position = -( 100L << 16 );
+ top->underline_thickness = 50L << 16;
top->charstring_type = 2;
top->font_matrix.xx = 0x10000L;
top->font_matrix.yy = 0x10000L;
@@ -2341,7 +2341,7 @@
if ( face_index > 0 && subfont_index >= font->name_index.count )
{
FT_ERROR(( "cff_font_load:"
- " invalid subfont index for pure CFF font (%u)\n",
+ " invalid subfont index for pure CFF font (%d)\n",
subfont_index ));
error = FT_THROW( Invalid_Argument );
goto Exit;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.h
index fdc132c8f3..0220924542 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffload.h
@@ -4,7 +4,7 @@
*
* OpenType & CFF data/program tables loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.c b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.c
index 9e00943a95..7c6713739a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
*
* OpenType objects manager (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -537,8 +537,8 @@
sfnt_format = 1;
- /* the font may be OpenType/CFF, SVG CEF, or sfnt/CFF; a `head' table */
- /* implies OpenType/CFF, otherwise just look for an optional cmap */
+ /* now, the font can be either an OpenType/CFF font, or an SVG CEF */
+ /* font; in the latter case it doesn't have a `head' table */
error = face->goto_table( face, TTAG_head, stream, 0 );
if ( !error )
{
@@ -554,9 +554,7 @@
{
/* load the `cmap' table explicitly */
error = sfnt->load_cmap( face, stream );
-
- /* this may fail because CID-keyed fonts don't have a cmap */
- if ( FT_ERR_NEQ( error, Table_Missing ) && FT_ERR_NEQ( error, Ok ) )
+ if ( error )
goto Exit;
}
@@ -653,7 +651,7 @@
{
s = cff_index_get_sid_string( cff, idx );
if ( s )
- FT_TRACE4(( " %5u %s\n", idx, s ));
+ FT_TRACE4(( " %5d %s\n", idx, s ));
}
/* In Multiple Master CFFs, two SIDs hold the Normalize Design */
@@ -668,7 +666,7 @@
FT_PtrDist l;
- FT_TRACE4(( " %5u ", idx + 390 ));
+ FT_TRACE4(( " %5d ", idx + 390 ));
for ( l = 0; l < s1len; l++ )
FT_TRACE4(( "%c", s1[l] ));
FT_TRACE4(( "\n" ));
@@ -683,7 +681,7 @@
FT_PtrDist l;
- FT_TRACE4(( " %5u ", cff->num_strings + 390 ));
+ FT_TRACE4(( " %5d ", cff->num_strings + 390 ));
for ( l = 0; l < s1len; l++ )
FT_TRACE4(( "%c", s1[l] ));
FT_TRACE4(( "\n" ));
@@ -846,8 +844,10 @@
cffface->height = (FT_Short)( cffface->ascender -
cffface->descender );
- cffface->underline_position = (FT_Short)dict->underline_position;
- cffface->underline_thickness = (FT_Short)dict->underline_thickness;
+ cffface->underline_position =
+ (FT_Short)( dict->underline_position >> 16 );
+ cffface->underline_thickness =
+ (FT_Short)( dict->underline_thickness >> 16 );
/* retrieve font family & style name */
if ( dict->family_name )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.h
index 982dcd64dd..91ad83b1cd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffobjs.h
@@ -4,7 +4,7 @@
*
* OpenType objects manager (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.c b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.c
index 864b2490b3..92a69c3b51 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.c
@@ -4,7 +4,7 @@
*
* CFF token stream parser (body)
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -892,7 +892,7 @@
dict->cid_supplement ));
error = FT_Err_Ok;
- FT_TRACE4(( " %u %u %ld\n",
+ FT_TRACE4(( " %d %d %ld\n",
dict->cid_registry,
dict->cid_ordering,
dict->cid_supplement ));
@@ -929,7 +929,7 @@
priv->vsindex = (FT_UInt)cff_parse_num( parser, data++ );
- FT_TRACE4(( " %u\n", priv->vsindex ));
+ FT_TRACE4(( " %d\n", priv->vsindex ));
error = FT_Err_Ok;
@@ -979,7 +979,7 @@
goto Exit;
}
- FT_TRACE4(( " %u value%s blended\n",
+ FT_TRACE4(( " %d value%s blended\n",
numBlends,
numBlends == 1 ? "" : "s" ));
@@ -1014,7 +1014,7 @@
if ( dict->maxstack < CFF2_DEFAULT_STACK )
dict->maxstack = CFF2_DEFAULT_STACK;
- FT_TRACE4(( " %u\n", dict->maxstack ));
+ FT_TRACE4(( " %d\n", dict->maxstack ));
Exit:
return error;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.h
index 47cceb1a4a..ca6b18af6a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cffparse.h
@@ -4,7 +4,7 @@
*
* CFF token stream parser (specification)
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfftoken.h b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfftoken.h
index a7ee1cb3fe..da45faa7f4 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfftoken.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cff/cfftoken.h
@@ -4,7 +4,7 @@
*
* CFF token definitions (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -30,8 +30,8 @@
CFF_FIELD_STRING ( 4, weight, "Weight" )
CFF_FIELD_BOOL ( 0x101, is_fixed_pitch, "isFixedPitch" )
CFF_FIELD_FIXED ( 0x102, italic_angle, "ItalicAngle" )
- CFF_FIELD_NUM ( 0x103, underline_position, "UnderlinePosition" )
- CFF_FIELD_NUM ( 0x104, underline_thickness, "UnderlineThickness" )
+ CFF_FIELD_FIXED ( 0x103, underline_position, "UnderlinePosition" )
+ CFF_FIELD_FIXED ( 0x104, underline_thickness, "UnderlineThickness" )
CFF_FIELD_NUM ( 0x105, paint_type, "PaintType" )
CFF_FIELD_NUM ( 0x106, charstring_type, "CharstringType" )
CFF_FIELD_CALLBACK( 0x107, font_matrix, "FontMatrix" )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/ciderrs.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/ciderrs.h
index 1591979d37..c439a8c4a0 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/ciderrs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/ciderrs.h
@@ -4,7 +4,7 @@
*
* CID error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.c b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.c
index 249ede5757..7b571322d4 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.c
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 Glyph Loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -103,20 +103,20 @@
if ( ( cid->fd_bytes == 1 && fd_select == 0xFFU ) ||
( cid->fd_bytes == 2 && fd_select == 0xFFFFU ) )
{
- FT_TRACE1(( "cid_load_glyph: fail for glyph index %u:\n",
+ FT_TRACE1(( "cid_load_glyph: fail for glyph index %d:\n",
glyph_index ));
- FT_TRACE1(( " FD number %lu is the maximum\n",
+ FT_TRACE1(( " FD number %ld is the maximum\n",
fd_select ));
- FT_TRACE1(( " integer fitting into %u byte%s\n",
+ FT_TRACE1(( " integer fitting into %d byte%s\n",
cid->fd_bytes, cid->fd_bytes == 1 ? "" : "s" ));
}
else
{
- FT_TRACE0(( "cid_load_glyph: fail for glyph index %u:\n",
+ FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n",
glyph_index ));
- FT_TRACE0(( " FD number %lu is larger\n",
+ FT_TRACE0(( " FD number %ld is larger\n",
fd_select ));
- FT_TRACE0(( " than number of dictionaries (%u)\n",
+ FT_TRACE0(( " than number of dictionaries (%d)\n",
cid->num_dicts ));
}
@@ -125,7 +125,7 @@
}
else if ( off2 > stream->size )
{
- FT_TRACE0(( "cid_load_glyph: fail for glyph index %u:\n",
+ FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n",
glyph_index ));
FT_TRACE0(( " end of the glyph data\n" ));
FT_TRACE0(( " is beyond the data stream\n" ));
@@ -135,7 +135,7 @@
}
else if ( off1 > off2 )
{
- FT_TRACE0(( "cid_load_glyph: fail for glyph index %u:\n",
+ FT_TRACE0(( "cid_load_glyph: fail for glyph index %d:\n",
glyph_index ));
FT_TRACE0(( " the end position of glyph data\n" ));
FT_TRACE0(( " is set before the start position\n" ));
@@ -252,8 +252,8 @@
cs_offset = decoder->lenIV >= 0 ? (FT_UInt)decoder->lenIV : 0;
if ( cs_offset > glyph_length )
{
- FT_TRACE0(( "cid_load_glyph: fail for glyph_index=%u,"
- " offset to the charstring is beyond glyph length\n",
+ FT_TRACE0(( "cid_load_glyph: fail for glyph_index=%d, "
+ "offset to the charstring is beyond glyph length\n",
glyph_index ));
error = FT_THROW( Invalid_Offset );
goto Exit;
@@ -452,12 +452,16 @@
glyph->x_scale = cidsize->metrics.x_scale;
glyph->y_scale = cidsize->metrics.y_scale;
+ cidglyph->outline.n_points = 0;
+ cidglyph->outline.n_contours = 0;
+
hinting = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 &&
( load_flags & FT_LOAD_NO_HINTING ) == 0 );
scaled = FT_BOOL( ( load_flags & FT_LOAD_NO_SCALE ) == 0 );
glyph->hint = hinting;
glyph->scaled = scaled;
+ cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;
error = psaux->t1_decoder_funcs->init( &decoder,
cidglyph->face,
@@ -497,8 +501,12 @@
/* now set the metrics -- this is rather simple, as */
/* the left side bearing is the xMin, and the top side */
- /* bearing the yMax; for composite glyphs, return only */
- /* left side bearing and advance width */
+ /* bearing the yMax */
+ cidglyph->outline.flags &= FT_OUTLINE_OWNER;
+ cidglyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
+
+ /* for composite glyphs, return only left side bearing and */
+ /* advance width */
if ( load_flags & FT_LOAD_NO_RECURSE )
{
FT_Slot_Internal internal = cidglyph->internal;
@@ -519,13 +527,6 @@
FT_Glyph_Metrics* metrics = &cidglyph->metrics;
- cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;
-
- cidglyph->outline.flags &= FT_OUTLINE_OWNER;
- cidglyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
- if ( cidsize->metrics.y_ppem < 24 )
- cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
-
/* copy the _unscaled_ advance width */
metrics->horiAdvance =
FIXED_TO_INT( decoder.builder.advance.x );
@@ -538,6 +539,11 @@
face->cid.font_bbox.yMin ) >> 16;
cidglyph->linearVertAdvance = metrics->vertAdvance;
+ cidglyph->format = FT_GLYPH_FORMAT_OUTLINE;
+
+ if ( cidsize->metrics.y_ppem < 24 )
+ cidglyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+
/* apply the font matrix, if any */
if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
font_matrix.xy != 0 || font_matrix.yx != 0 )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.h
index cef96073de..9fdc9db589 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidgload.h
@@ -4,7 +4,7 @@
*
* OpenType Glyph Loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.c b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.c
index bb1bf13e22..722f5a34dd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.c
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 font loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.h
index 659dd0e378..7f030b32df 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidload.h
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 font loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.c b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.c
index 634bbf2f13..8d337c4112 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.c
@@ -4,7 +4,7 @@
*
* CID objects manager (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.h
index 800268efa2..d371cbe995 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidobjs.h
@@ -4,7 +4,7 @@
*
* CID objects manager (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.c b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.c
index 4d1ba33596..73a3ade893 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 parser (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.h
index 6ae2e54239..0f5baddcb9 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidparse.h
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 parser (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.c b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.c
index a3a587c57b..4be8a5c00d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.c
@@ -4,7 +4,7 @@
*
* CID driver interface (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.h
index 55d0b8a0d9..7ddce431c5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidriver.h
@@ -4,7 +4,7 @@
*
* High-level CID driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidtoken.h b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidtoken.h
index d40ebfab86..160897d144 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidtoken.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/cid/cidtoken.h
@@ -4,7 +4,7 @@
*
* CID token definitions (specification only).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -47,7 +47,7 @@
T1_FIELD_STRING( "FullName", full_name, 0 )
T1_FIELD_STRING( "FamilyName", family_name, 0 )
T1_FIELD_STRING( "Weight", weight, 0 )
- T1_FIELD_FIXED ( "ItalicAngle", italic_angle, 0 )
+ T1_FIELD_NUM ( "ItalicAngle", italic_angle, 0 )
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 )
T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 )
T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.c
index b813efde4e..e2f6a8e5ad 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.c
@@ -4,7 +4,7 @@
*
* AFM parser (body).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.h
index add8597717..b776637282 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/afmparse.h
@@ -4,7 +4,7 @@
*
* AFM parser (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.c
index 17bdd23c7d..9556e11a58 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.c
@@ -4,7 +4,7 @@
*
* PostScript CFF (Type 2) decoding routines (body).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -2141,7 +2141,7 @@
decoder->locals_bias );
- FT_TRACE4(( " callsubr (idx %u, entering level %td)\n",
+ FT_TRACE4(( " callsubr (idx %d, entering level %td)\n",
idx,
zone - decoder->zones + 1 ));
@@ -2185,7 +2185,7 @@
decoder->globals_bias );
- FT_TRACE4(( " callgsubr (idx %u, entering level %td)\n",
+ FT_TRACE4(( " callgsubr (idx %d, entering level %td)\n",
idx,
zone - decoder->zones + 1 ));
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.h
index e72ec043ba..038f7235c3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/cffdecode.h
@@ -4,7 +4,7 @@
*
* PostScript CFF (Type 2) decoding routines (specification).
*
- * Copyright (C) 2017-2025 by
+ * Copyright (C) 2017-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxerr.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxerr.h
index 0d7fe2b612..18428c40d5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxerr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxerr.h
@@ -4,7 +4,7 @@
*
* PS auxiliary module error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.c
index 942804190c..6826f9d8d3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.c
@@ -4,7 +4,7 @@
*
* FreeType auxiliary PostScript module implementation (body).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.h
index 4a5ebc1b60..82d7e348af 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psauxmod.h
@@ -4,7 +4,7 @@
*
* FreeType auxiliary PostScript module implementation (specification).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -46,6 +46,9 @@ FT_BEGIN_HEADER
const CFF_Decoder_FuncsRec cff_decoder_funcs;
+ FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class;
+
+
FT_DECLARE_MODULE( psaux_module_class )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.c
index 4567d3f3c0..56c0ecd1d7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.c
@@ -4,7 +4,7 @@
*
* Some convenience conversions (body).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.h
index 63735af411..91fcd15a1c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psconv.h
@@ -4,7 +4,7 @@
*
* Some convenience conversions (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psintrp.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psintrp.c
index 7e3475e6f5..7572e225e3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psintrp.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psintrp.c
@@ -618,7 +618,7 @@
/* Our copy of it does not change that requirement. */
cf2_arrstack_setCount( &subrStack, CF2_MAX_SUBR + 1 );
- charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );
+ charstring = (CF2_Buffer)cf2_arrstack_getBuffer( &subrStack );
/* catch errors so far */
if ( *error )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.c
index 8159fd6ef1..eca465f009 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
*
* Auxiliary functions for PostScript fonts (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -460,9 +460,6 @@
case '%':
skip_comment( &cur, limit );
break;
-
- default:
- break;
}
}
@@ -1148,7 +1145,7 @@
FT_ERROR(( "ps_parser_load_field:"
" expected a name or string\n" ));
FT_ERROR(( " "
- " but found token of type %u instead\n",
+ " but found token of type %d instead\n",
token.type ));
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -1228,7 +1225,7 @@
if ( result < 0 || (FT_UInt)result < max_objects )
{
FT_ERROR(( "ps_parser_load_field:"
- " expected %u integer%s in the %s subarray\n",
+ " expected %d integer%s in the %s subarray\n",
max_objects, max_objects > 1 ? "s" : "",
i == 0 ? "first"
: ( i == 1 ? "second"
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.h
index 277aa1247c..345fc8a733 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/psobjs.h
@@ -4,7 +4,7 @@
*
* Auxiliary functions for PostScript fonts (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.c
index 66493b6812..5681c3bd0f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.c
@@ -4,7 +4,7 @@
*
* Type 1 character map support (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.h
index 114bfbb041..445e6a2784 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1cmap.h
@@ -4,7 +4,7 @@
*
* Type 1 character map support (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.c b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.c
index c3fb343d4c..c74baa8038 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
*
* PostScript Type 1 decoding routines (body).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -1633,7 +1633,7 @@
default:
FT_ERROR(( "t1_decoder_parse_charstrings:"
- " unhandled opcode %u\n", op ));
+ " unhandled opcode %d\n", op ));
goto Syntax_Error;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.h b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.h
index 7b913f55df..16203b8f73 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psaux/t1decode.h
@@ -4,7 +4,7 @@
*
* PostScript Type 1 decoding routines (specification).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.c b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.c
index e053dba17b..967767b348 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.c
@@ -4,7 +4,7 @@
*
* PostScript hinting algorithm (body).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
@@ -35,6 +35,10 @@
#endif
+#define COMPUTE_INFLEXS /* compute inflection points to optimize `S' */
+ /* and similar glyphs */
+
+
/*************************************************************************/
/*************************************************************************/
/***** *****/
@@ -96,7 +100,7 @@
if ( idx >= table->max_hints )
{
- FT_TRACE0(( "psh_hint_table_record: invalid hint index %u\n", idx ));
+ FT_TRACE0(( "psh_hint_table_record: invalid hint index %d\n", idx ));
return;
}
@@ -916,6 +920,117 @@
#define psh_corner_orientation ft_corner_orientation
+#ifdef COMPUTE_INFLEXS
+
+ /* compute all inflex points in a given glyph */
+ static void
+ psh_glyph_compute_inflections( PSH_Glyph glyph )
+ {
+ FT_UInt n;
+
+
+ for ( n = 0; n < glyph->num_contours; n++ )
+ {
+ PSH_Point first, start, end, before, after;
+ FT_Pos in_x, in_y, out_x, out_y;
+ FT_Int orient_prev, orient_cur;
+ FT_Int finished = 0;
+
+
+ /* we need at least 4 points to create an inflection point */
+ if ( glyph->contours[n].count < 4 )
+ continue;
+
+ /* compute first segment in contour */
+ first = glyph->contours[n].start;
+
+ start = end = first;
+ do
+ {
+ end = end->next;
+ if ( end == first )
+ goto Skip;
+
+ in_x = end->org_u - start->org_u;
+ in_y = end->org_v - start->org_v;
+
+ } while ( in_x == 0 && in_y == 0 );
+
+ /* extend the segment start whenever possible */
+ before = start;
+ do
+ {
+ do
+ {
+ start = before;
+ before = before->prev;
+ if ( before == first )
+ goto Skip;
+
+ out_x = start->org_u - before->org_u;
+ out_y = start->org_v - before->org_v;
+
+ } while ( out_x == 0 && out_y == 0 );
+
+ orient_prev = psh_corner_orientation( in_x, in_y, out_x, out_y );
+
+ } while ( orient_prev == 0 );
+
+ first = start;
+ in_x = out_x;
+ in_y = out_y;
+
+ /* now, process all segments in the contour */
+ do
+ {
+ /* first, extend current segment's end whenever possible */
+ after = end;
+ do
+ {
+ do
+ {
+ end = after;
+ after = after->next;
+ if ( after == first )
+ finished = 1;
+
+ out_x = after->org_u - end->org_u;
+ out_y = after->org_v - end->org_v;
+
+ } while ( out_x == 0 && out_y == 0 );
+
+ orient_cur = psh_corner_orientation( in_x, in_y, out_x, out_y );
+
+ } while ( orient_cur == 0 );
+
+ if ( ( orient_cur ^ orient_prev ) < 0 )
+ {
+ do
+ {
+ psh_point_set_inflex( start );
+ start = start->next;
+ }
+ while ( start != end );
+
+ psh_point_set_inflex( start );
+ }
+
+ start = end;
+ end = after;
+ orient_prev = orient_cur;
+ in_x = out_x;
+ in_y = out_y;
+
+ } while ( !finished );
+
+ Skip:
+ ;
+ }
+ }
+
+#endif /* COMPUTE_INFLEXS */
+
+
static void
psh_glyph_done( PSH_Glyph glyph )
{
@@ -1143,6 +1258,11 @@
glyph->outline = outline;
glyph->globals = globals;
+#ifdef COMPUTE_INFLEXS
+ psh_glyph_load_points( glyph, 0 );
+ psh_glyph_compute_inflections( glyph );
+#endif /* COMPUTE_INFLEXS */
+
/* now deal with hints tables */
error = psh_hint_table_init( &glyph->hint_tables [0],
&ps_hints->dimension[0].hints,
@@ -1165,47 +1285,122 @@
}
- /* compute all extreme and inflection points */
- /* in a glyph for a given dimension */
+ /* compute all extrema in a glyph for a given dimension */
static void
psh_glyph_compute_extrema( PSH_Glyph glyph )
{
FT_UInt n;
+ /* first of all, compute all local extrema */
for ( n = 0; n < glyph->num_contours; n++ )
{
- PSH_Point first, point, before, after;
+ PSH_Point first = glyph->contours[n].start;
+ PSH_Point point, before, after;
- /* we need at least 3 points to create an extremum */
- if ( glyph->contours[n].count < 3 )
+ if ( glyph->contours[n].count == 0 )
continue;
- first = glyph->contours[n].start;
- point = first->prev;
- after = first;
+ point = first;
+ before = point;
do
{
- before = point;
+ before = before->prev;
+ if ( before == first )
+ goto Skip;
+
+ } while ( before->org_u == point->org_u );
+
+ first = point = before->next;
+
+ for (;;)
+ {
+ after = point;
+ do
+ {
+ after = after->next;
+ if ( after == first )
+ goto Next;
+
+ } while ( after->org_u == point->org_u );
+
+ if ( before->org_u < point->org_u )
+ {
+ if ( after->org_u < point->org_u )
+ {
+ /* local maximum */
+ goto Extremum;
+ }
+ }
+ else /* before->org_u > point->org_u */
+ {
+ if ( after->org_u > point->org_u )
+ {
+ /* local minimum */
+ Extremum:
+ do
+ {
+ psh_point_set_extremum( point );
+ point = point->next;
+
+ } while ( point != after );
+ }
+ }
+
+ before = after->prev;
point = after;
- after = point->next;
- if ( ( before->org_u < point->org_u && point->org_u < after->org_u ) ||
- ( before->org_u > point->org_u && point->org_u > after->org_u ) )
- continue;
+ } /* for */
+
+ Next:
+ ;
+ }
+
+ /* for each extremum, determine its direction along the */
+ /* orthogonal axis */
+ for ( n = 0; n < glyph->num_points; n++ )
+ {
+ PSH_Point point, before, after;
+
+
+ point = &glyph->points[n];
+ before = point;
+ after = point;
- /* otherwise this is either extremum or inflection point */
- psh_point_set_extremum( point );
+ if ( psh_point_is_extremum( point ) )
+ {
+ do
+ {
+ before = before->prev;
+ if ( before == point )
+ goto Skip;
+
+ } while ( before->org_v == point->org_v );
+
+ do
+ {
+ after = after->next;
+ if ( after == point )
+ goto Skip;
+
+ } while ( after->org_v == point->org_v );
+ }
- /* also note its direction */
- if ( before->org_v < after->org_v )
- psh_point_set_positive( point );
- else if ( before->org_v > after->org_v )
- psh_point_set_negative( point );
+ if ( before->org_v < point->org_v &&
+ after->org_v > point->org_v )
+ {
+ psh_point_set_positive( point );
+ }
+ else if ( before->org_v > point->org_v &&
+ after->org_v < point->org_v )
+ {
+ psh_point_set_negative( point );
+ }
- } while ( after != first );
+ Skip:
+ ;
}
}
@@ -1641,7 +1836,8 @@
point->dir_in != point->dir_out )
continue;
- if ( !psh_point_is_extremum( point ) )
+ if ( !psh_point_is_extremum( point ) &&
+ !psh_point_is_inflex( point ) )
continue;
point->flags &= ~PSH_POINT_SMOOTH;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.h b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.h
index f4aa854055..fb362f061b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshalgo.h
@@ -4,7 +4,7 @@
*
* PostScript hinting algorithm (specification).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.c b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.c
index a772b66f30..435f45838f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.c
@@ -5,7 +5,7 @@
* PostScript hinter global hinting management (body).
* Inspired by the new auto-hinter module.
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
@@ -376,24 +376,36 @@
/* not. We simply need to compare the vertical scale */
/* parameter to the raw bluescale value. Here is why: */
/* */
- /* The specs explain how the bluescale is calculated */
- /* from the desired maximum rounded pointsize at 300 dpi */
- /* and assuming upem of 1000. */
+ /* We need to suppress overshoots for all pointsizes. */
+ /* At 300dpi that satisfies: */
/* */
- /* bluescale = ( pointsize - 0.49 ) / 240 */
+ /* pointsize < 240*bluescale + 0.49 */
/* */
- /* For unrounded pointsize in general terms */
+ /* This corresponds to: */
/* */
- /* bluescale = ( pointsize * dpi / 72 ) / upem */
+ /* pixelsize < 1000*bluescale + 49/24 */
/* */
- /* which is */
+ /* scale*EM_Size < 1000*bluescale + 49/24 */
/* */
- /* bluescale = pixelsize / upem */
+ /* However, for normal Type 1 fonts, EM_Size is 1000! */
+ /* We thus only check: */
/* */
- /* Therefore, the bluescale value can be used directly */
- /* as a scale limit, now that it is in comparable units */
+ /* scale < bluescale + 49/24000 */
/* */
- blues->no_overshoots = FT_BOOL( scale < blues->blue_scale );
+ /* which we shorten to */
+ /* */
+ /* "scale < bluescale" */
+ /* */
+ /* Note that `blue_scale' is stored 1000 times its real */
+ /* value, and that `scale' converts from font units to */
+ /* fractional pixels. */
+ /* */
+
+ /* 1000 / 64 = 125 / 8 */
+ if ( scale >= 0x20C49BAL )
+ blues->no_overshoots = FT_BOOL( scale < blues->blue_scale * 8 / 125 );
+ else
+ blues->no_overshoots = FT_BOOL( scale * 125 < blues->blue_scale * 8 );
/* */
/* The blue threshold is the font units distance under */
@@ -408,8 +420,8 @@
FT_Int threshold = blues->blue_shift;
- if ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 )
- threshold = 32 * 0x10000L / scale;
+ while ( threshold > 0 && FT_MulFix( threshold, scale ) > 32 )
+ threshold--;
blues->blue_threshold = threshold;
}
@@ -696,6 +708,7 @@
/* limit the BlueScale value to `1 / max_of_blue_zone_heights' */
{
+ FT_Fixed max_scale;
FT_Short max_height = 1;
@@ -712,12 +725,11 @@
priv->family_other_blues,
max_height );
- /* restrict BlueScale value that is amplified 1000-fold and */
- /* rescale it to be comparable to the metrics scale */
- if ( FT_MulFix( max_height, priv->blue_scale ) < 1000 )
- globals->blues.blue_scale = priv->blue_scale * 8 / 125;
- else
- globals->blues.blue_scale = 64 * 0x10000L / max_height;
+ /* BlueScale is scaled 1000 times */
+ max_scale = FT_DivFix( 1000, max_height );
+ globals->blues.blue_scale = priv->blue_scale < max_scale
+ ? priv->blue_scale
+ : max_scale;
}
globals->blues.blue_shift = priv->blue_shift;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.h b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.h
index 555e99facb..c5a5c91316 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshglob.h
@@ -4,7 +4,7 @@
*
* PostScript hinter global hinting management.
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.c b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.c
index c9f4a94fe9..9965d5b16b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.c
@@ -4,7 +4,7 @@
*
* FreeType PostScript hinter module implementation (body).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.h b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.h
index de9c398e9f..62ac0a60fd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshmod.h
@@ -4,7 +4,7 @@
*
* PostScript hinter module interface (specification).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshnterr.h b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshnterr.h
index 7076664ddd..e9641340e5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshnterr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshnterr.h
@@ -4,7 +4,7 @@
*
* PS Hinter error codes (specification only).
*
- * Copyright (C) 2003-2025 by
+ * Copyright (C) 2003-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.c b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.c
index 13754313fb..0b2b549fc2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.c
@@ -4,7 +4,7 @@
*
* FreeType PostScript hints recorder (body).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -467,7 +467,7 @@
table->num_masks--;
}
else
- FT_TRACE0(( "ps_mask_table_merge: ignoring invalid indices (%u,%u)\n",
+ FT_TRACE0(( "ps_mask_table_merge: ignoring invalid indices (%d,%d)\n",
index1, index2 ));
Exit:
@@ -817,7 +817,7 @@
/* limit "dimension" to 0..1 */
if ( dimension > 1 )
{
- FT_TRACE0(( "ps_hints_stem: invalid dimension (%u) used\n",
+ FT_TRACE0(( "ps_hints_stem: invalid dimension (%d) used\n",
dimension ));
dimension = ( dimension != 0 );
}
@@ -870,7 +870,7 @@
/* limit "dimension" to 0..1 */
if ( dimension > 1 )
{
- FT_TRACE0(( "ps_hints_t1stem3: invalid dimension (%u) used\n",
+ FT_TRACE0(( "ps_hints_t1stem3: invalid dimension (%d) used\n",
dimension ));
dimension = ( dimension != 0 );
}
@@ -976,7 +976,7 @@
if ( bit_count != count1 + count2 )
{
FT_TRACE0(( "ps_hints_t2mask:"
- " called with invalid bitcount %u (instead of %u)\n",
+ " called with invalid bitcount %d (instead of %d)\n",
bit_count, count1 + count2 ));
/* simply ignore the operator */
@@ -1022,7 +1022,7 @@
if ( bit_count != count1 + count2 )
{
FT_TRACE0(( "ps_hints_t2counter:"
- " called with invalid bitcount %u (instead of %u)\n",
+ " called with invalid bitcount %d (instead of %d)\n",
bit_count, count1 + count2 ));
/* simply ignore the operator */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.h b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.h
index a79069f98d..7e375af7ba 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/pshinter/pshrec.h
@@ -4,7 +4,7 @@
*
* Postscript (Type1/Type2) hints recorder (specification).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.c b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.c
index c5d71edad8..35d054d1cf 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
*
* psnames module implementation (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.h b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.h
index 482fd0a36d..770458316b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psmodule.h
@@ -4,7 +4,7 @@
*
* High-level psnames module interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psnamerr.h b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psnamerr.h
index 17987f9cd4..e123eb65e3 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psnamerr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/psnamerr.h
@@ -4,7 +4,7 @@
*
* PS names module error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/pstables.h b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/pstables.h
index 65ce6c0b47..2a941b0460 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/psnames/pstables.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/psnames/pstables.h
@@ -4,7 +4,7 @@
*
* PostScript glyph names.
*
- * Copyright (C) 2005-2025 by
+ * Copyright (C) 2005-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftmisc.h b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftmisc.h
index 9d97223e94..943f2aa0a5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftmisc.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftmisc.h
@@ -5,7 +5,7 @@
* Miscellaneous macros for stand-alone rasterizer (specification
* only).
*
- * Copyright (C) 2005-2025 by
+ * Copyright (C) 2005-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.c b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.c
index 807d444e7a..e4b7b937d5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.c
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -251,11 +251,7 @@
/* On the other hand, SMulDiv means `Slow MulDiv', and is used typically */
/* for clipping computations. It simply uses the FT_MulDiv() function */
/* defined in `ftcalc.h'. */
-#ifdef FT_INT64
-#define SMulDiv( a, b, c ) (Long)( (FT_Int64)(a) * (b) / (c) )
-#else
-#define SMulDiv FT_MulDiv_No_Round
-#endif
+#define SMulDiv_No_Round FT_MulDiv_No_Round
/* The rasterizer is a very general purpose component; please leave */
/* the following redefinitions there (you never know your target */
@@ -657,7 +653,7 @@
ras.cProfile->height = 0;
}
- ras.cProfile->flags = ras.dropOutControl;
+ ras.cProfile->flags = ras.dropOutControl;
switch ( aState )
{
@@ -971,14 +967,14 @@
goto Fin;
}
- Ix = SMulDiv( e - y1, Dx, Dy );
+ Ix = SMulDiv_No_Round( e - y1, Dx, Dy );
x1 += Ix;
*top++ = x1;
if ( --size )
{
Ax = Dx * ( e - y1 ) - Dy * Ix; /* remainder */
- Ix = SMulDiv( ras.precision, Dx, Dy );
+ Ix = FMulDiv( ras.precision, Dx, Dy );
Rx = Dx * ras.precision - Dy * Ix; /* remainder */
Dx = 1;
@@ -1094,8 +1090,8 @@
PLong top;
- y1 = arc[degree].y;
- y2 = arc[0].y;
+ y1 = arc[degree].y;
+ y2 = arc[0].y;
if ( y2 < miny || y1 > maxy )
return SUCCESS;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.h b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.h
index 64499bf955..ad9cb1b9fe 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftraster.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.c b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.c
index 3fa008704e..fd9f174f2e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.c
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer interface (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.h b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.h
index d838a942b0..cf3e73c0a2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/raster/ftrend1.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/raster/rasterrs.h b/jdk/src/share/native/sun/awt/libfreetype/src/raster/rasterrs.h
index 39d82a8051..326d42e043 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/raster/rasterrs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/raster/rasterrs.h
@@ -4,7 +4,7 @@
*
* monochrome renderer error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.c
index 24fb345559..76181568af 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.c
@@ -4,7 +4,7 @@
*
* PNG Bitmap glyph support.
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* Google, Inc.
* Written by Stuart Gill and Behdad Esfahbod.
*
@@ -420,7 +420,10 @@
if ( populate_map_and_metrics )
{
/* this doesn't overflow: 0x7FFF * 0x7FFF * 4 < 2^32 */
- error = ft_glyphslot_alloc_bitmap( slot );
+ FT_ULong size = map->rows * (FT_ULong)map->pitch;
+
+
+ error = ft_glyphslot_alloc_bitmap( slot, size );
if ( error )
goto DestroyExit;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.h
index c59199e60d..6e7a5c08e7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/pngshim.h
@@ -4,7 +4,7 @@
*
* PNG Bitmap glyph support.
*
- * Copyright (C) 2013-2025 by
+ * Copyright (C) 2013-2024 by
* Google, Inc.
* Written by Stuart Gill and Behdad Esfahbod.
*
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.c
index 32291e23e3..81072207b4 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
*
* High-level SFNT driver interface (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -895,7 +895,7 @@
FT_TRACE0(( "sfnt_get_var_ps_name:"
" Shortening variation PS name prefix\n" ));
FT_TRACE0(( " "
- " to %u characters\n", len ));
+ " to %d characters\n", len ));
}
face->var_postscript_prefix = result;
@@ -1142,7 +1142,12 @@
FT_Error error;
- /* We expect that a bitmap strike has been selected. */
+ /* XXX: I don't know whether this is correct, since
+ * tt_face_find_bdf_prop only returns something correct if we have
+ * previously selected a size that is listed in the BDF table.
+ * Should we change the BDF table format to include single offsets
+ * for `CHARSET_REGISTRY' and `CHARSET_ENCODING'?
+ */
error = tt_face_find_bdf_prop( face, "CHARSET_REGISTRY", ®istry );
if ( !error )
{
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.h
index be4e33166c..6f71489fdc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfdriver.h
@@ -4,7 +4,7 @@
*
* High-level SFNT driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sferrors.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sferrors.h
index 2da4ac776b..d3ca1d9aa8 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sferrors.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sferrors.h
@@ -4,7 +4,7 @@
*
* SFNT error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.c
index 6af35787e8..6ee4e5e939 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
*
* SFNT object management (base).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -579,9 +579,6 @@
if ( face_instance_index < 0 && face_index > 0 )
face_index--;
- /* Note that `face_index` is also used to enumerate elements */
- /* of containers like a Mac Resource; this means we must */
- /* check whether we actually have a TTC. */
if ( face_index >= face->ttc_header.count )
{
if ( face_instance_index >= 0 )
@@ -1130,9 +1127,9 @@
flags |= FT_FACE_FLAG_VERTICAL;
/* kerning available ? */
- if ( face->kern_avail_bits
+ if ( TT_FACE_HAS_KERNING( face )
#ifdef TT_CONFIG_OPTION_GPOS_KERNING
- || face->num_gpos_lookups_kerning
+ || face->gpos_kerning_available
#endif
)
flags |= FT_FACE_FLAG_KERNING;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.h
index 8c38b72795..90847d9573 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfobjs.h
@@ -4,7 +4,7 @@
*
* SFNT object management (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.c
index 015c7b78b4..14514bf957 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.c
@@ -4,7 +4,7 @@
*
* WOFF format management (base).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.h
index df7ace5c20..a04735ffe2 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff.h
@@ -4,7 +4,7 @@
*
* WOFFF format management (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.c
index 41c233597b..589b3e0c6b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.c
@@ -4,7 +4,7 @@
*
* WOFF2 format management (base).
*
- * Copyright (C) 2019-2025 by
+ * Copyright (C) 2019-2024 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -902,7 +902,7 @@
substreams[i].offset = pos + offset;
substreams[i].size = substream_size;
- FT_TRACE5(( " Substream %u: offset = %lu; size = %lu;\n",
+ FT_TRACE5(( " Substream %d: offset = %lu; size = %lu;\n",
i, substreams[i].offset, substreams[i].size ));
offset += substream_size;
}
@@ -1043,6 +1043,7 @@
FT_ULong total_n_points = 0;
FT_UShort n_points_contour;
FT_UInt j;
+ FT_ULong flag_size;
FT_ULong triplet_size;
FT_ULong triplet_bytes_used;
FT_Bool have_overlap = FALSE;
@@ -1087,8 +1088,8 @@
}
substreams[N_POINTS_STREAM].offset = FT_STREAM_POS();
- points_size += total_n_points;
- if ( points_size > substreams[FLAG_STREAM].size )
+ flag_size = total_n_points;
+ if ( flag_size > substreams[FLAG_STREAM].size )
goto Fail;
flags_buf = stream->base + substreams[FLAG_STREAM].offset;
@@ -1105,7 +1106,8 @@
triplet_bytes_used = 0;
/* Create array to store point information. */
- if ( FT_QNEW_ARRAY( points, total_n_points ) )
+ points_size = total_n_points;
+ if ( FT_QNEW_ARRAY( points, points_size ) )
goto Fail;
if ( triplet_decode( flags_buf,
@@ -1116,7 +1118,7 @@
&triplet_bytes_used ) )
goto Fail;
- substreams[FLAG_STREAM].offset += total_n_points;
+ substreams[FLAG_STREAM].offset += flag_size;
substreams[GLYPH_STREAM].offset += triplet_bytes_used;
if ( FT_STREAM_SEEK( substreams[GLYPH_STREAM].offset ) ||
@@ -1590,7 +1592,7 @@
WOFF2_TableRec table = *( indices[nn] );
- FT_TRACE3(( "Seeking to %lu with table size %lu.\n",
+ FT_TRACE3(( "Seeking to %ld with table size %ld.\n",
table.src_offset, table.src_length ));
FT_TRACE3(( "Table tag: %c%c%c%c.\n",
(FT_Char)( table.Tag >> 24 ),
@@ -1941,7 +1943,7 @@
src_offset += table->TransformLength;
table->dst_offset = 0;
- FT_TRACE2(( " %c%c%c%c %08d %08d %08lu %08lu %08lu\n",
+ FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld %08ld\n",
(FT_Char)( table->Tag >> 24 ),
(FT_Char)( table->Tag >> 16 ),
(FT_Char)( table->Tag >> 8 ),
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.h
index 588761d0c8..f41140648d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/sfwoff2.h
@@ -4,7 +4,7 @@
*
* WOFFF2 format management (specification).
*
- * Copyright (C) 2019-2025 by
+ * Copyright (C) 2019-2024 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.c
index 91b0234422..28f4d1173c 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
*
* TrueType character mapping table (cmap) support (body).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -179,7 +179,7 @@
cmap_info->format = 0;
- cmap_info->language = TT_PEEK_USHORT( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
return FT_Err_Ok;
}
@@ -596,7 +596,7 @@
cmap_info->format = 2;
- cmap_info->language = TT_PEEK_USHORT( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
return FT_Err_Ok;
}
@@ -1539,7 +1539,7 @@
cmap_info->format = 4;
- cmap_info->language = TT_PEEK_USHORT( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
return FT_Err_Ok;
}
@@ -1712,7 +1712,7 @@
cmap_info->format = 6;
- cmap_info->language = TT_PEEK_USHORT( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_USHORT( p );
return FT_Err_Ok;
}
@@ -2009,7 +2009,7 @@
cmap_info->format = 8;
- cmap_info->language = TT_PEEK_ULONG( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
return FT_Err_Ok;
}
@@ -2184,7 +2184,7 @@
cmap_info->format = 10;
- cmap_info->language = TT_PEEK_ULONG( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
return FT_Err_Ok;
}
@@ -2528,7 +2528,7 @@
cmap_info->format = 12;
- cmap_info->language = TT_PEEK_ULONG( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
return FT_Err_Ok;
}
@@ -2844,7 +2844,7 @@
cmap_info->format = 13;
- cmap_info->language = TT_PEEK_ULONG( p );
+ cmap_info->language = (FT_ULong)TT_PEEK_ULONG( p );
return FT_Err_Ok;
}
@@ -3792,7 +3792,7 @@
return FT_THROW( Invalid_Table );
/* Version 1.8.3 of the OpenType specification contains the following */
- /* (https://learn.microsoft.com/typography/opentype/spec/cmap): */
+ /* (https://docs.microsoft.com/en-us/typography/opentype/spec/cmap): */
/* */
/* The 'cmap' table version number remains at 0x0000 for fonts that */
/* make use of the newer subtable formats. */
@@ -3803,7 +3803,7 @@
p += 2;
num_cmaps = TT_NEXT_USHORT( p );
- FT_TRACE4(( "tt_face_build_cmaps: %u cmaps\n", num_cmaps ));
+ FT_TRACE4(( "tt_face_build_cmaps: %d cmaps\n", num_cmaps ));
limit = table + face->cmap_size;
for ( ; num_cmaps > 0 && p + 8 <= limit; num_cmaps-- )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.h
index 645e9e37e0..e2c5e72bf0 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmap.h
@@ -4,7 +4,7 @@
*
* TrueType character mapping table (cmap) support (specification).
*
- * Copyright (C) 2002-2025 by
+ * Copyright (C) 2002-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmapc.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmapc.h
index 65807bb737..370898363f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmapc.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcmapc.h
@@ -4,7 +4,7 @@
*
* TT CMAP classes definitions (specification only).
*
- * Copyright (C) 2009-2025 by
+ * Copyright (C) 2009-2024 by
* Oran Agra and Mickey Gabel.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.c
index 7929b7aaf4..b37658dde9 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType colored glyph layer support (body).
*
- * Copyright (C) 2018-2025 by
+ * Copyright (C) 2018-2024 by
* David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
@@ -51,7 +51,7 @@
#define COLOR_STOP_SIZE 6U
#define VAR_IDX_BASE_SIZE 4U
#define LAYER_SIZE 4U
-/* https://learn.microsoft.com/typography/opentype/spec/colr#colr-header */
+/* https://docs.microsoft.com/en-us/typography/opentype/spec/colr#colr-header */
/* 3 * uint16 + 2 * Offset32 */
#define COLRV0_HEADER_SIZE 14U
/* COLRV0_HEADER_SIZE + 5 * Offset32 */
@@ -1749,6 +1749,7 @@
FT_UInt x, y;
FT_Byte b, g, r, alpha;
+ FT_ULong size;
FT_Byte* src;
FT_Byte* dst;
@@ -1766,9 +1767,13 @@
dstSlot->bitmap.pitch = (int)dstSlot->bitmap.width * 4;
dstSlot->bitmap.num_grays = 256;
- error = ft_glyphslot_alloc_bitmap( dstSlot );
+ size = dstSlot->bitmap.rows * (unsigned int)dstSlot->bitmap.pitch;
+
+ error = ft_glyphslot_alloc_bitmap( dstSlot, size );
if ( error )
return error;
+
+ FT_MEM_ZERO( dstSlot->bitmap.buffer, size );
}
else
{
@@ -1800,7 +1805,8 @@
FT_Byte* q;
- if ( FT_ALLOC_MULT( buf, rows, pitch ) )
+ size = rows * pitch;
+ if ( FT_ALLOC( buf, size ) )
return error;
p = dstSlot->bitmap.buffer;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.h
index 3913acc74d..30031464c7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcolr.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType colored glyph layer support (specification).
*
- * Copyright (C) 2018-2025 by
+ * Copyright (C) 2018-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.c
index 6d1208f6af..997eb869ff 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType color palette support (body).
*
- * Copyright (C) 2018-2025 by
+ * Copyright (C) 2018-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.h
index a0b4c9d927..bb301ae88b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttcpal.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType color palette support (specification).
*
- * Copyright (C) 2018-2025 by
+ * Copyright (C) 2018-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.c
index 76618b0d3b..f0411366af 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.c
@@ -2,9 +2,10 @@
*
* ttkern.c
*
- * Routines to parse and access the 'kern' table for kerning (body).
+ * Load the basic TrueType kerning table. This doesn't handle
+ * kerning data within the GPOS table at the moment.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.h
index e0075dce61..a54e51df12 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttkern.h
@@ -2,10 +2,10 @@
*
* ttkern.h
*
- * Routines to parse and access the 'kern' table for kerning
- * (specification).
+ * Load the basic TrueType kerning table. This doesn't handle
+ * kerning data within the GPOS table at the moment.
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -40,6 +40,8 @@ FT_BEGIN_HEADER
FT_UInt left_glyph,
FT_UInt right_glyph );
+#define TT_FACE_HAS_KERNING( face ) ( (face)->kern_avail_bits != 0 )
+
FT_END_HEADER
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.c
index 0c257ce4d3..c3a5fae2cb 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.c
@@ -5,7 +5,7 @@
* Load the basic TrueType tables, i.e., tables that can be either in
* TTF or OTF fonts (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -535,8 +535,7 @@
* The tag of table to load. Use the value 0 if you want
* to access the whole font file, else set this parameter
* to a valid TrueType table tag that you can forge with
- * the MAKE_TT_TAG macro. Use value 1 to access the table
- * directory.
+ * the MAKE_TT_TAG macro.
*
* offset ::
* The starting offset in the table (or the file if
@@ -578,29 +577,7 @@
FT_ULong size;
- if ( tag == 0 )
- {
- /* The whole font file. */
- size = face->root.stream->size;
- }
- else if ( tag == 1 )
- {
- /* The currently selected font's table directory. */
- /* */
- /* Note that `face_index` is also used to enumerate elements */
- /* of containers like a Mac Resource; this means we must */
- /* check whether we actually have a TTC (with multiple table */
- /* directories). */
- FT_Long idx = face->root.face_index & 0xFFFF;
-
-
- if ( idx >= face->ttc_header.count )
- idx = 0;
-
- offset += face->ttc_header.offsets[idx];
- size = 4 + 8 + 16 * face->num_tables;
- }
- else
+ if ( tag != 0 )
{
/* look for tag in font directory */
table = tt_face_lookup_table( face, tag );
@@ -613,6 +590,9 @@
offset += table->Offset;
size = table->Length;
}
+ else
+ /* tag == 0 -- the user wants to access the font file directly */
+ size = face->root.stream->size;
if ( length && *length == 0 )
{
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.h
index e3666c901b..2b1d62d9bd 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttload.h
@@ -5,7 +5,7 @@
* Load the basic TrueType tables, i.e., tables that can be either in
* TTF or OTF fonts (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.c
index 541d844747..2788411856 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
*
* Load the metrics tables common to TTF and OTF fonts (body).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -306,7 +306,7 @@
}
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( var && FT_IS_VARIATION( &face->root ) )
+ if ( var && face->blend )
{
FT_Face f = FT_FACE( face );
FT_Int a = (FT_Int)*aadvance;
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.h
index 1ee84507f1..34b3c0e18f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttmtx.h
@@ -4,7 +4,7 @@
*
* Load the metrics tables common to TTF and OTF fonts (specification).
*
- * Copyright (C) 2006-2025 by
+ * Copyright (C) 2006-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.c
index 4246b6c8ef..5698a62c8d 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.c
@@ -5,7 +5,7 @@
* PostScript name table processing for TrueType and OpenType fonts
* (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.h
index a11b669685..150db6c398 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttpost.h
@@ -5,7 +5,7 @@
* PostScript name table processing for TrueType and OpenType fonts
* (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.c
index 34e4561981..cb3a8abf18 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType embedded bitmap support (body).
*
- * Copyright (C) 2005-2025 by
+ * Copyright (C) 2005-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Copyright 2013 by Google, Inc.
@@ -342,7 +342,7 @@
FT_TRACE2(( "tt_face_load_strike_metrics:"
" sanitizing invalid ascender and descender\n" ));
FT_TRACE2(( " "
- " values for strike %lu (%dppem, %dppem)\n",
+ " values for strike %ld (%dppem, %dppem)\n",
strike_index,
metrics->x_ppem, metrics->y_ppem ));
@@ -547,6 +547,7 @@
FT_Error error = FT_Err_Ok;
FT_UInt width, height;
FT_Bitmap* map = decoder->bitmap;
+ FT_ULong size;
if ( !decoder->metrics_loaded )
@@ -598,11 +599,17 @@
goto Exit;
}
+ size = map->rows * (FT_ULong)map->pitch;
+
+ /* check that there is no empty image */
+ if ( size == 0 )
+ goto Exit; /* exit successfully! */
+
if ( metrics_only )
goto Exit; /* only metrics are requested */
- error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph );
- if ( error || !map->buffer )
+ error = ft_glyphslot_alloc_bitmap( decoder->face->root.glyph, size );
+ if ( error )
goto Exit;
decoder->bitmap_allocated = 1;
@@ -986,7 +993,7 @@
goto Fail;
}
- FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %u component%s\n",
+ FT_TRACE3(( "tt_sbit_decoder_load_compound: loading %d component%s\n",
num_components,
num_components == 1 ? "" : "s" ));
@@ -1412,7 +1419,7 @@
image_start = image_offset + image_start;
FT_TRACE3(( "tt_sbit_decoder_load_image:"
- " found sbit (format %u) for glyph index %u\n",
+ " found sbit (format %d) for glyph index %d\n",
image_format, glyph_index ));
return tt_sbit_decoder_load_bitmap( decoder,
@@ -1431,13 +1438,13 @@
if ( recurse_count )
{
FT_TRACE4(( "tt_sbit_decoder_load_image:"
- " missing subglyph sbit with glyph index %u\n",
+ " missing subglyph sbit with glyph index %d\n",
glyph_index ));
return FT_THROW( Invalid_Composite );
}
FT_TRACE4(( "tt_sbit_decoder_load_image:"
- " no sbit found for glyph index %u\n", glyph_index ));
+ " no sbit found for glyph index %d\n", glyph_index ));
return FT_THROW( Missing_Bitmap );
}
@@ -1455,13 +1462,12 @@
FT_Int originOffsetX, originOffsetY;
FT_Tag graphicType;
FT_Int recurse_depth = 0;
- FT_Bool flipped = FALSE;
FT_Error error;
FT_Byte* p;
-#ifndef FT_CONFIG_OPTION_USE_PNG
FT_UNUSED( map );
+#ifndef FT_CONFIG_OPTION_USE_PNG
FT_UNUSED( metrics_only );
#endif
@@ -1511,16 +1517,12 @@
switch ( graphicType )
{
- case FT_MAKE_TAG( 'f', 'l', 'i', 'p' ):
- flipped = !flipped;
- FALL_THROUGH;
-
case FT_MAKE_TAG( 'd', 'u', 'p', 'e' ):
- if ( recurse_depth++ < 4 )
+ if ( recurse_depth < 4 )
{
glyph_index = FT_GET_USHORT();
FT_FRAME_EXIT();
-
+ recurse_depth++;
goto retry;
}
error = FT_THROW( Invalid_File_Format );
@@ -1538,38 +1540,6 @@
glyph_end - glyph_start - 8,
TRUE,
metrics_only );
- if ( flipped && !metrics_only && !error )
- {
- FT_UInt32* curr_pos = (FT_UInt32*)map->buffer;
-
- /* `Load_SBit_Png` always returns a pixmap with 32 bits per pixel */
- /* and no extra pitch bytes. */
- FT_UInt width = map->width;
- FT_UInt y;
-
-
- for ( y = 0; y < map->rows; y++ )
- {
- FT_UInt32* left = curr_pos;
- FT_UInt32* right = curr_pos + width - 1;
-
-
- while ( left < right )
- {
- FT_UInt32 value;
-
-
- value = *right;
- *right = *left;
- *left = value;
-
- left++;
- right--;
- }
-
- curr_pos += width;
- }
- }
#else
error = FT_THROW( Unimplemented_Feature );
#endif
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.h
index 7427149d68..96f80a5842 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/ttsbit.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType embedded bitmap support (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.c b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.c
index 0f9e3889aa..532ccfa173 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.c
@@ -4,7 +4,7 @@
*
* WOFF2 Font table tags (base).
*
- * Copyright (C) 2019-2025 by
+ * Copyright (C) 2019-2024 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.h b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.h
index e223022962..d03b4b41bc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/sfnt/woff2tags.h
@@ -4,7 +4,7 @@
*
* WOFF2 Font table tags (specification).
*
- * Copyright (C) 2019-2025 by
+ * Copyright (C) 2019-2024 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.c b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.c
index 3c387aea0a..b7c0632a6f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
*
* A new `perfect' anti-aliasing renderer (body).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -157,6 +157,10 @@
#define ft_memset memset
+#define ft_setjmp setjmp
+#define ft_longjmp longjmp
+#define ft_jmp_buf jmp_buf
+
typedef ptrdiff_t FT_PtrDist;
@@ -166,8 +170,8 @@ typedef ptrdiff_t FT_PtrDist;
#define Smooth_Err_Invalid_Argument -3
#define Smooth_Err_Raster_Overflow -4
-#define FT_BEGIN_HEADER /* nothing */
-#define FT_END_HEADER /* nothing */
+#define FT_BEGIN_HEADER
+#define FT_END_HEADER
#include "ftimage.h"
#include "ftgrays.h"
@@ -491,7 +495,6 @@ typedef ptrdiff_t FT_PtrDist;
TCoord min_ey, max_ey;
TCoord count_ey; /* same as (max_ey - min_ey) */
- int error; /* pool overflow exception */
PCell cell; /* current cell */
PCell cell_free; /* call allocation next free slot */
PCell cell_null; /* last cell, used as dumpster and limit */
@@ -507,6 +510,8 @@ typedef ptrdiff_t FT_PtrDist;
FT_Raster_Span_Func render_span;
void* render_span_data;
+ ft_jmp_buf jump_buffer;
+
} gray_TWorker, *gray_PWorker;
#if defined( _MSC_VER )
@@ -608,14 +613,9 @@ typedef ptrdiff_t FT_PtrDist;
}
/* insert new cell */
- cell = ras.cell_free;
- if ( cell == ras.cell_null )
- {
- ras.error = FT_THROW( Raster_Overflow );
- goto Found;
- }
-
- ras.cell_free = cell + 1;
+ cell = ras.cell_free++;
+ if ( cell >= ras.cell_null )
+ ft_longjmp( ras.jump_buffer, 1 );
cell->x = ex;
cell->area = 0;
@@ -1353,8 +1353,7 @@ typedef ptrdiff_t FT_PtrDist;
ras.x = x;
ras.y = y;
-
- return ras.error;
+ return 0;
}
@@ -1366,8 +1365,7 @@ typedef ptrdiff_t FT_PtrDist;
gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) );
-
- return ras.error;
+ return 0;
}
@@ -1380,8 +1378,7 @@ typedef ptrdiff_t FT_PtrDist;
gray_render_conic( RAS_VAR_ control, to );
-
- return ras.error;
+ return 0;
}
@@ -1395,8 +1392,7 @@ typedef ptrdiff_t FT_PtrDist;
gray_render_cubic( RAS_VAR_ control1, control2, to );
-
- return ras.error;
+ return 0;
}
@@ -1704,22 +1700,30 @@ typedef ptrdiff_t FT_PtrDist;
gray_convert_glyph_inner( RAS_ARG_
int continued )
{
- int error;
+ volatile int error;
- if ( continued )
- FT_Trace_Disable();
- error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
- if ( continued )
- FT_Trace_Enable();
+ if ( ft_setjmp( ras.jump_buffer ) == 0 )
+ {
+ if ( continued )
+ FT_Trace_Disable();
+ error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras );
+ if ( continued )
+ FT_Trace_Enable();
+
+ FT_TRACE7(( "band [%d..%d]: %td cell%s remaining\n",
+ ras.min_ey,
+ ras.max_ey,
+ ras.cell_null - ras.cell_free,
+ ras.cell_null - ras.cell_free == 1 ? "" : "s" ));
+ }
+ else
+ {
+ error = FT_THROW( Raster_Overflow );
- FT_TRACE7(( error == Smooth_Err_Raster_Overflow
- ? "band [%d..%d]: to be bisected\n"
- : "band [%d..%d]: %td cell%s remaining\n",
- ras.min_ey,
- ras.max_ey,
- ras.cell_null - ras.cell_free,
- ras.cell_null - ras.cell_free == 1 ? "" : "s" ));
+ FT_TRACE7(( "band [%d..%d]: to be bisected\n",
+ ras.min_ey, ras.max_ey ));
+ }
return error;
}
@@ -1804,7 +1808,7 @@ typedef ptrdiff_t FT_PtrDist;
FT_FILL_RULE( coverage, cover, fill );
span[n].coverage = (unsigned char)coverage;
- span[n].x = (unsigned short)x;
+ span[n].x = (short)x;
span[n].len = (unsigned short)( cell->x - x );
if ( ++n == FT_MAX_GRAY_SPANS )
@@ -1823,7 +1827,7 @@ typedef ptrdiff_t FT_PtrDist;
FT_FILL_RULE( coverage, area, fill );
span[n].coverage = (unsigned char)coverage;
- span[n].x = (unsigned short)cell->x;
+ span[n].x = (short)cell->x;
span[n].len = 1;
if ( ++n == FT_MAX_GRAY_SPANS )
@@ -1869,7 +1873,6 @@ typedef ptrdiff_t FT_PtrDist;
TCoord* band;
int continued = 0;
- int error = Smooth_Err_Ok;
/* Initialize the null cell at the end of the poll. */
@@ -1904,6 +1907,7 @@ typedef ptrdiff_t FT_PtrDist;
do
{
TCoord i;
+ int error;
ras.min_ex = band[1];
@@ -1918,7 +1922,6 @@ typedef ptrdiff_t FT_PtrDist;
ras.cell_free = buffer + n;
ras.cell = ras.cell_null;
- ras.error = Smooth_Err_Ok;
error = gray_convert_glyph_inner( RAS_VAR_ continued );
continued = 1;
@@ -1933,7 +1936,7 @@ typedef ptrdiff_t FT_PtrDist;
continue;
}
else if ( error != Smooth_Err_Raster_Overflow )
- goto Exit;
+ return error;
/* render pool overflow; we will reduce the render band by half */
i = ( band[0] - band[1] ) >> 1;
@@ -1942,8 +1945,7 @@ typedef ptrdiff_t FT_PtrDist;
if ( i == 0 )
{
FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" ));
- error = FT_THROW( Raster_Overflow );
- goto Exit;
+ return FT_THROW( Raster_Overflow );
}
band++;
@@ -1952,11 +1954,7 @@ typedef ptrdiff_t FT_PtrDist;
} while ( band >= bands );
}
- Exit:
- ras.cell = ras.cell_free = ras.cell_null = NULL;
- ras.ycells = NULL;
-
- return error;
+ return Smooth_Err_Ok;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.h b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.h
index e463e5b3eb..940fbe8c79 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftgrays.h
@@ -4,7 +4,7 @@
*
* FreeType smooth renderer declaration
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,6 +19,11 @@
#ifndef FTGRAYS_H_
#define FTGRAYS_H_
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
#ifdef STANDALONE_
#include "ftimage.h"
#else
@@ -26,7 +31,6 @@
#include <freetype/ftimage.h>
#endif
-FT_BEGIN_HEADER
/**************************************************************************
*
@@ -42,7 +46,10 @@ FT_BEGIN_HEADER
FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster;
-FT_END_HEADER
+
+#ifdef __cplusplus
+ }
+#endif
#endif /* FTGRAYS_H_ */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmerrs.h b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmerrs.h
index 8d5068549f..6d41fb8e0f 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmerrs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmerrs.h
@@ -4,7 +4,7 @@
*
* smooth renderer error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.c b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.c
index 5a7a852a61..f0acc1ea4a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
*
* Anti-aliasing renderer interface (body).
*
- * Copyright (C) 2000-2025 by
+ * Copyright (C) 2000-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -80,7 +80,6 @@
{
unsigned char* origin; /* pixmap origin at the bottom-left */
int pitch; /* pitch to go down one row */
- unsigned char wght[5]; /* filtering weights */
} TOrigin;
@@ -275,32 +274,6 @@
}
- /* This function applies a horizontal filter in direct rendering mode */
- static void
- ft_smooth_lcd_spans( int y,
- int count,
- const FT_Span* spans,
- void* target_ ) /* TOrigin* */
- {
- TOrigin* target = (TOrigin*)target_;
-
- unsigned char* dst_line = target->origin - y * target->pitch - 2;
- unsigned char* dst;
- unsigned short w;
-
-
- for ( ; count--; spans++ )
- for ( dst = dst_line + spans->x, w = spans->len; w--; dst++ )
- {
- dst[0] += ( spans->coverage * target->wght[0] + 85 ) >> 8;
- dst[1] += ( spans->coverage * target->wght[1] + 85 ) >> 8;
- dst[2] += ( spans->coverage * target->wght[2] + 85 ) >> 8;
- dst[3] += ( spans->coverage * target->wght[3] + 85 ) >> 8;
- dst[4] += ( spans->coverage * target->wght[4] + 85 ) >> 8;
- }
- }
-
-
static FT_Error
ft_smooth_raster_lcd( FT_Renderer render,
FT_Outline* outline,
@@ -312,47 +285,11 @@
FT_Vector* vec;
FT_Raster_Params params;
- TOrigin target;
-
-
- if ( render->root.library->lcd_weights[2] )
- {
- /* Reject outlines that are too wide for 16-bit FT_Span. */
- /* Other limits are applied upstream with the same error code. */
- if ( bitmap->width > 0x7FFF )
- return FT_THROW( Raster_Overflow );
-
- /* Set up direct rendering for instant filtering. */
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
- params.gray_spans = ft_smooth_lcd_spans;
- params.user = ⌖
-
- params.clip_box.xMin = 0;
- params.clip_box.yMin = 0;
- params.clip_box.xMax = bitmap->width;
- params.clip_box.yMax = bitmap->rows;
-
- if ( bitmap->pitch < 0 )
- target.origin = bitmap->buffer;
- else
- target.origin = bitmap->buffer
- + ( bitmap->rows - 1 ) * (unsigned int)bitmap->pitch;
- target.pitch = bitmap->pitch;
- target.wght[0] = render->root.library->lcd_weights[0];
- target.wght[1] = render->root.library->lcd_weights[1];
- target.wght[2] = render->root.library->lcd_weights[2];
- target.wght[3] = render->root.library->lcd_weights[3];
- target.wght[4] = render->root.library->lcd_weights[4];
- }
- else
- {
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA;
- }
+ params.target = bitmap;
+ params.source = outline;
+ params.flags = FT_RASTER_FLAG_AA;
/* implode outline */
for ( vec = points; vec < points_end; vec++ )
@@ -369,32 +306,6 @@
}
- /* This function applies a vertical filter in direct rendering mode */
- static void
- ft_smooth_lcdv_spans( int y,
- int count,
- const FT_Span* spans,
- void* target_ ) /* TOrigin* */
- {
- TOrigin* target = (TOrigin*)target_;
-
- int pitch = target->pitch;
- unsigned char* dst_line = target->origin - ( y + 2 ) * pitch;
- unsigned char* dst;
- unsigned short w;
-
-
- for ( ; count--; spans++ )
- for ( dst = dst_line + spans->x, w = spans->len; w--; dst++ )
- {
- dst[ 0] += ( spans->coverage * target->wght[0] + 85 ) >> 8;
- dst[ pitch] += ( spans->coverage * target->wght[1] + 85 ) >> 8;
- dst[2 * pitch] += ( spans->coverage * target->wght[2] + 85 ) >> 8;
- dst[3 * pitch] += ( spans->coverage * target->wght[3] + 85 ) >> 8;
- dst[4 * pitch] += ( spans->coverage * target->wght[4] + 85 ) >> 8;
- }
- }
-
static FT_Error
ft_smooth_raster_lcdv( FT_Renderer render,
FT_Outline* outline,
@@ -406,42 +317,11 @@
FT_Vector* vec;
FT_Raster_Params params;
- TOrigin target;
-
- if ( render->root.library->lcd_weights[2] )
- {
- /* Set up direct rendering for instant filtering. */
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
- params.gray_spans = ft_smooth_lcdv_spans;
- params.user = ⌖
-
- params.clip_box.xMin = 0;
- params.clip_box.yMin = 0;
- params.clip_box.xMax = bitmap->width;
- params.clip_box.yMax = bitmap->rows;
-
- if ( bitmap->pitch < 0 )
- target.origin = bitmap->buffer;
- else
- target.origin = bitmap->buffer
- + ( bitmap->rows - 1 ) * (unsigned int)bitmap->pitch;
- target.pitch = bitmap->pitch;
-
- target.wght[0] = render->root.library->lcd_weights[0];
- target.wght[1] = render->root.library->lcd_weights[1];
- target.wght[2] = render->root.library->lcd_weights[2];
- target.wght[3] = render->root.library->lcd_weights[3];
- target.wght[4] = render->root.library->lcd_weights[4];
- }
- else
- {
- params.target = bitmap;
- params.source = outline;
- params.flags = FT_RASTER_FLAG_AA;
- }
+ params.target = bitmap;
+ params.source = outline;
+ params.flags = FT_RASTER_FLAG_AA;
/* implode outline */
for ( vec = points; vec < points_end; vec++ )
@@ -614,6 +494,12 @@
else
y_shift += 64 * (FT_Int)bitmap->rows;
+ if ( origin )
+ {
+ x_shift += origin->x;
+ y_shift += origin->y;
+ }
+
/* translate outline to render it into the bitmap */
if ( x_shift || y_shift )
FT_Outline_Translate( outline, x_shift, y_shift );
@@ -641,6 +527,33 @@
error = ft_smooth_raster_lcd ( render, outline, bitmap );
else if ( mode == FT_RENDER_MODE_LCD_V )
error = ft_smooth_raster_lcdv( render, outline, bitmap );
+
+#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+
+ /* finally apply filtering */
+ {
+ FT_Byte* lcd_weights;
+ FT_Bitmap_LcdFilterFunc lcd_filter_func;
+
+
+ /* Per-face LCD filtering takes priority if set up. */
+ if ( slot->face && slot->face->internal->lcd_filter_func )
+ {
+ lcd_weights = slot->face->internal->lcd_weights;
+ lcd_filter_func = slot->face->internal->lcd_filter_func;
+ }
+ else
+ {
+ lcd_weights = slot->library->lcd_weights;
+ lcd_filter_func = slot->library->lcd_filter_func;
+ }
+
+ if ( lcd_filter_func )
+ lcd_filter_func( bitmap, lcd_weights );
+ }
+
+#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+
}
Exit:
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.h b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.h
index f76708ae70..d7b61a9e60 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/smooth/ftsmooth.h
@@ -4,7 +4,7 @@
*
* Anti-aliasing renderer interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.c
index 6369d83d6d..4ab68eb9a1 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
*
* TrueType font driver implementation (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -220,12 +220,12 @@
{
/* Use 'kern' table if available since that can be faster; otherwise */
/* use GPOS kerning pairs if available. */
- if ( ttface->kern_avail_bits )
+ if ( ttface->kern_avail_bits != 0 )
kerning->x = sfnt->get_kerning( ttface,
left_glyph,
right_glyph );
#ifdef TT_CONFIG_OPTION_GPOS_KERNING
- else if ( ttface->num_gpos_lookups_kerning )
+ else if ( ttface->gpos_kerning_available )
kerning->x = sfnt->get_gpos_kerning( ttface,
left_glyph,
right_glyph );
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.h
index 943eaae348..3e1cf234fc 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttdriver.h
@@ -4,7 +4,7 @@
*
* High-level TrueType driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/tterrors.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/tterrors.h
index 631dbf5a80..7ad937bd04 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/tterrors.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/tterrors.h
@@ -4,7 +4,7 @@
*
* TrueType error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.c
index 4dd68ab101..b656ccf04e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
*
* TrueType Glyph Loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -660,7 +660,7 @@
} while ( subglyph->flags & MORE_COMPONENTS );
gloader->current.num_subglyphs = num_subglyphs;
- FT_TRACE5(( " %u component%s\n",
+ FT_TRACE5(( " %d component%s\n",
num_subglyphs,
num_subglyphs > 1 ? "s" : "" ));
@@ -674,7 +674,7 @@
for ( i = 0; i < num_subglyphs; i++ )
{
if ( num_subglyphs > 1 )
- FT_TRACE7(( " subglyph %u:\n", i ));
+ FT_TRACE7(( " subglyph %d:\n", i ));
FT_TRACE7(( " glyph index: %d\n", subglyph->index ));
@@ -777,11 +777,15 @@
TT_Hint_Glyph( TT_Loader loader,
FT_Bool is_composite )
{
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ TT_Face face = loader->face;
+ TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
+#endif
+
TT_GlyphZone zone = &loader->zone;
#ifdef TT_USE_BYTECODE_INTERPRETER
TT_ExecContext exec = loader->exec;
- TT_Size size = loader->size;
FT_Long n_ins = exec->glyphSize;
#else
FT_UNUSED( is_composite );
@@ -793,6 +797,9 @@
if ( n_ins > 0 )
FT_ARRAY_COPY( zone->org, zone->cur, zone->n_points );
+ /* Reset graphics state. */
+ exec->GS = loader->size->GS;
+
/* XXX: UNDOCUMENTED! Hinting instructions of a composite glyph */
/* completely refer to the (already) hinted subglyphs. */
if ( is_composite )
@@ -804,8 +811,8 @@
}
else
{
- exec->metrics.x_scale = size->metrics->x_scale;
- exec->metrics.y_scale = size->metrics->y_scale;
+ exec->metrics.x_scale = loader->size->metrics->x_scale;
+ exec->metrics.y_scale = loader->size->metrics->y_scale;
}
#endif
@@ -831,7 +838,7 @@
exec->is_composite = is_composite;
exec->pts = *zone;
- error = TT_Run_Context( exec, size );
+ error = TT_Run_Context( exec );
if ( error && exec->pedantic_hinting )
return error;
@@ -847,7 +854,8 @@
/* to change bearings or advance widths. */
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( exec->backward_compatibility )
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
+ exec->backward_compatibility )
return FT_Err_Ok;
#endif
@@ -1144,15 +1152,30 @@
x = FT_MulFix( x, x_scale );
y = FT_MulFix( y, y_scale );
- if ( subglyph->flags & ROUND_XY_TO_GRID &&
- IS_HINTED( loader->load_flags ) )
+ if ( subglyph->flags & ROUND_XY_TO_GRID )
{
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( !loader->exec->backward_compatibility )
-#endif
- x = FT_PIX_ROUND( x );
+ TT_Face face = loader->face;
+ TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
+
- y = FT_PIX_ROUND( y );
+ if ( IS_HINTED( loader->load_flags ) )
+ {
+ /*
+ * We round the horizontal offset only if there is hinting along
+ * the x axis; this corresponds to integer advance width values.
+ *
+ * Theoretically, a glyph's bytecode can toggle ClearType's
+ * `backward compatibility' mode, which would allow modification
+ * of the advance width. In reality, however, applications
+ * neither allow nor expect modified advance widths if subpixel
+ * rendering is active.
+ *
+ */
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_35 )
+ x = FT_PIX_ROUND( x );
+
+ y = FT_PIX_ROUND( y );
+ }
}
}
}
@@ -1181,6 +1204,8 @@
{
FT_Error error;
FT_Outline* outline = &loader->gloader->base.outline;
+ FT_Stream stream = loader->stream;
+ FT_UShort n_ins;
FT_UInt i;
@@ -1199,10 +1224,8 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
{
- TT_ExecContext exec = loader->exec;
+ TT_ExecContext exec = loader->exec;
FT_Memory memory = exec->memory;
- FT_Stream stream = loader->stream;
- FT_UShort n_ins;
if ( exec->glyphSize )
@@ -1355,9 +1378,8 @@
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
loader->exec &&
- loader->exec->mode != FT_RENDER_MODE_MONO &&
- loader->exec->mode != FT_RENDER_MODE_LCD &&
- loader->exec->mode != FT_RENDER_MODE_LCD_V )
+ loader->exec->subpixel_hinting_lean &&
+ loader->exec->grayscale_cleartype )
{
loader->pp3.x = loader->advance / 2;
loader->pp4.x = loader->advance / 2;
@@ -1422,13 +1444,13 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( recurse_count )
- FT_TRACE5(( " nesting level: %u\n", recurse_count ));
+ FT_TRACE5(( " nesting level: %d\n", recurse_count ));
#endif
/* some fonts have an incorrect value of `maxComponentDepth' */
if ( recurse_count > face->max_profile.maxComponentDepth )
{
- FT_TRACE1(( "load_truetype_glyph: maxComponentDepth set to %u\n",
+ FT_TRACE1(( "load_truetype_glyph: maxComponentDepth set to %d\n",
recurse_count ));
face->max_profile.maxComponentDepth = (FT_UShort)recurse_count;
}
@@ -1544,18 +1566,18 @@
if ( header_only )
goto Exit;
+ if ( loader->byte_len == 0 || loader->n_contours == 0 )
+ {
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- tt_get_metrics_incremental( loader, glyph_index );
+ tt_get_metrics_incremental( loader, glyph_index );
#endif
- tt_loader_set_pp( loader );
+ tt_loader_set_pp( loader );
- /* shortcut for empty glyphs */
- if ( loader->byte_len == 0 || loader->n_contours == 0 )
- {
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( !IS_DEFAULT_INSTANCE( FT_FACE( face ) ) )
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ||
+ FT_IS_VARIATION( FT_FACE( face ) ) )
{
/* a small outline structure with four elements for */
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
@@ -1605,6 +1627,11 @@
goto Exit;
}
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ tt_get_metrics_incremental( loader, glyph_index );
+#endif
+ tt_loader_set_pp( loader );
+
/***********************************************************************/
/***********************************************************************/
@@ -1708,7 +1735,8 @@
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- if ( !IS_DEFAULT_INSTANCE( FT_FACE( face ) ) )
+ if ( FT_IS_NAMED_INSTANCE( FT_FACE( face ) ) ||
+ FT_IS_VARIATION( FT_FACE( face ) ) )
{
FT_UShort i, limit;
FT_SubGlyph subglyph;
@@ -1925,9 +1953,6 @@
#ifdef FT_CONFIG_OPTION_INCREMENTAL
- /* restore the original stream */
- loader->stream = face->root.stream;
-
if ( glyph_data_loaded )
face->root.internal->incremental_interface->funcs->free_glyph_data(
face->root.internal->incremental_interface->object,
@@ -2087,6 +2112,7 @@
{
TT_Face face = (TT_Face)glyph->face;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
+ FT_Stream stream = face->root.stream;
FT_Error error;
TT_SBit_MetricsRec sbit_metrics;
@@ -2095,11 +2121,14 @@
size->strike_index,
glyph_index,
(FT_UInt)load_flags,
- face->root.stream,
+ stream,
&glyph->bitmap,
&sbit_metrics );
if ( !error )
{
+ glyph->outline.n_points = 0;
+ glyph->outline.n_contours = 0;
+
glyph->metrics.width = (FT_Pos)sbit_metrics.width * 64;
glyph->metrics.height = (FT_Pos)sbit_metrics.height * 64;
@@ -2124,50 +2153,6 @@
glyph->bitmap_top = sbit_metrics.horiBearingY;
}
}
- /* a missing glyph in a bitmap-only font is assumed whitespace */
- /* that needs to be constructed using metrics data from `hmtx' */
- /* and, optionally, `vmtx' tables */
- else if ( FT_ERR_EQ( error, Missing_Bitmap ) &&
- !FT_IS_SCALABLE( glyph->face ) &&
- face->horz_metrics_size )
- {
- FT_Fixed x_scale = size->root.metrics.x_scale;
- FT_Fixed y_scale = size->root.metrics.y_scale;
-
- FT_Short left_bearing = 0;
- FT_Short top_bearing = 0;
-
- FT_UShort advance_width = 0;
- FT_UShort advance_height = 0;
-
-
- TT_Get_HMetrics( face, glyph_index,
- &left_bearing,
- &advance_width );
- TT_Get_VMetrics( face, glyph_index,
- 0,
- &top_bearing,
- &advance_height );
-
- glyph->metrics.width = 0;
- glyph->metrics.height = 0;
-
- glyph->metrics.horiBearingX = FT_MulFix( left_bearing, x_scale );
- glyph->metrics.horiBearingY = 0;
- glyph->metrics.horiAdvance = FT_MulFix( advance_width, x_scale );
-
- glyph->metrics.vertBearingX = 0;
- glyph->metrics.vertBearingY = FT_MulFix( top_bearing, y_scale );
- glyph->metrics.vertAdvance = FT_MulFix( advance_height, y_scale );
-
- glyph->format = FT_GLYPH_FORMAT_BITMAP;
- glyph->bitmap.pixel_mode = FT_PIXEL_MODE_MONO;
-
- glyph->bitmap_left = 0;
- glyph->bitmap_top = 0;
-
- error = FT_Err_Ok;
- }
return error;
}
@@ -2183,6 +2168,15 @@
FT_Bool glyf_table_only )
{
TT_Face face = (TT_Face)glyph->face;
+ FT_Stream stream = face->root.stream;
+
+#ifdef TT_USE_BYTECODE_INTERPRETER
+ FT_Error error;
+ FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( glyph->face );
+#endif
+#endif
FT_ZERO( loader );
@@ -2192,80 +2186,122 @@
/* load execution context */
if ( IS_HINTED( load_flags ) && !glyf_table_only )
{
- FT_Error error;
TT_ExecContext exec;
- FT_Render_Mode mode = FT_LOAD_TARGET_MODE( load_flags );
- FT_Bool grayscale = FT_BOOL( mode != FT_RENDER_MODE_MONO );
- FT_Bool reexecute = FALSE;
+ FT_Bool grayscale = TRUE;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( glyph->face );
+ FT_Bool subpixel_hinting_lean;
+ FT_Bool grayscale_cleartype;
#endif
-
- if ( size->bytecode_ready > 0 )
- return size->bytecode_ready;
- if ( size->bytecode_ready < 0 )
- {
- FT_Bool pedantic = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
+ FT_Bool reexecute = FALSE;
- error = tt_size_init_bytecode( size, pedantic );
+ if ( size->bytecode_ready < 0 || size->cvt_ready < 0 )
+ {
+ error = tt_size_ready_bytecode( size, pedantic );
if ( error )
return error;
}
+ else if ( size->bytecode_ready )
+ return size->bytecode_ready;
+ else if ( size->cvt_ready )
+ return size->cvt_ready;
+ /* query new execution context */
exec = size->context;
+ if ( !exec )
+ return FT_THROW( Could_Not_Find_Context );
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* reset backward compatibility; note that */
- /* the CVT program always runs without it */
- exec->backward_compatibility = 0;
+ grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+ FT_RENDER_MODE_MONO );
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
{
- grayscale = FALSE;
+ subpixel_hinting_lean =
+ FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
+ FT_RENDER_MODE_MONO );
+ grayscale_cleartype =
+ FT_BOOL( subpixel_hinting_lean &&
+ !( ( load_flags &
+ FT_LOAD_TARGET_LCD ) ||
+ ( load_flags &
+ FT_LOAD_TARGET_LCD_V ) ) );
+ exec->vertical_lcd_lean =
+ FT_BOOL( subpixel_hinting_lean &&
+ ( load_flags &
+ FT_LOAD_TARGET_LCD_V ) );
+ grayscale = FT_BOOL( grayscale && !subpixel_hinting_lean );
+ }
+ else
+ {
+ subpixel_hinting_lean = FALSE;
+ grayscale_cleartype = FALSE;
+ exec->vertical_lcd_lean = FALSE;
+ }
+#endif
+
+ error = TT_Load_Context( exec, face, size );
+ if ( error )
+ return error;
- /* any mode change requires a re-execution of the CVT program */
- if ( mode != exec->mode )
+ {
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
{
- FT_TRACE4(( "tt_loader_init: render mode change,"
- " re-executing `prep' table\n" ));
+ /* a change from mono to subpixel rendering (and vice versa) */
+ /* requires a re-execution of the CVT program */
+ if ( subpixel_hinting_lean != exec->subpixel_hinting_lean )
+ {
+ FT_TRACE4(( "tt_loader_init: subpixel hinting change,"
+ " re-executing `prep' table\n" ));
+
+ exec->subpixel_hinting_lean = subpixel_hinting_lean;
+ reexecute = TRUE;
+ }
+
+ /* a change from colored to grayscale subpixel rendering (and */
+ /* vice versa) requires a re-execution of the CVT program */
+ if ( grayscale_cleartype != exec->grayscale_cleartype )
+ {
+ FT_TRACE4(( "tt_loader_init: grayscale subpixel hinting change,"
+ " re-executing `prep' table\n" ));
- exec->mode = mode;
- reexecute = TRUE;
+ exec->grayscale_cleartype = grayscale_cleartype;
+ reexecute = TRUE;
+ }
}
- }
#endif
- /* a change from mono to grayscale rendering (and vice versa) */
- /* requires a re-execution of the CVT program */
- if ( grayscale != exec->grayscale )
- {
- FT_TRACE4(( "tt_loader_init: grayscale hinting change,"
- " re-executing `prep' table\n" ));
+ /* a change from mono to grayscale rendering (and vice versa) */
+ /* requires a re-execution of the CVT program */
+ if ( grayscale != exec->grayscale )
+ {
+ FT_TRACE4(( "tt_loader_init: grayscale hinting change,"
+ " re-executing `prep' table\n" ));
- exec->grayscale = grayscale;
- reexecute = TRUE;
+ exec->grayscale = grayscale;
+ reexecute = TRUE;
+ }
}
- if ( size->cvt_ready > 0 )
- return size->cvt_ready;
- if ( size->cvt_ready < 0 || reexecute )
+ if ( reexecute )
{
- error = tt_size_run_prep( size );
+ error = tt_size_run_prep( size, pedantic );
+ if ( error )
+ return error;
+ error = TT_Load_Context( exec, face, size );
if ( error )
return error;
}
- TT_Load_Context( exec, face, size );
-
/* check whether the cvt program has disabled hinting */
- if ( size->GS.instruct_control & 1 )
+ if ( exec->GS.instruct_control & 1 )
load_flags |= FT_LOAD_NO_HINTING;
- /* check whether GS modifications should be reverted */
- if ( size->GS.instruct_control & 2 )
- size->GS = tt_default_graphics_state;
+ /* load default graphics state -- if needed */
+ if ( exec->GS.instruct_control & 2 )
+ exec->GS = tt_default_graphics_state;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/*
@@ -2282,24 +2318,28 @@
*
*/
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
- mode != FT_RENDER_MODE_MONO &&
+ subpixel_hinting_lean &&
!FT_IS_TRICKY( glyph->face ) )
- exec->backward_compatibility = ( size->GS.instruct_control & 4 ) ^ 4;
-
+ exec->backward_compatibility = !( exec->GS.instruct_control & 4 );
+ else
+ exec->backward_compatibility = FALSE;
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
+ exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
loader->exec = exec;
+ loader->instructions = exec->glyphIns;
/* Use the hdmx table if any unless FT_LOAD_COMPUTE_METRICS */
/* is set or backward compatibility mode of the v38 or v40 */
/* interpreters is active. See `ttinterp.h' for details on */
/* backward compatibility mode. */
- if ( IS_HINTED( load_flags ) &&
- !( load_flags & FT_LOAD_COMPUTE_METRICS ) &&
+ if ( IS_HINTED( loader->load_flags ) &&
+ !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) &&
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- !exec->backward_compatibility &&
+ !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
+ exec->backward_compatibility ) &&
#endif
- !face->postscript.isFixedPitch )
+ !face->postscript.isFixedPitch )
{
loader->widthp = size->widthp;
}
@@ -2324,7 +2364,7 @@
loader->face = face;
loader->size = size;
loader->glyph = (FT_GlyphSlot)glyph;
- loader->stream = face->root.stream;
+ loader->stream = stream;
loader->composites.head = NULL;
loader->composites.tail = NULL;
@@ -2386,26 +2426,84 @@
TT_LoaderRec loader;
- FT_TRACE1(( "TT_Load_Glyph: glyph index %u\n", glyph_index ));
+ FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index ));
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* try to load embedded bitmap (if any) */
- if ( size->strike_index != 0xFFFFFFFFUL &&
- !( load_flags & FT_LOAD_NO_BITMAP &&
- FT_IS_SCALABLE( glyph->face ) ) &&
- IS_DEFAULT_INSTANCE( glyph->face ) )
+ if ( size->strike_index != 0xFFFFFFFFUL &&
+ ( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
+ IS_DEFAULT_INSTANCE( glyph->face ) )
{
+ FT_Fixed x_scale = size->root.metrics.x_scale;
+ FT_Fixed y_scale = size->root.metrics.y_scale;
+
+
error = load_sbit_image( size, glyph, glyph_index, load_flags );
- if ( !error )
+ if ( FT_ERR_EQ( error, Missing_Bitmap ) )
{
- if ( FT_IS_SCALABLE( glyph->face ) ||
- FT_HAS_SBIX( glyph->face ) )
+ /* the bitmap strike is incomplete and misses the requested glyph; */
+ /* if we have a bitmap-only font, return an empty glyph */
+ if ( !FT_IS_SCALABLE( glyph->face ) )
{
- FT_Fixed x_scale = size->root.metrics.x_scale;
- FT_Fixed y_scale = size->root.metrics.y_scale;
+ FT_Short left_bearing = 0;
+ FT_Short top_bearing = 0;
+ FT_UShort advance_width = 0;
+ FT_UShort advance_height = 0;
+
+
+ /* to return an empty glyph, however, we need metrics data */
+ /* from the `hmtx' (or `vmtx') table; the assumption is that */
+ /* empty glyphs are missing intentionally, representing */
+ /* whitespace - not having at least horizontal metrics is */
+ /* thus considered an error */
+ if ( !face->horz_metrics_size )
+ return error;
+ /* we now construct an empty bitmap glyph */
+ TT_Get_HMetrics( face, glyph_index,
+ &left_bearing,
+ &advance_width );
+ TT_Get_VMetrics( face, glyph_index,
+ 0,
+ &top_bearing,
+ &advance_height );
+
+ glyph->outline.n_points = 0;
+ glyph->outline.n_contours = 0;
+
+ glyph->metrics.width = 0;
+ glyph->metrics.height = 0;
+
+ glyph->metrics.horiBearingX = FT_MulFix( left_bearing, x_scale );
+ glyph->metrics.horiBearingY = 0;
+ glyph->metrics.horiAdvance = FT_MulFix( advance_width, x_scale );
+
+ glyph->metrics.vertBearingX = 0;
+ glyph->metrics.vertBearingY = FT_MulFix( top_bearing, y_scale );
+ glyph->metrics.vertAdvance = FT_MulFix( advance_height, y_scale );
+
+ glyph->format = FT_GLYPH_FORMAT_BITMAP;
+ glyph->bitmap.pixel_mode = FT_PIXEL_MODE_MONO;
+
+ glyph->bitmap_left = 0;
+ glyph->bitmap_top = 0;
+
+ return FT_Err_Ok;
+ }
+ }
+ else if ( error )
+ {
+ /* return error if font is not scalable */
+ if ( !FT_IS_SCALABLE( glyph->face ) )
+ return error;
+ }
+ else
+ {
+ if ( FT_IS_SCALABLE( glyph->face ) ||
+ FT_HAS_SBIX( glyph->face ) )
+ {
/* for the bbox we need the header only */
(void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
(void)load_truetype_glyph( &loader, glyph_index, 0, TRUE );
@@ -2452,10 +2550,8 @@
y_scale );
}
- goto Exit;
+ return FT_Err_Ok;
}
- else if ( !FT_IS_SCALABLE( glyph->face ) )
- goto Exit;
}
if ( load_flags & FT_LOAD_SBITS_ONLY )
@@ -2467,7 +2563,7 @@
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
/* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
- if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.ppem )
+ if ( !( load_flags & FT_LOAD_NO_SCALE ) && !size->ttmetrics.valid )
{
error = FT_THROW( Invalid_Size_Handle );
goto Exit;
@@ -2518,7 +2614,7 @@
glyph->metrics.horiAdvance = FT_MulFix( advanceX, x_scale );
glyph->metrics.vertAdvance = FT_MulFix( advanceY, y_scale );
- goto Exit;
+ return error;
}
FT_TRACE3(( "Failed to load SVG glyph\n" ));
@@ -2546,6 +2642,10 @@
goto Done;
}
+ glyph->format = FT_GLYPH_FORMAT_OUTLINE;
+ glyph->num_subglyphs = 0;
+ glyph->outline.flags = 0;
+
/* main loading loop */
error = load_truetype_glyph( &loader, glyph_index, 0, FALSE );
if ( !error )
@@ -2557,18 +2657,9 @@
}
else
{
- glyph->format = FT_GLYPH_FORMAT_OUTLINE;
-
glyph->outline = loader.gloader->base.outline;
glyph->outline.flags &= ~FT_OUTLINE_SINGLE_PASS;
- /* Set the `high precision' bit flag. This is _critical_ to */
- /* get correct output for monochrome TrueType glyphs at all */
- /* sizes using the bytecode interpreter. */
- if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
- size->metrics->y_ppem < 24 )
- glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
-
/* Translate array so that (0,0) is the glyph's origin. Note */
/* that this behaviour is independent on the value of bit 1 of */
/* the `flags' field in the `head' table -- at least major */
@@ -2617,6 +2708,14 @@
error = compute_glyph_metrics( &loader, glyph_index );
}
+ /* Set the `high precision' bit flag. */
+ /* This is _critical_ to get correct output for monochrome */
+ /* TrueType glyphs at all sizes using the bytecode interpreter. */
+ /* */
+ if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
+ size->metrics->y_ppem < 24 )
+ glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+
FT_TRACE1(( " subglyphs = %u, contours = %hu, points = %hu,"
" flags = 0x%.3x\n",
loader.gloader->base.num_subglyphs,
@@ -2628,8 +2727,11 @@
tt_loader_done( &loader );
Exit:
- FT_TRACE1(( error ? " failed (error code 0x%x)\n" : "",
- error ));
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( error )
+ FT_TRACE1(( " failed (error code 0x%x)\n",
+ error ));
+#endif
return error;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.h
index 39d6ae3664..22ea967f30 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
*
* TrueType Glyph Loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.c
index f8842795f1..4f0083c96b 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.c
@@ -4,7 +4,7 @@
*
* TrueType GX Font Variation loader
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
*
* This file is part of the FreeType project, and may only be used,
@@ -489,9 +489,8 @@
FT_UShort axis_count;
FT_UInt region_count;
- FT_UInt i, j;
- FT_Byte* bytes;
- FT_Bool long_words;
+ FT_UInt i, j;
+ FT_Bool long_words;
GX_Blend blend = ttface->blend;
FT_ULong* dataOffsetArray = NULL;
@@ -527,15 +526,11 @@
if ( FT_QNEW_ARRAY( dataOffsetArray, data_count ) )
goto Exit;
- if ( FT_FRAME_ENTER( data_count * 4 ) )
- goto Exit;
-
- bytes = stream->cursor;
-
for ( i = 0; i < data_count; i++ )
- dataOffsetArray[i] = FT_NEXT_ULONG( bytes );
-
- FT_FRAME_EXIT();
+ {
+ if ( FT_READ_ULONG( dataOffsetArray[i] ) )
+ goto Exit;
+ }
/* parse array of region records (region list) */
if ( FT_STREAM_SEEK( offset + region_offset ) )
@@ -569,26 +564,13 @@
goto Exit;
itemStore->regionCount = region_count;
- if ( FT_FRAME_ENTER( (FT_Long)region_count * axis_count * 6 ) )
- {
- FT_TRACE2(( "tt_var_load_item_variation_store:"
- " not enough data for variation regions\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
-
- bytes = stream->cursor;
-
- for ( i = 0; i < region_count; i++ )
+ for ( i = 0; i < itemStore->regionCount; i++ )
{
GX_AxisCoords axisCoords;
if ( FT_NEW_ARRAY( itemStore->varRegionList[i].axisList, axis_count ) )
- {
- FT_FRAME_EXIT();
goto Exit;
- }
axisCoords = itemStore->varRegionList[i].axisList;
@@ -597,9 +579,10 @@
FT_Int start, peak, end;
- start = FT_NEXT_SHORT( bytes );
- peak = FT_NEXT_SHORT( bytes );
- end = FT_NEXT_SHORT( bytes );
+ if ( FT_READ_SHORT( start ) ||
+ FT_READ_SHORT( peak ) ||
+ FT_READ_SHORT( end ) )
+ goto Exit;
/* immediately tag invalid ranges with special peak = 0 */
if ( ( start < 0 && end > 0 ) || start > peak || peak > end )
@@ -611,8 +594,6 @@
}
}
- FT_FRAME_EXIT();
-
/* end of region list parse */
/* use dataOffsetArray now to parse varData items */
@@ -644,7 +625,7 @@
/* check some data consistency */
if ( word_delta_count > region_idx_count )
{
- FT_TRACE2(( "bad short count %d or region count %u\n",
+ FT_TRACE2(( "bad short count %d or region count %d\n",
word_delta_count,
region_idx_count ));
error = FT_THROW( Invalid_Table );
@@ -653,7 +634,7 @@
if ( region_idx_count > itemStore->regionCount )
{
- FT_TRACE2(( "inconsistent regionCount %u in varData[%u]\n",
+ FT_TRACE2(( "inconsistent regionCount %d in varData[%d]\n",
region_idx_count,
i ));
error = FT_THROW( Invalid_Table );
@@ -667,39 +648,29 @@
varData->wordDeltaCount = word_delta_count;
varData->longWords = long_words;
- if ( FT_FRAME_ENTER( region_idx_count * 2 ) )
- {
- FT_TRACE2(( "tt_var_load_item_variation_store:"
- " not enough data for region indices\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
-
- bytes = stream->cursor;
-
for ( j = 0; j < varData->regionIdxCount; j++ )
{
- varData->regionIndices[j] = FT_NEXT_USHORT( bytes );
+ if ( FT_READ_USHORT( varData->regionIndices[j] ) )
+ goto Exit;
if ( varData->regionIndices[j] >= itemStore->regionCount )
{
- FT_TRACE2(( "bad region index %u\n",
+ FT_TRACE2(( "bad region index %d\n",
varData->regionIndices[j] ));
- FT_FRAME_EXIT();
error = FT_THROW( Invalid_Table );
goto Exit;
}
}
- FT_FRAME_EXIT();
-
per_region_size = word_delta_count + region_idx_count;
if ( long_words )
per_region_size *= 2;
- if ( FT_QALLOC_MULT( varData->deltaSet, item_count, per_region_size ) )
+ if ( FT_NEW_ARRAY( varData->deltaSet, per_region_size * item_count ) )
goto Exit;
- if ( FT_STREAM_READ( varData->deltaSet, item_count * per_region_size ) )
+ if ( FT_Stream_Read( stream,
+ varData->deltaSet,
+ per_region_size * item_count ) )
{
FT_TRACE2(( "deltaSet read failed." ));
error = FT_THROW( Invalid_Table );
@@ -735,7 +706,6 @@
FT_UInt innerIndexMask;
FT_ULong i;
FT_UInt j;
- FT_Byte* bytes;
if ( FT_STREAM_SEEK( offset ) ||
@@ -787,16 +757,6 @@
if ( FT_NEW_ARRAY( map->outerIndex, map->mapCount ) )
goto Exit;
- if ( FT_FRAME_ENTER( map->mapCount * entrySize ) )
- {
- FT_TRACE2(( "tt_var_load_delta_set_index_mapping:"
- " invalid number of delta-set index mappings\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
-
- bytes = stream->cursor;
-
for ( i = 0; i < map->mapCount; i++ )
{
FT_UInt mapData = 0;
@@ -809,7 +769,9 @@
FT_Byte data;
- data = FT_NEXT_BYTE( bytes );
+ if ( FT_READ_BYTE( data ) )
+ goto Exit;
+
mapData = ( mapData << 8 ) | data;
}
@@ -827,7 +789,7 @@
if ( outerIndex >= itemStore->dataCount )
{
- FT_TRACE2(( "outerIndex[%lu] == %u out of range\n",
+ FT_TRACE2(( "outerIndex[%ld] == %d out of range\n",
i,
outerIndex ));
error = FT_THROW( Invalid_Table );
@@ -840,7 +802,7 @@
if ( innerIndex >= itemStore->varData[outerIndex].itemCount )
{
- FT_TRACE2(( "innerIndex[%lu] == %u out of range\n",
+ FT_TRACE2(( "innerIndex[%ld] == %d out of range\n",
i,
innerIndex ));
error = FT_THROW( Invalid_Table );
@@ -850,8 +812,6 @@
map->innerIndex[i] = innerIndex;
}
- FT_FRAME_EXIT();
-
Exit:
return error;
}
@@ -1005,181 +965,28 @@
}
- static FT_Fixed
- tt_calculate_scalar( GX_AxisCoords axis,
- FT_UInt axisCount,
- FT_Fixed* normalizedcoords )
- {
- FT_Fixed scalar = 0x10000L;
- FT_UInt j;
-
-
- /* Inner loop steps through axes in this region. */
- for ( j = 0; j < axisCount; j++, axis++ )
- {
- FT_Fixed ncv = normalizedcoords[j];
-
-
- /* Compute the scalar contribution of this axis, */
- /* with peak of 0 used for invalid axes. */
- if ( axis->peakCoord == ncv ||
- axis->peakCoord == 0 )
- continue;
-
- /* Ignore this region if coordinates are out of range. */
- else if ( ncv <= axis->startCoord ||
- ncv >= axis->endCoord )
- {
- scalar = 0;
- break;
- }
-
- /* Cumulative product of all the axis scalars. */
- else if ( ncv < axis->peakCoord )
- scalar = FT_MulDiv( scalar,
- ncv - axis->startCoord,
- axis->peakCoord - axis->startCoord );
- else /* ncv > axis->peakCoord */
- scalar = FT_MulDiv( scalar,
- axis->endCoord - ncv,
- axis->endCoord - axis->peakCoord );
-
- } /* per-axis loop */
-
- return scalar;
- }
-
-
- static FT_Int64
- ft_mul_add_delta_scalar( FT_Int64 returnValue,
- FT_Int32 delta,
- FT_Int32 scalar )
- {
-
-#ifdef FT_INT64
-
- return returnValue + (FT_Int64)delta * scalar;
-
-#else /* !FT_INT64 */
-
- if ( (FT_UInt32)( delta + 0x8000 ) <= 0x20000 )
- {
- /* Fast path: multiplication result fits into 32 bits. */
-
- FT_Int32 lo = delta * scalar;
-
-
- returnValue.lo += (FT_UInt32)lo;
-
- if ( returnValue.lo < (FT_UInt32)lo )
- returnValue.hi += ( lo < 0 ) ? 0 : 1;
-
- if ( lo < 0 )
- returnValue.hi -= 1;
-
- return returnValue;
- }
- else
- {
- /* Slow path: full 32x32 -> 64-bit signed multiplication. */
-
- FT_Int64 product;
-
- /* Get absolute values. */
- FT_UInt32 a = ( delta < 0 ) ? -delta : delta;
- FT_UInt32 b = ( scalar < 0 ) ? -scalar : scalar;
-
- /* Prepare unsigned multiplication. */
- FT_UInt32 a_lo = a & 0xFFFF;
- FT_UInt32 a_hi = a >> 16;
-
- FT_UInt32 b_lo = b & 0xFFFF;
- FT_UInt32 b_hi = b >> 16;
-
- /* Partial products. */
- FT_UInt32 p0 = a_lo * b_lo;
- FT_UInt32 p1 = a_lo * b_hi;
- FT_UInt32 p2 = a_hi * b_lo;
- FT_UInt32 p3 = a_hi * b_hi;
-
- /* Combine: result = p3 << 32 + (p1 + p2) << 16 + p0 */
- FT_UInt32 mid = p1 + p2;
- FT_UInt32 mid_carry = ( mid < p1 );
-
- FT_UInt32 carry;
-
-
- product.lo = ( mid << 16 ) + ( p0 & 0xFFFF );
- carry = ( product.lo < ( p0 & 0xFFFF ) ) ? 1 : 0;
- product.hi = p3 + ( mid >> 16 ) + mid_carry + carry;
-
- /* If result should be negative, negate. */
- if ( ( delta < 0 ) ^ ( scalar < 0 ) )
- {
- product.lo = ~product.lo + 1;
- product.hi = ~product.hi + ( product.lo == 0 ? 1 : 0 );
- }
-
- /* Add to `returnValue`. */
- returnValue.lo += product.lo;
- if ( returnValue.lo < product.lo )
- returnValue.hi++;
- returnValue.hi += product.hi;
-
- return returnValue;
- }
-
-#endif /* !FT_INT64 */
-
- }
-
-
- static FT_ItemVarDelta
- ft_round_and_shift16( FT_Int64 returnValue )
- {
-
-#ifdef FT_INT64
-
- return (FT_ItemVarDelta)( returnValue + 0x8000L ) >> 16;
-
-#else /* !FT_INT64 */
-
- FT_UInt hi = returnValue.hi;
- FT_UInt lo = returnValue.lo;
-
- FT_UInt delta;
-
-
- /* Add 0x8000 to round. */
- lo += 0x8000;
- if ( lo < 0x8000 ) /* overflow occurred */
- hi += 1;
-
- /* Shift right by 16 bits. */
- delta = ( hi << 16 ) | ( lo >> 16 );
-
- return (FT_ItemVarDelta)delta;
-
-#endif /* !FT_INT64 */
-
- }
-
-
FT_LOCAL_DEF( FT_ItemVarDelta )
tt_var_get_item_delta( FT_Face face, /* TT_Face */
GX_ItemVarStore itemStore,
FT_UInt outerIndex,
FT_UInt innerIndex )
{
- TT_Face ttface = (TT_Face)face;
+ TT_Face ttface = (TT_Face)face;
+ FT_Stream stream = FT_FACE_STREAM( face );
+ FT_Memory memory = stream->memory;
+ FT_Error error = FT_Err_Ok;
+
+ GX_ItemVarData varData;
+ FT_ItemVarDelta* deltaSet = NULL;
+ FT_ItemVarDelta deltaSetStack[16];
- GX_ItemVarData varData;
+ FT_Fixed* scalars = NULL;
+ FT_Fixed scalarsStack[16];
- FT_UInt master;
- FT_Int64 returnValue = FT_INT64_ZERO;
- FT_UInt shift_base = 1;
- FT_UInt per_region_size;
- FT_Byte* bytes;
+ FT_UInt master, j;
+ FT_ItemVarDelta returnValue = 0;
+ FT_UInt per_region_size;
+ FT_Byte* bytes;
if ( !ttface->blend || !ttface->blend->normalizedcoords )
@@ -1204,63 +1011,113 @@
if ( varData->regionIdxCount == 0 )
return 0; /* Avoid "applying zero offset to null pointer". */
+ if ( varData->regionIdxCount < 16 )
+ {
+ deltaSet = deltaSetStack;
+ scalars = scalarsStack;
+ }
+ else
+ {
+ if ( FT_QNEW_ARRAY( deltaSet, varData->regionIdxCount ) )
+ goto Exit;
+ if ( FT_QNEW_ARRAY( scalars, varData->regionIdxCount ) )
+ goto Exit;
+ }
+
/* Parse delta set. */
/* */
/* Deltas are (word_delta_count + region_idx_count) bytes each */
/* if `longWords` isn't set, and twice as much otherwise. */
per_region_size = varData->wordDeltaCount + varData->regionIdxCount;
if ( varData->longWords )
- {
- shift_base = 2;
per_region_size *= 2;
- }
bytes = varData->deltaSet + per_region_size * innerIndex;
+ if ( varData->longWords )
+ {
+ for ( master = 0; master < varData->wordDeltaCount; master++ )
+ deltaSet[master] = FT_NEXT_LONG( bytes );
+ for ( ; master < varData->regionIdxCount; master++ )
+ deltaSet[master] = FT_NEXT_SHORT( bytes );
+ }
+ else
+ {
+ for ( master = 0; master < varData->wordDeltaCount; master++ )
+ deltaSet[master] = FT_NEXT_SHORT( bytes );
+ for ( ; master < varData->regionIdxCount; master++ )
+ deltaSet[master] = FT_NEXT_CHAR( bytes );
+ }
+
/* outer loop steps through master designs to be blended */
for ( master = 0; master < varData->regionIdxCount; master++ )
{
- FT_UInt regionIndex = varData->regionIndices[master];
+ FT_Fixed scalar = 0x10000L;
+ FT_UInt regionIndex = varData->regionIndices[master];
GX_AxisCoords axis = itemStore->varRegionList[regionIndex].axisList;
- FT_Fixed scalar = tt_calculate_scalar(
- axis,
- itemStore->axisCount,
- ttface->blend->normalizedcoords );
-
- if ( scalar )
+ /* inner loop steps through axes in this region */
+ for ( j = 0; j < itemStore->axisCount; j++, axis++ )
{
- FT_Int delta;
+ FT_Fixed ncv = ttface->blend->normalizedcoords[j];
- if ( varData->longWords )
- {
- if ( master < varData->wordDeltaCount )
- delta = FT_NEXT_LONG( bytes );
- else
- delta = FT_NEXT_SHORT( bytes );
- }
- else
+ /* compute the scalar contribution of this axis */
+ /* with peak of 0 used for invalid axes */
+ if ( axis->peakCoord == ncv ||
+ axis->peakCoord == 0 )
+ continue;
+
+ /* ignore this region if coords are out of range */
+ else if ( ncv <= axis->startCoord ||
+ ncv >= axis->endCoord )
{
- if ( master < varData->wordDeltaCount )
- delta = FT_NEXT_SHORT( bytes );
- else
- delta = FT_NEXT_CHAR( bytes );
+ scalar = 0;
+ break;
}
- returnValue = ft_mul_add_delta_scalar( returnValue, delta, scalar );
- }
- else
- {
- /* Branch-free, yay. */
- bytes += shift_base << ( master < varData->wordDeltaCount );
- }
+ /* cumulative product of all the axis scalars */
+ else if ( ncv < axis->peakCoord )
+ scalar = FT_MulDiv( scalar,
+ ncv - axis->startCoord,
+ axis->peakCoord - axis->startCoord );
+ else /* ncv > axis->peakCoord */
+ scalar = FT_MulDiv( scalar,
+ axis->endCoord - ncv,
+ axis->endCoord - axis->peakCoord );
+
+ } /* per-axis loop */
+
+ scalars[master] = scalar;
} /* per-region loop */
- return ft_round_and_shift16( returnValue );
+
+ /* Compute the scaled delta for this region.
+ *
+ * From: https://docs.microsoft.com/en-us/typography/opentype/spec/otvarcommonformats#item-variation-store-header-and-item-variation-data-subtables:
+ *
+ * `Fixed` is a 32-bit (16.16) type and, in the general case, requires
+ * 32-bit deltas. As described above, the `DeltaSet` record can
+ * accommodate deltas that are, logically, either 16-bit or 32-bit.
+ * When scaled deltas are applied to `Fixed` values, the `Fixed` value
+ * is treated like a 32-bit integer.
+ *
+ * `FT_MulAddFix` internally uses 64-bit precision; it thus can handle
+ * deltas ranging from small 8-bit to large 32-bit values that are
+ * applied to 16.16 `FT_Fixed` / OpenType `Fixed` values.
+ */
+ returnValue = FT_MulAddFix( scalars, deltaSet, varData->regionIdxCount );
+
+ Exit:
+ if ( scalars != scalarsStack )
+ FT_FREE( scalars );
+ if ( deltaSet != deltaSetStack )
+ FT_FREE( deltaSet );
+
+ return returnValue;
}
@@ -1786,7 +1643,6 @@
GX_Blend blend = face->blend;
FT_Error error;
FT_UInt i, j;
- FT_Byte* bytes;
FT_ULong table_len;
FT_ULong gvar_start;
FT_ULong offsetToData;
@@ -1878,8 +1734,6 @@
if ( FT_FRAME_ENTER( offsets_len ) )
goto Exit;
- bytes = stream->cursor;
-
/* offsets (one more offset than glyphs, to mark size of last) */
if ( FT_QNEW_ARRAY( blend->glyphoffsets, gvar_head.glyphCount + 1 ) )
goto Fail2;
@@ -1890,24 +1744,16 @@
FT_ULong max_offset = 0;
- if ( stream->limit - stream->cursor < gvar_head.glyphCount * 4 )
- {
- FT_TRACE2(( "ft_var_load_gvar:"
- " glyph variation data offset not enough\n" ));
- error = FT_THROW( Invalid_Table );
- goto Fail;
- }
-
for ( i = 0; i <= gvar_head.glyphCount; i++ )
{
- blend->glyphoffsets[i] = offsetToData + FT_NEXT_ULONG( bytes );
+ blend->glyphoffsets[i] = offsetToData + FT_GET_ULONG();
if ( max_offset <= blend->glyphoffsets[i] )
max_offset = blend->glyphoffsets[i];
else
{
FT_TRACE2(( "ft_var_load_gvar:"
- " glyph variation data offset %u not monotonic\n",
+ " glyph variation data offset %d not monotonic\n",
i ));
blend->glyphoffsets[i] = max_offset;
}
@@ -1916,7 +1762,7 @@
if ( limit < blend->glyphoffsets[i] )
{
FT_TRACE2(( "ft_var_load_gvar:"
- " glyph variation data offset %u out of range\n",
+ " glyph variation data offset %d out of range\n",
i ));
blend->glyphoffsets[i] = limit;
}
@@ -1928,24 +1774,16 @@
FT_ULong max_offset = 0;
- if ( stream->limit - stream->cursor < gvar_head.glyphCount * 2 )
- {
- FT_TRACE2(( "ft_var_load_gvar:"
- " glyph variation data offset not enough\n" ));
- error = FT_THROW( Invalid_Table );
- goto Fail;
- }
-
for ( i = 0; i <= gvar_head.glyphCount; i++ )
{
- blend->glyphoffsets[i] = offsetToData + FT_NEXT_USHORT( bytes ) * 2;
+ blend->glyphoffsets[i] = offsetToData + FT_GET_USHORT() * 2;
if ( max_offset <= blend->glyphoffsets[i] )
max_offset = blend->glyphoffsets[i];
else
{
FT_TRACE2(( "ft_var_load_gvar:"
- " glyph variation data offset %u not monotonic\n",
+ " glyph variation data offset %d not monotonic\n",
i ));
blend->glyphoffsets[i] = max_offset;
}
@@ -1954,7 +1792,7 @@
if ( limit < blend->glyphoffsets[i] )
{
FT_TRACE2(( "ft_var_load_gvar:"
- " glyph variation data offset %u out of range\n",
+ " glyph variation data offset %d out of range\n",
i ));
blend->glyphoffsets[i] = limit;
}
@@ -1976,8 +1814,6 @@
goto Fail;
}
- bytes = stream->cursor;
-
if ( FT_QNEW_ARRAY( blend->tuplecoords,
gvar_head.axisCount * gvar_head.globalCoordCount ) )
goto Fail2;
@@ -1988,17 +1824,13 @@
for ( j = 0; j < (FT_UInt)gvar_head.axisCount; j++ )
{
blend->tuplecoords[i * gvar_head.axisCount + j] =
- FT_fdot14ToFixed( FT_NEXT_SHORT( bytes ) );
+ FT_fdot14ToFixed( FT_GET_SHORT() );
FT_TRACE5(( "%.5f ",
(double)blend->tuplecoords[i * gvar_head.axisCount + j] / 65536 ));
}
FT_TRACE5(( "]\n" ));
}
- if ( FT_NEW_ARRAY( blend->tuplescalars,
- gvar_head.globalCoordCount ) )
- goto Fail2;
-
blend->tuplecount = gvar_head.globalCoordCount;
FT_TRACE5(( "\n" ));
@@ -2064,25 +1896,15 @@
for ( i = 0; i < blend->num_axis; i++ )
{
- FT_Fixed ncv;
+ FT_Fixed ncv = blend->normalizedcoords[i];
- if ( tuple_coords[i] == 0 )
- {
- FT_TRACE6(( " tuple coordinate is zero, ignore\n" ));
- continue;
- }
+ FT_TRACE6(( " axis %d coordinate %.5f:\n", i, (double)ncv / 65536 ));
- ncv = blend->normalizedcoords[i];
-
- FT_TRACE6(( " axis %u coordinate %.5f:\n", i, (double)ncv / 65536 ));
-
- if ( ncv == 0 )
- {
- FT_TRACE6(( " axis coordinate is zero, stop\n" ));
- apply = 0;
- break;
- }
+ /* It's not clear why (for intermediate tuples) we don't need */
+ /* to check against start/end -- the documentation says we don't. */
+ /* Similarly, it's unclear why we don't need to scale along the */
+ /* axis. */
if ( tuple_coords[i] == ncv )
{
@@ -2092,6 +1914,12 @@
continue;
}
+ if ( tuple_coords[i] == 0 )
+ {
+ FT_TRACE6(( " tuple coordinate is zero, ignore\n" ));
+ continue;
+ }
+
if ( !( tupleIndex & GX_TI_INTERMEDIATE_TUPLE ) )
{
/* not an intermediate tuple */
@@ -2173,7 +2001,7 @@
if ( num_coords > mmvar->num_axis )
{
FT_TRACE2(( "ft_var_to_normalized:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
mmvar->num_axis, num_coords ));
num_coords = mmvar->num_axis;
}
@@ -2188,7 +2016,7 @@
FT_Fixed coord = coords[i];
- FT_TRACE5(( " %u: %.5f\n", i, (double)coord / 65536 ));
+ FT_TRACE5(( " %d: %.5f\n", i, (double)coord / 65536 ));
if ( coord > a->maximum || coord < a->minimum )
{
FT_TRACE1(( "ft_var_to_normalized: design coordinate %.5f\n",
@@ -2328,7 +2156,7 @@
if ( num_coords > blend->num_axis )
{
FT_TRACE2(( "ft_var_to_design:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
blend->num_axis, num_coords ));
nc = blend->num_axis;
}
@@ -2688,7 +2516,7 @@
" minimum default maximum flags\n" ));
/* " XXXX.XXXXX XXXX.XXXXX XXXX.XXXXX 0xXXXX" */
- FT_TRACE5(( " %3u `%s'"
+ FT_TRACE5(( " %3d `%s'"
" %10.5f %10.5f %10.5f 0x%04X%s\n",
i,
a->name,
@@ -2780,7 +2608,7 @@
(void)FT_STREAM_SEEK( pos );
- FT_TRACE5(( " named instance %u (%s%s%s, %s%s%s)\n",
+ FT_TRACE5(( " named instance %d (%s%s%s, %s%s%s)\n",
i,
strname ? "name: `" : "",
strname ? strname : "unnamed",
@@ -2808,7 +2636,7 @@
FT_UInt strid = ~0U;
- /* The default instance is missing in the array */
+ /* The default instance is missing in array the */
/* of named instances; try to synthesize an entry. */
/* If this fails, `default_named_instance` remains */
/* at value zero, which doesn't do any harm. */
@@ -2938,18 +2766,10 @@
} manageCvt;
+ face->doblend = FALSE;
+
if ( !face->blend )
{
- face->doblend = FALSE;
- for ( i = 0; i < num_coords; i++ )
- if ( coords[i] )
- {
- face->doblend = TRUE;
- break;
- }
- if ( !face->doblend )
- goto Exit;
-
if ( FT_SET_ERROR( TT_Get_MM_Var( FT_FACE( face ), NULL ) ) )
goto Exit;
}
@@ -2960,7 +2780,7 @@
if ( num_coords > mmvar->num_axis )
{
FT_TRACE2(( "TT_Set_MM_Blend:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
mmvar->num_axis, num_coords ));
num_coords = mmvar->num_axis;
}
@@ -3062,7 +2882,11 @@
/* return value -1 indicates `no change' */
if ( !have_diff )
+ {
+ face->doblend = TRUE;
+
return -1;
+ }
for ( ; i < mmvar->num_axis; i++ )
{
@@ -3091,15 +2915,7 @@
blend->normalizedcoords,
blend->coords );
- face->doblend = FALSE;
- for ( i = 0; i < blend->num_axis; i++ )
- {
- if ( blend->normalizedcoords[i] )
- {
- face->doblend = TRUE;
- break;
- }
- }
+ face->doblend = TRUE;
if ( face->cvt )
{
@@ -3125,9 +2941,6 @@
}
}
- for ( i = 0 ; i < blend->tuplecount ; i++ )
- blend->tuplescalars[i] = (FT_Fixed)-0x20000L;
-
Exit:
return error;
}
@@ -3167,24 +2980,7 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
- FT_Error error;
-
-
- error = tt_set_mm_blend( (TT_Face)face, num_coords, coords, 1 );
- if ( error == FT_Err_Ok )
- {
- FT_UInt i;
-
-
- for ( i = 0; i < num_coords; i++ )
- if ( coords[i] )
- {
- error = -2; /* -2 means is_variable. */
- break;
- }
- }
-
- return error;
+ return tt_set_mm_blend( (TT_Face)face, num_coords, coords, 1 );
}
@@ -3247,7 +3043,7 @@
if ( num_coords > blend->num_axis )
{
FT_TRACE2(( "TT_Get_MM_Blend:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
blend->num_axis, num_coords ));
nc = blend->num_axis;
}
@@ -3329,7 +3125,7 @@
if ( num_coords > mmvar->num_axis )
{
FT_TRACE2(( "TT_Set_Var_Design:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
mmvar->num_axis, num_coords ));
num_coords = mmvar->num_axis;
}
@@ -3405,15 +3201,6 @@
if ( error )
goto Exit;
- for ( i = 0; i < num_coords; i++ )
- {
- if ( normalized[i] )
- {
- error = -2; /* -2 means is_variable. */
- break;
- }
- }
-
Exit:
FT_FREE( normalized );
return error;
@@ -3450,12 +3237,10 @@
FT_UInt num_coords,
FT_Fixed* coords )
{
- TT_Face ttface = (TT_Face)face;
- FT_Error error = FT_Err_Ok;
- GX_Blend blend;
- FT_MM_Var* mmvar;
- FT_Var_Axis* a;
- FT_UInt i, nc;
+ TT_Face ttface = (TT_Face)face;
+ FT_Error error = FT_Err_Ok;
+ GX_Blend blend;
+ FT_UInt i, nc;
if ( !ttface->blend )
@@ -3478,26 +3263,24 @@
if ( num_coords > blend->num_axis )
{
FT_TRACE2(( "TT_Get_Var_Design:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
blend->num_axis, num_coords ));
nc = blend->num_axis;
}
- mmvar = blend->mmvar;
- a = mmvar->axis;
if ( ttface->doblend )
{
- for ( i = 0; i < nc; i++, a++ )
+ for ( i = 0; i < nc; i++ )
coords[i] = blend->coords[i];
}
else
{
- for ( i = 0; i < nc; i++, a++ )
- coords[i] = a->def;
+ for ( i = 0; i < nc; i++ )
+ coords[i] = 0;
}
- for ( ; i < num_coords; i++, a++ )
- coords[i] = a->def;
+ for ( ; i < num_coords; i++ )
+ coords[i] = 0;
return FT_Err_Ok;
}
@@ -3590,9 +3373,6 @@
error = TT_Set_Var_Design( face, 0, NULL );
}
- if ( error == -1 || error == -2 )
- error = FT_Err_Ok;
-
Exit:
return error;
}
@@ -3811,7 +3591,7 @@
FT_Stream_SeekSet( stream, here );
}
- FT_TRACE5(( "cvar: there %s %u tuple%s:\n",
+ FT_TRACE5(( "cvar: there %s %d tuple%s:\n",
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
tupleCount & GX_TC_TUPLE_COUNT_MASK,
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
@@ -3830,7 +3610,7 @@
FT_Fixed apply;
- FT_TRACE6(( " tuple %u:\n", i ));
+ FT_TRACE6(( " tuple %d:\n", i ));
tupleDataSize = FT_GET_USHORT();
tupleIndex = FT_GET_USHORT();
@@ -3896,7 +3676,7 @@
if ( !points || !deltas )
; /* failure, ignore it */
- else if ( points == ALL_POINTS )
+ else if ( localpoints == ALL_POINTS )
{
#ifdef FT_DEBUG_LEVEL_TRACE
int count = 0;
@@ -3917,7 +3697,7 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( old_cvt_delta != cvt_deltas[j] )
{
- FT_TRACE7(( " %u: %f -> %f\n",
+ FT_TRACE7(( " %d: %f -> %f\n",
j,
(double)( FT_fdot6ToFixed( face->cvt[j] ) +
old_cvt_delta ) / 65536,
@@ -4247,7 +4027,7 @@
FT_Outline* outline,
FT_Vector* unrounded )
{
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
TT_Face face = loader->face;
FT_Stream stream = face->root.stream;
FT_Memory memory = stream->memory;
@@ -4267,15 +4047,6 @@
FT_ULong here;
FT_UInt i, j;
- FT_UInt peak_coords_size;
- FT_UInt point_deltas_x_size;
- FT_UInt points_org_size;
- FT_UInt points_out_size;
- FT_UInt has_delta_size;
- FT_UInt pool_size;
- FT_Byte* pool = NULL;
- FT_Byte* p;
-
FT_Fixed* peak_coords = NULL;
FT_Fixed* tuple_coords;
FT_Fixed* im_start_coords;
@@ -4296,24 +4067,21 @@
FT_Fixed* point_deltas_y = NULL;
+ if ( !face->doblend || !blend )
+ return FT_THROW( Invalid_Argument );
+
for ( i = 0; i < n_points; i++ )
{
unrounded[i].x = INT_TO_F26DOT6( outline->points[i].x );
unrounded[i].y = INT_TO_F26DOT6( outline->points[i].y );
}
- if ( !face->doblend )
- goto Exit;
-
- if ( !blend )
- return FT_THROW( Invalid_Argument );
-
if ( glyph_index >= blend->gv_glyphcnt ||
blend->glyphoffsets[glyph_index] ==
blend->glyphoffsets[glyph_index + 1] )
{
FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
- " no variation data for glyph %u\n", glyph_index ));
+ " no variation data for glyph %d\n", glyph_index ));
return FT_Err_Ok;
}
@@ -4357,41 +4125,18 @@
FT_Stream_SeekSet( stream, here );
}
- FT_TRACE5(( "gvar: there %s %u tuple%s:\n",
+ FT_TRACE5(( "gvar: there %s %d tuple%s:\n",
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "is" : "are",
tupleCount & GX_TC_TUPLE_COUNT_MASK,
( tupleCount & GX_TC_TUPLE_COUNT_MASK ) == 1 ? "" : "s" ));
- peak_coords_size = ALIGN_SIZE( 3 * blend->num_axis *
- sizeof ( *peak_coords ) );
- point_deltas_x_size = ALIGN_SIZE( 2 * n_points *
- sizeof ( *point_deltas_x ) );
- points_org_size = ALIGN_SIZE( n_points * sizeof ( *points_org ) );
- points_out_size = ALIGN_SIZE( n_points * sizeof ( *points_out ) );
- has_delta_size = ALIGN_SIZE( n_points * sizeof ( *has_delta ) );
-
- pool_size = peak_coords_size +
- point_deltas_x_size +
- points_org_size +
- points_out_size +
- has_delta_size;
-
- if ( FT_ALLOC( pool, pool_size ) )
+ if ( FT_QNEW_ARRAY( peak_coords, 3 * blend->num_axis ) ||
+ FT_NEW_ARRAY( point_deltas_x, 2 * n_points ) ||
+ FT_QNEW_ARRAY( points_org, n_points ) ||
+ FT_QNEW_ARRAY( points_out, n_points ) ||
+ FT_QNEW_ARRAY( has_delta, n_points ) )
goto Exit;
- p = pool;
- peak_coords = (FT_Fixed*)p;
- p += peak_coords_size;
- point_deltas_x = (FT_Fixed*)p;
- p += point_deltas_x_size;
- points_org = (FT_Vector*)p;
- p += points_org_size;
- points_out = (FT_Vector*)p;
- p += points_out_size;
- has_delta = (FT_Bool*)p;
-
- FT_ARRAY_ZERO( point_deltas_x, 2 * n_points );
-
im_start_coords = peak_coords + blend->num_axis;
im_end_coords = im_start_coords + blend->num_axis;
point_deltas_y = point_deltas_x + n_points;
@@ -4402,70 +4147,27 @@
points_org[j].y = FT_intToFixed( outline->points[j].y );
}
- p = stream->cursor;
-
- tupleCount &= GX_TC_TUPLE_COUNT_MASK;
- for ( i = 0; i < tupleCount; i++ )
+ for ( i = 0; i < ( tupleCount & GX_TC_TUPLE_COUNT_MASK ); i++ )
{
- FT_UInt tupleDataSize;
- FT_UInt tupleIndex;
- FT_Fixed apply;
- FT_Fixed* tupleScalars;
-
-
- FT_TRACE6(( " tuple %u:\n", i ));
-
- tupleScalars = blend->tuplescalars;
+ FT_UInt tupleDataSize;
+ FT_UInt tupleIndex;
+ FT_Fixed apply;
- /* Enter frame for four bytes. */
- if ( 4 > stream->limit - p )
- {
- FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
- " invalid glyph variation array header\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
- tupleDataSize = FT_NEXT_USHORT( p );
- tupleIndex = FT_NEXT_USHORT( p );
+ FT_TRACE6(( " tuple %d:\n", i ));
- if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
- tupleScalars = NULL;
+ tupleDataSize = FT_GET_USHORT();
+ tupleIndex = FT_GET_USHORT();
if ( tupleIndex & GX_TI_EMBEDDED_TUPLE_COORD )
{
- if ( 2 * blend->num_axis > (FT_UInt)( stream->limit - p ) )
- {
- FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
- " invalid glyph variation array header\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
-
for ( j = 0; j < blend->num_axis; j++ )
- peak_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) );
-
+ peak_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
tuple_coords = peak_coords;
- tupleScalars = NULL;
}
else if ( ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) < blend->tuplecount )
- {
- FT_Fixed scalar =
- tupleScalars
- ? tupleScalars[tupleIndex & GX_TI_TUPLE_INDEX_MASK]
- : (FT_Fixed)-0x20000;
-
-
- if ( scalar != (FT_Fixed)-0x20000 )
- {
- apply = scalar;
- goto apply_found;
- }
-
tuple_coords = blend->tuplecoords +
- ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) *
- blend->num_axis;
- }
+ ( tupleIndex & GX_TI_TUPLE_INDEX_MASK ) * blend->num_axis;
else
{
FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
@@ -4477,18 +4179,10 @@
if ( tupleIndex & GX_TI_INTERMEDIATE_TUPLE )
{
- if ( 4 * blend->num_axis > (FT_UInt)( stream->limit - p ) )
- {
- FT_TRACE2(( "TT_Vary_Apply_Glyph_Deltas:"
- " invalid glyph variation array header\n" ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
-
for ( j = 0; j < blend->num_axis; j++ )
- im_start_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) );
+ im_start_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
for ( j = 0; j < blend->num_axis; j++ )
- im_end_coords[j] = FT_fdot14ToFixed( FT_NEXT_SHORT( p ) );
+ im_end_coords[j] = FT_fdot14ToFixed( FT_GET_SHORT() );
}
apply = ft_var_apply_tuple( blend,
@@ -4497,11 +4191,6 @@
im_start_coords,
im_end_coords );
- if ( tupleScalars )
- tupleScalars[tupleIndex & GX_TI_TUPLE_INDEX_MASK] = apply;
-
- apply_found:
-
if ( apply == 0 ) /* tuple isn't active for our blend */
{
offsetToData += tupleDataSize;
@@ -4558,7 +4247,7 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( point_delta_x || point_delta_y )
{
- FT_TRACE7(( " %u: (%f, %f) -> (%f, %f)\n",
+ FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n",
j,
(double)( FT_intToFixed( outline->points[j].x ) +
old_point_delta_x ) / 65536,
@@ -4632,7 +4321,7 @@
#ifdef FT_DEBUG_LEVEL_TRACE
if ( point_delta_x || point_delta_y )
{
- FT_TRACE7(( " %u: (%f, %f) -> (%f, %f)\n",
+ FT_TRACE7(( " %d: (%f, %f) -> (%f, %f)\n",
j,
(double)( FT_intToFixed( outline->points[j].x ) +
old_point_delta_x ) / 65536,
@@ -4713,7 +4402,11 @@
Exit:
if ( sharedpoints != ALL_POINTS )
FT_FREE( sharedpoints );
- FT_FREE( pool );
+ FT_FREE( points_org );
+ FT_FREE( points_out );
+ FT_FREE( has_delta );
+ FT_FREE( peak_coords );
+ FT_FREE( point_deltas_x );
FExit:
FT_FRAME_EXIT();
@@ -4884,7 +4577,6 @@
FT_FREE( blend->mvar_table );
}
- FT_FREE( blend->tuplescalars );
FT_FREE( blend->tuplecoords );
FT_FREE( blend->glyphoffsets );
FT_FREE( blend );
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.h
index 568c8027bb..9326011e3a 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttgxvar.h
@@ -4,7 +4,7 @@
*
* TrueType GX Font Variation loader (specification)
*
- * Copyright (C) 2004-2025 by
+ * Copyright (C) 2004-2024 by
* David Turner, Robert Wilhelm, Werner Lemberg and George Williams.
*
* This file is part of the FreeType project, and may only be used,
@@ -255,10 +255,6 @@ FT_BEGIN_HEADER
* A two-dimensional array that holds the shared tuple coordinates
* in the `gvar' table.
*
- * tuplescalars ::
- * A one-dimensional array that holds the shared tuple
- * scalars in the `gvar' table for current face coordinates.
- *
* gv_glyphcnt ::
* The number of glyphs handled in the `gvar' table.
*
@@ -297,7 +293,6 @@ FT_BEGIN_HEADER
FT_UInt tuplecount;
FT_Fixed* tuplecoords; /* tuplecoords[tuplecount][num_axis] */
- FT_Fixed* tuplescalars; /* tuplescalars[tuplecount] */
FT_UInt gv_glyphcnt;
FT_ULong* glyphoffsets; /* glyphoffsets[gv_glyphcnt + 1] */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.c
index f46cc77fe5..951891dbf5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
*
* TrueType bytecode interpreter (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -27,8 +27,6 @@
#include <freetype/ftdriver.h>
#include <freetype/ftmm.h>
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
#include "ttinterp.h"
#include "tterrors.h"
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
@@ -36,6 +34,9 @@
#endif
+#ifdef TT_USE_BYTECODE_INTERPRETER
+
+
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
@@ -88,37 +89,58 @@
#define FAILURE 1
- /* The default value for `scan_control' is documented as FALSE in the */
- /* TrueType specification. This is confusing since it implies a */
- /* Boolean value. However, this is not the case, thus both the */
- /* default values of our `scan_type' and `scan_control' fields (which */
- /* the documentation's `scan_control' variable is split into) are */
- /* zero. */
- /* */
- /* The rounding compensation should logically belong here but poorly */
- /* described in the OpenType specs. It was probably important in the */
- /* days of dot matrix printers. The values are referenced by color */
- /* as Gray, Black, and White in order. The Apple specification says */
- /* that the Gray compensation is always zero. The fourth value is */
- /* not described at all, but Greg says that it is the same as Gray. */
- /* FreeType sets all compensation values to zero. */
-
- const TT_GraphicsState tt_default_graphics_state =
- {
- 0, 0, 0, 1, 1, 1,
- { 0x4000, 0 }, { 0x4000, 0 }, { 0x4000, 0 },
- 1, 1, { 0, 0, 0, 0 },
-
- 64, 68, 0, 0, 9, 3,
- TRUE, 0, FALSE, 0
- };
+ /**************************************************************************
+ *
+ * CODERANGE FUNCTIONS
+ *
+ */
/**************************************************************************
*
- * CODERANGE FUNCTIONS
+ * @Function:
+ * TT_Goto_CodeRange
+ *
+ * @Description:
+ * Switches to a new code range (updates the code related elements in
+ * `exec', and `IP').
+ *
+ * @Input:
+ * range ::
+ * The new execution code range.
*
+ * IP ::
+ * The new IP in the new code range.
+ *
+ * @InOut:
+ * exec ::
+ * The target execution context.
*/
+ FT_LOCAL_DEF( void )
+ TT_Goto_CodeRange( TT_ExecContext exec,
+ FT_Int range,
+ FT_Long IP )
+ {
+ TT_CodeRange* coderange;
+
+
+ FT_ASSERT( range >= 1 && range <= 3 );
+
+ coderange = &exec->codeRangeTable[range - 1];
+
+ FT_ASSERT( coderange->base );
+
+ /* NOTE: Because the last instruction of a program may be a CALL */
+ /* which will return to the first byte *after* the code */
+ /* range, we test for IP <= Size instead of IP < Size. */
+ /* */
+ FT_ASSERT( IP <= coderange->size );
+
+ exec->code = coderange->base;
+ exec->codeSize = coderange->size;
+ exec->IP = IP;
+ exec->curRange = range;
+ }
/**************************************************************************
@@ -146,19 +168,13 @@
FT_LOCAL_DEF( void )
TT_Set_CodeRange( TT_ExecContext exec,
FT_Int range,
- FT_Byte* base,
+ void* base,
FT_Long length )
{
FT_ASSERT( range >= 1 && range <= 3 );
- exec->codeRangeTable[range - 1].base = base;
+ exec->codeRangeTable[range - 1].base = (FT_Byte*)base;
exec->codeRangeTable[range - 1].size = length;
-
- exec->code = base;
- exec->codeSize = length;
- exec->IP = 0;
- exec->curRange = range;
- exec->iniRange = range;
}
@@ -208,6 +224,9 @@
* exec ::
* A handle to the target execution context.
*
+ * memory ::
+ * A handle to the parent memory object.
+ *
* @Note:
* Only the glyph loader and debugger should call this function.
*/
@@ -221,6 +240,10 @@
exec->maxPoints = 0;
exec->maxContours = 0;
+ /* free stack */
+ FT_FREE( exec->stack );
+ exec->stackSize = 0;
+
/* free glyf cvt working area */
FT_FREE( exec->glyfCvt );
exec->glyfCvtSize = 0;
@@ -272,31 +295,79 @@
*
* Note that not all members of `TT_ExecContext` get initialized.
*/
- FT_LOCAL_DEF( void )
+ FT_LOCAL_DEF( FT_Error )
TT_Load_Context( TT_ExecContext exec,
TT_Face face,
TT_Size size )
{
- FT_Memory memory = exec->memory;
+ FT_Int i;
+ TT_MaxProfile* maxp;
+ FT_Error error;
+ FT_Memory memory = exec->memory;
exec->face = face;
+ maxp = &face->max_profile;
exec->size = size;
- /* CVT and storage are not persistent in FreeType */
- /* reset them after they might have been modified */
- exec->storage = exec->stack + exec->stackSize;
- exec->cvt = exec->storage + exec->storeSize;
+ if ( size )
+ {
+ exec->numFDefs = size->num_function_defs;
+ exec->maxFDefs = size->max_function_defs;
+ exec->numIDefs = size->num_instruction_defs;
+ exec->maxIDefs = size->max_instruction_defs;
+ exec->FDefs = size->function_defs;
+ exec->IDefs = size->instruction_defs;
+ exec->pointSize = size->point_size;
+ exec->tt_metrics = size->ttmetrics;
+ exec->metrics = *size->metrics;
+
+ exec->maxFunc = size->max_func;
+ exec->maxIns = size->max_ins;
+
+ for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
+ exec->codeRangeTable[i] = size->codeRangeTable[i];
+
+ /* set graphics state */
+ exec->GS = size->GS;
+
+ exec->cvtSize = size->cvt_size;
+ exec->cvt = size->cvt;
+
+ exec->storeSize = size->storage_size;
+ exec->storage = size->storage;
+
+ exec->twilight = size->twilight;
+
+ /* In case of multi-threading it can happen that the old size object */
+ /* no longer exists, thus we must clear all glyph zone references. */
+ FT_ZERO( &exec->zp0 );
+ exec->zp1 = exec->zp0;
+ exec->zp2 = exec->zp0;
+ }
+
+ /* XXX: We reserve a little more elements on the stack to deal safely */
+ /* with broken fonts like arialbs, courbs, timesbs, etc. */
+ if ( FT_QRENEW_ARRAY( exec->stack,
+ exec->stackSize,
+ maxp->maxStackElements + 32 ) )
+ return error;
+ exec->stackSize = maxp->maxStackElements + 32;
/* free previous glyph code range */
FT_FREE( exec->glyphIns );
exec->glyphSize = 0;
- exec->pointSize = size->point_size;
- exec->tt_metrics = size->ttmetrics;
- exec->metrics = *size->metrics;
+ exec->pts.n_points = 0;
+ exec->pts.n_contours = 0;
+
+ exec->zp1 = exec->pts;
+ exec->zp2 = exec->pts;
+ exec->zp0 = exec->pts;
+
+ exec->instruction_trap = FALSE;
- exec->twilight = size->twilight;
+ return FT_Err_Ok;
}
@@ -323,22 +394,89 @@
TT_Save_Context( TT_ExecContext exec,
TT_Size size )
{
- /* UNDOCUMENTED! */
- /* Only these GS values can be modified by the CVT program. */
+ FT_Int i;
+
+
+ /* XXX: Will probably disappear soon with all the code range */
+ /* management, which is now rather obsolete. */
+ /* */
+ size->num_function_defs = exec->numFDefs;
+ size->num_instruction_defs = exec->numIDefs;
+
+ size->max_func = exec->maxFunc;
+ size->max_ins = exec->maxIns;
+
+ for ( i = 0; i < TT_MAX_CODE_RANGES; i++ )
+ size->codeRangeTable[i] = exec->codeRangeTable[i];
+ }
+
+
+ /**************************************************************************
+ *
+ * @Function:
+ * TT_Run_Context
+ *
+ * @Description:
+ * Executes one or more instructions in the execution context.
+ *
+ * @Input:
+ * exec ::
+ * A handle to the target execution context.
+ *
+ * @Return:
+ * TrueType error code. 0 means success.
+ */
+ FT_LOCAL_DEF( FT_Error )
+ TT_Run_Context( TT_ExecContext exec )
+ {
+ TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 );
+
+ exec->zp0 = exec->pts;
+ exec->zp1 = exec->pts;
+ exec->zp2 = exec->pts;
+
+ exec->GS.gep0 = 1;
+ exec->GS.gep1 = 1;
+ exec->GS.gep2 = 1;
+
+ exec->GS.projVector.x = 0x4000;
+ exec->GS.projVector.y = 0x0000;
+
+ exec->GS.freeVector = exec->GS.projVector;
+ exec->GS.dualVector = exec->GS.projVector;
+
+ exec->GS.round_state = 1;
+ exec->GS.loop = 1;
+
+ /* some glyphs leave something on the stack. so we clean it */
+ /* before a new execution. */
+ exec->top = 0;
+ exec->callTop = 0;
- size->GS.minimum_distance = exec->GS.minimum_distance;
- size->GS.control_value_cutin = exec->GS.control_value_cutin;
- size->GS.single_width_cutin = exec->GS.single_width_cutin;
- size->GS.single_width_value = exec->GS.single_width_value;
- size->GS.delta_base = exec->GS.delta_base;
- size->GS.delta_shift = exec->GS.delta_shift;
- size->GS.auto_flip = exec->GS.auto_flip;
- size->GS.instruct_control = exec->GS.instruct_control;
- size->GS.scan_control = exec->GS.scan_control;
- size->GS.scan_type = exec->GS.scan_type;
+ return exec->face->interpreter( exec );
}
+ /* The default value for `scan_control' is documented as FALSE in the */
+ /* TrueType specification. This is confusing since it implies a */
+ /* Boolean value. However, this is not the case, thus both the */
+ /* default values of our `scan_type' and `scan_control' fields (which */
+ /* the documentation's `scan_control' variable is split into) are */
+ /* zero. */
+
+ const TT_GraphicsState tt_default_graphics_state =
+ {
+ 0, 0, 0,
+ { 0x4000, 0 },
+ { 0x4000, 0 },
+ { 0x4000, 0 },
+
+ 1, 64, 1,
+ TRUE, 68, 0, 0, 9, 3,
+ 0, FALSE, 0, 1, 1, 1
+ };
+
+
/* documentation is in ttinterp.h */
FT_EXPORT_DEF( TT_ExecContext )
@@ -347,8 +485,7 @@
FT_Memory memory;
FT_Error error;
- TT_ExecContext exec = NULL;
- FT_DebugHook_Func interp;
+ TT_ExecContext exec = NULL;
if ( !driver )
@@ -360,15 +497,6 @@
if ( FT_NEW( exec ) )
goto Fail;
- /* set `exec->interpreter' according to the debug hook present, */
- /* which is used by 'ttdebug'. */
- interp = driver->root.root.library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE];
-
- if ( interp )
- exec->interpreter = (TT_Interpreter)interp;
- else
- exec->interpreter = (TT_Interpreter)TT_RunIns;
-
/* create callStack here, other allocations delayed */
exec->memory = memory;
exec->callSize = 32;
@@ -1032,35 +1160,20 @@
#undef PACK
-#ifdef FT_INT64
-
-#define TT_MulFix14( a, b ) TT_MulFix14_64( a, b )
-
- static inline FT_F26Dot6
- TT_MulFix14_64( FT_F26Dot6 a,
- FT_F2Dot14 b )
- {
- FT_Int64 ab = MUL_INT64( a, b );
-
-
- ab = ADD_INT64( ab, 0x2000 + ( ab >> 63 ) ); /* rounding phase */
-
- return (FT_F26Dot6)( ab >> 14 );
- }
-
-#elif !defined( FT_CONFIG_OPTION_NO_ASSEMBLER )
+#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
#if defined( __arm__ ) && \
( defined( __thumb2__ ) || !defined( __thumb__ ) )
#define TT_MulFix14 TT_MulFix14_arm
- static __inline FT_Int32
+ static FT_Int32
TT_MulFix14_arm( FT_Int32 a,
- FT_Int32 b )
+ FT_Int b )
{
FT_Int32 t, t2;
+
#if defined( __CC_ARM ) || defined( __ARMCC__ )
__asm
@@ -1086,8 +1199,8 @@
#endif
"adds %1, %1, %0\n\t" /* %1 += %0 */
"adc %2, %2, #0\n\t" /* %2 += carry */
- "mov %0, %1, lsr #14\n\t" /* %0 = %1 >> 14 */
- "orr %0, %0, %2, lsl #18\n\t" /* %0 |= %2 << 18 */
+ "mov %0, %1, lsr #14\n\t" /* %0 = %1 >> 16 */
+ "orr %0, %0, %2, lsl #18\n\t" /* %0 |= %2 << 16 */
: "=r"(a), "=&r"(t2), "=&r"(t)
: "r"(a), "r"(b)
: "cc" );
@@ -1097,60 +1210,49 @@
return a;
}
-#elif defined( __i386__ ) || defined( _M_IX86 )
+#endif /* __arm__ && ( __thumb2__ || !__thumb__ ) */
+
+#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
+
+#if defined( __GNUC__ ) && \
+ ( defined( __i386__ ) || defined( __x86_64__ ) )
-#define TT_MulFix14 TT_MulFix14_i386
+#define TT_MulFix14 TT_MulFix14_long_long
- /* documentation is in freetype.h */
+ /* Temporarily disable the warning that C90 doesn't support `long long'. */
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Wlong-long"
- static __inline FT_Int32
- TT_MulFixi14_i386( FT_Int32 a,
- FT_Int32 b )
+ /* This is declared `noinline' because inlining the function results */
+ /* in slower code. The `pure' attribute indicates that the result */
+ /* only depends on the parameters. */
+ static __attribute__(( noinline ))
+ __attribute__(( pure )) FT_Int32
+ TT_MulFix14_long_long( FT_Int32 a,
+ FT_Int b )
{
- FT_Int32 result;
-#if defined( __GNUC__ )
+ long long ret = (long long)a * b;
- __asm__ __volatile__ (
- "imul %%edx\n"
- "movl %%edx, %%ecx\n"
- "sarl $31, %%ecx\n"
- "addl $0x2000, %%ecx\n"
- "addl %%ecx, %%eax\n"
- "adcl $0, %%edx\n"
- "shrl $14, %%eax\n"
- "shll $18, %%edx\n"
- "addl %%edx, %%eax\n"
- : "=a"(result), "=d"(b)
- : "a"(a), "d"(b)
- : "%ecx", "cc" );
-
-#elif defined( _MSC_VER)
+ /* The following line assumes that right shifting of signed values */
+ /* will actually preserve the sign bit. The exact behaviour is */
+ /* undefined, but this is true on x86 and x86_64. */
+ long long tmp = ret >> 63;
- __asm
- {
- mov eax, a
- mov edx, b
- imul edx
- mov ecx, edx
- sar ecx, 31
- add ecx, 2000h
- add eax, ecx
- adc edx, 0
- shr eax, 14
- shl edx, 18
- add eax, edx
- mov result, eax
- }
-#endif
+ ret += 0x2000 + tmp;
- return result;
+ return (FT_Int32)( ret >> 14 );
}
-#endif /* __i386__ || _M_IX86 */
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic pop
+#endif
-#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+#endif /* __GNUC__ && ( __i386__ || __x86_64__ ) */
#ifndef TT_MulFix14
@@ -1160,59 +1262,92 @@
/* for platforms where sizeof(int) == 2. */
static FT_Int32
TT_MulFix14( FT_Int32 a,
- FT_Int16 b )
+ FT_Int b )
{
- FT_Int32 m, hi;
- FT_UInt32 l, lo;
+ FT_Int32 sign;
+ FT_UInt32 ah, al, mid, lo, hi;
- /* compute a*b as 64-bit (hi_lo) value */
- l = (FT_UInt32)( ( a & 0xFFFFU ) * b );
- m = ( a >> 16 ) * b;
+ sign = a ^ b;
- lo = l + ( (FT_UInt32)m << 16 );
- hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l );
+ if ( a < 0 )
+ a = -a;
+ if ( b < 0 )
+ b = -b;
- /* divide the result by 2^14 with rounding */
- l = lo + 0x2000U + (FT_UInt32)( hi >> 31 ); /* rounding phase */
- hi += ( l < lo );
+ ah = (FT_UInt32)( ( a >> 16 ) & 0xFFFFU );
+ al = (FT_UInt32)( a & 0xFFFFU );
- return (FT_F26Dot6)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) );
+ lo = al * b;
+ mid = ah * b;
+ hi = mid >> 16;
+ mid = ( mid << 16 ) + ( 1 << 13 ); /* rounding */
+ lo += mid;
+ if ( lo < mid )
+ hi += 1;
+
+ mid = ( lo >> 14 ) | ( hi << 18 );
+
+ return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid;
}
#endif /* !TT_MulFix14 */
-#ifdef FT_INT64
+#if defined( __GNUC__ ) && \
+ ( defined( __i386__ ) || \
+ defined( __x86_64__ ) || \
+ defined( __arm__ ) )
- /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */
- static inline FT_F26Dot6
- TT_DotFix14( FT_F26Dot6 ax,
- FT_F26Dot6 ay,
- FT_F2Dot14 bx,
- FT_F2Dot14 by )
+#define TT_DotFix14 TT_DotFix14_long_long
+
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic push
+#endif
+#pragma GCC diagnostic ignored "-Wlong-long"
+
+ static __attribute__(( pure )) FT_Int32
+ TT_DotFix14_long_long( FT_Int32 ax,
+ FT_Int32 ay,
+ FT_Int bx,
+ FT_Int by )
{
- FT_Int64 c = ADD_INT64( MUL_INT64( ax, bx ), MUL_INT64( ay, by ) );
+ /* Temporarily disable the warning that C90 doesn't support */
+ /* `long long'. */
+
+ long long temp1 = (long long)ax * bx;
+ long long temp2 = (long long)ay * by;
+
+ temp1 += temp2;
+ temp2 = temp1 >> 63;
+ temp1 += 0x2000 + temp2;
- c = ADD_INT64( c, 0x2000 + ( c >> 63 ) ); /* rounding phase */
+ return (FT_Int32)( temp1 >> 14 );
- return (FT_F26Dot6)( c >> 14 );
}
-#else
+#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406
+#pragma GCC diagnostic pop
+#endif
+
+#endif /* __GNUC__ && (__arm__ || __i386__ || __x86_64__) */
+
- static inline FT_F26Dot6
- TT_DotFix14( FT_F26Dot6 ax,
- FT_F26Dot6 ay,
- FT_F2Dot14 bx,
- FT_F2Dot14 by )
+#ifndef TT_DotFix14
+
+ /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */
+ static FT_Int32
+ TT_DotFix14( FT_Int32 ax,
+ FT_Int32 ay,
+ FT_Int bx,
+ FT_Int by )
{
- FT_Int32 m, hi1, hi2, hi;
+ FT_Int32 m, s, hi1, hi2, hi;
FT_UInt32 l, lo1, lo2, lo;
- /* compute ax*bx as 64-bit (hi_lo) value */
+ /* compute ax*bx as 64-bit value */
l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx );
m = ( ax >> 16 ) * bx;
@@ -1231,13 +1366,18 @@
hi = hi1 + hi2 + ( lo < lo1 );
/* divide the result by 2^14 with rounding */
- l = lo + 0x2000U + (FT_UInt32)( hi >> 31 ); /* rounding phase */
+ s = hi >> 31;
+ l = lo + (FT_UInt32)s;
+ hi += s + ( l < lo );
+ lo = l;
+
+ l = lo + 0x2000U;
hi += ( l < lo );
- return (FT_F26Dot6)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) );
+ return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) );
}
-#endif /* !FT_INT64 */
+#endif /* TT_DotFix14 */
/**************************************************************************
@@ -1391,6 +1531,31 @@
}
+ /**************************************************************************
+ *
+ * @Function:
+ * GetShortIns
+ *
+ * @Description:
+ * Returns a short integer taken from the instruction stream at
+ * address IP.
+ *
+ * @Return:
+ * Short read at code[IP].
+ *
+ * @Note:
+ * This one could become a macro.
+ */
+ static FT_Short
+ GetShortIns( TT_ExecContext exc )
+ {
+ /* Reading a byte stream so there is no endianness (DaveP) */
+ exc->IP += 2;
+ return (FT_Short)( ( exc->code[exc->IP - 2] << 8 ) +
+ exc->code[exc->IP - 1] );
+ }
+
+
/**************************************************************************
*
* @Function:
@@ -1444,7 +1609,6 @@
exc->code = range->base;
exc->codeSize = range->size;
exc->IP = aIP;
- exc->length = 0;
exc->curRange = aRange;
return SUCCESS;
@@ -1507,33 +1671,48 @@
FT_UShort point,
FT_F26Dot6 distance )
{
- FT_Fixed v;
+ FT_F26Dot6 v;
- v = exc->moveVector.x;
+ v = exc->GS.freeVector.x;
+
if ( v != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/* Exception to the post-IUP curfew: Allow the x component of */
/* diagonal moves, but only post-IUP. DejaVu tries to adjust */
/* diagonal stems like on `Z' and `z' post-IUP. */
- if ( !exc->backward_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
+ zone->cur[point].x = ADD_LONG( zone->cur[point].x,
+ FT_MulDiv( distance,
+ v,
+ exc->F_dot_P ) );
+ else
#endif
+
+ if ( NO_SUBPIXEL_HINTING )
zone->cur[point].x = ADD_LONG( zone->cur[point].x,
- FT_MulFix( distance, v ) );
+ FT_MulDiv( distance,
+ v,
+ exc->F_dot_P ) );
zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
}
- v = exc->moveVector.y;
+ v = exc->GS.freeVector.y;
+
if ( v != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility != 0x7 )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called ) )
#endif
zone->cur[point].y = ADD_LONG( zone->cur[point].y,
- FT_MulFix( distance, v ) );
+ FT_MulDiv( distance,
+ v,
+ exc->F_dot_P ) );
zone->tags[point] |= FT_CURVE_TAG_TOUCH_Y;
}
@@ -1566,20 +1745,24 @@
FT_UShort point,
FT_F26Dot6 distance )
{
- FT_Fixed v;
+ FT_F26Dot6 v;
- v = exc->moveVector.x;
+ v = exc->GS.freeVector.x;
if ( v != 0 )
zone->org[point].x = ADD_LONG( zone->org[point].x,
- FT_MulFix( distance, v ) );
+ FT_MulDiv( distance,
+ v,
+ exc->F_dot_P ) );
- v = exc->moveVector.y;
+ v = exc->GS.freeVector.y;
if ( v != 0 )
zone->org[point].y = ADD_LONG( zone->org[point].y,
- FT_MulFix( distance, v ) );
+ FT_MulDiv( distance,
+ v,
+ exc->F_dot_P ) );
}
@@ -1601,8 +1784,12 @@
FT_F26Dot6 distance )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( !exc->backward_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL && !exc->backward_compatibility )
+ zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
+ else
#endif
+
+ if ( NO_SUBPIXEL_HINTING )
zone->cur[point].x = ADD_LONG( zone->cur[point].x, distance );
zone->tags[point] |= FT_CURVE_TAG_TOUCH_X;
@@ -1618,8 +1805,9 @@
FT_UNUSED( exc );
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility != 0x7 )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called && exc->iupy_called ) )
#endif
zone->cur[point].y = ADD_LONG( zone->cur[point].y, distance );
@@ -1672,8 +1860,8 @@
* distance ::
* The distance (not) to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* The compensated distance.
@@ -1681,10 +1869,10 @@
static FT_F26Dot6
Round_None( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
- FT_UNUSED( exc );
if ( distance >= 0 )
@@ -1715,8 +1903,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -1724,10 +1912,10 @@
static FT_F26Dot6
Round_To_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
- FT_UNUSED( exc );
if ( distance >= 0 )
@@ -1760,8 +1948,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -1769,10 +1957,10 @@
static FT_F26Dot6
Round_To_Half_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
- FT_UNUSED( exc );
if ( distance >= 0 )
@@ -1807,8 +1995,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -1816,10 +2004,10 @@
static FT_F26Dot6
Round_Down_To_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
- FT_UNUSED( exc );
if ( distance >= 0 )
@@ -1851,8 +2039,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -1860,10 +2048,10 @@
static FT_F26Dot6
Round_Up_To_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
- FT_UNUSED( exc );
if ( distance >= 0 )
@@ -1896,8 +2084,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -1905,10 +2093,10 @@
static FT_F26Dot6
Round_To_Double_Grid( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
- FT_UNUSED( exc );
if ( distance >= 0 )
@@ -1941,8 +2129,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -1956,8 +2144,9 @@
static FT_F26Dot6
Round_Super( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
@@ -1996,8 +2185,8 @@
* distance ::
* The distance to round.
*
- * compensation ::
- * The engine compensation.
+ * color ::
+ * The engine compensation color.
*
* @Return:
* Rounded distance.
@@ -2009,8 +2198,9 @@
static FT_F26Dot6
Round_Super_45( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation )
+ FT_Int color )
{
+ FT_F26Dot6 compensation = exc->tt_metrics.compensations[color];
FT_F26Dot6 val;
@@ -2037,6 +2227,59 @@
}
+ /**************************************************************************
+ *
+ * @Function:
+ * Compute_Round
+ *
+ * @Description:
+ * Sets the rounding mode.
+ *
+ * @Input:
+ * round_mode ::
+ * The rounding mode to be used.
+ */
+ static void
+ Compute_Round( TT_ExecContext exc,
+ FT_Byte round_mode )
+ {
+ switch ( round_mode )
+ {
+ case TT_Round_Off:
+ exc->func_round = (TT_Round_Func)Round_None;
+ break;
+
+ case TT_Round_To_Grid:
+ exc->func_round = (TT_Round_Func)Round_To_Grid;
+ break;
+
+ case TT_Round_Up_To_Grid:
+ exc->func_round = (TT_Round_Func)Round_Up_To_Grid;
+ break;
+
+ case TT_Round_Down_To_Grid:
+ exc->func_round = (TT_Round_Func)Round_Down_To_Grid;
+ break;
+
+ case TT_Round_To_Half_Grid:
+ exc->func_round = (TT_Round_Func)Round_To_Half_Grid;
+ break;
+
+ case TT_Round_To_Double_Grid:
+ exc->func_round = (TT_Round_Func)Round_To_Double_Grid;
+ break;
+
+ case TT_Round_Super:
+ exc->func_round = (TT_Round_Func)Round_Super;
+ break;
+
+ case TT_Round_Super_45:
+ exc->func_round = (TT_Round_Func)Round_Super_45;
+ break;
+ }
+ }
+
+
/**************************************************************************
*
* @Function:
@@ -2238,45 +2481,14 @@
static void
Compute_Funcs( TT_ExecContext exc )
{
- FT_Long F_dot_P =
- ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x +
- (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y +
- 0x2000L ) >> 14;
-
-
- if ( F_dot_P >= 0x3FFEL )
- {
- /* commonly collinear */
- exc->moveVector.x = exc->GS.freeVector.x * 4;
- exc->moveVector.y = exc->GS.freeVector.y * 4;
- }
- else if ( -0x400L < F_dot_P && F_dot_P < 0x400L )
- {
- /* prohibitively orthogonal */
- exc->moveVector.x = 0;
- exc->moveVector.y = 0;
- }
- else
- {
- exc->moveVector.x = exc->GS.freeVector.x * 0x10000L / F_dot_P;
- exc->moveVector.y = exc->GS.freeVector.y * 0x10000L / F_dot_P;
- }
-
- if ( F_dot_P >= 0x3FFEL && exc->GS.freeVector.x == 0x4000 )
- {
- exc->func_move = (TT_Move_Func)Direct_Move_X;
- exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
- }
- else if ( F_dot_P >= 0x3FFEL && exc->GS.freeVector.y == 0x4000 )
- {
- exc->func_move = (TT_Move_Func)Direct_Move_Y;
- exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
- }
+ if ( exc->GS.freeVector.x == 0x4000 )
+ exc->F_dot_P = exc->GS.projVector.x;
+ else if ( exc->GS.freeVector.y == 0x4000 )
+ exc->F_dot_P = exc->GS.projVector.y;
else
- {
- exc->func_move = (TT_Move_Func)Direct_Move;
- exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig;
- }
+ exc->F_dot_P =
+ ( (FT_Long)exc->GS.projVector.x * exc->GS.freeVector.x +
+ (FT_Long)exc->GS.projVector.y * exc->GS.freeVector.y ) >> 14;
if ( exc->GS.projVector.x == 0x4000 )
exc->func_project = (TT_Project_Func)Project_x;
@@ -2292,6 +2504,29 @@
else
exc->func_dualproj = (TT_Project_Func)Dual_Project;
+ exc->func_move = (TT_Move_Func)Direct_Move;
+ exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig;
+
+ if ( exc->F_dot_P == 0x4000L )
+ {
+ if ( exc->GS.freeVector.x == 0x4000 )
+ {
+ exc->func_move = (TT_Move_Func)Direct_Move_X;
+ exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_X;
+ }
+ else if ( exc->GS.freeVector.y == 0x4000 )
+ {
+ exc->func_move = (TT_Move_Func)Direct_Move_Y;
+ exc->func_move_orig = (TT_Move_Func)Direct_Move_Orig_Y;
+ }
+ }
+
+ /* at small sizes, F_dot_P can become too small, resulting */
+ /* in overflows and `spikes' in a number of glyphs like `w'. */
+
+ if ( FT_ABS( exc->F_dot_P ) < 0x400L )
+ exc->F_dot_P = 0x4000L;
+
/* Disable cached aspect ratio */
exc->tt_metrics.ratio = 0;
}
@@ -2564,7 +2799,7 @@
Ins_ODD( TT_ExecContext exc,
FT_Long* args )
{
- args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 64 ) == 64 );
+ args[0] = ( ( exc->func_round( exc, args[0], 3 ) & 127 ) == 64 );
}
@@ -2578,7 +2813,7 @@
Ins_EVEN( TT_ExecContext exc,
FT_Long* args )
{
- args[0] = ( ( exc->func_round( exc, args[0], 0 ) & 64 ) == 0 );
+ args[0] = ( ( exc->func_round( exc, args[0], 3 ) & 127 ) == 0 );
}
@@ -2785,7 +3020,7 @@
FT_MEM_QRENEW_ARRAY( exc->glyfStorage,
exc->glyfStoreSize,
exc->storeSize );
- exc->error = error;
+ exc->error = error;
if ( error )
return;
@@ -2908,8 +3143,7 @@
Ins_ROUND( TT_ExecContext exc,
FT_Long* args )
{
- args[0] = exc->func_round( exc, args[0],
- exc->GS.compensation[exc->opcode & 3] );
+ args[0] = exc->func_round( exc, args[0], exc->opcode & 3 );
}
@@ -2923,8 +3157,7 @@
Ins_NROUND( TT_ExecContext exc,
FT_Long* args )
{
- args[0] = Round_None( exc, args[0],
- exc->GS.compensation[exc->opcode & 3] );
+ args[0] = Round_None( exc, args[0], exc->opcode & 3 );
}
@@ -2978,11 +3211,13 @@
}
else
{
- K = args[-L];
+ K = exc->stack[exc->args - L];
- FT_ARRAY_MOVE( args - L, args - L + 1, L - 1 );
+ FT_ARRAY_MOVE( &exc->stack[exc->args - L ],
+ &exc->stack[exc->args - L + 1],
+ ( L - 1 ) );
- args[-1] = K;
+ exc->stack[exc->args - 1] = K;
}
}
@@ -3009,7 +3244,7 @@
args[0] = 0;
}
else
- args[0] = args[-L];
+ args[0] = exc->stack[exc->args - L];
}
@@ -3079,7 +3314,8 @@
exc->length = 2 - exc->length * exc->code[exc->IP + 1];
}
- return SUCCESS;
+ if ( exc->IP + exc->length <= exc->codeSize )
+ return SUCCESS;
}
Fail_Overflow:
@@ -3127,9 +3363,6 @@
nIfs--;
Out = FT_BOOL( nIfs == 0 );
break;
-
- default:
- break;
}
} while ( Out == 0 );
}
@@ -3163,9 +3396,6 @@
case 0x59: /* EIF */
nIfs--;
break;
-
- default:
- break;
}
} while ( nIfs != 0 );
}
@@ -3209,7 +3439,7 @@
return;
}
- exc->length = 0;
+ exc->step_ins = FALSE;
if ( args[0] < 0 )
{
@@ -3310,10 +3540,10 @@
return;
}
- rec->range = exc->curRange;
- rec->opc = (FT_UInt16)n;
- rec->start = exc->IP + 1;
- rec->active = TRUE;
+ rec->range = exc->curRange;
+ rec->opc = (FT_UInt16)n;
+ rec->start = exc->IP + 1;
+ rec->active = TRUE;
if ( n > exc->maxFunc )
exc->maxFunc = (FT_UInt16)n;
@@ -3325,17 +3555,14 @@
{
switch ( exc->opcode )
{
- case 0x89: /* IDEF */
- case 0x2C: /* FDEF */
+ case 0x89: /* IDEF */
+ case 0x2C: /* FDEF */
exc->error = FT_THROW( Nested_DEFS );
return;
case 0x2D: /* ENDF */
rec->end = exc->IP;
return;
-
- default:
- break;
}
}
}
@@ -3365,11 +3592,12 @@
pRec->Cur_Count--;
+ exc->step_ins = FALSE;
+
if ( pRec->Cur_Count > 0 )
{
exc->callTop++;
- exc->IP = pRec->Def->start;
- exc->length = 0;
+ exc->IP = pRec->Def->start;
}
else
/* Loop through the current function */
@@ -3457,6 +3685,8 @@
Ins_Goto_CodeRange( exc, def->range, def->start );
+ exc->step_ins = FALSE;
+
return;
Fail:
@@ -3534,6 +3764,8 @@
Ins_Goto_CodeRange( exc, def->range, def->start );
+ exc->step_ins = FALSE;
+
exc->loopcall_counter += (FT_ULong)args[0];
if ( exc->loopcall_counter > exc->loopcall_counter_max )
exc->error = FT_THROW( Execution_Too_Long );
@@ -3613,13 +3845,9 @@
case 0x2C: /* FDEF */
exc->error = FT_THROW( Nested_DEFS );
return;
-
case 0x2D: /* ENDF */
def->end = exc->IP;
return;
-
- default:
- break;
}
}
}
@@ -3642,23 +3870,10 @@
Ins_NPUSHB( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long IP = exc->IP;
- FT_Int L, K;
-
+ FT_UShort L, K;
- if ( ++IP >= exc->codeSize )
- {
- exc->error = FT_THROW( Code_Overflow );
- return;
- }
- L = exc->code[IP];
-
- if ( IP + L >= exc->codeSize )
- {
- exc->error = FT_THROW( Code_Overflow );
- return;
- }
+ L = (FT_UShort)exc->code[exc->IP + 1];
if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
@@ -3666,11 +3881,10 @@
return;
}
- for ( K = 0; K < L; K++ )
- args[K] = exc->code[++IP];
+ for ( K = 1; K <= L; K++ )
+ args[K - 1] = exc->code[exc->IP + K + 1];
exc->new_top += L;
- exc->IP = IP;
}
@@ -3684,23 +3898,10 @@
Ins_NPUSHW( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long IP = exc->IP;
- FT_Int L, K;
+ FT_UShort L, K;
- if ( ++IP >= exc->codeSize )
- {
- exc->error = FT_THROW( Code_Overflow );
- return;
- }
-
- L = exc->code[IP];
-
- if ( IP + 2 * L >= exc->codeSize )
- {
- exc->error = FT_THROW( Code_Overflow );
- return;
- }
+ L = (FT_UShort)exc->code[exc->IP + 1];
if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
@@ -3708,12 +3909,13 @@
return;
}
- /* note casting for sign-extension */
- for ( K = 0; K < L; K++, IP += 2 )
- args[K] = (FT_Short)( exc->code[IP + 1] << 8 ) | exc->code[IP + 2];
+ exc->IP += 2;
+ for ( K = 0; K < L; K++ )
+ args[K] = GetShortIns( exc );
+
+ exc->step_ins = FALSE;
exc->new_top += L;
- exc->IP = IP;
}
@@ -3727,17 +3929,10 @@
Ins_PUSHB( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long IP = exc->IP;
- FT_Int L, K;
+ FT_UShort L, K;
- L = exc->opcode - 0xB0 + 1;
-
- if ( IP + L >= exc->codeSize )
- {
- exc->error = FT_THROW( Code_Overflow );
- return;
- }
+ L = (FT_UShort)( exc->opcode - 0xB0 + 1 );
if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
@@ -3745,10 +3940,8 @@
return;
}
- for ( K = 0; K < L; K++ )
- args[K] = exc->code[++IP];
-
- exc->IP = IP;
+ for ( K = 1; K <= L; K++ )
+ args[K - 1] = exc->code[exc->IP + K];
}
@@ -3762,17 +3955,10 @@
Ins_PUSHW( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long IP = exc->IP;
- FT_Int L, K;
-
+ FT_UShort L, K;
- L = exc->opcode - 0xB8 + 1;
- if ( IP + 2 * L >= exc->codeSize )
- {
- exc->error = FT_THROW( Code_Overflow );
- return;
- }
+ L = (FT_UShort)( exc->opcode - 0xB8 + 1 );
if ( BOUNDS( L, exc->stackSize + 1 - exc->top ) )
{
@@ -3780,11 +3966,12 @@
return;
}
- /* note casting for sign-extension */
- for ( K = 0; K < L; K++, IP += 2 )
- args[K] = (FT_Short)( exc->code[IP + 1] << 8 ) | exc->code[IP + 2];
+ exc->IP++;
- exc->IP = IP;
+ for ( K = 0; K < L; K++ )
+ args[K] = GetShortIns( exc );
+
+ exc->step_ins = FALSE;
}
@@ -3955,12 +4142,15 @@
Ins_SPVFS( TT_ExecContext exc,
FT_Long* args )
{
+ FT_Short S;
FT_Long X, Y;
/* Only use low 16bits, then sign extend */
- Y = (FT_Short)args[1];
- X = (FT_Short)args[0];
+ S = (FT_Short)args[1];
+ Y = (FT_Long)S;
+ S = (FT_Short)args[0];
+ X = (FT_Long)S;
Normalize( X, Y, &exc->GS.projVector );
@@ -3979,12 +4169,15 @@
Ins_SFVFS( TT_ExecContext exc,
FT_Long* args )
{
+ FT_Short S;
FT_Long X, Y;
/* Only use low 16bits, then sign extend */
- Y = (FT_Short)args[1];
- X = (FT_Short)args[0];
+ S = (FT_Short)args[1];
+ Y = (FT_Long)S;
+ S = (FT_Short)args[0];
+ X = S;
Normalize( X, Y, &exc->GS.freeVector );
Compute_Funcs( exc );
@@ -4722,7 +4915,7 @@
/* compatibility hacks and lets them program points to the grid like */
/* it's 1996. They might sign a waiver for just one glyph, though. */
if ( SUBPIXEL_HINTING_MINIMAL )
- exc->backward_compatibility = ( L & 4 ) ^ 4;
+ exc->backward_compatibility = !FT_BOOL( L == 4 );
#endif
}
else if ( exc->pedantic_hinting )
@@ -4806,31 +4999,32 @@
* Stack: uint32... -->
*/
static void
- Ins_FLIPPT( TT_ExecContext exc,
- FT_Long* args )
+ Ins_FLIPPT( TT_ExecContext exc )
{
- FT_Long loop = exc->GS.loop;
FT_UShort point;
- if ( exc->new_top < loop )
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ /* See `ttinterp.h' for details on backward compatibility mode. */
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called )
+ goto Fail;
+#endif
+
+ if ( exc->top < exc->GS.loop )
{
if ( exc->pedantic_hinting )
exc->error = FT_THROW( Too_Few_Arguments );
goto Fail;
}
- exc->new_top -= loop;
-
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility == 0x7 )
- goto Fail;
-#endif
-
- while ( loop-- )
+ while ( exc->GS.loop > 0 )
{
- point = (FT_UShort)*(--args);
+ exc->args--;
+
+ point = (FT_UShort)exc->stack[exc->args];
if ( BOUNDS( point, exc->pts.n_points ) )
{
@@ -4842,10 +5036,13 @@
}
else
exc->pts.tags[point] ^= FT_CURVE_TAG_ON;
+
+ exc->GS.loop--;
}
Fail:
exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -4864,7 +5061,10 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility == 0x7 )
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called )
return;
#endif
@@ -4899,7 +5099,10 @@
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility == 0x7 )
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called )
return;
#endif
@@ -4955,8 +5158,8 @@
d = PROJECT( zp.cur + p, zp.org + p );
- *x = FT_MulFix( d, exc->moveVector.x );
- *y = FT_MulFix( d, exc->moveVector.y );
+ *x = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.x, exc->F_dot_P );
+ *y = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.y, exc->F_dot_P );
return SUCCESS;
}
@@ -4973,8 +5176,8 @@
if ( exc->GS.freeVector.x != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backward compatibility mode. */
- if ( !exc->backward_compatibility )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility ) )
#endif
exc->zp2.cur[point].x = ADD_LONG( exc->zp2.cur[point].x, dx );
@@ -4985,8 +5188,10 @@
if ( exc->GS.freeVector.y != 0 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility != 0x7 )
+ if ( !( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility &&
+ exc->iupx_called &&
+ exc->iupy_called ) )
#endif
exc->zp2.cur[point].y = ADD_LONG( exc->zp2.cur[point].y, dy );
@@ -5003,10 +5208,8 @@
* Stack: uint32... -->
*/
static void
- Ins_SHP( TT_ExecContext exc,
- FT_Long* args )
+ Ins_SHP( TT_ExecContext exc )
{
- FT_Long loop = exc->GS.loop;
TT_GlyphZoneRec zp;
FT_UShort refp;
@@ -5014,21 +5217,20 @@
FT_UShort point;
- if ( exc->new_top < loop )
+ if ( exc->top < exc->GS.loop )
{
if ( exc->pedantic_hinting )
- exc->error = FT_THROW( Too_Few_Arguments );
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
- exc->new_top -= loop;
-
if ( Compute_Point_Displacement( exc, &dx, &dy, &zp, &refp ) )
return;
- while ( loop-- )
+ while ( exc->GS.loop > 0 )
{
- point = (FT_UShort)*(--args);
+ exc->args--;
+ point = (FT_UShort)exc->stack[exc->args];
if ( BOUNDS( point, exc->zp2.n_points ) )
{
@@ -5040,10 +5242,13 @@
}
else
Move_Zp2_Point( exc, point, dx, dy, TRUE );
+
+ exc->GS.loop--;
}
Fail:
exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -5159,7 +5364,6 @@
Ins_SHPIX( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long loop = exc->GS.loop;
FT_F26Dot6 dx, dy;
FT_UShort point;
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
@@ -5169,21 +5373,22 @@
#endif
- if ( exc->new_top < loop )
+
+ if ( exc->top < exc->GS.loop + 1 )
{
if ( exc->pedantic_hinting )
- exc->error = FT_THROW( Too_Few_Arguments );
+ exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
- exc->new_top -= loop;
-
dx = TT_MulFix14( args[0], exc->GS.freeVector.x );
dy = TT_MulFix14( args[0], exc->GS.freeVector.y );
- while ( loop-- )
+ while ( exc->GS.loop > 0 )
{
- point = (FT_UShort)*(--args);
+ exc->args--;
+
+ point = (FT_UShort)exc->stack[exc->args];
if ( BOUNDS( point, exc->zp2.n_points ) )
{
@@ -5195,7 +5400,8 @@
}
else
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- if ( exc->backward_compatibility )
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility )
{
/* Special case: allow SHPIX to move points in the twilight zone. */
/* Otherwise, treat SHPIX the same as DELTAP. Unbreaks various */
@@ -5203,7 +5409,7 @@
/* that would glitch severely after calling ALIGNRP after a */
/* blocked SHPIX. */
if ( in_twilight ||
- ( exc->backward_compatibility != 0x7 &&
+ ( !( exc->iupx_called && exc->iupy_called ) &&
( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
( exc->zp2.tags[point] & FT_CURVE_TAG_TOUCH_Y ) ) ) )
Move_Zp2_Point( exc, point, 0, dy, TRUE );
@@ -5211,10 +5417,13 @@
else
#endif
Move_Zp2_Point( exc, point, dx, dy, TRUE );
+
+ exc->GS.loop--;
}
Fail:
exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -5293,7 +5502,7 @@
if ( ( exc->opcode & 1 ) != 0 )
{
cur_dist = FAST_PROJECT( &exc->zp0.cur[point] );
- distance = SUB_LONG( exc->func_round( exc, cur_dist, 0 ), cur_dist );
+ distance = SUB_LONG( exc->func_round( exc, cur_dist, 3 ), cur_dist );
}
else
distance = 0;
@@ -5357,7 +5566,7 @@
if ( exc->GS.gep0 == 0 ) /* If in twilight zone */
{
exc->zp0.org[point].x = TT_MulFix14( distance,
- exc->GS.freeVector.x );
+ exc->GS.freeVector.x );
exc->zp0.org[point].y = TT_MulFix14( distance,
exc->GS.freeVector.y );
exc->zp0.cur[point] = exc->zp0.org[point];
@@ -5378,7 +5587,7 @@
if ( delta > control_value_cutin )
distance = org_dist;
- distance = exc->func_round( exc, distance, 0 );
+ distance = exc->func_round( exc, distance, 3 );
}
exc->func_move( exc, &exc->zp0, point, SUB_LONG( distance, org_dist ) );
@@ -5400,7 +5609,7 @@
FT_Long* args )
{
FT_UShort point = 0;
- FT_F26Dot6 org_dist, distance, compensation;
+ FT_F26Dot6 org_dist, distance;
point = (FT_UShort)args[0];
@@ -5455,11 +5664,11 @@
/* single width cut-in test */
/* |org_dist - single_width_value| < single_width_cutin */
- if ( exc->GS.single_width_cutin > 0 &&
- org_dist < ADD_LONG( exc->GS.single_width_value,
- exc->GS.single_width_cutin ) &&
- org_dist > SUB_LONG( exc->GS.single_width_value,
- exc->GS.single_width_cutin ) )
+ if ( exc->GS.single_width_cutin > 0 &&
+ org_dist < exc->GS.single_width_value +
+ exc->GS.single_width_cutin &&
+ org_dist > exc->GS.single_width_value -
+ exc->GS.single_width_cutin )
{
if ( org_dist >= 0 )
org_dist = exc->GS.single_width_value;
@@ -5469,12 +5678,12 @@
/* round flag */
- compensation = exc->GS.compensation[exc->opcode & 3];
-
if ( ( exc->opcode & 4 ) != 0 )
- distance = exc->func_round( exc, org_dist, compensation );
+ {
+ distance = exc->func_round( exc, org_dist, exc->opcode & 3 );
+ }
else
- distance = Round_None( exc, org_dist, compensation );
+ distance = Round_None( exc, org_dist, exc->opcode & 3 );
/* minimum distance flag */
@@ -5526,8 +5735,7 @@
FT_F26Dot6 cvt_dist,
distance,
cur_dist,
- org_dist,
- compensation;
+ org_dist;
FT_F26Dot6 delta;
@@ -5593,8 +5801,6 @@
/* control value cut-in and round */
- compensation = exc->GS.compensation[exc->opcode & 3];
-
if ( ( exc->opcode & 4 ) != 0 )
{
/* XXX: UNDOCUMENTED! Only perform cut-in test when both points */
@@ -5625,16 +5831,16 @@
cvt_dist = org_dist;
}
- distance = exc->func_round( exc, cvt_dist, compensation );
+ distance = exc->func_round( exc, cvt_dist, exc->opcode & 3 );
}
else
- distance = Round_None( exc, cvt_dist, compensation );
+ distance = Round_None( exc, cvt_dist, exc->opcode & 3 );
/* minimum distance test */
if ( ( exc->opcode & 8 ) != 0 )
{
- FT_F26Dot6 minimum_distance = exc->GS.minimum_distance;
+ FT_F26Dot6 minimum_distance = exc->GS.minimum_distance;
if ( org_dist >= 0 )
@@ -5656,10 +5862,11 @@
Fail:
exc->GS.rp1 = exc->GS.rp0;
- exc->GS.rp2 = point;
if ( ( exc->opcode & 16 ) != 0 )
exc->GS.rp0 = point;
+
+ exc->GS.rp2 = point;
}
@@ -5670,33 +5877,25 @@
* Stack: uint32 uint32... -->
*/
static void
- Ins_ALIGNRP( TT_ExecContext exc,
- FT_Long* args )
+ Ins_ALIGNRP( TT_ExecContext exc )
{
- FT_Long loop = exc->GS.loop;
FT_UShort point;
FT_F26Dot6 distance;
- if ( exc->new_top < loop )
- {
- if ( exc->pedantic_hinting )
- exc->error = FT_THROW( Too_Few_Arguments );
- goto Fail;
- }
-
- exc->new_top -= loop;
-
- if ( BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
+ if ( exc->top < exc->GS.loop ||
+ BOUNDS( exc->GS.rp0, exc->zp0.n_points ) )
{
if ( exc->pedantic_hinting )
exc->error = FT_THROW( Invalid_Reference );
goto Fail;
}
- while ( loop-- )
+ while ( exc->GS.loop > 0 )
{
- point = (FT_UShort)*(--args);
+ exc->args--;
+
+ point = (FT_UShort)exc->stack[exc->args];
if ( BOUNDS( point, exc->zp1.n_points ) )
{
@@ -5713,10 +5912,13 @@
exc->func_move( exc, &exc->zp1, point, NEG_LONG( distance ) );
}
+
+ exc->GS.loop--;
}
Fail:
exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -5858,26 +6060,15 @@
/* SOMETIMES, DUMBER CODE IS BETTER CODE */
static void
- Ins_IP( TT_ExecContext exc,
- FT_Long* args )
+ Ins_IP( TT_ExecContext exc )
{
- FT_Long loop = exc->GS.loop;
FT_F26Dot6 old_range, cur_range;
FT_Vector* orus_base;
FT_Vector* cur_base;
FT_Int twilight;
- if ( exc->new_top < loop )
- {
- if ( exc->pedantic_hinting )
- exc->error = FT_THROW( Too_Few_Arguments );
- goto Fail;
- }
-
- exc->new_top -= loop;
-
- if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) )
+ if ( exc->top < exc->GS.loop )
{
if ( exc->pedantic_hinting )
exc->error = FT_THROW( Invalid_Reference );
@@ -5893,6 +6084,13 @@
exc->GS.gep1 == 0 ||
exc->GS.gep2 == 0 );
+ if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) )
+ {
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
+ goto Fail;
+ }
+
if ( twilight )
orus_base = &exc->zp0.org[exc->GS.rp1];
else
@@ -5904,7 +6102,8 @@
/* fonts out there (e.g. [aeu]grave in monotype.ttf) */
/* calling IP[] with bad values of rp[12]. */
/* Do something sane when this odd thing happens. */
- if ( BOUNDS( exc->GS.rp2, exc->zp1.n_points ) )
+ if ( BOUNDS( exc->GS.rp1, exc->zp0.n_points ) ||
+ BOUNDS( exc->GS.rp2, exc->zp1.n_points ) )
{
old_range = 0;
cur_range = 0;
@@ -5933,9 +6132,9 @@
cur_range = PROJECT( &exc->zp1.cur[exc->GS.rp2], cur_base );
}
- while ( loop-- )
+ for ( ; exc->GS.loop > 0; exc->GS.loop-- )
{
- FT_UInt point = (FT_UInt)*(--args);
+ FT_UInt point = (FT_UInt)exc->stack[--exc->args];
FT_F26Dot6 org_dist, cur_dist, new_dist;
@@ -6007,6 +6206,7 @@
Fail:
exc->GS.loop = 1;
+ exc->new_top = exc->args;
}
@@ -6205,10 +6405,17 @@
/* See `ttinterp.h' for details on backward compatibility mode. */
/* Allow IUP until it has been called on both axes. Immediately */
/* return on subsequent ones. */
- if ( exc->backward_compatibility == 0x7 )
- return;
- else if ( exc->backward_compatibility )
- exc->backward_compatibility |= 1 << ( exc->opcode & 1 );
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility )
+ {
+ if ( exc->iupx_called && exc->iupy_called )
+ return;
+
+ if ( exc->opcode & 1 )
+ exc->iupx_called = TRUE;
+ else
+ exc->iupy_called = TRUE;
+ }
#endif
/* ignore empty outlines */
@@ -6300,50 +6507,30 @@
Ins_DELTAP( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long nump;
+ FT_ULong nump, k;
FT_UShort A;
- FT_Long B, P, F;
+ FT_ULong C, P;
+ FT_Long B;
- nump = args[0]; /* signed value for convenience */
+ P = (FT_ULong)exc->func_cur_ppem( exc );
+ nump = (FT_ULong)args[0]; /* some points theoretically may occur more
+ than once, thus UShort isn't enough */
- if ( nump < 0 || nump > exc->new_top / 2 )
+ for ( k = 1; k <= nump; k++ )
{
- if ( exc->pedantic_hinting )
- exc->error = FT_THROW( Too_Few_Arguments );
-
- nump = exc->new_top / 2;
- }
-
- exc->new_top -= 2 * nump;
-
- P = exc->func_cur_ppem( exc ) - exc->GS.delta_base;
-
- switch ( exc->opcode )
- {
- case 0x5D:
- break;
-
- case 0x71:
- P -= 16;
- break;
-
- case 0x72:
- P -= 32;
- break;
- }
-
- /* check applicable range of adjusted ppem */
- if ( P & ~0xF ) /* P < 0 || P > 15 */
- return;
+ if ( exc->args < 2 )
+ {
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
+ exc->args = 0;
+ goto Fail;
+ }
- P <<= 4;
- F = 1L << ( 6 - exc->GS.delta_shift );
+ exc->args -= 2;
- while ( nump-- )
- {
- A = (FT_UShort)*(--args);
- B = *(--args);
+ A = (FT_UShort)exc->stack[exc->args + 1];
+ B = exc->stack[exc->args];
/* XXX: Because some popular fonts contain some invalid DeltaP */
/* instructions, we simply ignore them when the stacked */
@@ -6351,28 +6538,41 @@
/* error. As a delta instruction doesn't change a glyph */
/* in great ways, this shouldn't be a problem. */
- if ( BOUNDS( A, exc->zp0.n_points ) )
+ if ( !BOUNDS( A, exc->zp0.n_points ) )
{
- if ( exc->pedantic_hinting )
+ C = ( (FT_ULong)B & 0xF0 ) >> 4;
+
+ switch ( exc->opcode )
{
- exc->error = FT_THROW( Invalid_Reference );
- return;
+ case 0x5D:
+ break;
+
+ case 0x71:
+ C += 16;
+ break;
+
+ case 0x72:
+ C += 32;
+ break;
}
- }
- else
- {
- if ( ( B & 0xF0 ) == P )
+
+ C += exc->GS.delta_base;
+
+ if ( P == C )
{
- B = ( B & 0xF ) - 8;
+ B = ( (FT_ULong)B & 0xF ) - 8;
if ( B >= 0 )
B++;
- B *= F;
+ B *= 1L << ( 6 - exc->GS.delta_shift );
+
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* See `ttinterp.h' for details on backward compatibility mode. */
- if ( exc->backward_compatibility )
+ /* See `ttinterp.h' for details on backward compatibility */
+ /* mode. */
+ if ( SUBPIXEL_HINTING_MINIMAL &&
+ exc->backward_compatibility )
{
- if ( exc->backward_compatibility != 0x7 &&
+ if ( !( exc->iupx_called && exc->iupy_called ) &&
( ( exc->is_composite && exc->GS.freeVector.y != 0 ) ||
( exc->zp0.tags[A] & FT_CURVE_TAG_TOUCH_Y ) ) )
exc->func_move( exc, &exc->zp0, A, B );
@@ -6382,7 +6582,13 @@
exc->func_move( exc, &exc->zp0, A, B );
}
}
+ else
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
}
+
+ Fail:
+ exc->new_top = exc->args;
}
@@ -6396,50 +6602,28 @@
Ins_DELTAC( TT_ExecContext exc,
FT_Long* args )
{
- FT_Long nump;
- FT_ULong A;
- FT_Long B, P, F;
-
-
- nump = args[0]; /* signed value for convenience */
-
- if ( nump < 0 || nump > exc->new_top / 2 )
- {
- if ( exc->pedantic_hinting )
- exc->error = FT_THROW( Too_Few_Arguments );
-
- nump = exc->new_top / 2;
- }
+ FT_ULong nump, k;
+ FT_ULong A, C, P;
+ FT_Long B;
- exc->new_top -= 2 * nump;
- P = exc->func_cur_ppem( exc ) - exc->GS.delta_base;
+ P = (FT_ULong)exc->func_cur_ppem( exc );
+ nump = (FT_ULong)args[0];
- switch ( exc->opcode )
+ for ( k = 1; k <= nump; k++ )
{
- case 0x73:
- break;
-
- case 0x74:
- P -= 16;
- break;
-
- case 0x75:
- P -= 32;
- break;
- }
-
- /* check applicable range of adjusted ppem */
- if ( P & ~0xF ) /* P < 0 || P > 15 */
- return;
+ if ( exc->args < 2 )
+ {
+ if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Too_Few_Arguments );
+ exc->args = 0;
+ goto Fail;
+ }
- P <<= 4;
- F = 1L << ( 6 - exc->GS.delta_shift );
+ exc->args -= 2;
- while ( nump-- )
- {
- A = (FT_ULong)*(--args);
- B = *(--args);
+ A = (FT_ULong)exc->stack[exc->args + 1];
+ B = exc->stack[exc->args];
if ( BOUNDSL( A, exc->cvtSize ) )
{
@@ -6451,17 +6635,38 @@
}
else
{
- if ( ( B & 0xF0 ) == P )
+ C = ( (FT_ULong)B & 0xF0 ) >> 4;
+
+ switch ( exc->opcode )
+ {
+ case 0x73:
+ break;
+
+ case 0x74:
+ C += 16;
+ break;
+
+ case 0x75:
+ C += 32;
+ break;
+ }
+
+ C += exc->GS.delta_base;
+
+ if ( P == C )
{
- B = ( B & 0xF ) - 8;
+ B = ( (FT_ULong)B & 0xF ) - 8;
if ( B >= 0 )
B++;
- B *= F;
+ B *= 1L << ( 6 - exc->GS.delta_shift );
exc->func_move_cvt( exc, A, B );
}
}
}
+
+ Fail:
+ exc->new_top = exc->args;
}
@@ -6531,7 +6736,7 @@
/* Otherwise, instructions may behave weirdly and rendering results */
/* may differ between v35 and v40 mode, e.g., in `Times New Roman */
/* Bold Italic'. */
- if ( SUBPIXEL_HINTING_MINIMAL && exc->mode != FT_RENDER_MODE_MONO )
+ if ( SUBPIXEL_HINTING_MINIMAL && exc->subpixel_hinting_lean )
{
/*********************************
* HINTING FOR SUBPIXEL
@@ -6548,7 +6753,7 @@
* Selector Bit: 8
* Return Bit(s): 15
*/
- if ( ( args[0] & 256 ) != 0 && exc->mode == FT_RENDER_MODE_LCD_V )
+ if ( ( args[0] & 256 ) != 0 && exc->vertical_lcd_lean )
K |= 1 << 15;
/*********************************
@@ -6569,7 +6774,7 @@
* The only smoothing method FreeType supports unless someone sets
* FT_LOAD_TARGET_MONO.
*/
- if ( ( args[0] & 2048 ) != 0 && exc->mode != FT_RENDER_MODE_MONO )
+ if ( ( args[0] & 2048 ) != 0 && exc->subpixel_hinting_lean )
K |= 1 << 18;
/*********************************
@@ -6581,10 +6786,7 @@
* Grayscale rendering is what FreeType does anyway unless someone
* sets FT_LOAD_TARGET_MONO or FT_LOAD_TARGET_LCD(_V)
*/
- if ( ( args[0] & 4096 ) != 0 &&
- exc->mode != FT_RENDER_MODE_MONO &&
- exc->mode != FT_RENDER_MODE_LCD &&
- exc->mode != FT_RENDER_MODE_LCD_V )
+ if ( ( args[0] & 4096 ) != 0 && exc->grayscale_cleartype )
K |= 1 << 19;
}
#endif
@@ -6631,8 +6833,6 @@
for ( i = 0; i < num_axes; i++ )
args[i] = 0;
}
-
- exc->new_top += num_axes;
}
@@ -6683,6 +6883,7 @@
Ins_Goto_CodeRange( exc, def->range, def->start );
+ exc->step_ins = FALSE;
return;
}
}
@@ -6727,22 +6928,96 @@
TT_RunIns( void* exec )
{
TT_ExecContext exc = (TT_ExecContext)exec;
- FT_ULong ins_counter = 0;
+ FT_ULong ins_counter = 0; /* executed instructions counter */
+ FT_ULong num_twilight_points;
+ FT_UShort i;
- do
+
+ /* We restrict the number of twilight points to a reasonable, */
+ /* heuristic value to avoid slow execution of malformed bytecode. */
+ num_twilight_points = FT_MAX( 30,
+ 2 * ( exc->pts.n_points + exc->cvtSize ) );
+ if ( exc->twilight.n_points > num_twilight_points )
{
- /* increment instruction counter and check if we didn't */
- /* run this program for too long (e.g. infinite loops). */
- if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES )
- {
- exc->error = FT_THROW( Execution_Too_Long );
- goto LErrorLabel_;
- }
+ if ( num_twilight_points > 0xFFFFU )
+ num_twilight_points = 0xFFFFU;
+
+ FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n" ));
+ FT_TRACE5(( " from %d to the more reasonable value %ld\n",
+ exc->twilight.n_points,
+ num_twilight_points ));
+ exc->twilight.n_points = (FT_UShort)num_twilight_points;
+ }
+
+ /* Set up loop detectors. We restrict the number of LOOPCALL loops */
+ /* and the number of JMPR, JROT, and JROF calls with a negative */
+ /* argument to values that depend on various parameters like the */
+ /* size of the CVT table or the number of points in the current */
+ /* glyph (if applicable). */
+ /* */
+ /* The idea is that in real-world bytecode you either iterate over */
+ /* all CVT entries (in the `prep' table), or over all points (or */
+ /* contours, in the `glyf' table) of a glyph, and such iterations */
+ /* don't happen very often. */
+ exc->loopcall_counter = 0;
+ exc->neg_jump_counter = 0;
- exc->error = FT_Err_Ok;
+ /* The maximum values are heuristic. */
+ if ( exc->pts.n_points )
+ exc->loopcall_counter_max = FT_MAX( 50,
+ 10 * exc->pts.n_points ) +
+ FT_MAX( 50,
+ exc->cvtSize / 10 );
+ else
+ exc->loopcall_counter_max = 300 + 22 * exc->cvtSize;
+
+ /* as a protection against an unreasonable number of CVT entries */
+ /* we assume at most 100 control values per glyph for the counter */
+ if ( exc->loopcall_counter_max >
+ 100 * (FT_ULong)exc->face->root.num_glyphs )
+ exc->loopcall_counter_max = 100 * (FT_ULong)exc->face->root.num_glyphs;
+
+ FT_TRACE5(( "TT_RunIns: Limiting total number of loops in LOOPCALL"
+ " to %ld\n", exc->loopcall_counter_max ));
+
+ exc->neg_jump_counter_max = exc->loopcall_counter_max;
+ FT_TRACE5(( "TT_RunIns: Limiting total number of backward jumps"
+ " to %ld\n", exc->neg_jump_counter_max ));
+
+ /* set PPEM and CVT functions */
+ exc->tt_metrics.ratio = 0;
+ if ( exc->metrics.x_ppem != exc->metrics.y_ppem )
+ {
+ /* non-square pixels, use the stretched routines */
+ exc->func_cur_ppem = Current_Ppem_Stretched;
+ exc->func_read_cvt = Read_CVT_Stretched;
+ exc->func_write_cvt = Write_CVT_Stretched;
+ exc->func_move_cvt = Move_CVT_Stretched;
+ }
+ else
+ {
+ /* square pixels, use normal routines */
+ exc->func_cur_ppem = Current_Ppem;
+ exc->func_read_cvt = Read_CVT;
+ exc->func_write_cvt = Write_CVT;
+ exc->func_move_cvt = Move_CVT;
+ }
+
+ exc->iniRange = exc->curRange;
+
+ Compute_Funcs( exc );
+ Compute_Round( exc, (FT_Byte)exc->GS.round_state );
+
+ /* These flags cancel execution of some opcodes after IUP is called */
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ exc->iupx_called = FALSE;
+ exc->iupy_called = FALSE;
+#endif
+
+ do
+ {
exc->opcode = exc->code[exc->IP];
- exc->length = 1;
#ifdef FT_DEBUG_LEVEL_TRACE
if ( ft_trace_levels[trace_ttinterp] >= 6 )
@@ -6766,6 +7041,17 @@
}
#endif /* FT_DEBUG_LEVEL_TRACE */
+ if ( ( exc->length = opcode_length[exc->opcode] ) < 0 )
+ {
+ if ( exc->IP + 1 >= exc->codeSize )
+ goto LErrorCodeOverflow_;
+
+ exc->length = 2 - exc->length * exc->code[exc->IP + 1];
+ }
+
+ if ( exc->IP + exc->length > exc->codeSize )
+ goto LErrorCodeOverflow_;
+
/* First, let's check for empty stack and overflow */
exc->args = exc->top - ( Pop_Push_Count[exc->opcode] >> 4 );
@@ -6773,9 +7059,6 @@
/* One can also interpret it as the index of the last argument. */
if ( exc->args < 0 )
{
- FT_UShort i;
-
-
if ( exc->pedantic_hinting )
{
exc->error = FT_THROW( Too_Few_Arguments );
@@ -6788,7 +7071,21 @@
exc->args = 0;
}
- exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+ if ( exc->opcode == 0x91 )
+ {
+ /* this is very special: GETVARIATION returns */
+ /* a variable number of arguments */
+
+ /* it is the job of the application to `activate' GX handling, */
+ /* that is, calling any of the GX API functions on the current */
+ /* font to select a variation instance */
+ if ( exc->face->blend )
+ exc->new_top = exc->args + exc->face->blend->num_axis;
+ }
+ else
+#endif
+ exc->new_top = exc->args + ( Pop_Push_Count[exc->opcode] & 15 );
/* `new_top' is the new top of the stack, after the instruction's */
/* execution. `top' will be set to `new_top' after the `switch' */
@@ -6799,6 +7096,9 @@
goto LErrorLabel_;
}
+ exc->step_ins = TRUE;
+ exc->error = FT_Err_Ok;
+
{
FT_Long* args = exc->stack + exc->args;
FT_Byte opcode = exc->opcode;
@@ -6981,7 +7281,7 @@
case 0x32: /* SHP */
case 0x33: /* SHP */
- Ins_SHP( exc, args );
+ Ins_SHP( exc );
break;
case 0x34: /* SHC */
@@ -6999,7 +7299,7 @@
break;
case 0x39: /* IP */
- Ins_IP( exc, args );
+ Ins_IP( exc );
break;
case 0x3A: /* MSIRP */
@@ -7008,7 +7308,7 @@
break;
case 0x3C: /* AlignRP */
- Ins_ALIGNRP( exc, args );
+ Ins_ALIGNRP( exc );
break;
case 0x3D: /* RTDG */
@@ -7244,7 +7544,7 @@
break;
case 0x80: /* FLIPPT */
- Ins_FLIPPT( exc, args );
+ Ins_FLIPPT( exc );
break;
case 0x81: /* FLIPRGON */
@@ -7342,13 +7642,13 @@
{
switch ( exc->error )
{
+ /* looking for redefined instructions */
case FT_ERR( Invalid_Opcode ):
{
TT_DefRecord* def = exc->IDefs;
TT_DefRecord* limit = FT_OFFSET( def, exc->numIDefs );
- /* looking for redefined instructions */
for ( ; def < limit; def++ )
{
if ( def->active && exc->opcode == (FT_Byte)def->opc )
@@ -7378,15 +7678,37 @@
}
}
}
- FALL_THROUGH;
+
+ exc->error = FT_THROW( Invalid_Opcode );
+ goto LErrorLabel_;
+
+#if 0
+ break; /* Unreachable code warning suppression. */
+ /* Leave to remind in case a later change the editor */
+ /* to consider break; */
+#endif
default:
goto LErrorLabel_;
+
+#if 0
+ break;
+#endif
}
}
exc->top = exc->new_top;
- exc->IP += exc->length;
+
+ if ( exc->step_ins )
+ exc->IP += exc->length;
+
+ /* increment instruction counter and check if we didn't */
+ /* run this program for too long (e.g. infinite loops). */
+ if ( ++ins_counter > TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES )
+ {
+ exc->error = FT_THROW( Execution_Too_Long );
+ goto LErrorLabel_;
+ }
LSuiteLabel_:
if ( exc->IP >= exc->codeSize )
@@ -7402,12 +7724,15 @@
} while ( !exc->instruction_trap );
LNo_Error_:
- FT_TRACE4(( " %lu instruction%s executed\n",
+ FT_TRACE4(( " %ld instruction%s executed\n",
ins_counter,
ins_counter == 1 ? "" : "s" ));
return FT_Err_Ok;
+ LErrorCodeOverflow_:
+ exc->error = FT_THROW( Code_Overflow );
+
LErrorLabel_:
if ( exc->error && !exc->instruction_trap )
FT_TRACE1(( " The interpreter returned error 0x%x\n", exc->error ));
@@ -7415,126 +7740,6 @@
return exc->error;
}
-
- /**************************************************************************
- *
- * @Function:
- * TT_Run_Context
- *
- * @Description:
- * Executes one or more instructions in the execution context.
- *
- * @Input:
- * exec ::
- * A handle to the target execution context.
- *
- * @Return:
- * TrueType error code. 0 means success.
- */
- FT_LOCAL_DEF( FT_Error )
- TT_Run_Context( TT_ExecContext exec,
- TT_Size size )
- {
- FT_ULong num_twilight_points;
-
-
- exec->zp0 = exec->pts;
- exec->zp1 = exec->pts;
- exec->zp2 = exec->pts;
-
- /* We restrict the number of twilight points to a reasonable, */
- /* heuristic value to avoid slow execution of malformed bytecode. */
- /* The selected value is large enough to support fonts hinted */
- /* with `ttfautohint`, which uses twilight points to store */
- /* vertical coordinates of (auto-hinter) segments. */
- num_twilight_points = FT_MAX( 30,
- 2 * ( exec->pts.n_points + exec->cvtSize ) );
- if ( exec->twilight.n_points > num_twilight_points )
- {
- if ( num_twilight_points > 0xFFFFU )
- num_twilight_points = 0xFFFFU;
-
- FT_TRACE5(( "TT_RunIns: Resetting number of twilight points\n" ));
- FT_TRACE5(( " from %d to the more reasonable value %lu\n",
- exec->twilight.n_points,
- num_twilight_points ));
- exec->twilight.n_points = (FT_UShort)num_twilight_points;
- }
-
- /* Set up loop detectors. We restrict the number of LOOPCALL loops */
- /* and the number of JMPR, JROT, and JROF calls with a negative */
- /* argument to values that depend on various parameters like the */
- /* size of the CVT table or the number of points in the current */
- /* glyph (if applicable). */
- /* */
- /* The idea is that in real-world bytecode you either iterate over */
- /* all CVT entries (in the `prep' table), or over all points (or */
- /* contours, in the `glyf' table) of a glyph, and such iterations */
- /* don't happen very often. */
- exec->loopcall_counter = 0;
- exec->neg_jump_counter = 0;
-
- /* The maximum values are heuristic. */
- if ( exec->pts.n_points )
- exec->loopcall_counter_max = FT_MAX( 50,
- 10 * exec->pts.n_points ) +
- FT_MAX( 50,
- exec->cvtSize / 10 );
- else
- exec->loopcall_counter_max = 300 + 22 * exec->cvtSize;
-
- /* as a protection against an unreasonable number of CVT entries */
- /* we assume at most 100 control values per glyph for the counter */
- if ( exec->loopcall_counter_max >
- 100 * (FT_ULong)exec->face->root.num_glyphs )
- exec->loopcall_counter_max = 100 * (FT_ULong)exec->face->root.num_glyphs;
-
- FT_TRACE5(( "TT_RunIns: Limiting total number of loops in LOOPCALL"
- " to %lu\n", exec->loopcall_counter_max ));
-
- exec->neg_jump_counter_max = exec->loopcall_counter_max;
- FT_TRACE5(( "TT_RunIns: Limiting total number of backward jumps"
- " to %lu\n", exec->neg_jump_counter_max ));
-
- /* set PPEM and CVT functions */
- if ( exec->metrics.x_ppem != exec->metrics.y_ppem )
- {
- /* non-square pixels, use the stretched routines */
- exec->func_cur_ppem = Current_Ppem_Stretched;
- exec->func_read_cvt = Read_CVT_Stretched;
- exec->func_write_cvt = Write_CVT_Stretched;
- exec->func_move_cvt = Move_CVT_Stretched;
- }
- else
- {
- /* square pixels, use normal routines */
- exec->func_cur_ppem = Current_Ppem;
- exec->func_read_cvt = Read_CVT;
- exec->func_write_cvt = Write_CVT;
- exec->func_move_cvt = Move_CVT;
- }
-
- /* reset graphics state */
- exec->GS = size->GS;
- exec->func_round = (TT_Round_Func)Round_To_Grid;
- Compute_Funcs( exec );
-
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /* Reset IUP tracking bits in the backward compatibility mode. */
- /* See `ttinterp.h' for details. */
- exec->backward_compatibility &= ~0x3;
-#endif
-
- /* some glyphs leave something on the stack, */
- /* so we clean it before a new execution. */
- exec->top = 0;
- exec->callTop = 0;
-
- exec->instruction_trap = FALSE;
-
- return exec->interpreter( exec );
- }
-
#else /* !TT_USE_BYTECODE_INTERPRETER */
/* ANSI C doesn't like empty source files */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.h
index 5cdc8f59f1..4f1a9bbc67 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttinterp.h
@@ -4,7 +4,7 @@
*
* TrueType bytecode interpreter (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -39,60 +39,6 @@ FT_BEGIN_HEADER
#define TT_Round_Super_45 7
- /**************************************************************************
- *
- * EXECUTION SUBTABLES
- *
- * These sub-tables relate to instruction execution.
- *
- */
-
-
-#define TT_MAX_CODE_RANGES 3
-
-
- /**************************************************************************
- *
- * There can only be 3 active code ranges at once:
- * - the Font Program
- * - the CVT Program
- * - a glyph's instructions set
- */
- typedef enum TT_CodeRange_Tag_
- {
- tt_coderange_none = 0,
- tt_coderange_font,
- tt_coderange_cvt,
- tt_coderange_glyph
-
- } TT_CodeRange_Tag;
-
-
- typedef struct TT_CodeRange_
- {
- FT_Byte* base;
- FT_Long size;
-
- } TT_CodeRange;
-
- typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
-
-
- /**************************************************************************
- *
- * Defines a function/instruction definition record.
- */
- typedef struct TT_DefRecord_
- {
- FT_Int range; /* in which code range is it located? */
- FT_Long start; /* where does it start? */
- FT_Long end; /* where does it end? */
- FT_UInt opc; /* function #, or instruction code */
- FT_Bool active; /* is it active? */
-
- } TT_DefRecord, *TT_DefArray;
-
-
/**************************************************************************
*
* Function types used by the interpreter, depending on various modes
@@ -105,7 +51,7 @@ FT_BEGIN_HEADER
typedef FT_F26Dot6
(*TT_Round_Func)( TT_ExecContext exc,
FT_F26Dot6 distance,
- FT_F26Dot6 compensation );
+ FT_Int color );
/* Point displacement along the freedom vector routine */
typedef void
@@ -165,13 +111,12 @@ FT_BEGIN_HEADER
TT_Face face; /* ! */
TT_Size size; /* ! */
FT_Memory memory;
- TT_Interpreter interpreter;
/* instructions state */
FT_Error error; /* last execution error */
- FT_Long top; /* @! top of exec. stack */
+ FT_Long top; /* @ top of exec. stack */
FT_Long stackSize; /* ! size of exec. stack */
FT_Long* stack; /* ! current exec. stack */
@@ -197,9 +142,11 @@ FT_BEGIN_HEADER
FT_Long IP; /* current instruction pointer */
FT_Long codeSize; /* size of current range */
- FT_Byte opcode; /* current opcode */
- FT_Int length; /* opcode length or increment */
+ FT_Byte opcode; /* current opcode */
+ FT_Int length; /* length of current opcode */
+ FT_Bool step_ins; /* true if the interpreter must */
+ /* increment IP after ins. exec */
FT_ULong cvtSize; /* ! */
FT_Long* cvt; /* ! */
FT_ULong glyfCvtSize;
@@ -219,9 +166,9 @@ FT_BEGIN_HEADER
FT_UInt maxFunc; /* ! maximum function index */
FT_UInt maxIns; /* ! maximum instruction index */
- FT_Int callTop, /* @! top of call stack during execution */
- callSize; /* size of call stack */
- TT_CallStack callStack; /* call stack */
+ FT_Int callTop, /* @ top of call stack during execution */
+ callSize; /* size of call stack */
+ TT_CallStack callStack; /* call stack */
FT_UShort maxPoints; /* capacity of this context's `pts' */
FT_Short maxContours; /* record, expressed in points and */
@@ -242,14 +189,16 @@ FT_BEGIN_HEADER
FT_Bool instruction_trap; /* ! If `True', the interpreter */
/* exits after each instruction */
+ TT_GraphicsState default_GS; /* graphics state resulting from */
+ /* the prep program */
FT_Bool is_composite; /* true if the glyph is composite */
FT_Bool pedantic_hinting; /* true if pedantic interpretation */
/* latest interpreter additions */
- TT_Round_Func func_round; /* current rounding function */
-
- FT_Vector moveVector; /* "projected" freedom vector */
+ FT_Long F_dot_P; /* dot product of freedom and projection */
+ /* vectors */
+ TT_Round_Func func_round; /* current rounding function */
TT_Project_Func func_project, /* current projection function */
func_dualproj, /* current dual proj. function */
@@ -378,13 +327,34 @@ FT_BEGIN_HEADER
*
*/
- /* Activate backward compatibility (bit 2) and track IUP (bits 0-1). */
- /* If this is zero, it means that the interpreter is either in v35 */
- /* or in native ClearType mode. */
- FT_Int backward_compatibility;
-
- FT_Render_Mode mode; /* target render mode */
-
+ /* Using v40 implies subpixel hinting, unless FT_RENDER_MODE_MONO has been
+ * requested. Used to detect interpreter */
+ /* version switches. `_lean' to differentiate from the Infinality */
+ /* `subpixel_hinting', which is managed differently. */
+ FT_Bool subpixel_hinting_lean;
+
+ /* Long side of a LCD subpixel is vertical (e.g., screen is rotated). */
+ /* `_lean' to differentiate from the Infinality `vertical_lcd', which */
+ /* is managed differently. */
+ FT_Bool vertical_lcd_lean;
+
+ /* Default to backward compatibility mode in v40 interpreter. If */
+ /* this is false, it implies the interpreter is in v35 or in native */
+ /* ClearType mode. */
+ FT_Bool backward_compatibility;
+
+ /* Useful for detecting and denying post-IUP trickery that is usually */
+ /* used to fix pixel patterns (`superhinting'). */
+ FT_Bool iupx_called;
+ FT_Bool iupy_called;
+
+ /* ClearType hinting and grayscale rendering, as used by Universal */
+ /* Windows Platform apps (Windows 8 and above). Like the standard */
+ /* colorful ClearType mode, it utilizes a vastly increased virtual */
+ /* resolution on the x axis. Different from bi-level hinting and */
+ /* grayscale rendering, the old mode from Win9x days that roughly */
+ /* adheres to the physical pixel grid on both axes. */
+ FT_Bool grayscale_cleartype;
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
/* We maintain two counters (in addition to the instruction counter) */
@@ -401,15 +371,22 @@ FT_BEGIN_HEADER
extern const TT_GraphicsState tt_default_graphics_state;
+#ifdef TT_USE_BYTECODE_INTERPRETER
+ FT_LOCAL( void )
+ TT_Goto_CodeRange( TT_ExecContext exec,
+ FT_Int range,
+ FT_Long IP );
+
FT_LOCAL( void )
TT_Set_CodeRange( TT_ExecContext exec,
FT_Int range,
- FT_Byte* base,
+ void* base,
FT_Long length );
FT_LOCAL( void )
TT_Clear_CodeRange( TT_ExecContext exec,
FT_Int range );
+#endif /* TT_USE_BYTECODE_INTERPRETER */
/**************************************************************************
@@ -436,21 +413,22 @@ FT_BEGIN_HEADER
TT_New_Context( TT_Driver driver );
+#ifdef TT_USE_BYTECODE_INTERPRETER
FT_LOCAL( void )
TT_Done_Context( TT_ExecContext exec );
- FT_LOCAL( void )
+ FT_LOCAL( FT_Error )
TT_Load_Context( TT_ExecContext exec,
TT_Face face,
TT_Size size );
FT_LOCAL( void )
TT_Save_Context( TT_ExecContext exec,
- TT_Size size );
+ TT_Size ins );
FT_LOCAL( FT_Error )
- TT_Run_Context( TT_ExecContext exec,
- TT_Size size );
+ TT_Run_Context( TT_ExecContext exec );
+#endif /* TT_USE_BYTECODE_INTERPRETER */
/**************************************************************************
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.c
index 2aedbd842c..d0ac318120 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
*
* Objects manager (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -67,13 +67,23 @@
* A pointer to the target glyph zone.
*/
FT_LOCAL_DEF( void )
- tt_glyphzone_done( FT_Memory memory,
- TT_GlyphZone zone )
+ tt_glyphzone_done( TT_GlyphZone zone )
{
- FT_FREE( zone->org );
+ FT_Memory memory = zone->memory;
- zone->n_points = 0;
- zone->n_contours = 0;
+
+ if ( memory )
+ {
+ FT_FREE( zone->contours );
+ FT_FREE( zone->tags );
+ FT_FREE( zone->cur );
+ FT_FREE( zone->org );
+ FT_FREE( zone->orus );
+
+ zone->max_points = zone->n_points = 0;
+ zone->max_contours = zone->n_contours = 0;
+ zone->memory = NULL;
+ }
}
@@ -109,22 +119,23 @@
TT_GlyphZone zone )
{
FT_Error error;
- FT_Long size = 3 * maxPoints * sizeof ( FT_Vector ) +
- maxContours * sizeof ( FT_UShort ) +
- maxPoints * sizeof ( FT_Byte );
-
- if ( !FT_ALLOC( zone->org, size ) )
- {
- zone->n_points = maxPoints;
- zone->n_contours = maxContours;
- zone->cur = zone->org + maxPoints;
- zone->orus = zone->cur + maxPoints;
- zone->contours = (FT_UShort*)( zone->orus + maxPoints );
- zone->tags = (FT_Byte*)( zone->contours + maxContours );
+ FT_ZERO( zone );
+ zone->memory = memory;
- zone->first_point = 0;
+ if ( FT_NEW_ARRAY( zone->org, maxPoints ) ||
+ FT_NEW_ARRAY( zone->cur, maxPoints ) ||
+ FT_NEW_ARRAY( zone->orus, maxPoints ) ||
+ FT_NEW_ARRAY( zone->tags, maxPoints ) ||
+ FT_NEW_ARRAY( zone->contours, maxContours ) )
+ {
+ tt_glyphzone_done( zone );
+ }
+ else
+ {
+ zone->max_points = maxPoints;
+ zone->max_contours = maxContours;
}
return error;
@@ -477,7 +488,8 @@
int j, k;
- FT_ARRAY_ZERO( num_matched_ids, TRICK_SFNT_IDS_NUM_FACES );
+ FT_MEM_SET( num_matched_ids, 0,
+ sizeof ( int ) * TRICK_SFNT_IDS_NUM_FACES );
has_cvt = FALSE;
has_fpgm = FALSE;
has_prep = FALSE;
@@ -775,7 +787,7 @@
FT_UInt instance_index = (FT_UInt)face_index >> 16;
- if ( instance_index && FT_HAS_MULTIPLE_MASTERS( ttface ) )
+ if ( FT_HAS_MULTIPLE_MASTERS( ttface ) )
{
error = FT_Set_Named_Instance( ttface, instance_index );
if ( error )
@@ -873,18 +885,59 @@
* size ::
* A handle to the size object.
*
+ * pedantic ::
+ * Set if bytecode execution should be pedantic.
+ *
* @Return:
* FreeType error code. 0 means success.
*/
FT_LOCAL_DEF( FT_Error )
- tt_size_run_fpgm( TT_Size size )
+ tt_size_run_fpgm( TT_Size size,
+ FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
- TT_ExecContext exec = size->context;
+ TT_ExecContext exec;
FT_Error error;
- TT_Load_Context( exec, face, size );
+ exec = size->context;
+
+ error = TT_Load_Context( exec, face, size );
+ if ( error )
+ return error;
+
+ exec->callTop = 0;
+ exec->top = 0;
+
+ exec->period = 64;
+ exec->phase = 0;
+ exec->threshold = 0;
+
+ exec->instruction_trap = FALSE;
+ exec->F_dot_P = 0x4000L;
+
+ exec->pedantic_hinting = pedantic;
+
+ {
+ FT_Size_Metrics* size_metrics = &exec->metrics;
+ TT_Size_Metrics* tt_metrics = &exec->tt_metrics;
+
+
+ size_metrics->x_ppem = 0;
+ size_metrics->y_ppem = 0;
+ size_metrics->x_scale = 0;
+ size_metrics->y_scale = 0;
+
+ tt_metrics->ppem = 0;
+ tt_metrics->scale = 0;
+ tt_metrics->ratio = 0x10000L;
+ }
+
+ /* allow font program execution */
+ TT_Set_CodeRange( exec,
+ tt_coderange_font,
+ face->font_program,
+ (FT_Long)face->font_program_size );
/* disable CVT and glyph programs coderange */
TT_Clear_CodeRange( exec, tt_coderange_cvt );
@@ -892,19 +945,15 @@
if ( face->font_program_size > 0 )
{
- /* allow font program execution */
- TT_Set_CodeRange( exec,
- tt_coderange_font,
- face->font_program,
- (FT_Long)face->font_program_size );
-
- exec->pts.n_points = 0;
- exec->pts.n_contours = 0;
+ TT_Goto_CodeRange( exec, tt_coderange_font, 0 );
FT_TRACE4(( "Executing `fpgm' table.\n" ));
- error = TT_Run_Context( exec, size );
- FT_TRACE4(( error ? " failed (error code 0x%x)\n" : "",
- error ));
+ error = face->interpreter( exec );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( error )
+ FT_TRACE4(( " interpretation failed with error code 0x%x\n",
+ error ));
+#endif
}
else
error = FT_Err_Ok;
@@ -930,146 +979,212 @@
* size ::
* A handle to the size object.
*
+ * pedantic ::
+ * Set if bytecode execution should be pedantic.
+ *
* @Return:
* FreeType error code. 0 means success.
*/
FT_LOCAL_DEF( FT_Error )
- tt_size_run_prep( TT_Size size )
+ tt_size_run_prep( TT_Size size,
+ FT_Bool pedantic )
{
TT_Face face = (TT_Face)size->root.face;
- TT_ExecContext exec = size->context;
+ TT_ExecContext exec;
FT_Error error;
FT_UInt i;
- /* set default GS, twilight points, and storage */
- /* before CV program can modify them. */
- size->GS = tt_default_graphics_state;
-
- /* all twilight points are originally zero */
- FT_ARRAY_ZERO( size->twilight.org, size->twilight.n_points );
- FT_ARRAY_ZERO( size->twilight.cur, size->twilight.n_points );
-
- TT_Load_Context( exec, face, size );
-
- /* clear storage area */
- FT_ARRAY_ZERO( exec->storage, exec->storeSize );
-
/* Scale the cvt values to the new ppem. */
/* By default, we use the y ppem value for scaling. */
FT_TRACE6(( "CVT values:\n" ));
- for ( i = 0; i < exec->cvtSize; i++ )
+ for ( i = 0; i < size->cvt_size; i++ )
{
/* Unscaled CVT values are already stored in 26.6 format. */
/* Note that this scaling operation is very sensitive to rounding; */
/* the integer division by 64 must be applied to the first argument. */
- exec->cvt[i] = FT_MulFix( face->cvt[i] / 64, size->ttmetrics.scale );
- FT_TRACE6(( " %3u: %f (%f)\n",
- i, (double)face->cvt[i] / 64, (double)exec->cvt[i] / 64 ));
+ size->cvt[i] = FT_MulFix( face->cvt[i] / 64, size->ttmetrics.scale );
+ FT_TRACE6(( " %3d: %f (%f)\n",
+ i, (double)face->cvt[i] / 64, (double)size->cvt[i] / 64 ));
}
FT_TRACE6(( "\n" ));
+ exec = size->context;
+
+ error = TT_Load_Context( exec, face, size );
+ if ( error )
+ return error;
+
+ exec->callTop = 0;
+ exec->top = 0;
+
+ exec->instruction_trap = FALSE;
+
+ exec->pedantic_hinting = pedantic;
+
+ TT_Set_CodeRange( exec,
+ tt_coderange_cvt,
+ face->cvt_program,
+ (FT_Long)face->cvt_program_size );
+
TT_Clear_CodeRange( exec, tt_coderange_glyph );
if ( face->cvt_program_size > 0 )
{
- /* allow CV program execution */
- TT_Set_CodeRange( exec,
- tt_coderange_cvt,
- face->cvt_program,
- (FT_Long)face->cvt_program_size );
-
- exec->pts.n_points = 0;
- exec->pts.n_contours = 0;
+ TT_Goto_CodeRange( exec, tt_coderange_cvt, 0 );
FT_TRACE4(( "Executing `prep' table.\n" ));
- error = TT_Run_Context( exec, size );
- FT_TRACE4(( error ? " failed (error code 0x%x)\n" : "",
- error ));
+ error = face->interpreter( exec );
+#ifdef FT_DEBUG_LEVEL_TRACE
+ if ( error )
+ FT_TRACE4(( " interpretation failed with error code 0x%x\n",
+ error ));
+#endif
}
else
error = FT_Err_Ok;
size->cvt_ready = error;
- if ( !error )
- TT_Save_Context( exec, size );
+ /* UNDOCUMENTED! The MS rasterizer doesn't allow the following */
+ /* graphics state variables to be modified by the CVT program. */
+
+ exec->GS.dualVector.x = 0x4000;
+ exec->GS.dualVector.y = 0;
+ exec->GS.projVector.x = 0x4000;
+ exec->GS.projVector.y = 0x0;
+ exec->GS.freeVector.x = 0x4000;
+ exec->GS.freeVector.y = 0x0;
+
+ exec->GS.rp0 = 0;
+ exec->GS.rp1 = 0;
+ exec->GS.rp2 = 0;
+
+ exec->GS.gep0 = 1;
+ exec->GS.gep1 = 1;
+ exec->GS.gep2 = 1;
+
+ exec->GS.loop = 1;
+
+ /* save as default graphics state */
+ size->GS = exec->GS;
+
+ TT_Save_Context( exec, size );
return error;
}
static void
- tt_size_done_bytecode( TT_Size size )
+ tt_size_done_bytecode( FT_Size ftsize )
{
- FT_Memory memory = size->root.face->memory;
- TT_ExecContext exec = size->context;
+ TT_Size size = (TT_Size)ftsize;
+ TT_Face face = (TT_Face)ftsize->face;
+ FT_Memory memory = face->root.memory;
-
- if ( exec )
+ if ( size->context )
{
- FT_FREE( exec->stack );
- FT_FREE( exec->FDefs );
-
- TT_Done_Context( exec );
+ TT_Done_Context( size->context );
size->context = NULL;
}
+ FT_FREE( size->cvt );
+ size->cvt_size = 0;
+
+ /* free storage area */
+ FT_FREE( size->storage );
+ size->storage_size = 0;
+
/* twilight zone */
- tt_glyphzone_done( memory, &size->twilight );
+ tt_glyphzone_done( &size->twilight );
+
+ FT_FREE( size->function_defs );
+ FT_FREE( size->instruction_defs );
+
+ size->num_function_defs = 0;
+ size->max_function_defs = 0;
+ size->num_instruction_defs = 0;
+ size->max_instruction_defs = 0;
+
+ size->max_func = 0;
+ size->max_ins = 0;
+
+ size->bytecode_ready = -1;
+ size->cvt_ready = -1;
}
/* Initialize bytecode-related fields in the size object. */
/* We do this only if bytecode interpretation is really needed. */
- FT_LOCAL_DEF( FT_Error )
- tt_size_init_bytecode( TT_Size size,
+ static FT_Error
+ tt_size_init_bytecode( FT_Size ftsize,
FT_Bool pedantic )
{
FT_Error error;
- TT_Face face = (TT_Face)size->root.face;
- FT_Memory memory = size->root.face->memory;
+ TT_Size size = (TT_Size)ftsize;
+ TT_Face face = (TT_Face)ftsize->face;
+ FT_Memory memory = face->root.memory;
FT_UShort n_twilight;
TT_MaxProfile* maxp = &face->max_profile;
- TT_ExecContext exec;
- exec = TT_New_Context( (TT_Driver)face->root.driver );
- if ( !exec )
- return FT_THROW( Could_Not_Find_Context );
+ /* clean up bytecode related data */
+ FT_FREE( size->function_defs );
+ FT_FREE( size->instruction_defs );
+ FT_FREE( size->cvt );
+ FT_FREE( size->storage );
- size->context = exec;
+ if ( size->context )
+ TT_Done_Context( size->context );
+ tt_glyphzone_done( &size->twilight );
- exec->pedantic_hinting = pedantic;
+ size->bytecode_ready = -1;
+ size->cvt_ready = -1;
- exec->maxFDefs = maxp->maxFunctionDefs;
- exec->maxIDefs = maxp->maxInstructionDefs;
+ size->context = TT_New_Context( (TT_Driver)face->root.driver );
- if ( FT_NEW_ARRAY( exec->FDefs, exec->maxFDefs + exec->maxIDefs ) )
- goto Fail;
+ size->max_function_defs = maxp->maxFunctionDefs;
+ size->max_instruction_defs = maxp->maxInstructionDefs;
- exec->IDefs = exec->FDefs + exec->maxFDefs;
+ size->num_function_defs = 0;
+ size->num_instruction_defs = 0;
- exec->numFDefs = 0;
- exec->numIDefs = 0;
+ size->max_func = 0;
+ size->max_ins = 0;
- exec->maxFunc = 0;
- exec->maxIns = 0;
+ size->cvt_size = face->cvt_size;
+ size->storage_size = maxp->maxStorage;
- /* XXX: We reserve a little more elements on the stack to deal */
- /* with broken fonts like arialbs, courbs, timesbs, etc. */
- exec->stackSize = maxp->maxStackElements + 32;
- exec->storeSize = maxp->maxStorage;
- exec->cvtSize = face->cvt_size;
+ /* Set default metrics */
+ {
+ TT_Size_Metrics* tt_metrics = &size->ttmetrics;
+
+
+ tt_metrics->rotated = FALSE;
+ tt_metrics->stretched = FALSE;
+
+ /* Set default engine compensation. Value 3 is not described */
+ /* in the OpenType specification (as of Mai 2019), but Greg */
+ /* says that MS handles it the same as `gray'. */
+ /* */
+ /* The Apple specification says that the compensation for */
+ /* `gray' is always zero. FreeType doesn't do any */
+ /* compensation at all. */
+ tt_metrics->compensations[0] = 0; /* gray */
+ tt_metrics->compensations[1] = 0; /* black */
+ tt_metrics->compensations[2] = 0; /* white */
+ tt_metrics->compensations[3] = 0; /* zero */
+ }
- if ( FT_NEW_ARRAY( exec->stack,
- exec->stackSize +
- (FT_Long)( exec->storeSize + exec->cvtSize ) ) )
- goto Fail;
+ /* allocate function defs, instruction defs, cvt, and storage area */
+ if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) ||
+ FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) ||
+ FT_NEW_ARRAY( size->cvt, size->cvt_size ) ||
+ FT_NEW_ARRAY( size->storage, size->storage_size ) )
+ goto Exit;
- /* reserve twilight zone and set GS before fpgm is executed, */
- /* just in case, even though fpgm should not touch them */
+ /* reserve twilight zone */
n_twilight = maxp->maxTwilightPoints;
/* there are 4 phantom points (do we need this?) */
@@ -1077,13 +1192,22 @@
error = tt_glyphzone_new( memory, n_twilight, 0, &size->twilight );
if ( error )
- goto Fail;
+ goto Exit;
- size->GS = tt_default_graphics_state;
- size->cvt_ready = -1;
+ size->twilight.n_points = n_twilight;
+
+ size->GS = tt_default_graphics_state;
- size->ttmetrics.rotated = FALSE;
- size->ttmetrics.stretched = FALSE;
+ /* set `face->interpreter' according to the debug hook present */
+ {
+ FT_Library library = face->root.driver->root.library;
+
+
+ face->interpreter = (TT_Interpreter)
+ library->debug_hooks[FT_DEBUG_HOOK_TRUETYPE];
+ if ( !face->interpreter )
+ face->interpreter = (TT_Interpreter)TT_RunIns;
+ }
/* Fine, now run the font program! */
@@ -1093,11 +1217,59 @@
/* to be executed just once; calling it again is completely useless */
/* and might even lead to extremely slow behaviour if it is malformed */
/* (containing an infinite loop, for example). */
- error = tt_size_run_fpgm( size );
+ error = tt_size_run_fpgm( size, pedantic );
return error;
- Fail:
- tt_size_done_bytecode( size );
+ Exit:
+ if ( error )
+ tt_size_done_bytecode( ftsize );
+
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_size_ready_bytecode( TT_Size size,
+ FT_Bool pedantic )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ if ( size->bytecode_ready < 0 )
+ error = tt_size_init_bytecode( (FT_Size)size, pedantic );
+ else
+ error = size->bytecode_ready;
+
+ if ( error )
+ goto Exit;
+
+ /* rescale CVT when needed */
+ if ( size->cvt_ready < 0 )
+ {
+ FT_UShort i;
+
+
+ /* all twilight points are originally zero */
+ for ( i = 0; i < size->twilight.n_points; i++ )
+ {
+ size->twilight.org[i].x = 0;
+ size->twilight.org[i].y = 0;
+ size->twilight.cur[i].x = 0;
+ size->twilight.cur[i].y = 0;
+ }
+
+ /* clear storage area */
+ for ( i = 0; i < size->storage_size; i++ )
+ size->storage[i] = 0;
+
+ size->GS = tt_default_graphics_state;
+
+ error = tt_size_run_prep( size, pedantic );
+ }
+ else
+ error = size->cvt_ready;
+
+ Exit:
return error;
}
@@ -1128,9 +1300,11 @@
#ifdef TT_USE_BYTECODE_INTERPRETER
size->bytecode_ready = -1;
+ size->cvt_ready = -1;
#endif
- size->strike_index = 0xFFFFFFFFUL;
+ size->ttmetrics.valid = FALSE;
+ size->strike_index = 0xFFFFFFFFUL;
return error;
}
@@ -1151,11 +1325,14 @@
FT_LOCAL_DEF( void )
tt_size_done( FT_Size ttsize ) /* TT_Size */
{
+ TT_Size size = (TT_Size)ttsize;
+
+
#ifdef TT_USE_BYTECODE_INTERPRETER
- tt_size_done_bytecode( (TT_Size)ttsize );
-#else
- FT_UNUSED( ttsize );
+ tt_size_done_bytecode( ttsize );
#endif
+
+ size->ttmetrics.valid = FALSE;
}
@@ -1176,13 +1353,21 @@
* function must take `FT_Size` as a result. The passed `FT_Size` is
* expected to point to a `TT_Size`.
*/
- FT_LOCAL_DEF( void )
+ FT_LOCAL_DEF( FT_Error )
tt_size_reset_height( FT_Size ft_size )
{
TT_Size size = (TT_Size)ft_size;
- TT_Face face = (TT_Face)ft_size->face;
+ TT_Face face = (TT_Face)size->root.face;
FT_Size_Metrics* size_metrics = &size->hinted_metrics;
+ size->ttmetrics.valid = FALSE;
+
+ /* copy the result from base layer */
+ *size_metrics = size->root.metrics;
+
+ if ( size_metrics->x_ppem < 1 || size_metrics->y_ppem < 1 )
+ return FT_THROW( Invalid_PPem );
+
/* This bit flag, if set, indicates that the ppems must be */
/* rounded to integers. Nearly all TrueType fonts have this bit */
/* set, as hinting won't work really well otherwise. */
@@ -1200,6 +1385,10 @@
FT_MulFix( face->root.height,
size_metrics->y_scale ) );
}
+
+ size->ttmetrics.valid = TRUE;
+
+ return FT_Err_Ok;
}
@@ -1219,20 +1408,14 @@
FT_LOCAL_DEF( FT_Error )
tt_size_reset( TT_Size size )
{
+ FT_Error error;
TT_Face face = (TT_Face)size->root.face;
FT_Size_Metrics* size_metrics = &size->hinted_metrics;
- /* invalidate the size object first */
- size->ttmetrics.ppem = 0;
-
- if ( size->root.metrics.x_ppem == 0 || size->root.metrics.y_ppem == 0 )
- return FT_THROW( Invalid_PPem );
-
- /* copy the result from base layer */
- *size_metrics = size->root.metrics;
-
- tt_size_reset_height( (FT_Size)size );
+ error = tt_size_reset_height( (FT_Size)size );
+ if ( error )
+ return error;
if ( face->header.Flags & 8 )
{
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.h
index 28d6c7d855..9c36ca7836 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
*
* Objects manager (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -53,8 +53,6 @@ FT_BEGIN_HEADER
typedef FT_GlyphSlot TT_GlyphSlot;
-#ifdef TT_USE_BYTECODE_INTERPRETER
-
/**************************************************************************
*
* @Struct:
@@ -69,27 +67,21 @@ FT_BEGIN_HEADER
FT_UShort rp1;
FT_UShort rp2;
- FT_UShort gep0;
- FT_UShort gep1;
- FT_UShort gep2;
-
FT_UnitVector dualVector;
FT_UnitVector projVector;
FT_UnitVector freeVector;
FT_Long loop;
+ FT_F26Dot6 minimum_distance;
FT_Int round_state;
- FT_F26Dot6 compensation[4]; /* device-specific compensations */
- /* default values below can be modified by 'fpgm' and 'prep' */
- FT_F26Dot6 minimum_distance;
+ FT_Bool auto_flip;
FT_F26Dot6 control_value_cutin;
FT_F26Dot6 single_width_cutin;
FT_F26Dot6 single_width_value;
FT_UShort delta_base;
FT_UShort delta_shift;
- FT_Bool auto_flip;
FT_Byte instruct_control;
/* According to Greg Hitchcock from Microsoft, the `scan_control' */
/* variable as documented in the TrueType specification is a 32-bit */
@@ -98,12 +90,17 @@ FT_BEGIN_HEADER
FT_Bool scan_control;
FT_Int scan_type;
+ FT_UShort gep0;
+ FT_UShort gep1;
+ FT_UShort gep2;
+
} TT_GraphicsState;
+#ifdef TT_USE_BYTECODE_INTERPRETER
+
FT_LOCAL( void )
- tt_glyphzone_done( FT_Memory memory,
- TT_GlyphZone zone );
+ tt_glyphzone_done( TT_GlyphZone zone );
FT_LOCAL( FT_Error )
tt_glyphzone_new( FT_Memory memory,
@@ -115,6 +112,73 @@ FT_BEGIN_HEADER
+ /**************************************************************************
+ *
+ * EXECUTION SUBTABLES
+ *
+ * These sub-tables relate to instruction execution.
+ *
+ */
+
+
+#define TT_MAX_CODE_RANGES 3
+
+
+ /**************************************************************************
+ *
+ * There can only be 3 active code ranges at once:
+ * - the Font Program
+ * - the CVT Program
+ * - a glyph's instructions set
+ */
+ typedef enum TT_CodeRange_Tag_
+ {
+ tt_coderange_none = 0,
+ tt_coderange_font,
+ tt_coderange_cvt,
+ tt_coderange_glyph
+
+ } TT_CodeRange_Tag;
+
+
+ typedef struct TT_CodeRange_
+ {
+ FT_Byte* base;
+ FT_Long size;
+
+ } TT_CodeRange;
+
+ typedef TT_CodeRange TT_CodeRangeTable[TT_MAX_CODE_RANGES];
+
+
+ /**************************************************************************
+ *
+ * Defines a function/instruction definition record.
+ */
+ typedef struct TT_DefRecord_
+ {
+ FT_Int range; /* in which code range is it located? */
+ FT_Long start; /* where does it start? */
+ FT_Long end; /* where does it end? */
+ FT_UInt opc; /* function #, or instruction code */
+ FT_Bool active; /* is it active? */
+
+ } TT_DefRecord, *TT_DefArray;
+
+
+ /**************************************************************************
+ *
+ * Subglyph transformation record.
+ */
+ typedef struct TT_Transform_
+ {
+ FT_Fixed xx, xy; /* transformation matrix coefficients */
+ FT_Fixed yx, yy;
+ FT_F26Dot6 ox, oy; /* offsets */
+
+ } TT_Transform;
+
+
/**************************************************************************
*
* A note regarding non-squared pixels:
@@ -187,9 +251,13 @@ FT_BEGIN_HEADER
FT_Long x_ratio;
FT_Long y_ratio;
+ FT_UShort ppem; /* maximum ppem size */
FT_Long ratio; /* current ratio */
FT_Fixed scale;
- FT_UShort ppem; /* maximum ppem size */
+
+ FT_F26Dot6 compensations[4]; /* device-specific compensations */
+
+ FT_Bool valid;
FT_Bool rotated; /* `is the glyph rotated?'-flag */
FT_Bool stretched; /* `is the glyph stretched?'-flag */
@@ -220,8 +288,27 @@ FT_BEGIN_HEADER
FT_Long point_size; /* for the `MPS' bytecode instruction */
+ FT_UInt num_function_defs; /* number of function definitions */
+ FT_UInt max_function_defs;
+ TT_DefArray function_defs; /* table of function definitions */
+
+ FT_UInt num_instruction_defs; /* number of ins. definitions */
+ FT_UInt max_instruction_defs;
+ TT_DefArray instruction_defs; /* table of ins. definitions */
+
+ FT_UInt max_func;
+ FT_UInt max_ins;
+
+ TT_CodeRangeTable codeRangeTable;
+
TT_GraphicsState GS;
+ FT_ULong cvt_size; /* the scaled control value table */
+ FT_Long* cvt;
+
+ FT_UShort storage_size; /* The storage area is now part of */
+ FT_Long* storage; /* the instance */
+
TT_GlyphZoneRec twilight; /* The instance's twilight zone */
TT_ExecContext context;
@@ -288,18 +375,20 @@ FT_BEGIN_HEADER
#ifdef TT_USE_BYTECODE_INTERPRETER
FT_LOCAL( FT_Error )
- tt_size_run_fpgm( TT_Size size );
+ tt_size_run_fpgm( TT_Size size,
+ FT_Bool pedantic );
FT_LOCAL( FT_Error )
- tt_size_run_prep( TT_Size size );
+ tt_size_run_prep( TT_Size size,
+ FT_Bool pedantic );
FT_LOCAL( FT_Error )
- tt_size_init_bytecode( TT_Size size,
- FT_Bool pedantic );
+ tt_size_ready_bytecode( TT_Size size,
+ FT_Bool pedantic );
#endif /* TT_USE_BYTECODE_INTERPRETER */
- FT_LOCAL( void )
+ FT_LOCAL( FT_Error )
tt_size_reset_height( FT_Size size );
FT_LOCAL( FT_Error )
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.c
index 827454d857..9505b5f179 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
*
* TrueType-specific tables loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -110,7 +110,7 @@
if ( face->num_locations != (FT_ULong)face->root.num_glyphs + 1 )
{
- FT_TRACE2(( "glyph count mismatch! loca: %lu, maxp: %ld\n",
+ FT_TRACE2(( "glyph count mismatch! loca: %ld, maxp: %ld\n",
face->num_locations - 1, face->root.num_glyphs ));
/* we only handle the case where `maxp' gives a larger value */
@@ -151,7 +151,7 @@
face->num_locations = (FT_ULong)face->root.num_glyphs + 1;
table_len = new_loca_len;
- FT_TRACE2(( "adjusting num_locations to %lu\n",
+ FT_TRACE2(( "adjusting num_locations to %ld\n",
face->num_locations ));
}
else
@@ -225,7 +225,7 @@
if ( pos1 > ttface->glyf_len )
{
FT_TRACE1(( "tt_face_get_location:"
- " too large offset (0x%08lx) found for glyph index %u,\n",
+ " too large offset (0x%08lx) found for glyph index %d,\n",
pos1, gindex ));
FT_TRACE1(( " "
" exceeding the end of `glyf' table (0x%08lx)\n",
@@ -240,17 +240,17 @@
if ( gindex == ttface->num_locations - 2 )
{
FT_TRACE1(( "tt_face_get_location:"
- " too large size (%lu bytes) found for glyph index %u,\n",
+ " too large size (%ld bytes) found for glyph index %d,\n",
pos2 - pos1, gindex ));
FT_TRACE1(( " "
- " truncating at the end of `glyf' table to %lu bytes\n",
+ " truncating at the end of `glyf' table to %ld bytes\n",
ttface->glyf_len - pos1 ));
pos2 = ttface->glyf_len;
}
else
{
FT_TRACE1(( "tt_face_get_location:"
- " too large offset (0x%08lx) found for glyph index %u,\n",
+ " too large offset (0x%08lx) found for glyph index %d,\n",
pos2, gindex + 1 ));
FT_TRACE1(( " "
" exceeding the end of `glyf' table (0x%08lx)\n",
@@ -419,7 +419,7 @@
if ( FT_FRAME_EXTRACT( table_len, face->font_program ) )
goto Exit;
- FT_TRACE2(( "loaded, %12lu bytes\n", face->font_program_size ));
+ FT_TRACE2(( "loaded, %12ld bytes\n", face->font_program_size ));
}
Exit:
@@ -482,7 +482,7 @@
if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) )
goto Exit;
- FT_TRACE2(( "loaded, %12lu bytes\n", face->cvt_program_size ));
+ FT_TRACE2(( "loaded, %12ld bytes\n", face->cvt_program_size ));
}
Exit:
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.h
index bb4d3c9cc5..bc32b58020 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttpload.h
@@ -4,7 +4,7 @@
*
* TrueType-specific tables loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttsubpix.c b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttsubpix.c
new file mode 100644
index 0000000000..d811beef0d
--- /dev/null
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttsubpix.c
@@ -0,0 +1,1013 @@
+/****************************************************************************
+ *
+ * ttsubpix.c
+ *
+ * TrueType Subpixel Hinting.
+ *
+ * Copyright (C) 2010-2023 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftcalc.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/sfnt.h>
+#include <freetype/tttags.h>
+#include <freetype/ftoutln.h>
+#include <freetype/ftdriver.h>
+
+#include "ttsubpix.h"
+
+
+#if defined( TT_USE_BYTECODE_INTERPRETER ) && \
+ defined( TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY )
+
+ /**************************************************************************
+ *
+ * These rules affect how the TT Interpreter does hinting, with the
+ * goal of doing subpixel hinting by (in general) ignoring x moves.
+ * Some of these rules are fixes that go above and beyond the
+ * stated techniques in the MS whitepaper on Cleartype, due to
+ * artifacts in many glyphs. So, these rules make some glyphs render
+ * better than they do in the MS rasterizer.
+ *
+ * "" string or 0 int/char indicates to apply to all glyphs.
+ * "-" used as dummy placeholders, but any non-matching string works.
+ *
+ * Some of this could arguably be implemented in fontconfig, however:
+ *
+ * - Fontconfig can't set things on a glyph-by-glyph basis.
+ * - The tweaks that happen here are very low-level, from an average
+ * user's point of view and are best implemented in the hinter.
+ *
+ * The goal is to make the subpixel hinting techniques as generalized
+ * as possible across all fonts to prevent the need for extra rules such
+ * as these.
+ *
+ * The rule structure is designed so that entirely new rules can easily
+ * be added when a new compatibility feature is discovered.
+ *
+ * The rule structures could also use some enhancement to handle ranges.
+ *
+ * ****************** WORK IN PROGRESS *******************
+ */
+
+ /* These are `classes' of fonts that can be grouped together and used in */
+ /* rules below. A blank entry "" is required at the end of these! */
+#define FAMILY_CLASS_RULES_SIZE 7
+
+ static const SPH_Font_Class FAMILY_CLASS_Rules
+ [FAMILY_CLASS_RULES_SIZE] =
+ {
+ { "MS Legacy Fonts",
+ { "Aharoni",
+ "Andale Mono",
+ "Andalus",
+ "Angsana New",
+ "AngsanaUPC",
+ "Arabic Transparent",
+ "Arial Black",
+ "Arial Narrow",
+ "Arial Unicode MS",
+ "Arial",
+ "Batang",
+ "Browallia New",
+ "BrowalliaUPC",
+ "Comic Sans MS",
+ "Cordia New",
+ "CordiaUPC",
+ "Courier New",
+ "DFKai-SB",
+ "David Transparent",
+ "David",
+ "DilleniaUPC",
+ "Estrangelo Edessa",
+ "EucrosiaUPC",
+ "FangSong_GB2312",
+ "Fixed Miriam Transparent",
+ "FrankRuehl",
+ "Franklin Gothic Medium",
+ "FreesiaUPC",
+ "Garamond",
+ "Gautami",
+ "Georgia",
+ "Gulim",
+ "Impact",
+ "IrisUPC",
+ "JasmineUPC",
+ "KaiTi_GB2312",
+ "KodchiangUPC",
+ "Latha",
+ "Levenim MT",
+ "LilyUPC",
+ "Lucida Console",
+ "Lucida Sans Unicode",
+ "MS Gothic",
+ "MS Mincho",
+ "MV Boli",
+ "Mangal",
+ "Marlett",
+ "Microsoft Sans Serif",
+ "Mingliu",
+ "Miriam Fixed",
+ "Miriam Transparent",
+ "Miriam",
+ "Narkisim",
+ "Palatino Linotype",
+ "Raavi",
+ "Rod Transparent",
+ "Rod",
+ "Shruti",
+ "SimHei",
+ "Simplified Arabic Fixed",
+ "Simplified Arabic",
+ "Simsun",
+ "Sylfaen",
+ "Symbol",
+ "Tahoma",
+ "Times New Roman",
+ "Traditional Arabic",
+ "Trebuchet MS",
+ "Tunga",
+ "Verdana",
+ "Webdings",
+ "Wingdings",
+ "",
+ },
+ },
+ { "Core MS Legacy Fonts",
+ { "Arial Black",
+ "Arial Narrow",
+ "Arial Unicode MS",
+ "Arial",
+ "Comic Sans MS",
+ "Courier New",
+ "Garamond",
+ "Georgia",
+ "Impact",
+ "Lucida Console",
+ "Lucida Sans Unicode",
+ "Microsoft Sans Serif",
+ "Palatino Linotype",
+ "Tahoma",
+ "Times New Roman",
+ "Trebuchet MS",
+ "Verdana",
+ "",
+ },
+ },
+ { "Apple Legacy Fonts",
+ { "Geneva",
+ "Times",
+ "Monaco",
+ "Century",
+ "Chalkboard",
+ "Lobster",
+ "Century Gothic",
+ "Optima",
+ "Lucida Grande",
+ "Gill Sans",
+ "Baskerville",
+ "Helvetica",
+ "Helvetica Neue",
+ "",
+ },
+ },
+ { "Legacy Sans Fonts",
+ { "Andale Mono",
+ "Arial Unicode MS",
+ "Arial",
+ "Century Gothic",
+ "Comic Sans MS",
+ "Franklin Gothic Medium",
+ "Geneva",
+ "Lucida Console",
+ "Lucida Grande",
+ "Lucida Sans Unicode",
+ "Lucida Sans Typewriter",
+ "Microsoft Sans Serif",
+ "Monaco",
+ "Tahoma",
+ "Trebuchet MS",
+ "Verdana",
+ "",
+ },
+ },
+
+ { "Misc Legacy Fonts",
+ { "Dark Courier", "", }, },
+ { "Verdana Clones",
+ { "DejaVu Sans",
+ "Bitstream Vera Sans", "", }, },
+ { "Verdana and Clones",
+ { "DejaVu Sans",
+ "Bitstream Vera Sans",
+ "Verdana", "", }, },
+ };
+
+
+ /* Define this to force natural (i.e. not bitmap-compatible) widths. */
+ /* The default leans strongly towards natural widths except for a few */
+ /* legacy fonts where a selective combination produces nicer results. */
+/* #define FORCE_NATURAL_WIDTHS */
+
+
+ /* Define `classes' of styles that can be grouped together and used in */
+ /* rules below. A blank entry "" is required at the end of these! */
+#define STYLE_CLASS_RULES_SIZE 5
+
+ static const SPH_Font_Class STYLE_CLASS_Rules
+ [STYLE_CLASS_RULES_SIZE] =
+ {
+ { "Regular Class",
+ { "Regular",
+ "Book",
+ "Medium",
+ "Roman",
+ "Normal",
+ "",
+ },
+ },
+ { "Regular/Italic Class",
+ { "Regular",
+ "Book",
+ "Medium",
+ "Italic",
+ "Oblique",
+ "Roman",
+ "Normal",
+ "",
+ },
+ },
+ { "Bold/BoldItalic Class",
+ { "Bold",
+ "Bold Italic",
+ "Black",
+ "",
+ },
+ },
+ { "Bold/Italic/BoldItalic Class",
+ { "Bold",
+ "Bold Italic",
+ "Black",
+ "Italic",
+ "Oblique",
+ "",
+ },
+ },
+ { "Regular/Bold Class",
+ { "Regular",
+ "Book",
+ "Medium",
+ "Normal",
+ "Roman",
+ "Bold",
+ "Black",
+ "",
+ },
+ },
+ };
+
+
+ /* Force special legacy fixes for fonts. */
+#define COMPATIBILITY_MODE_RULES_SIZE 1
+
+ static const SPH_TweakRule COMPATIBILITY_MODE_Rules
+ [COMPATIBILITY_MODE_RULES_SIZE] =
+ {
+ { "Verdana Clones", 0, "", 0 },
+ };
+
+
+ /* Don't do subpixel (ignore_x_mode) hinting; do normal hinting. */
+#define PIXEL_HINTING_RULES_SIZE 2
+
+ static const SPH_TweakRule PIXEL_HINTING_Rules
+ [PIXEL_HINTING_RULES_SIZE] =
+ {
+ /* these characters are almost always safe */
+ { "Courier New", 12, "Italic", 'z' },
+ { "Courier New", 11, "Italic", 'z' },
+ };
+
+
+ /* Subpixel hinting ignores SHPIX rules on X. Force SHPIX for these. */
+#define DO_SHPIX_RULES_SIZE 1
+
+ static const SPH_TweakRule DO_SHPIX_Rules
+ [DO_SHPIX_RULES_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+ /* Skip Y moves that start with a point that is not on a Y pixel */
+ /* boundary and don't move that point to a Y pixel boundary. */
+#define SKIP_NONPIXEL_Y_MOVES_RULES_SIZE 4
+
+ static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules
+ [SKIP_NONPIXEL_Y_MOVES_RULES_SIZE] =
+ {
+ /* fix vwxyz thinness */
+ { "Consolas", 0, "", 0 },
+ /* Fix thin middle stems */
+ { "Core MS Legacy Fonts", 0, "Regular", 0 },
+ /* Cyrillic small letter I */
+ { "Legacy Sans Fonts", 0, "", 0 },
+ /* Fix artifacts with some Regular & Bold */
+ { "Verdana Clones", 0, "", 0 },
+ };
+
+
+#define SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
+
+ static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions
+ [SKIP_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+ {
+ /* Fixes < and > */
+ { "Courier New", 0, "Regular", 0 },
+ };
+
+
+ /* Skip Y moves that start with a point that is not on a Y pixel */
+ /* boundary and don't move that point to a Y pixel boundary. */
+#define SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE 2
+
+ static const SPH_TweakRule SKIP_NONPIXEL_Y_MOVES_DELTAP_Rules
+ [SKIP_NONPIXEL_Y_MOVES_DELTAP_RULES_SIZE] =
+ {
+ /* Maintain thickness of diagonal in 'N' */
+ { "Times New Roman", 0, "Regular/Bold Class", 'N' },
+ { "Georgia", 0, "Regular/Bold Class", 'N' },
+ };
+
+
+ /* Skip Y moves that move a point off a Y pixel boundary. */
+#define SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE 1
+
+ static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules
+ [SKIP_OFFPIXEL_Y_MOVES_RULES_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+#define SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
+
+ static const SPH_TweakRule SKIP_OFFPIXEL_Y_MOVES_Rules_Exceptions
+ [SKIP_OFFPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+ /* Round moves that don't move a point to a Y pixel boundary. */
+#define ROUND_NONPIXEL_Y_MOVES_RULES_SIZE 2
+
+ static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules
+ [ROUND_NONPIXEL_Y_MOVES_RULES_SIZE] =
+ {
+ /* Droid font instructions don't snap Y to pixels */
+ { "Droid Sans", 0, "Regular/Italic Class", 0 },
+ { "Droid Sans Mono", 0, "", 0 },
+ };
+
+
+#define ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE 1
+
+ static const SPH_TweakRule ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions
+ [ROUND_NONPIXEL_Y_MOVES_RULES_EXCEPTIONS_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+ /* Allow a Direct_Move along X freedom vector if matched. */
+#define ALLOW_X_DMOVE_RULES_SIZE 1
+
+ static const SPH_TweakRule ALLOW_X_DMOVE_Rules
+ [ALLOW_X_DMOVE_RULES_SIZE] =
+ {
+ /* Fixes vanishing diagonal in 4 */
+ { "Verdana", 0, "Regular", '4' },
+ };
+
+
+ /* Return MS rasterizer version 35 if matched. */
+#define RASTERIZER_35_RULES_SIZE 8
+
+ static const SPH_TweakRule RASTERIZER_35_Rules
+ [RASTERIZER_35_RULES_SIZE] =
+ {
+ /* This seems to be the only way to make these look good */
+ { "Times New Roman", 0, "Regular", 'i' },
+ { "Times New Roman", 0, "Regular", 'j' },
+ { "Times New Roman", 0, "Regular", 'm' },
+ { "Times New Roman", 0, "Regular", 'r' },
+ { "Times New Roman", 0, "Regular", 'a' },
+ { "Times New Roman", 0, "Regular", 'n' },
+ { "Times New Roman", 0, "Regular", 'p' },
+ { "Times", 0, "", 0 },
+ };
+
+
+ /* Don't round to the subpixel grid. Round to pixel grid. */
+#define NORMAL_ROUND_RULES_SIZE 1
+
+ static const SPH_TweakRule NORMAL_ROUND_Rules
+ [NORMAL_ROUND_RULES_SIZE] =
+ {
+ /* Fix serif thickness for certain ppems */
+ /* Can probably be generalized somehow */
+ { "Courier New", 0, "", 0 },
+ };
+
+
+ /* Skip IUP instructions if matched. */
+#define SKIP_IUP_RULES_SIZE 1
+
+ static const SPH_TweakRule SKIP_IUP_Rules
+ [SKIP_IUP_RULES_SIZE] =
+ {
+ { "Arial", 13, "Regular", 'a' },
+ };
+
+
+ /* Skip MIAP Twilight hack if matched. */
+#define MIAP_HACK_RULES_SIZE 1
+
+ static const SPH_TweakRule MIAP_HACK_Rules
+ [MIAP_HACK_RULES_SIZE] =
+ {
+ { "Geneva", 12, "", 0 },
+ };
+
+
+ /* Skip DELTAP instructions if matched. */
+#define ALWAYS_SKIP_DELTAP_RULES_SIZE 23
+
+ static const SPH_TweakRule ALWAYS_SKIP_DELTAP_Rules
+ [ALWAYS_SKIP_DELTAP_RULES_SIZE] =
+ {
+ { "Georgia", 0, "Regular", 'k' },
+ /* fix various problems with e in different versions */
+ { "Trebuchet MS", 14, "Regular", 'e' },
+ { "Trebuchet MS", 13, "Regular", 'e' },
+ { "Trebuchet MS", 15, "Regular", 'e' },
+ { "Trebuchet MS", 0, "Italic", 'v' },
+ { "Trebuchet MS", 0, "Italic", 'w' },
+ { "Trebuchet MS", 0, "Regular", 'Y' },
+ { "Arial", 11, "Regular", 's' },
+ /* prevent problems with '3' and others */
+ { "Verdana", 10, "Regular", 0 },
+ { "Verdana", 9, "Regular", 0 },
+ /* Cyrillic small letter short I */
+ { "Legacy Sans Fonts", 0, "", 0x438 },
+ { "Legacy Sans Fonts", 0, "", 0x439 },
+ { "Arial", 10, "Regular", '6' },
+ { "Arial", 0, "Bold/BoldItalic Class", 'a' },
+ /* Make horizontal stems consistent with the rest */
+ { "Arial", 24, "Bold", 'a' },
+ { "Arial", 25, "Bold", 'a' },
+ { "Arial", 24, "Bold", 's' },
+ { "Arial", 25, "Bold", 's' },
+ { "Arial", 34, "Bold", 's' },
+ { "Arial", 35, "Bold", 's' },
+ { "Arial", 36, "Bold", 's' },
+ { "Arial", 25, "Regular", 's' },
+ { "Arial", 26, "Regular", 's' },
+ };
+
+
+ /* Always do DELTAP instructions if matched. */
+#define ALWAYS_DO_DELTAP_RULES_SIZE 1
+
+ static const SPH_TweakRule ALWAYS_DO_DELTAP_Rules
+ [ALWAYS_DO_DELTAP_RULES_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+ /* Don't allow ALIGNRP after IUP. */
+#define NO_ALIGNRP_AFTER_IUP_RULES_SIZE 1
+
+ static const SPH_TweakRule NO_ALIGNRP_AFTER_IUP_Rules
+ [NO_ALIGNRP_AFTER_IUP_RULES_SIZE] =
+ {
+ /* Prevent creation of dents in outline */
+ { "-", 0, "", 0 },
+ };
+
+
+ /* Don't allow DELTAP after IUP. */
+#define NO_DELTAP_AFTER_IUP_RULES_SIZE 1
+
+ static const SPH_TweakRule NO_DELTAP_AFTER_IUP_Rules
+ [NO_DELTAP_AFTER_IUP_RULES_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+ /* Don't allow CALL after IUP. */
+#define NO_CALL_AFTER_IUP_RULES_SIZE 1
+
+ static const SPH_TweakRule NO_CALL_AFTER_IUP_Rules
+ [NO_CALL_AFTER_IUP_RULES_SIZE] =
+ {
+ /* Prevent creation of dents in outline */
+ { "-", 0, "", 0 },
+ };
+
+
+ /* De-embolden these glyphs slightly. */
+#define DEEMBOLDEN_RULES_SIZE 9
+
+ static const SPH_TweakRule DEEMBOLDEN_Rules
+ [DEEMBOLDEN_RULES_SIZE] =
+ {
+ { "Courier New", 0, "Bold", 'A' },
+ { "Courier New", 0, "Bold", 'W' },
+ { "Courier New", 0, "Bold", 'w' },
+ { "Courier New", 0, "Bold", 'M' },
+ { "Courier New", 0, "Bold", 'X' },
+ { "Courier New", 0, "Bold", 'K' },
+ { "Courier New", 0, "Bold", 'x' },
+ { "Courier New", 0, "Bold", 'z' },
+ { "Courier New", 0, "Bold", 'v' },
+ };
+
+
+ /* Embolden these glyphs slightly. */
+#define EMBOLDEN_RULES_SIZE 2
+
+ static const SPH_TweakRule EMBOLDEN_Rules
+ [EMBOLDEN_RULES_SIZE] =
+ {
+ { "Courier New", 0, "Regular", 0 },
+ { "Courier New", 0, "Italic", 0 },
+ };
+
+
+ /* This is a CVT hack that makes thick horizontal stems on 2, 5, 7 */
+ /* similar to Windows XP. */
+#define TIMES_NEW_ROMAN_HACK_RULES_SIZE 12
+
+ static const SPH_TweakRule TIMES_NEW_ROMAN_HACK_Rules
+ [TIMES_NEW_ROMAN_HACK_RULES_SIZE] =
+ {
+ { "Times New Roman", 16, "Italic", '2' },
+ { "Times New Roman", 16, "Italic", '5' },
+ { "Times New Roman", 16, "Italic", '7' },
+ { "Times New Roman", 16, "Regular", '2' },
+ { "Times New Roman", 16, "Regular", '5' },
+ { "Times New Roman", 16, "Regular", '7' },
+ { "Times New Roman", 17, "Italic", '2' },
+ { "Times New Roman", 17, "Italic", '5' },
+ { "Times New Roman", 17, "Italic", '7' },
+ { "Times New Roman", 17, "Regular", '2' },
+ { "Times New Roman", 17, "Regular", '5' },
+ { "Times New Roman", 17, "Regular", '7' },
+ };
+
+
+ /* This fudges distance on 2 to get rid of the vanishing stem issue. */
+ /* A real solution to this is certainly welcome. */
+#define COURIER_NEW_2_HACK_RULES_SIZE 15
+
+ static const SPH_TweakRule COURIER_NEW_2_HACK_Rules
+ [COURIER_NEW_2_HACK_RULES_SIZE] =
+ {
+ { "Courier New", 10, "Regular", '2' },
+ { "Courier New", 11, "Regular", '2' },
+ { "Courier New", 12, "Regular", '2' },
+ { "Courier New", 13, "Regular", '2' },
+ { "Courier New", 14, "Regular", '2' },
+ { "Courier New", 15, "Regular", '2' },
+ { "Courier New", 16, "Regular", '2' },
+ { "Courier New", 17, "Regular", '2' },
+ { "Courier New", 18, "Regular", '2' },
+ { "Courier New", 19, "Regular", '2' },
+ { "Courier New", 20, "Regular", '2' },
+ { "Courier New", 21, "Regular", '2' },
+ { "Courier New", 22, "Regular", '2' },
+ { "Courier New", 23, "Regular", '2' },
+ { "Courier New", 24, "Regular", '2' },
+ };
+
+
+#ifndef FORCE_NATURAL_WIDTHS
+
+ /* Use compatible widths with these glyphs. Compatible widths is always */
+ /* on when doing B/W TrueType instructing, but is used selectively here, */
+ /* typically on glyphs with 3 or more vertical stems. */
+#define COMPATIBLE_WIDTHS_RULES_SIZE 38
+
+ static const SPH_TweakRule COMPATIBLE_WIDTHS_Rules
+ [COMPATIBLE_WIDTHS_RULES_SIZE] =
+ {
+ { "Arial Unicode MS", 12, "Regular Class", 'm' },
+ { "Arial Unicode MS", 14, "Regular Class", 'm' },
+ /* Cyrillic small letter sha */
+ { "Arial", 10, "Regular Class", 0x448 },
+ { "Arial", 11, "Regular Class", 'm' },
+ { "Arial", 12, "Regular Class", 'm' },
+ /* Cyrillic small letter sha */
+ { "Arial", 12, "Regular Class", 0x448 },
+ { "Arial", 13, "Regular Class", 0x448 },
+ { "Arial", 14, "Regular Class", 'm' },
+ /* Cyrillic small letter sha */
+ { "Arial", 14, "Regular Class", 0x448 },
+ { "Arial", 15, "Regular Class", 0x448 },
+ { "Arial", 17, "Regular Class", 'm' },
+ { "DejaVu Sans", 15, "Regular Class", 0 },
+ { "Microsoft Sans Serif", 11, "Regular Class", 0 },
+ { "Microsoft Sans Serif", 12, "Regular Class", 0 },
+ { "Segoe UI", 11, "Regular Class", 0 },
+ { "Monaco", 0, "Regular Class", 0 },
+ { "Segoe UI", 12, "Regular Class", 'm' },
+ { "Segoe UI", 14, "Regular Class", 'm' },
+ { "Tahoma", 11, "Regular Class", 0 },
+ { "Times New Roman", 16, "Regular Class", 'c' },
+ { "Times New Roman", 16, "Regular Class", 'm' },
+ { "Times New Roman", 16, "Regular Class", 'o' },
+ { "Times New Roman", 16, "Regular Class", 'w' },
+ { "Trebuchet MS", 11, "Regular Class", 0 },
+ { "Trebuchet MS", 12, "Regular Class", 0 },
+ { "Trebuchet MS", 14, "Regular Class", 0 },
+ { "Trebuchet MS", 15, "Regular Class", 0 },
+ { "Ubuntu", 12, "Regular Class", 'm' },
+ /* Cyrillic small letter sha */
+ { "Verdana", 10, "Regular Class", 0x448 },
+ { "Verdana", 11, "Regular Class", 0x448 },
+ { "Verdana and Clones", 12, "Regular Class", 'i' },
+ { "Verdana and Clones", 12, "Regular Class", 'j' },
+ { "Verdana and Clones", 12, "Regular Class", 'l' },
+ { "Verdana and Clones", 12, "Regular Class", 'm' },
+ { "Verdana and Clones", 13, "Regular Class", 'i' },
+ { "Verdana and Clones", 13, "Regular Class", 'j' },
+ { "Verdana and Clones", 13, "Regular Class", 'l' },
+ { "Verdana and Clones", 14, "Regular Class", 'm' },
+ };
+
+
+ /* Scaling slightly in the x-direction prior to hinting results in */
+ /* more visually pleasing glyphs in certain cases. */
+ /* This sometimes needs to be coordinated with compatible width rules. */
+ /* A value of 1000 corresponds to a scaled value of 1.0. */
+
+#define X_SCALING_RULES_SIZE 50
+
+ static const SPH_ScaleRule X_SCALING_Rules[X_SCALING_RULES_SIZE] =
+ {
+ { "DejaVu Sans", 12, "Regular Class", 'm', 950 },
+ { "Verdana and Clones", 12, "Regular Class", 'a', 1100 },
+ { "Verdana and Clones", 13, "Regular Class", 'a', 1050 },
+ { "Arial", 11, "Regular Class", 'm', 975 },
+ { "Arial", 12, "Regular Class", 'm', 1050 },
+ /* Cyrillic small letter el */
+ { "Arial", 13, "Regular Class", 0x43B, 950 },
+ { "Arial", 13, "Regular Class", 'o', 950 },
+ { "Arial", 13, "Regular Class", 'e', 950 },
+ { "Arial", 14, "Regular Class", 'm', 950 },
+ /* Cyrillic small letter el */
+ { "Arial", 15, "Regular Class", 0x43B, 925 },
+ { "Bitstream Vera Sans", 10, "Regular/Italic Class", 0, 1100 },
+ { "Bitstream Vera Sans", 12, "Regular/Italic Class", 0, 1050 },
+ { "Bitstream Vera Sans", 16, "Regular Class", 0, 1050 },
+ { "Bitstream Vera Sans", 9, "Regular/Italic Class", 0, 1050 },
+ { "DejaVu Sans", 12, "Regular Class", 'l', 975 },
+ { "DejaVu Sans", 12, "Regular Class", 'i', 975 },
+ { "DejaVu Sans", 12, "Regular Class", 'j', 975 },
+ { "DejaVu Sans", 13, "Regular Class", 'l', 950 },
+ { "DejaVu Sans", 13, "Regular Class", 'i', 950 },
+ { "DejaVu Sans", 13, "Regular Class", 'j', 950 },
+ { "DejaVu Sans", 10, "Regular/Italic Class", 0, 1100 },
+ { "DejaVu Sans", 12, "Regular/Italic Class", 0, 1050 },
+ { "Georgia", 10, "", 0, 1050 },
+ { "Georgia", 11, "", 0, 1100 },
+ { "Georgia", 12, "", 0, 1025 },
+ { "Georgia", 13, "", 0, 1050 },
+ { "Georgia", 16, "", 0, 1050 },
+ { "Georgia", 17, "", 0, 1030 },
+ { "Liberation Sans", 12, "Regular Class", 'm', 1100 },
+ { "Lucida Grande", 11, "Regular Class", 'm', 1100 },
+ { "Microsoft Sans Serif", 11, "Regular Class", 'm', 950 },
+ { "Microsoft Sans Serif", 12, "Regular Class", 'm', 1050 },
+ { "Segoe UI", 12, "Regular Class", 'H', 1050 },
+ { "Segoe UI", 12, "Regular Class", 'm', 1050 },
+ { "Segoe UI", 14, "Regular Class", 'm', 1050 },
+ { "Tahoma", 11, "Regular Class", 'i', 975 },
+ { "Tahoma", 11, "Regular Class", 'l', 975 },
+ { "Tahoma", 11, "Regular Class", 'j', 900 },
+ { "Tahoma", 11, "Regular Class", 'm', 918 },
+ { "Verdana", 10, "Regular/Italic Class", 0, 1100 },
+ { "Verdana", 12, "Regular Class", 'm', 975 },
+ { "Verdana", 12, "Regular/Italic Class", 0, 1050 },
+ { "Verdana", 13, "Regular/Italic Class", 'i', 950 },
+ { "Verdana", 13, "Regular/Italic Class", 'j', 950 },
+ { "Verdana", 13, "Regular/Italic Class", 'l', 950 },
+ { "Verdana", 16, "Regular Class", 0, 1050 },
+ { "Verdana", 9, "Regular/Italic Class", 0, 1050 },
+ { "Times New Roman", 16, "Regular Class", 'm', 918 },
+ { "Trebuchet MS", 11, "Regular Class", 'm', 800 },
+ { "Trebuchet MS", 12, "Regular Class", 'm', 800 },
+ };
+
+#else
+
+#define COMPATIBLE_WIDTHS_RULES_SIZE 1
+
+ static const SPH_TweakRule COMPATIBLE_WIDTHS_Rules
+ [COMPATIBLE_WIDTHS_RULES_SIZE] =
+ {
+ { "-", 0, "", 0 },
+ };
+
+
+#define X_SCALING_RULES_SIZE 1
+
+ static const SPH_ScaleRule X_SCALING_Rules
+ [X_SCALING_RULES_SIZE] =
+ {
+ { "-", 0, "", 0, 1000 },
+ };
+
+#endif /* FORCE_NATURAL_WIDTHS */
+
+
+ static FT_Bool
+ is_member_of_family_class( const FT_String* detected_font_name,
+ const FT_String* rule_font_name )
+ {
+ FT_UInt i, j;
+
+
+ /* Does font name match rule family? */
+ if ( ft_strcmp( detected_font_name, rule_font_name ) == 0 )
+ return TRUE;
+
+ /* Is font name a wildcard ""? */
+ if ( ft_strcmp( rule_font_name, "" ) == 0 )
+ return TRUE;
+
+ /* Is font name contained in a class list? */
+ for ( i = 0; i < FAMILY_CLASS_RULES_SIZE; i++ )
+ {
+ if ( ft_strcmp( FAMILY_CLASS_Rules[i].name, rule_font_name ) == 0 )
+ {
+ for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
+ {
+ if ( ft_strcmp( FAMILY_CLASS_Rules[i].member[j], "" ) == 0 )
+ continue;
+ if ( ft_strcmp( FAMILY_CLASS_Rules[i].member[j],
+ detected_font_name ) == 0 )
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+ }
+
+
+ static FT_Bool
+ is_member_of_style_class( const FT_String* detected_font_style,
+ const FT_String* rule_font_style )
+ {
+ FT_UInt i, j;
+
+
+ /* Does font style match rule style? */
+ if ( ft_strcmp( detected_font_style, rule_font_style ) == 0 )
+ return TRUE;
+
+ /* Is font style a wildcard ""? */
+ if ( ft_strcmp( rule_font_style, "" ) == 0 )
+ return TRUE;
+
+ /* Is font style contained in a class list? */
+ for ( i = 0; i < STYLE_CLASS_RULES_SIZE; i++ )
+ {
+ if ( ft_strcmp( STYLE_CLASS_Rules[i].name, rule_font_style ) == 0 )
+ {
+ for ( j = 0; j < SPH_MAX_CLASS_MEMBERS; j++ )
+ {
+ if ( ft_strcmp( STYLE_CLASS_Rules[i].member[j], "" ) == 0 )
+ continue;
+ if ( ft_strcmp( STYLE_CLASS_Rules[i].member[j],
+ detected_font_style ) == 0 )
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+ }
+
+
+ FT_LOCAL_DEF( FT_Bool )
+ sph_test_tweak( TT_Face face,
+ const FT_String* family,
+ FT_UInt ppem,
+ const FT_String* style,
+ FT_UInt glyph_index,
+ const SPH_TweakRule* rule,
+ FT_UInt num_rules )
+ {
+ FT_UInt i;
+
+
+ /* rule checks may be able to be optimized further */
+ for ( i = 0; i < num_rules; i++ )
+ {
+ if ( family &&
+ ( is_member_of_family_class ( family, rule[i].family ) ) )
+ if ( rule[i].ppem == 0 ||
+ rule[i].ppem == ppem )
+ if ( style &&
+ is_member_of_style_class ( style, rule[i].style ) )
+ if ( rule[i].glyph == 0 ||
+ FT_Get_Char_Index( (FT_Face)face,
+ rule[i].glyph ) == glyph_index )
+ return TRUE;
+ }
+
+ return FALSE;
+ }
+
+
+ static FT_UInt
+ scale_test_tweak( TT_Face face,
+ const FT_String* family,
+ FT_UInt ppem,
+ const FT_String* style,
+ FT_UInt glyph_index,
+ const SPH_ScaleRule* rule,
+ FT_UInt num_rules )
+ {
+ FT_UInt i;
+
+
+ /* rule checks may be able to be optimized further */
+ for ( i = 0; i < num_rules; i++ )
+ {
+ if ( family &&
+ ( is_member_of_family_class ( family, rule[i].family ) ) )
+ if ( rule[i].ppem == 0 ||
+ rule[i].ppem == ppem )
+ if ( style &&
+ is_member_of_style_class( style, rule[i].style ) )
+ if ( rule[i].glyph == 0 ||
+ FT_Get_Char_Index( (FT_Face)face,
+ rule[i].glyph ) == glyph_index )
+ return rule[i].scale;
+ }
+
+ return 1000;
+ }
+
+
+ FT_LOCAL_DEF( FT_UInt )
+ sph_test_tweak_x_scaling( TT_Face face,
+ const FT_String* family,
+ FT_UInt ppem,
+ const FT_String* style,
+ FT_UInt glyph_index )
+ {
+ return scale_test_tweak( face, family, ppem, style, glyph_index,
+ X_SCALING_Rules, X_SCALING_RULES_SIZE );
+ }
+
+
+#define TWEAK_RULES( x ) \
+ if ( sph_test_tweak( face, family, ppem, style, glyph_index, \
+ x##_Rules, x##_RULES_SIZE ) ) \
+ loader->exec->sph_tweak_flags |= SPH_TWEAK_##x
+
+#define TWEAK_RULES_EXCEPTIONS( x ) \
+ if ( sph_test_tweak( face, family, ppem, style, glyph_index, \
+ x##_Rules_Exceptions, x##_RULES_EXCEPTIONS_SIZE ) ) \
+ loader->exec->sph_tweak_flags &= ~SPH_TWEAK_##x
+
+
+ FT_LOCAL_DEF( void )
+ sph_set_tweaks( TT_Loader loader,
+ FT_UInt glyph_index )
+ {
+ TT_Face face = loader->face;
+ FT_String* family = face->root.family_name;
+ FT_UInt ppem = loader->size->metrics->x_ppem;
+ FT_String* style = face->root.style_name;
+
+
+ /* don't apply rules if style isn't set */
+ if ( !face->root.style_name )
+ return;
+
+#ifdef SPH_DEBUG_MORE_VERBOSE
+ printf( "%s,%d,%s,%c=%d ",
+ family, ppem, style, glyph_index, glyph_index );
+#endif
+
+ TWEAK_RULES( PIXEL_HINTING );
+
+ if ( loader->exec->sph_tweak_flags & SPH_TWEAK_PIXEL_HINTING )
+ {
+ loader->exec->ignore_x_mode = FALSE;
+ return;
+ }
+
+ TWEAK_RULES( ALLOW_X_DMOVE );
+ TWEAK_RULES( ALWAYS_DO_DELTAP );
+ TWEAK_RULES( ALWAYS_SKIP_DELTAP );
+ TWEAK_RULES( DEEMBOLDEN );
+ TWEAK_RULES( DO_SHPIX );
+ TWEAK_RULES( EMBOLDEN );
+ TWEAK_RULES( MIAP_HACK );
+ TWEAK_RULES( NORMAL_ROUND );
+ TWEAK_RULES( NO_ALIGNRP_AFTER_IUP );
+ TWEAK_RULES( NO_CALL_AFTER_IUP );
+ TWEAK_RULES( NO_DELTAP_AFTER_IUP );
+ TWEAK_RULES( RASTERIZER_35 );
+ TWEAK_RULES( SKIP_IUP );
+
+ TWEAK_RULES( SKIP_OFFPIXEL_Y_MOVES );
+ TWEAK_RULES_EXCEPTIONS( SKIP_OFFPIXEL_Y_MOVES );
+
+ TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES_DELTAP );
+
+ TWEAK_RULES( SKIP_NONPIXEL_Y_MOVES );
+ TWEAK_RULES_EXCEPTIONS( SKIP_NONPIXEL_Y_MOVES );
+
+ TWEAK_RULES( ROUND_NONPIXEL_Y_MOVES );
+ TWEAK_RULES_EXCEPTIONS( ROUND_NONPIXEL_Y_MOVES );
+
+ if ( loader->exec->sph_tweak_flags & SPH_TWEAK_RASTERIZER_35 )
+ {
+ if ( loader->exec->rasterizer_version != TT_INTERPRETER_VERSION_35 )
+ {
+ loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
+ loader->exec->size->cvt_ready = -1;
+
+ tt_size_ready_bytecode(
+ loader->exec->size,
+ FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+ }
+ else
+ loader->exec->rasterizer_version = TT_INTERPRETER_VERSION_35;
+ }
+ else
+ {
+ if ( loader->exec->rasterizer_version !=
+ SPH_OPTION_SET_RASTERIZER_VERSION )
+ {
+ loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
+ loader->exec->size->cvt_ready = -1;
+
+ tt_size_ready_bytecode(
+ loader->exec->size,
+ FT_BOOL( loader->load_flags & FT_LOAD_PEDANTIC ) );
+ }
+ else
+ loader->exec->rasterizer_version = SPH_OPTION_SET_RASTERIZER_VERSION;
+ }
+
+ if ( IS_HINTED( loader->load_flags ) )
+ {
+ TWEAK_RULES( TIMES_NEW_ROMAN_HACK );
+ TWEAK_RULES( COURIER_NEW_2_HACK );
+ }
+
+ if ( sph_test_tweak( face, family, ppem, style, glyph_index,
+ COMPATIBILITY_MODE_Rules, COMPATIBILITY_MODE_RULES_SIZE ) )
+ loader->exec->face->sph_compatibility_mode = TRUE;
+
+
+ if ( IS_HINTED( loader->load_flags ) )
+ {
+ if ( sph_test_tweak( face, family, ppem, style, glyph_index,
+ COMPATIBLE_WIDTHS_Rules, COMPATIBLE_WIDTHS_RULES_SIZE ) )
+ loader->exec->compatible_widths |= TRUE;
+ }
+ }
+
+#else /* !(TT_USE_BYTECODE_INTERPRETER && */
+ /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY) */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_subpix_dummy;
+
+#endif /* !(TT_USE_BYTECODE_INTERPRETER && */
+ /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY) */
+
+
+/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttsubpix.h b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttsubpix.h
new file mode 100644
index 0000000000..62af4c272d
--- /dev/null
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/truetype/ttsubpix.h
@@ -0,0 +1,110 @@
+/****************************************************************************
+ *
+ * ttsubpix.h
+ *
+ * TrueType Subpixel Hinting.
+ *
+ * Copyright (C) 2010-2023 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#ifndef TTSUBPIX_H_
+#define TTSUBPIX_H_
+
+#include "ttobjs.h"
+#include "ttinterp.h"
+
+
+FT_BEGIN_HEADER
+
+
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+
+ /**************************************************************************
+ *
+ * ID flags to identify special functions at FDEF and runtime.
+ *
+ */
+#define SPH_FDEF_INLINE_DELTA_1 0x0000001
+#define SPH_FDEF_INLINE_DELTA_2 0x0000002
+#define SPH_FDEF_DIAGONAL_STROKE 0x0000004
+#define SPH_FDEF_VACUFORM_ROUND_1 0x0000008
+#define SPH_FDEF_TTFAUTOHINT_1 0x0000010
+#define SPH_FDEF_SPACING_1 0x0000020
+#define SPH_FDEF_SPACING_2 0x0000040
+#define SPH_FDEF_TYPEMAN_STROKES 0x0000080
+#define SPH_FDEF_TYPEMAN_DIAGENDCTRL 0x0000100
+
+
+ /**************************************************************************
+ *
+ * Tweak flags that are set for each glyph by the below rules.
+ *
+ */
+#define SPH_TWEAK_ALLOW_X_DMOVE 0x0000001UL
+#define SPH_TWEAK_ALWAYS_DO_DELTAP 0x0000002UL
+#define SPH_TWEAK_ALWAYS_SKIP_DELTAP 0x0000004UL
+#define SPH_TWEAK_COURIER_NEW_2_HACK 0x0000008UL
+#define SPH_TWEAK_DEEMBOLDEN 0x0000010UL
+#define SPH_TWEAK_DO_SHPIX 0x0000020UL
+#define SPH_TWEAK_EMBOLDEN 0x0000040UL
+#define SPH_TWEAK_MIAP_HACK 0x0000080UL
+#define SPH_TWEAK_NORMAL_ROUND 0x0000100UL
+#define SPH_TWEAK_NO_ALIGNRP_AFTER_IUP 0x0000200UL
+#define SPH_TWEAK_NO_CALL_AFTER_IUP 0x0000400UL
+#define SPH_TWEAK_NO_DELTAP_AFTER_IUP 0x0000800UL
+#define SPH_TWEAK_PIXEL_HINTING 0x0001000UL
+#define SPH_TWEAK_RASTERIZER_35 0x0002000UL
+#define SPH_TWEAK_ROUND_NONPIXEL_Y_MOVES 0x0004000UL
+#define SPH_TWEAK_SKIP_IUP 0x0008000UL
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES 0x0010000UL
+#define SPH_TWEAK_SKIP_OFFPIXEL_Y_MOVES 0x0020000UL
+#define SPH_TWEAK_TIMES_NEW_ROMAN_HACK 0x0040000UL
+#define SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP 0x0080000UL
+
+
+ FT_LOCAL( FT_Bool )
+ sph_test_tweak( TT_Face face,
+ const FT_String* family,
+ FT_UInt ppem,
+ const FT_String* style,
+ FT_UInt glyph_index,
+ const SPH_TweakRule* rule,
+ FT_UInt num_rules );
+
+ FT_LOCAL( FT_UInt )
+ sph_test_tweak_x_scaling( TT_Face face,
+ const FT_String* family,
+ FT_UInt ppem,
+ const FT_String* style,
+ FT_UInt glyph_index );
+
+ FT_LOCAL( void )
+ sph_set_tweaks( TT_Loader loader,
+ FT_UInt glyph_index );
+
+
+ /* These macros are defined absent a method for setting them */
+#define SPH_OPTION_BITMAP_WIDTHS FALSE
+#define SPH_OPTION_SET_SUBPIXEL TRUE
+#define SPH_OPTION_SET_GRAYSCALE FALSE
+#define SPH_OPTION_SET_COMPATIBLE_WIDTHS FALSE
+#define SPH_OPTION_SET_RASTERIZER_VERSION 38
+
+#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+
+
+FT_END_HEADER
+
+#endif /* TTSUBPIX_H_ */
+
+
+/* END */
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.c b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.c
index b1a0d23bed..a63cd4dc48 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.c
@@ -4,7 +4,7 @@
*
* AFM support for Type 1 fonts (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.h
index 92ff627dd0..7f5cdda191 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1afm.h
@@ -4,7 +4,7 @@
*
* AFM support for Type 1 fonts (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.c b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.c
index 5ded771402..8ed01914a5 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.c
@@ -4,7 +4,7 @@
*
* Type 1 driver interface (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.h
index 1cc3d24e7d..5ff52b55b1 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1driver.h
@@ -4,7 +4,7 @@
*
* High-level Type 1 driver interface (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1errors.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1errors.h
index 46bddbc30f..8aeb24ae18 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1errors.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1errors.h
@@ -4,7 +4,7 @@
*
* Type 1 error codes (specification only).
*
- * Copyright (C) 2001-2025 by
+ * Copyright (C) 2001-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.c b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.c
index b9bc0b56ce..c29e682510 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.c
@@ -4,7 +4,7 @@
*
* Type 1 Glyph Loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -70,13 +70,8 @@
/* For incremental fonts get the character data using the */
/* callback function. */
if ( inc )
- {
- /* So `free_glyph_data` knows whether to free it. */
- char_string->pointer = NULL;
-
error = inc->funcs->get_glyph_data( inc->object,
glyph_index, char_string );
- }
else
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
@@ -160,9 +155,6 @@
decoder->builder.advance.y = INT_TO_FIXED( metrics.advance_v );
}
- if ( error && inc )
- inc->funcs->free_glyph_data( inc->object, char_string );
-
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
return error;
@@ -303,7 +295,7 @@
{
advances[nn] = 0;
- FT_TRACE5(( " idx %u: advance height 0 font units\n",
+ FT_TRACE5(( " idx %d: advance height 0 font units\n",
first + nn ));
}
@@ -341,7 +333,7 @@
else
advances[nn] = 0;
- FT_TRACE5(( " idx %u: advance width %ld font unit%s\n",
+ FT_TRACE5(( " idx %d: advance width %ld font unit%s\n",
first + nn,
advances[nn],
advances[nn] == 1 ? "" : "s" ));
@@ -388,7 +380,7 @@
goto Exit;
}
- FT_TRACE1(( "T1_Load_Glyph: glyph index %u\n", glyph_index ));
+ FT_TRACE1(( "T1_Load_Glyph: glyph index %d\n", glyph_index ));
FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) );
@@ -406,12 +398,16 @@
glyph->y_scale = 0x10000L;
}
+ t1glyph->outline.n_points = 0;
+ t1glyph->outline.n_contours = 0;
+
hinting = FT_BOOL( !( load_flags & FT_LOAD_NO_SCALE ) &&
!( load_flags & FT_LOAD_NO_HINTING ) );
scaled = FT_BOOL( !( load_flags & FT_LOAD_NO_SCALE ) );
glyph->hint = hinting;
glyph->scaled = scaled;
+ t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
error = decoder_funcs->init( &decoder,
t1glyph->face,
@@ -456,12 +452,16 @@
must_finish_decoder = FALSE;
+ /* now, set the metrics -- this is rather simple, as */
+ /* the left side bearing is the xMin, and the top side */
+ /* bearing the yMax */
if ( !error )
{
- /* now, set the metrics -- this is rather simple, as */
- /* the left side bearing is the xMin, and the top side */
- /* bearing the yMax; for composite glyphs, return only */
- /* left side bearing and advance width */
+ t1glyph->outline.flags &= FT_OUTLINE_OWNER;
+ t1glyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
+
+ /* for composite glyphs, return only left side bearing and */
+ /* advance width */
if ( load_flags & FT_LOAD_NO_RECURSE )
{
FT_Slot_Internal internal = t1glyph->internal;
@@ -482,13 +482,6 @@
FT_Glyph_Metrics* metrics = &t1glyph->metrics;
- t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
-
- t1glyph->outline.flags &= FT_OUTLINE_OWNER;
- t1glyph->outline.flags |= FT_OUTLINE_REVERSE_FILL;
- if ( t1size && t1size->metrics.y_ppem < 24 )
- t1glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
-
/* copy the _unscaled_ advance width */
metrics->horiAdvance =
FIXED_TO_INT( decoder.builder.advance.x );
@@ -511,6 +504,11 @@
FIXED_TO_INT( decoder.builder.advance.y );
}
+ t1glyph->format = FT_GLYPH_FORMAT_OUTLINE;
+
+ if ( t1size && t1size->metrics.y_ppem < 24 )
+ t1glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
+
#if 1
/* apply the font matrix, if any */
if ( font_matrix.xx != 0x10000L || font_matrix.yy != 0x10000L ||
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.h
index 6bedd132c5..17a6a5941e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1gload.h
@@ -4,7 +4,7 @@
*
* Type 1 Glyph Loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.c b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.c
index 0f11445bef..ee7fb42a51 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.c
@@ -4,7 +4,7 @@
*
* Type 1 font loader (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -471,7 +471,7 @@
nc = num_coords;
if ( num_coords > blend->num_axis )
{
- FT_TRACE2(( "T1_Get_MM_Blend: only using first %u of %u coordinates\n",
+ FT_TRACE2(( "T1_Get_MM_Blend: only using first %d of %d coordinates\n",
blend->num_axis, num_coords ));
nc = blend->num_axis;
}
@@ -640,7 +640,7 @@
{
FT_UNUSED( instance_index );
- return T1_Set_MM_WeightVector( face, 0, NULL );
+ return T1_Set_MM_Blend( face, 0, NULL );
}
@@ -691,7 +691,7 @@
if ( num_coords > blend->num_axis )
{
FT_TRACE2(( "T1_Get_Var_Design:"
- " only using first %u of %u coordinates\n",
+ " only using first %d of %d coordinates\n",
blend->num_axis, num_coords ));
nc = blend->num_axis;
}
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.h
index 2cd8241968..a45efa7cb7 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1load.h
@@ -4,7 +4,7 @@
*
* Type 1 font loader (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.c b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.c
index 7f25208f87..b1b27c31fe 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
*
* Type 1 objects manager (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.h
index 6c71977c15..3809370c1e 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1objs.h
@@ -4,7 +4,7 @@
*
* Type 1 objects manager (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.c b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.c
index ef643e298f..3717ea7c57 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.c
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.c
@@ -4,7 +4,7 @@
*
* Type 1 parser (body).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.h
index f4ad426e9e..a0a2134d45 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1parse.h
@@ -4,7 +4,7 @@
*
* Type 1 parser (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1tokens.h b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1tokens.h
index a526406a41..5a3d2f1ef0 100644
--- a/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1tokens.h
+++ b/jdk/src/share/native/sun/awt/libfreetype/src/type1/t1tokens.h
@@ -4,7 +4,7 @@
*
* Type 1 tokenizer (specification).
*
- * Copyright (C) 1996-2025 by
+ * Copyright (C) 1996-2024 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -33,7 +33,7 @@
T1_FIELD_DICT_FONTDICT )
/* we use pointers to detect modifications made by synthetic fonts */
- T1_FIELD_FIXED ( "ItalicAngle", italic_angle,
+ T1_FIELD_NUM ( "ItalicAngle", italic_angle,
T1_FIELD_DICT_FONTDICT )
T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch,
T1_FIELD_DICT_FONTDICT )
diff --git a/jdk/src/share/native/sun/awt/libpng/CHANGES b/jdk/src/share/native/sun/awt/libpng/CHANGES
index ba81df0c0e..2478fd0fc0 100644
--- a/jdk/src/share/native/sun/awt/libpng/CHANGES
+++ b/jdk/src/share/native/sun/awt/libpng/CHANGES
@@ -5988,7 +5988,7 @@ Version 1.6.32rc01 [August 18, 2017]
Version 1.6.32rc02 [August 22, 2017]
Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
- project <https://github.com/google/oss-fuzz/tree/master/projects/libpng>.
+ project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
Version 1.6.32 [August 24, 2017]
No changes.
@@ -6304,82 +6304,7 @@ Version 1.6.51 [November 21, 2025]
Added GitHub Actions workflows for automated testing.
Performed various refactorings and cleanups.
-Version 1.6.52 [December 3, 2025]
- Fixed CVE-2025-66293 (high severity):
- Out-of-bounds read in `png_image_read_composite`.
- (Reported by flyfish101 <flyfish101@users.noreply.github.com>.)
- Fixed the Paeth filter handling in the RISC-V RVV implementation.
- (Reported by Filip Wasil; fixed by Liang Junzhao.)
- Improved the performance of the RISC-V RVV implementation.
- (Contributed by Liang Junzhao.)
- Added allocation failure fuzzing to oss-fuzz.
- (Contributed by Philippe Antoine.)
-
-Version 1.6.53 [December 5, 2025]
- Fixed a build failure on RISC-V RVV caused by a misspelled intrinsic.
- (Contributed by Alexander Smorkalov.)
- Fixed a build failure with CMake 4.1 or newer, on Windows, when using
- Visual C++ without MASM installed.
-
-Version 1.6.54 [January 12, 2026]
- Fixed CVE-2026-22695 (medium severity):
- Heap buffer over-read in `png_image_read_direct_scaled`.
- (Reported and fixed by Petr Simecek.)
- Fixed CVE-2026-22801 (medium severity):
- Integer truncation causing heap buffer over-read in `png_image_write_*`.
- Implemented various improvements in oss-fuzz.
- (Contributed by Philippe Antoine.)
-
-Version 1.6.55 [February 9, 2026]
- Fixed CVE-2026-25646 (high severity):
- Heap buffer overflow in `png_set_quantize`.
- (Reported and fixed by Joshua Inscoe.)
- Resolved an oss-fuzz build issue involving nalloc.
- (Contributed by Philippe Antoine.)
-
-Version 1.6.56 [March 25, 2026]
- Fixed CVE-2026-33416 (high severity):
- Use-after-free via pointer aliasing in `png_set_tRNS` and `png_set_PLTE`.
- (Reported by Halil Oktay and Ryo Shimada;
- fixed by Halil Oktay and Cosmin Truta.)
- Fixed CVE-2026-33636 (high severity):
- Out-of-bounds read/write in the palette expansion on ARM Neon.
- (Reported by Taegu Ha; fixed by Taegu Ha and Cosmin Truta.)
- Fixed uninitialized reads beyond `num_trans` in `trans_alpha` buffers.
- (Contributed by Halil Oktay.)
- Fixed stale `info_ptr->palette` after in-place gamma and background
- transforms.
- Fixed wrong channel indices in `png_image_read_and_map` RGB_ALPHA path.
- (Contributed by Yuelin Wang.)
- Fixed wrong background color in colormap read.
- (Contributed by Yuelin Wang.)
- Fixed dead loop in sPLT write.
- (Contributed by Yuelin Wang.)
- Added missing null pointer checks in four public API functions.
- (Contributed by Yuelin Wang.)
- Validated shift bit depths in `png_set_shift` to prevent infinite loop.
- (Contributed by Yuelin Wang.)
- Avoided undefined behavior in library and tests.
- Deprecated the hardly-ever-tested POINTER_INDEXING config option.
- Added negative-stride test coverage for the simplified API.
- Fixed memory leaks and API misuse in oss-fuzz.
- (Contributed by Owen Sanzas.)
- Implemented various fixes and improvements in oss-fuzz.
- (Contributed by Bob Friesenhahn and Philippe Antoine.)
- Performed various refactorings and cleanups.
-
-Version 1.6.57 [April 8, 2026]
- Fixed CVE-2026-34757 (medium severity):
- Use-after-free in `png_set_PLTE`, `png_set_tRNS` and `png_set_hIST`
- leading to corrupted chunk data and potential heap information disclosure.
- Also hardened the append-style setters (`png_set_text`, `png_set_sPLT`,
- `png_set_unknown_chunks`) against a theoretical variant of the same
- aliasing pattern.
- (Reported by Iv4n <Iv4n550@users.noreply.github.com>.)
- Fixed integer overflow in rowbytes computation in read transforms.
- (Contributed by Mohammad Seet.)
-
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
-<https://lists.sourceforge.net/lists/listinfo/png-mng-implement>
+https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe.
diff --git a/jdk/src/share/native/sun/awt/libpng/LICENSE b/jdk/src/share/native/sun/awt/libpng/LICENSE
index 1b765ae9f9..ea6df986cb 100644
--- a/jdk/src/share/native/sun/awt/libpng/LICENSE
+++ b/jdk/src/share/native/sun/awt/libpng/LICENSE
@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2
---------------------------------------
- * Copyright (c) 1995-2026 The PNG Reference Library Authors.
- * Copyright (c) 2018-2026 Cosmin Truta.
+ * Copyright (c) 1995-2025 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2025 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
diff --git a/jdk/src/share/native/sun/awt/libpng/README b/jdk/src/share/native/sun/awt/libpng/README
index 179b8dc8cb..5ea329ee3d 100644
--- a/jdk/src/share/native/sun/awt/libpng/README
+++ b/jdk/src/share/native/sun/awt/libpng/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.57
+README for libpng version 1.6.51
================================
See the note about version numbers near the top of `png.h`.
@@ -24,14 +24,14 @@ for more things than just PNG files. You can use zlib as a drop-in
replacement for `fread()` and `fwrite()`, if you are so inclined.
zlib should be available at the same place that libpng is, or at
-<https://zlib.net>.
+https://zlib.net .
You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
-these at <http://www.libpng.org/pub/png/pngdocs.html>.
+these at http://www.libpng.org/pub/png/pngdocs.html .
-This code is currently being archived at <https://libpng.sourceforge.io>
-in the download area, and at <http://libpng.download/src>.
+This code is currently being archived at https://libpng.sourceforge.io
+in the download area, and at http://libpng.download/src .
This release, based in a large way on Glenn's, Guy's and Andreas'
earlier work, was created and will be supported by myself and the PNG
@@ -39,12 +39,12 @@ development group.
Send comments, corrections and commendations to `png-mng-implement`
at `lists.sourceforge.net`. (Subscription is required; visit
-<https://lists.sourceforge.net/lists/listinfo/png-mng-implement>
+https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe.)
Send general questions about the PNG specification to `png-mng-misc`
at `lists.sourceforge.net`. (Subscription is required; visit
-<https://lists.sourceforge.net/lists/listinfo/png-mng-misc>
+https://lists.sourceforge.net/lists/listinfo/png-mng-misc
to subscribe.)
Historical notes
diff --git a/jdk/src/share/native/sun/awt/libpng/png.c b/jdk/src/share/native/sun/awt/libpng/png.c
index e4e13b0a68..7d85e7c8d5 100644
--- a/jdk/src/share/native/sun/awt/libpng/png.c
+++ b/jdk/src/share/native/sun/awt/libpng/png.c
@@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -42,7 +42,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_57 Your_png_h_is_not_version_1_6_57;
+typedef png_libpng_version_1_6_51 Your_png_h_is_not_version_1_6_51;
/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
* corresponding macro definitions. This causes a compile time failure if
@@ -130,8 +130,7 @@ png_sig_cmp(png_const_bytep sig, size_t start, size_t num_to_check)
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
/* Function to allocate memory for zlib */
PNG_FUNCTION(voidpf /* PRIVATE */,
-png_zalloc,(voidpf png_ptr, uInt items, uInt size),
- PNG_ALLOCATED)
+png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED)
{
png_alloc_size_t num_bytes = size;
@@ -287,8 +286,7 @@ png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
PNG_FUNCTION(png_structp /* PRIVATE */,
png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
- png_malloc_ptr malloc_fn, png_free_ptr free_fn),
- PNG_ALLOCATED)
+ png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED)
{
png_struct create_struct;
# ifdef PNG_SETJMP_SUPPORTED
@@ -392,8 +390,7 @@ png_create_png_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
/* Allocate the memory for an info_struct for the application. */
PNG_FUNCTION(png_infop,PNGAPI
-png_create_info_struct,(png_const_structrp png_ptr),
- PNG_ALLOCATED)
+png_create_info_struct,(png_const_structrp png_ptr),PNG_ALLOCATED)
{
png_inforp info_ptr;
@@ -849,8 +846,8 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
- "libpng version 1.6.57" PNG_STRING_NEWLINE \
- "Copyright (c) 2018-2026 Cosmin Truta" PNG_STRING_NEWLINE \
+ "libpng version 1.6.51" PNG_STRING_NEWLINE \
+ "Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
@@ -1199,7 +1196,7 @@ png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
return 1;
/* The reference white is simply the sum of the end-point (X,Y,Z) vectors so
- * the following calculates (X+Y+Z) of the reference white (media white,
+ * the fillowing calculates (X+Y+Z) of the reference white (media white,
* encoding white) itself:
*/
d = dblue;
@@ -1244,9 +1241,9 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
* (-0.0770) because the PNG spec itself requires the xy values to be
* unsigned. whitey is also required to be 5 or more to avoid overflow.
*
- * Instead the upper limits have been relaxed to accommodate ACES AP1 where
+ * Instead the upper limits have been relaxed to accomodate ACES AP1 where
* redz ends up as -600 (-0.006). ProPhotoRGB was already "in range."
- * The new limit accommodates the AP0 and AP1 ranges for z but not AP0 redy.
+ * The new limit accomodates the AP0 and AP1 ranges for z but not AP0 redy.
*/
const png_fixed_point fpLimit = PNG_FP_1+(PNG_FP_1/10);
if (xy->redx < 0 || xy->redx > fpLimit) return 1;
@@ -1357,7 +1354,7 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
* red-scale + green-scale + blue-scale = 1/white-y = white-scale
*
* So now we have a Cramer's rule solution where the determinants are just
- * 3x3 - far more tractable. Unfortunately 3x3 determinants still involve
+ * 3x3 - far more tractible. Unfortunately 3x3 determinants still involve
* multiplication of three coefficients so we can't guarantee to avoid
* overflow in the libpng fixed point representation. Using Cramer's rule in
* floating point is probably a good choice here, but it's not an option for
@@ -1726,7 +1723,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_const_charp name,
* into R, G and B channels.
*
* Previously it was suggested that an RGB profile on grayscale data could be
- * handled. However it is clear that using an RGB profile in this context
+ * handled. However it it is clear that using an RGB profile in this context
* must be an error - there is no specification of what it means. Thus it is
* almost certainly more correct to ignore the profile.
*/
@@ -2289,8 +2286,8 @@ PNG_FP_End:
int
png_check_fp_string(png_const_charp string, size_t size)
{
- int state = 0;
- size_t char_index = 0;
+ int state=0;
+ size_t char_index=0;
if (png_check_fp_number(string, size, &state, &char_index) != 0 &&
(char_index == size || string[char_index] == 0))
@@ -2944,7 +2941,7 @@ png_gamma_significant(png_fixed_point gamma_val)
*
* 2.2/(2+51/256) == 1.00035524
*
- * I.e. vanishingly small (<4E-4) but still detectable in 16-bit linear (+/-
+ * I.e. vanishly small (<4E-4) but still detectable in 16-bit linear (+/-
* 23). Note that the Adobe choice seems to be something intended to give an
* exact number with 8 binary fractional digits - it is the closest to 2.2
* that is possible a base 2 .8p representation.
diff --git a/jdk/src/share/native/sun/awt/libpng/png.h b/jdk/src/share/native/sun/awt/libpng/png.h
index 349e7d0738..d39ff73552 100644
--- a/jdk/src/share/native/sun/awt/libpng/png.h
+++ b/jdk/src/share/native/sun/awt/libpng/png.h
@@ -29,9 +29,9 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * libpng version 1.6.57
+ * libpng version 1.6.51
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -43,7 +43,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
- * libpng versions 1.6.36, December 2018, through 1.6.57, April 2026:
+ * libpng versions 1.6.36, December 2018, through 1.6.51, November 2025:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -55,8 +55,8 @@
* PNG Reference Library License version 2
* ---------------------------------------
*
- * * Copyright (c) 1995-2026 The PNG Reference Library Authors.
- * * Copyright (c) 2018-2026 Cosmin Truta.
+ * * Copyright (c) 1995-2025 The PNG Reference Library Authors.
+ * * Copyright (c) 2018-2025 Cosmin Truta.
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* * Copyright (c) 1996-1997 Andreas Dilger.
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -267,7 +267,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.57 16 10657 16.so.16.57[.0]
+ * 1.6.51 16 10651 16.so.16.51[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -303,7 +303,7 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.57"
+#define PNG_LIBPNG_VER_STRING "1.6.51"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
/* The versions of shared library builds should stay in sync, going forward */
@@ -314,7 +314,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
-#define PNG_LIBPNG_VER_RELEASE 57
+#define PNG_LIBPNG_VER_RELEASE 51
/* This should be zero for a public release, or non-zero for a
* development version.
@@ -345,7 +345,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
-#define PNG_LIBPNG_VER 10657 /* 1.6.57 */
+#define PNG_LIBPNG_VER 10651 /* 1.6.51 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -455,7 +455,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
-typedef char *png_libpng_version_1_6_57;
+typedef char* png_libpng_version_1_6_51;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -814,22 +814,17 @@ typedef png_row_info * * png_row_infopp;
* modify the buffer it is passed. The 'read' function, on the other hand, is
* expected to return the read data in the buffer.
*/
-typedef PNG_CALLBACK(void, *png_error_ptr,
- (png_structp, png_const_charp));
-typedef PNG_CALLBACK(void, *png_rw_ptr,
- (png_structp, png_bytep, size_t));
-typedef PNG_CALLBACK(void, *png_flush_ptr,
- (png_structp));
-typedef PNG_CALLBACK(void, *png_read_status_ptr,
- (png_structp, png_uint_32, int));
-typedef PNG_CALLBACK(void, *png_write_status_ptr,
- (png_structp, png_uint_32, int));
+typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp));
+typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, size_t));
+typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp));
+typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32,
+ int));
+typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32,
+ int));
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
-typedef PNG_CALLBACK(void, *png_progressive_info_ptr,
- (png_structp, png_infop));
-typedef PNG_CALLBACK(void, *png_progressive_end_ptr,
- (png_structp, png_infop));
+typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop));
+typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop));
/* The following callback receives png_uint_32 row_number, int pass for the
* png_bytep data of the row. When transforming an interlaced image the
@@ -841,19 +836,19 @@ typedef PNG_CALLBACK(void, *png_progressive_end_ptr,
* find the output pixel (x,y) given an interlaced sub-image pixel
* (row,col,pass). (See below for these macros.)
*/
-typedef PNG_CALLBACK(void, *png_progressive_row_ptr,
- (png_structp, png_bytep, png_uint_32, int));
+typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep,
+ png_uint_32, int));
#endif
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
-typedef PNG_CALLBACK(void, *png_user_transform_ptr,
- (png_structp, png_row_infop, png_bytep));
+typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop,
+ png_bytep));
#endif
#ifdef PNG_USER_CHUNKS_SUPPORTED
-typedef PNG_CALLBACK(int, *png_user_chunk_ptr,
- (png_structp, png_unknown_chunkp));
+typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
+ png_unknown_chunkp));
#endif
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
/* not used anywhere */
@@ -911,10 +906,9 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef);
* ignores the first argument) should be completely compatible with the
* following.
*/
-typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr,
- (png_structp, png_alloc_size_t));
-typedef PNG_CALLBACK(void, *png_free_ptr,
- (png_structp, png_voidp));
+typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp,
+ png_alloc_size_t));
+typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp));
/* Section 4: exported functions
* Here are the function definitions most commonly used. This is not
@@ -946,22 +940,20 @@ typedef PNG_CALLBACK(void, *png_free_ptr,
*/
/* Returns the version number of the library */
-PNG_EXPORT(1, png_uint_32, png_access_version_number,
- (void));
+PNG_EXPORT(1, png_uint_32, png_access_version_number, (void));
/* Tell lib we have already handled the first <num_bytes> magic bytes.
* Handling more than 8 bytes from the beginning of the file is an error.
*/
-PNG_EXPORT(2, void, png_set_sig_bytes,
- (png_structrp png_ptr, int num_bytes));
+PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
* PNG file. Returns zero if the supplied bytes match the 8-byte PNG
* signature, and non-zero otherwise. Having num_to_check == 0 or
* start > 7 will always fail (i.e. return non-zero).
*/
-PNG_EXPORT(3, int, png_sig_cmp,
- (png_const_bytep sig, size_t start, size_t num_to_check));
+PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start,
+ size_t num_to_check));
/* Simple signature checking function. This is the same as calling
* png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0).
@@ -970,21 +962,21 @@ PNG_EXPORT(3, int, png_sig_cmp,
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
PNG_EXPORTA(4, png_structp, png_create_read_struct,
- (png_const_charp user_png_ver,
- png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn),
- PNG_ALLOCATED);
+ (png_const_charp user_png_ver, png_voidp error_ptr,
+ png_error_ptr error_fn, png_error_ptr warn_fn),
+ PNG_ALLOCATED);
/* Allocate and initialize png_ptr struct for writing, and any other memory */
PNG_EXPORTA(5, png_structp, png_create_write_struct,
- (png_const_charp user_png_ver,
- png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn),
- PNG_ALLOCATED);
+ (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+ png_error_ptr warn_fn),
+ PNG_ALLOCATED);
PNG_EXPORT(6, size_t, png_get_compression_buffer_size,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
-PNG_EXPORT(7, void, png_set_compression_buffer_size,
- (png_structrp png_ptr, size_t size));
+PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr,
+ size_t size));
/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
* match up.
@@ -997,8 +989,8 @@ PNG_EXPORT(7, void, png_set_compression_buffer_size,
* allocated by the library - the call will return NULL on a mismatch
* indicating an ABI mismatch.
*/
-PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn,
- (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));
+PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr,
+ png_longjmp_ptr longjmp_fn, size_t jmp_buf_size));
# define png_jmpbuf(png_ptr) \
(*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf))))
#else
@@ -1010,77 +1002,67 @@ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn,
* will use it; otherwise it will call PNG_ABORT(). This function was
* added in libpng-1.5.0.
*/
-PNG_EXPORTA(9, void, png_longjmp,
- (png_const_structrp png_ptr, int val),
- PNG_NORETURN);
+PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val),
+ PNG_NORETURN);
#ifdef PNG_READ_SUPPORTED
/* Reset the compression stream */
-PNG_EXPORTA(10, int, png_reset_zstream,
- (png_structrp png_ptr),
- PNG_DEPRECATED);
+PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED);
#endif
/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
#ifdef PNG_USER_MEM_SUPPORTED
PNG_EXPORTA(11, png_structp, png_create_read_struct_2,
- (png_const_charp user_png_ver,
- png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn,
+ (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+ png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
- PNG_ALLOCATED);
+ PNG_ALLOCATED);
PNG_EXPORTA(12, png_structp, png_create_write_struct_2,
- (png_const_charp user_png_ver,
- png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn,
+ (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+ png_error_ptr warn_fn,
png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
- PNG_ALLOCATED);
+ PNG_ALLOCATED);
#endif
/* Write the PNG file signature. */
-PNG_EXPORT(13, void, png_write_sig,
- (png_structrp png_ptr));
+PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr));
/* Write a PNG chunk - size, type, (optional) data, CRC. */
-PNG_EXPORT(14, void, png_write_chunk,
- (png_structrp png_ptr,
- png_const_bytep chunk_name, png_const_bytep data, size_t length));
+PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep
+ chunk_name, png_const_bytep data, size_t length));
/* Write the start of a PNG chunk - length and chunk name. */
-PNG_EXPORT(15, void, png_write_chunk_start,
- (png_structrp png_ptr,
+PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr,
png_const_bytep chunk_name, png_uint_32 length));
/* Write the data of a PNG chunk started with png_write_chunk_start(). */
-PNG_EXPORT(16, void, png_write_chunk_data,
- (png_structrp png_ptr,
+PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr,
png_const_bytep data, size_t length));
/* Finish a chunk started with png_write_chunk_start() (includes CRC). */
-PNG_EXPORT(17, void, png_write_chunk_end,
- (png_structrp png_ptr));
+PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr));
/* Allocate and initialize the info structure */
-PNG_EXPORTA(18, png_infop, png_create_info_struct,
- (png_const_structrp png_ptr),
- PNG_ALLOCATED);
+PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr),
+ PNG_ALLOCATED);
/* DEPRECATED: this function allowed init structures to be created using the
* default allocation method (typically malloc). Use is deprecated in 1.6.0 and
* the API will be removed in the future.
*/
-PNG_EXPORTA(19, void, png_info_init_3,
- (png_infopp info_ptr, size_t png_info_struct_size),
- PNG_DEPRECATED);
+PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr,
+ size_t png_info_struct_size), PNG_DEPRECATED);
/* Writes all the PNG information before the image. */
PNG_EXPORT(20, void, png_write_info_before_PLTE,
- (png_structrp png_ptr, png_const_inforp info_ptr));
+ (png_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(21, void, png_write_info,
- (png_structrp png_ptr, png_const_inforp info_ptr));
+ (png_structrp png_ptr, png_const_inforp info_ptr));
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read the information before the actual image data. */
PNG_EXPORT(22, void, png_read_info,
- (png_structrp png_ptr, png_inforp info_ptr));
+ (png_structrp png_ptr, png_inforp info_ptr));
#endif
#ifdef PNG_TIME_RFC1123_SUPPORTED
@@ -1090,54 +1072,45 @@ PNG_EXPORT(22, void, png_read_info,
*/
#if PNG_LIBPNG_VER < 10700
/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */
-PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123,
- (png_structrp png_ptr, png_const_timep ptime),
- PNG_DEPRECATED);
+PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr,
+ png_const_timep ptime),PNG_DEPRECATED);
#endif
-PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer,
- (char out[29], png_const_timep ptime));
+PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29],
+ png_const_timep ptime));
#endif
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* Convert from a struct tm to png_time */
-PNG_EXPORT(24, void, png_convert_from_struct_tm,
- (png_timep ptime, const struct tm * ttime));
+PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime,
+ const struct tm * ttime));
/* Convert from time_t to png_time. Uses gmtime() */
-PNG_EXPORT(25, void, png_convert_from_time_t,
- (png_timep ptime, time_t ttime));
+PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime));
#endif /* CONVERT_tIME */
#ifdef PNG_READ_EXPAND_SUPPORTED
/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
-PNG_EXPORT(26, void, png_set_expand,
- (png_structrp png_ptr));
-PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8,
- (png_structrp png_ptr));
-PNG_EXPORT(28, void, png_set_palette_to_rgb,
- (png_structrp png_ptr));
-PNG_EXPORT(29, void, png_set_tRNS_to_alpha,
- (png_structrp png_ptr));
+PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr));
+PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr));
+PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr));
+PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr));
#endif
#ifdef PNG_READ_EXPAND_16_SUPPORTED
/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion
* of a tRNS chunk if present.
*/
-PNG_EXPORT(221, void, png_set_expand_16,
- (png_structrp png_ptr));
+PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
/* Use blue, green, red order for pixels. */
-PNG_EXPORT(30, void, png_set_bgr,
- (png_structrp png_ptr));
+PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr));
#endif
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
/* Expand the grayscale to 24-bit RGB if necessary. */
-PNG_EXPORT(31, void, png_set_gray_to_rgb,
- (png_structrp png_ptr));
+PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr));
#endif
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
@@ -1147,20 +1120,18 @@ PNG_EXPORT(31, void, png_set_gray_to_rgb,
#define PNG_ERROR_ACTION_ERROR 3
#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/
-PNG_FP_EXPORT(32, void, png_set_rgb_to_gray,
- (png_structrp png_ptr,
+PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr,
int error_action, double red, double green))
-PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed,
- (png_structrp png_ptr,
+PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr,
int error_action, png_fixed_point red, png_fixed_point green))
-PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status,
- (png_const_structrp png_ptr));
+PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp
+ png_ptr));
#endif
#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
-PNG_EXPORT(35, void, png_build_grayscale_palette,
- (int bit_depth, png_colorp palette));
+PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth,
+ png_colorp palette));
#endif
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
@@ -1205,10 +1176,10 @@ PNG_EXPORT(35, void, png_build_grayscale_palette,
#define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */
#define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */
-PNG_FP_EXPORT(227, void, png_set_alpha_mode,
- (png_structrp png_ptr, int mode, double output_gamma))
-PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed,
- (png_structrp png_ptr, int mode, png_fixed_point output_gamma))
+PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode,
+ double output_gamma))
+PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr,
+ int mode, png_fixed_point output_gamma))
#endif
#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED)
@@ -1298,57 +1269,51 @@ PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed,
*/
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
-PNG_EXPORT(36, void, png_set_strip_alpha,
- (png_structrp png_ptr));
+PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
-PNG_EXPORT(37, void, png_set_swap_alpha,
- (png_structrp png_ptr));
+PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
-PNG_EXPORT(38, void, png_set_invert_alpha,
- (png_structrp png_ptr));
+PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */
-PNG_EXPORT(39, void, png_set_filler,
- (png_structrp png_ptr, png_uint_32 filler, int flags));
+PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler,
+ int flags));
/* The values of the PNG_FILLER_ defines should NOT be changed */
# define PNG_FILLER_BEFORE 0
# define PNG_FILLER_AFTER 1
/* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */
-PNG_EXPORT(40, void, png_set_add_alpha,
- (png_structrp png_ptr, png_uint_32 filler, int flags));
+PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr,
+ png_uint_32 filler, int flags));
#endif /* READ_FILLER || WRITE_FILLER */
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
/* Swap bytes in 16-bit depth files. */
-PNG_EXPORT(41, void, png_set_swap,
- (png_structrp png_ptr));
+PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
-PNG_EXPORT(42, void, png_set_packing,
- (png_structrp png_ptr));
+PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
defined(PNG_WRITE_PACKSWAP_SUPPORTED)
/* Swap packing order of pixels in bytes. */
-PNG_EXPORT(43, void, png_set_packswap,
- (png_structrp png_ptr));
+PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
/* Converts files to legal bit depths. */
-PNG_EXPORT(44, void, png_set_shift,
- (png_structrp png_ptr, png_const_color_8p true_bits));
+PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p
+ true_bits));
#endif
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
@@ -1359,14 +1324,12 @@ PNG_EXPORT(44, void, png_set_shift,
* necessary to call png_read_row or png_read_rows png_get_image_height
* times for each pass.
*/
-PNG_EXPORT(45, int, png_set_interlace_handling,
- (png_structrp png_ptr));
+PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr));
#endif
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
/* Invert monochrome files */
-PNG_EXPORT(46, void, png_set_invert_mono,
- (png_structrp png_ptr));
+PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr));
#endif
#ifdef PNG_READ_BACKGROUND_SUPPORTED
@@ -1375,12 +1338,10 @@ PNG_EXPORT(46, void, png_set_invert_mono,
* read. Doing so will result in unexpected behavior and possible warnings or
* errors if the PNG file contains a bKGD chunk.
*/
-PNG_FP_EXPORT(47, void, png_set_background,
- (png_structrp png_ptr,
+PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, double background_gamma))
-PNG_FIXED_EXPORT(215, void, png_set_background_fixed,
- (png_structrp png_ptr,
+PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr,
png_const_color_16p background_color, int background_gamma_code,
int need_expand, png_fixed_point background_gamma))
#endif
@@ -1393,23 +1354,20 @@ PNG_FIXED_EXPORT(215, void, png_set_background_fixed,
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
/* Scale a 16-bit depth file down to 8-bit, accurately. */
-PNG_EXPORT(229, void, png_set_scale_16,
- (png_structrp png_ptr));
+PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr));
#endif
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */
/* Strip the second byte of information from a 16-bit depth file. */
-PNG_EXPORT(48, void, png_set_strip_16,
- (png_structrp png_ptr));
+PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr));
#endif
#ifdef PNG_READ_QUANTIZE_SUPPORTED
/* Turn on quantizing, and reduce the palette to the number of colors
* available.
*/
-PNG_EXPORT(49, void, png_set_quantize,
- (png_structrp png_ptr,
+PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr,
png_colorp palette, int num_palette, int maximum_colors,
png_const_uint_16p histogram, int full_quantize));
#endif
@@ -1431,92 +1389,82 @@ PNG_EXPORT(49, void, png_set_quantize,
* API (floating point or fixed.) Notice, however, that the 'file_gamma' value
* is the inverse of a 'screen gamma' value.
*/
-PNG_FP_EXPORT(50, void, png_set_gamma,
- (png_structrp png_ptr,
+PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr,
double screen_gamma, double override_file_gamma))
-PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed,
- (png_structrp png_ptr,
+PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr,
png_fixed_point screen_gamma, png_fixed_point override_file_gamma))
#endif
#ifdef PNG_WRITE_FLUSH_SUPPORTED
/* Set how many lines between output flushes - 0 for no flushing */
-PNG_EXPORT(51, void, png_set_flush,
- (png_structrp png_ptr, int nrows));
+PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows));
/* Flush the current PNG output buffer */
-PNG_EXPORT(52, void, png_write_flush,
- (png_structrp png_ptr));
+PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr));
#endif
/* Optional update palette with requested transformations */
-PNG_EXPORT(53, void, png_start_read_image,
- (png_structrp png_ptr));
+PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr));
/* Optional call to update the users info structure */
-PNG_EXPORT(54, void, png_read_update_info,
- (png_structrp png_ptr, png_inforp info_ptr));
+PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr,
+ png_inforp info_ptr));
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read one or more rows of image data. */
-PNG_EXPORT(55, void, png_read_rows,
- (png_structrp png_ptr, png_bytepp row,
+PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row,
png_bytepp display_row, png_uint_32 num_rows));
#endif
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read a row of data. */
-PNG_EXPORT(56, void, png_read_row,
- (png_structrp png_ptr, png_bytep row, png_bytep display_row));
+PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row,
+ png_bytep display_row));
#endif
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read the whole image into memory at once. */
-PNG_EXPORT(57, void, png_read_image,
- (png_structrp png_ptr, png_bytepp image));
+PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image));
#endif
/* Write a row of image data */
-PNG_EXPORT(58, void, png_write_row,
- (png_structrp png_ptr, png_const_bytep row));
+PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr,
+ png_const_bytep row));
/* Write a few rows of image data: (*row) is not written; however, the type
* is declared as writeable to maintain compatibility with previous versions
* of libpng and to allow the 'display_row' array from read_rows to be passed
* unchanged to write_rows.
*/
-PNG_EXPORT(59, void, png_write_rows,
- (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows));
+PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row,
+ png_uint_32 num_rows));
/* Write the image data */
-PNG_EXPORT(60, void, png_write_image,
- (png_structrp png_ptr, png_bytepp image));
+PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image));
/* Write the end of the PNG file. */
-PNG_EXPORT(61, void, png_write_end,
- (png_structrp png_ptr, png_inforp info_ptr));
+PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr,
+ png_inforp info_ptr));
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
/* Read the end of the PNG file. */
-PNG_EXPORT(62, void, png_read_end,
- (png_structrp png_ptr, png_inforp info_ptr));
+PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr));
#endif
/* Free any memory associated with the png_info_struct */
-PNG_EXPORT(63, void, png_destroy_info_struct,
- (png_const_structrp png_ptr, png_infopp info_ptr_ptr));
+PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr,
+ png_infopp info_ptr_ptr));
/* Free any memory associated with the png_struct and the png_info_structs */
-PNG_EXPORT(64, void, png_destroy_read_struct,
- (png_structpp png_ptr_ptr,
+PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr,
png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
/* Free any memory associated with the png_struct and the png_info_structs */
-PNG_EXPORT(65, void, png_destroy_write_struct,
- (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
+PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr,
+ png_infopp info_ptr_ptr));
/* Set the libpng method of handling chunk CRC errors */
-PNG_EXPORT(66, void, png_set_crc_action,
- (png_structrp png_ptr, int crit_action, int ancil_action));
+PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
+ int ancil_action));
/* Values for png_set_crc_action() say how to handle CRC errors in
* ancillary and critical chunks, and whether to use the data contained
@@ -1546,8 +1494,8 @@ PNG_EXPORT(66, void, png_set_crc_action,
/* Set the filtering method(s) used by libpng. Currently, the only valid
* value for "method" is 0.
*/
-PNG_EXPORT(67, void, png_set_filter,
- (png_structrp png_ptr, int method, int filters));
+PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method,
+ int filters));
#endif /* WRITE */
/* Flags for png_set_filter() to say which filters to use. The flags
@@ -1576,14 +1524,11 @@ PNG_EXPORT(67, void, png_set_filter,
#ifdef PNG_WRITE_SUPPORTED
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */
-PNG_FP_EXPORT(68, void, png_set_filter_heuristics,
- (png_structrp png_ptr,
- int heuristic_method, int num_weights,
- png_const_doublep filter_weights,
+PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr,
+ int heuristic_method, int num_weights, png_const_doublep filter_weights,
png_const_doublep filter_costs))
PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
- (png_structrp png_ptr,
- int heuristic_method, int num_weights,
+ (png_structrp png_ptr, int heuristic_method, int num_weights,
png_const_fixed_point_p filter_weights,
png_const_fixed_point_p filter_costs))
#endif /* WRITE_WEIGHTED_FILTER */
@@ -1602,44 +1547,44 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
* these values may not correspond directly to the zlib compression levels.
*/
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
-PNG_EXPORT(69, void, png_set_compression_level,
- (png_structrp png_ptr, int level));
+PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr,
+ int level));
-PNG_EXPORT(70, void, png_set_compression_mem_level,
- (png_structrp png_ptr, int mem_level));
+PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr,
+ int mem_level));
-PNG_EXPORT(71, void, png_set_compression_strategy,
- (png_structrp png_ptr, int strategy));
+PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr,
+ int strategy));
/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a
* smaller value of window_bits if it can do so safely.
*/
-PNG_EXPORT(72, void, png_set_compression_window_bits,
- (png_structrp png_ptr, int window_bits));
+PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr,
+ int window_bits));
-PNG_EXPORT(73, void, png_set_compression_method,
- (png_structrp png_ptr, int method));
+PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr,
+ int method));
#endif /* WRITE_CUSTOMIZE_COMPRESSION */
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
/* Also set zlib parameters for compressing non-IDAT chunks */
-PNG_EXPORT(222, void, png_set_text_compression_level,
- (png_structrp png_ptr, int level));
+PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr,
+ int level));
-PNG_EXPORT(223, void, png_set_text_compression_mem_level,
- (png_structrp png_ptr, int mem_level));
+PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr,
+ int mem_level));
-PNG_EXPORT(224, void, png_set_text_compression_strategy,
- (png_structrp png_ptr, int strategy));
+PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr,
+ int strategy));
/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a
* smaller value of window_bits if it can do so safely.
*/
PNG_EXPORT(225, void, png_set_text_compression_window_bits,
- (png_structrp png_ptr, int window_bits));
+ (png_structrp png_ptr, int window_bits));
-PNG_EXPORT(226, void, png_set_text_compression_method,
- (png_structrp png_ptr, int method));
+PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,
+ int method));
#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
#endif /* WRITE */
@@ -1654,8 +1599,7 @@ PNG_EXPORT(226, void, png_set_text_compression_method,
#ifdef PNG_STDIO_SUPPORTED
/* Initialize the input/output for the PNG file to the default functions. */
-PNG_EXPORT(74, void, png_init_io,
- (png_structrp png_ptr, FILE *fp));
+PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, FILE *fp));
#endif
/* Replace the (error and abort), and warning functions with user
@@ -1666,13 +1610,11 @@ PNG_EXPORT(74, void, png_init_io,
* default function will be used.
*/
-PNG_EXPORT(75, void, png_set_error_fn,
- (png_structrp png_ptr,
+PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr,
png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
/* Return the user pointer associated with the error functions */
-PNG_EXPORT(76, png_voidp, png_get_error_ptr,
- (png_const_structrp png_ptr));
+PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr));
/* Replace the default data output functions with a user supplied one(s).
* If buffered output is not used, then output_flush_fn can be set to NULL.
@@ -1684,54 +1626,47 @@ PNG_EXPORT(76, png_voidp, png_get_error_ptr,
* default flush function, which uses the standard *FILE structure, will
* be used.
*/
-PNG_EXPORT(77, void, png_set_write_fn,
- (png_structrp png_ptr,
- png_voidp io_ptr,
+PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr,
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
/* Replace the default data input function with a user supplied one. */
-PNG_EXPORT(78, void, png_set_read_fn,
- (png_structrp png_ptr,
- png_voidp io_ptr, png_rw_ptr read_data_fn));
+PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr,
+ png_rw_ptr read_data_fn));
/* Return the user pointer associated with the I/O functions */
-PNG_EXPORT(79, png_voidp, png_get_io_ptr,
- (png_const_structrp png_ptr));
+PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr));
-PNG_EXPORT(80, void, png_set_read_status_fn,
- (png_structrp png_ptr, png_read_status_ptr read_row_fn));
+PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr,
+ png_read_status_ptr read_row_fn));
-PNG_EXPORT(81, void, png_set_write_status_fn,
- (png_structrp png_ptr, png_write_status_ptr write_row_fn));
+PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr,
+ png_write_status_ptr write_row_fn));
#ifdef PNG_USER_MEM_SUPPORTED
/* Replace the default memory allocation functions with user supplied one(s). */
-PNG_EXPORT(82, void, png_set_mem_fn,
- (png_structrp png_ptr,
- png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));
+PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr,
+ png_malloc_ptr malloc_fn, png_free_ptr free_fn));
/* Return the user pointer associated with the memory functions */
-PNG_EXPORT(83, png_voidp, png_get_mem_ptr,
- (png_const_structrp png_ptr));
+PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr));
#endif
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
-PNG_EXPORT(84, void, png_set_read_user_transform_fn,
- (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn));
+PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr,
+ png_user_transform_ptr read_user_transform_fn));
#endif
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
-PNG_EXPORT(85, void, png_set_write_user_transform_fn,
- (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn));
+PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr,
+ png_user_transform_ptr write_user_transform_fn));
#endif
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
-PNG_EXPORT(86, void, png_set_user_transform_info,
- (png_structrp png_ptr,
- png_voidp user_transform_ptr,
- int user_transform_depth, int user_transform_channels));
+PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr,
+ png_voidp user_transform_ptr, int user_transform_depth,
+ int user_transform_channels));
/* Return the user pointer associated with the user transform functions */
PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
#endif
#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED
@@ -1746,10 +1681,8 @@ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr,
* find the output pixel (x,y) given an interlaced sub-image pixel
* (row,col,pass). (See below for these macros.)
*/
-PNG_EXPORT(217, png_uint_32, png_get_current_row_number,
- (png_const_structrp));
-PNG_EXPORT(218, png_byte, png_get_current_pass_number,
- (png_const_structrp));
+PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp));
+PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp));
#endif
#ifdef PNG_READ_USER_CHUNKS_SUPPORTED
@@ -1772,32 +1705,28 @@ PNG_EXPORT(218, png_byte, png_get_current_pass_number,
* See "INTERACTION WITH USER CHUNK CALLBACKS" below for important notes about
* how this behavior will change in libpng 1.7
*/
-PNG_EXPORT(88, void, png_set_read_user_chunk_fn,
- (png_structrp png_ptr,
+PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr,
png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
#endif
#ifdef PNG_USER_CHUNKS_SUPPORTED
-PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr,
- (png_const_structrp png_ptr));
+PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr));
#endif
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
/* Sets the function callbacks for the push reader, and a pointer to a
* user-defined structure available to the callback functions.
*/
-PNG_EXPORT(90, void, png_set_progressive_read_fn,
- (png_structrp png_ptr,
+PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr,
png_voidp progressive_ptr, png_progressive_info_ptr info_fn,
png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn));
/* Returns the user pointer associated with the push read functions */
PNG_EXPORT(91, png_voidp, png_get_progressive_ptr,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
/* Function to be called when data becomes available */
-PNG_EXPORT(92, void, png_process_data,
- (png_structrp png_ptr,
+PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr,
png_inforp info_ptr, png_bytep buffer, size_t buffer_size));
/* A function which may be called *only* within png_process_data to stop the
@@ -1807,8 +1736,7 @@ PNG_EXPORT(92, void, png_process_data,
* 'save' is set to true the routine will first save all the pending data and
* will always return 0.
*/
-PNG_EXPORT(219, size_t, png_process_data_pause,
- (png_structrp, int save));
+PNG_EXPORT(219, size_t, png_process_data_pause, (png_structrp, int save));
/* A function which may be called *only* outside (after) a call to
* png_process_data. It returns the number of bytes of data to skip in the
@@ -1816,53 +1744,45 @@ PNG_EXPORT(219, size_t, png_process_data_pause,
* application must skip than number of bytes of input data and pass the
* following data to the next call to png_process_data.
*/
-PNG_EXPORT(220, png_uint_32, png_process_data_skip,
- (png_structrp));
+PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp));
/* Function that combines rows. 'new_row' is a flag that should come from
* the callback and be non-NULL if anything needs to be done; the library
* stores its own version of the new data internally and ignores the passed
* in value.
*/
-PNG_EXPORT(93, void, png_progressive_combine_row,
- (png_const_structrp png_ptr,
+PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr,
png_bytep old_row, png_const_bytep new_row));
#endif /* PROGRESSIVE_READ */
-PNG_EXPORTA(94, png_voidp, png_malloc,
- (png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED);
+PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr,
+ png_alloc_size_t size), PNG_ALLOCATED);
/* Added at libpng version 1.4.0 */
-PNG_EXPORTA(95, png_voidp, png_calloc,
- (png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED);
+PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr,
+ png_alloc_size_t size), PNG_ALLOCATED);
/* Added at libpng version 1.2.4 */
-PNG_EXPORTA(96, png_voidp, png_malloc_warn,
- (png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED);
+PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr,
+ png_alloc_size_t size), PNG_ALLOCATED);
/* Frees a pointer allocated by png_malloc() */
-PNG_EXPORT(97, void, png_free,
- (png_const_structrp png_ptr, png_voidp ptr));
+PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));
/* Free data that was allocated internally */
-PNG_EXPORT(98, void, png_free_data,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_uint_32 free_me, int num));
+PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_uint_32 free_me, int num));
/* Reassign the responsibility for freeing existing data, whether allocated
* by libpng or by the application; this works on the png_info structure passed
* in, without changing the state for other png_info structures.
*/
-PNG_EXPORT(99, void, png_data_freer,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- int freer, png_uint_32 mask));
+PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int freer, png_uint_32 mask));
/* Assignments for png_data_freer */
#define PNG_DESTROY_WILL_FREE_DATA 1
-#define PNG_SET_WILL_FREE_DATA 1
-#define PNG_USER_WILL_FREE_DATA 2
+#define PNG_SET_WILL_FREE_DATA 1
+#define PNG_USER_WILL_FREE_DATA 2
/* Flags for png_ptr->free_me and info_ptr->free_me */
#define PNG_FREE_HIST 0x0008U
#define PNG_FREE_ICCP 0x0010U
@@ -1882,42 +1802,36 @@ PNG_EXPORT(99, void, png_data_freer,
#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
#ifdef PNG_USER_MEM_SUPPORTED
-PNG_EXPORTA(100, png_voidp, png_malloc_default,
- (png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED PNG_DEPRECATED);
-PNG_EXPORTA(101, void, png_free_default,
- (png_const_structrp png_ptr, png_voidp ptr),
- PNG_DEPRECATED);
+PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr,
+ png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED);
+PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr,
+ png_voidp ptr), PNG_DEPRECATED);
#endif
#ifdef PNG_ERROR_TEXT_SUPPORTED
/* Fatal error in PNG image of libpng - can't continue */
-PNG_EXPORTA(102, void, png_error,
- (png_const_structrp png_ptr, png_const_charp error_message),
- PNG_NORETURN);
+PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr,
+ png_const_charp error_message), PNG_NORETURN);
/* The same, but the chunk name is prepended to the error string. */
-PNG_EXPORTA(103, void, png_chunk_error,
- (png_const_structrp png_ptr, png_const_charp error_message),
- PNG_NORETURN);
+PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr,
+ png_const_charp error_message), PNG_NORETURN);
#else
/* Fatal error in PNG image of libpng - can't continue */
-PNG_EXPORTA(104, void, png_err,
- (png_const_structrp png_ptr),
- PNG_NORETURN);
+PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN);
# define png_error(s1,s2) png_err(s1)
# define png_chunk_error(s1,s2) png_err(s1)
#endif
#ifdef PNG_WARNINGS_SUPPORTED
/* Non-fatal error in libpng. Can continue, but may have a problem. */
-PNG_EXPORT(105, void, png_warning,
- (png_const_structrp png_ptr, png_const_charp warning_message));
+PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr,
+ png_const_charp warning_message));
/* Non-fatal error in libpng, chunk name is prepended to message. */
-PNG_EXPORT(106, void, png_chunk_warning,
- (png_const_structrp png_ptr, png_const_charp warning_message));
+PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr,
+ png_const_charp warning_message));
#else
# define png_warning(s1,s2) ((void)(s1))
# define png_chunk_warning(s1,s2) ((void)(s1))
@@ -1926,17 +1840,17 @@ PNG_EXPORT(106, void, png_chunk_warning,
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
/* Benign error in libpng. Can continue, but may have a problem.
* User can choose whether to handle as a fatal error or as a warning. */
-PNG_EXPORT(107, void, png_benign_error,
- (png_const_structrp png_ptr, png_const_charp warning_message));
+PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr,
+ png_const_charp warning_message));
#ifdef PNG_READ_SUPPORTED
/* Same, chunk name is prepended to message (only during read) */
-PNG_EXPORT(108, void, png_chunk_benign_error,
- (png_const_structrp png_ptr, png_const_charp warning_message));
+PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr,
+ png_const_charp warning_message));
#endif
PNG_EXPORT(109, void, png_set_benign_errors,
- (png_structrp png_ptr, int allowed));
+ (png_structrp png_ptr, int allowed));
#else
# ifdef PNG_ALLOW_BENIGN_ERRORS
# define png_benign_error png_warning
@@ -1960,181 +1874,169 @@ PNG_EXPORT(109, void, png_set_benign_errors,
* png_info_struct.
*/
/* Returns "flag" if chunk data is valid in info_ptr. */
-PNG_EXPORT(110, png_uint_32, png_get_valid,
- (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag));
+PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_uint_32 flag));
/* Returns number of bytes needed to hold a transformed row. */
-PNG_EXPORT(111, size_t, png_get_rowbytes,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(111, size_t, png_get_rowbytes, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* Returns row_pointers, which is an array of pointers to scanlines that was
* returned from png_read_png().
*/
-PNG_EXPORT(112, png_bytepp, png_get_rows,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Set row_pointers, which is an array of pointers to scanlines for use
* by png_write_png().
*/
-PNG_EXPORT(113, void, png_set_rows,
- (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers));
+PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_bytepp row_pointers));
#endif
/* Returns number of color channels in image. */
-PNG_EXPORT(114, png_byte, png_get_channels,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
#ifdef PNG_EASY_ACCESS_SUPPORTED
/* Returns image width in pixels. */
-PNG_EXPORT(115, png_uint_32, png_get_image_width,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image height in pixels. */
-PNG_EXPORT(116, png_uint_32, png_get_image_height,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image bit_depth. */
-PNG_EXPORT(117, png_byte, png_get_bit_depth,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image color_type. */
-PNG_EXPORT(118, png_byte, png_get_color_type,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image filter_type. */
-PNG_EXPORT(119, png_byte, png_get_filter_type,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image interlace_type. */
-PNG_EXPORT(120, png_byte, png_get_interlace_type,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image compression_type. */
-PNG_EXPORT(121, png_byte, png_get_compression_type,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
/* Returns image resolution in pixels per meter, from pHYs chunk data. */
PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
/* Returns pixel aspect ratio, computed from pHYs chunk data. */
PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio,
- (png_const_structrp png_ptr, png_const_inforp info_ptr))
+ (png_const_structrp png_ptr, png_const_inforp info_ptr))
PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr))
+ (png_const_structrp png_ptr, png_const_inforp info_ptr))
/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(128, png_int_32, png_get_x_offset_microns,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(129, png_int_32, png_get_y_offset_microns,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
#endif /* EASY_ACCESS */
#ifdef PNG_READ_SUPPORTED
/* Returns pointer to signature string read from PNG header */
-PNG_EXPORT(130, png_const_bytep, png_get_signature,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr));
#endif
#ifdef PNG_bKGD_SUPPORTED
-PNG_EXPORT(131, png_uint_32, png_get_bKGD,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_color_16p *background));
+PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_color_16p *background));
#endif
#ifdef PNG_bKGD_SUPPORTED
-PNG_EXPORT(132, void, png_set_bKGD,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_color_16p background));
+PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_color_16p background));
#endif
#ifdef PNG_cHRM_SUPPORTED
-PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- double *white_x, double *white_y,
- double *red_x, double *red_y,
- double *green_x, double *green_y,
- double *blue_x, double *blue_y))
-PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- double *red_X, double *red_Y, double *red_Z,
- double *green_X, double *green_Y, double *green_Z,
- double *blue_X, double *blue_Y, double *blue_Z))
+PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x,
+ double *red_y, double *green_x, double *green_y, double *blue_x,
+ double *blue_y))
+PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z,
+ double *green_X, double *green_Y, double *green_Z, double *blue_X,
+ double *blue_Y, double *blue_Z))
PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
+ (png_const_structrp png_ptr, png_const_inforp info_ptr,
png_fixed_point *int_white_x, png_fixed_point *int_white_y,
png_fixed_point *int_red_x, png_fixed_point *int_red_y,
png_fixed_point *int_green_x, png_fixed_point *int_green_y,
png_fixed_point *int_blue_x, png_fixed_point *int_blue_y))
PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
+ (png_const_structrp png_ptr, png_const_inforp info_ptr,
png_fixed_point *int_red_X, png_fixed_point *int_red_Y,
- png_fixed_point *int_red_Z,
- png_fixed_point *int_green_X, png_fixed_point *int_green_Y,
- png_fixed_point *int_green_Z,
+ png_fixed_point *int_red_Z, png_fixed_point *int_green_X,
+ png_fixed_point *int_green_Y, png_fixed_point *int_green_Z,
png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
png_fixed_point *int_blue_Z))
#endif
#ifdef PNG_cHRM_SUPPORTED
-PNG_FP_EXPORT(135, void, png_set_cHRM,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- double white_x, double white_y,
- double red_x, double red_y,
- double green_x, double green_y,
- double blue_x, double blue_y))
-PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- double red_X, double red_Y, double red_Z,
- double green_X, double green_Y, double green_Z,
- double blue_X, double blue_Y, double blue_Z))
-PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_fixed_point int_white_x, png_fixed_point int_white_y,
- png_fixed_point int_red_x, png_fixed_point int_red_y,
- png_fixed_point int_green_x, png_fixed_point int_green_y,
- png_fixed_point int_blue_x, png_fixed_point int_blue_y))
-PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_fixed_point int_red_X, png_fixed_point int_red_Y,
- png_fixed_point int_red_Z,
- png_fixed_point int_green_X, png_fixed_point int_green_Y,
- png_fixed_point int_green_Z,
+PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr,
+ png_inforp info_ptr,
+ double white_x, double white_y, double red_x, double red_y, double green_x,
+ double green_y, double blue_x, double blue_y))
+PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr,
+ png_inforp info_ptr, double red_X, double red_Y, double red_Z,
+ double green_X, double green_Y, double green_Z, double blue_X,
+ double blue_Y, double blue_Z))
+PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_fixed_point int_white_x,
+ png_fixed_point int_white_y, png_fixed_point int_red_x,
+ png_fixed_point int_red_y, png_fixed_point int_green_x,
+ png_fixed_point int_green_y, png_fixed_point int_blue_x,
+ png_fixed_point int_blue_y))
+PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y,
+ png_fixed_point int_red_Z, png_fixed_point int_green_X,
+ png_fixed_point int_green_Y, png_fixed_point int_green_Z,
png_fixed_point int_blue_X, png_fixed_point int_blue_Y,
png_fixed_point int_blue_Z))
#endif
#ifdef PNG_cICP_SUPPORTED
-PNG_EXPORT(250, png_uint_32, png_get_cICP,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_bytep colour_primaries, png_bytep transfer_function,
- png_bytep matrix_coefficients, png_bytep video_full_range_flag));
+PNG_EXPORT(250, png_uint_32, png_get_cICP, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_bytep colour_primaries,
+ png_bytep transfer_function, png_bytep matrix_coefficients,
+ png_bytep video_full_range_flag));
#endif
#ifdef PNG_cICP_SUPPORTED
-PNG_EXPORT(251, void, png_set_cICP,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_byte colour_primaries, png_byte transfer_function,
- png_byte matrix_coefficients, png_byte video_full_range_flag));
+PNG_EXPORT(251, void, png_set_cICP, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_byte colour_primaries,
+ png_byte transfer_function, png_byte matrix_coefficients,
+ png_byte video_full_range_flag));
#endif
#ifdef PNG_cLLI_SUPPORTED
-PNG_FP_EXPORT(252, png_uint_32, png_get_cLLI,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- double *maximum_content_light_level,
- double *maximum_frame_average_light_level))
+PNG_FP_EXPORT(252, png_uint_32, png_get_cLLI, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, double *maximum_content_light_level,
+ double *maximum_frame_average_light_level))
PNG_FIXED_EXPORT(253, png_uint_32, png_get_cLLI_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
+ (png_const_structrp png_ptr, png_const_inforp info_ptr,
/* The values below are in cd/m2 (nits) and are scaled by 10,000; not
* 100,000 as in the case of png_fixed_point.
*/
@@ -2143,12 +2045,11 @@ PNG_FIXED_EXPORT(253, png_uint_32, png_get_cLLI_fixed,
#endif
#ifdef PNG_cLLI_SUPPORTED
-PNG_FP_EXPORT(254, void, png_set_cLLI,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- double maximum_content_light_level,
- double maximum_frame_average_light_level))
-PNG_FIXED_EXPORT(255, void, png_set_cLLI_fixed,
- (png_const_structrp png_ptr, png_inforp info_ptr,
+PNG_FP_EXPORT(254, void, png_set_cLLI, (png_const_structrp png_ptr,
+ png_inforp info_ptr, double maximum_content_light_level,
+ double maximum_frame_average_light_level))
+PNG_FIXED_EXPORT(255, void, png_set_cLLI_fixed, (png_const_structrp png_ptr,
+ png_inforp info_ptr,
/* The values below are in cd/m2 (nits) and are scaled by 10,000; not
* 100,000 as in the case of png_fixed_point.
*/
@@ -2157,73 +2058,64 @@ PNG_FIXED_EXPORT(255, void, png_set_cLLI_fixed,
#endif
#ifdef PNG_eXIf_SUPPORTED
-PNG_EXPORT(246, png_uint_32, png_get_eXIf,
- (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *exif));
-PNG_EXPORT(247, void, png_set_eXIf,
- (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep exif));
+PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_bytep *exif));
+PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_bytep exif));
-PNG_EXPORT(248, png_uint_32, png_get_eXIf_1,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_uint_32 *num_exif, png_bytep *exif));
-PNG_EXPORT(249, void, png_set_eXIf_1,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_uint_32 num_exif, png_bytep exif));
+PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
+PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_uint_32 num_exif, png_bytep exif));
#endif
#ifdef PNG_gAMA_SUPPORTED
-PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- double *file_gamma))
+PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, double *file_gamma))
PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
+ (png_const_structrp png_ptr, png_const_inforp info_ptr,
png_fixed_point *int_file_gamma))
#endif
#ifdef PNG_gAMA_SUPPORTED
-PNG_FP_EXPORT(139, void, png_set_gAMA,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- double file_gamma))
-PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_fixed_point int_file_gamma))
+PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr,
+ png_inforp info_ptr, double file_gamma))
+PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_fixed_point int_file_gamma))
#endif
#ifdef PNG_hIST_SUPPORTED
-PNG_EXPORT(141, png_uint_32, png_get_hIST,
- (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist));
-PNG_EXPORT(142, void, png_set_hIST,
- (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist));
+PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_uint_16p *hist));
+PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_uint_16p hist));
#endif
-PNG_EXPORT(143, png_uint_32, png_get_IHDR,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_uint_32 *width, png_uint_32 *height,
- int *bit_depth, int *color_type,
- int *interlace_method, int *compression_method, int *filter_method));
+PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height,
+ int *bit_depth, int *color_type, int *interlace_method,
+ int *compression_method, int *filter_method));
-PNG_EXPORT(144, void, png_set_IHDR,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_uint_32 width, png_uint_32 height,
- int bit_depth, int color_type,
- int interlace_method, int compression_method, int filter_method));
+PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,
+ int color_type, int interlace_method, int compression_method,
+ int filter_method));
#ifdef PNG_mDCV_SUPPORTED
-PNG_FP_EXPORT(256, png_uint_32, png_get_mDCV,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
+PNG_FP_EXPORT(256, png_uint_32, png_get_mDCV, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr,
/* The chromaticities of the mastering display. As cHRM, but independent of
* the encoding endpoints in cHRM, or cICP, or iCCP. These values will
* always be in the range 0 to 1.3107.
*/
- double *white_x, double *white_y,
- double *red_x, double *red_y,
- double *green_x, double *green_y,
- double *blue_x, double *blue_y,
+ double *white_x, double *white_y, double *red_x, double *red_y,
+ double *green_x, double *green_y, double *blue_x, double *blue_y,
/* Mastering display luminance in cd/m2 (nits). */
double *mastering_display_maximum_luminance,
double *mastering_display_minimum_luminance))
PNG_FIXED_EXPORT(257, png_uint_32, png_get_mDCV_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
+ (png_const_structrp png_ptr, png_const_inforp info_ptr,
png_fixed_point *int_white_x, png_fixed_point *int_white_y,
png_fixed_point *int_red_x, png_fixed_point *int_red_y,
png_fixed_point *int_green_x, png_fixed_point *int_green_y,
@@ -2236,21 +2128,19 @@ PNG_FIXED_EXPORT(257, png_uint_32, png_get_mDCV_fixed,
#endif
#ifdef PNG_mDCV_SUPPORTED
-PNG_FP_EXPORT(258, void, png_set_mDCV,
- (png_const_structrp png_ptr, png_inforp info_ptr,
+PNG_FP_EXPORT(258, void, png_set_mDCV, (png_const_structrp png_ptr,
+ png_inforp info_ptr,
/* The chromaticities of the mastering display. As cHRM, but independent of
* the encoding endpoints in cHRM, or cICP, or iCCP.
*/
- double white_x, double white_y,
- double red_x, double red_y,
- double green_x, double green_y,
- double blue_x, double blue_y,
+ double white_x, double white_y, double red_x, double red_y, double green_x,
+ double green_y, double blue_x, double blue_y,
/* Mastering display luminance in cd/m2 (nits). */
double mastering_display_maximum_luminance,
double mastering_display_minimum_luminance))
-PNG_FIXED_EXPORT(259, void, png_set_mDCV_fixed,
- (png_const_structrp png_ptr, png_inforp info_ptr,
+PNG_FIXED_EXPORT(259, void, png_set_mDCV_fixed, (png_const_structrp png_ptr,
+ png_inforp info_ptr,
/* The admissible range of these values is not the full range of a PNG
* fixed point value. Negative values cannot be encoded and the maximum
* value is about 1.3 */
@@ -2266,152 +2156,134 @@ PNG_FIXED_EXPORT(259, void, png_set_mDCV_fixed,
#endif
#ifdef PNG_oFFs_SUPPORTED
-PNG_EXPORT(145, png_uint_32, png_get_oFFs,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type));
+PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
+ int *unit_type));
#endif
#ifdef PNG_oFFs_SUPPORTED
-PNG_EXPORT(146, void, png_set_oFFs,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_int_32 offset_x, png_int_32 offset_y, int unit_type));
+PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y,
+ int unit_type));
#endif
#ifdef PNG_pCAL_SUPPORTED
-PNG_EXPORT(147, png_uint_32, png_get_pCAL,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
- int *type, int *nparams, png_charp *units, png_charpp *params));
+PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_charp *purpose, png_int_32 *X0,
+ png_int_32 *X1, int *type, int *nparams, png_charp *units,
+ png_charpp *params));
#endif
#ifdef PNG_pCAL_SUPPORTED
-PNG_EXPORT(148, void, png_set_pCAL,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_charp purpose, png_int_32 X0, png_int_32 X1,
+PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1,
int type, int nparams, png_const_charp units, png_charpp params));
#endif
#ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(149, png_uint_32, png_get_pHYs,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
+PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
+ int *unit_type));
#endif
#ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(150, void, png_set_pHYs,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_uint_32 res_x, png_uint_32 res_y, int unit_type));
+PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
#endif
-PNG_EXPORT(151, png_uint_32, png_get_PLTE,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_colorp *palette, int *num_palette));
+PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_colorp *palette, int *num_palette));
-PNG_EXPORT(152, void, png_set_PLTE,
- (png_structrp png_ptr, png_inforp info_ptr,
- png_const_colorp palette, int num_palette));
+PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr,
+ png_inforp info_ptr, png_const_colorp palette, int num_palette));
#ifdef PNG_sBIT_SUPPORTED
-PNG_EXPORT(153, png_uint_32, png_get_sBIT,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_color_8p *sig_bit));
+PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_color_8p *sig_bit));
#endif
#ifdef PNG_sBIT_SUPPORTED
-PNG_EXPORT(154, void, png_set_sBIT,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_color_8p sig_bit));
+PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_color_8p sig_bit));
#endif
#ifdef PNG_sRGB_SUPPORTED
-PNG_EXPORT(155, png_uint_32, png_get_sRGB,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- int *file_srgb_intent));
+PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, int *file_srgb_intent));
#endif
#ifdef PNG_sRGB_SUPPORTED
-PNG_EXPORT(156, void, png_set_sRGB,
- (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent));
-PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM,
- (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent));
+PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int srgb_intent));
+PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int srgb_intent));
#endif
#ifdef PNG_iCCP_SUPPORTED
-PNG_EXPORT(158, png_uint_32, png_get_iCCP,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_charpp name, int *compression_type,
+PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_charpp name, int *compression_type,
png_bytepp profile, png_uint_32 *proflen));
#endif
#ifdef PNG_iCCP_SUPPORTED
-PNG_EXPORT(159, void, png_set_iCCP,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_charp name, int compression_type,
+PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_charp name, int compression_type,
png_const_bytep profile, png_uint_32 proflen));
#endif
#ifdef PNG_sPLT_SUPPORTED
-PNG_EXPORT(160, int, png_get_sPLT,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_sPLT_tpp entries));
+PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_sPLT_tpp entries));
#endif
#ifdef PNG_sPLT_SUPPORTED
-PNG_EXPORT(161, void, png_set_sPLT,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_sPLT_tp entries, int nentries));
+PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_sPLT_tp entries, int nentries));
#endif
#ifdef PNG_TEXT_SUPPORTED
/* png_get_text also returns the number of text chunks in *num_text */
-PNG_EXPORT(162, int, png_get_text,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_textp *text_ptr, int *num_text));
+PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_textp *text_ptr, int *num_text));
#endif
/* Note while png_set_text() will accept a structure whose text,
- * language, and translated keywords are NULL pointers, the structure
+ * language, and translated keywords are NULL pointers, the structure
* returned by png_get_text will always contain regular
* zero-terminated C strings. They might be empty strings but
* they will never be NULL pointers.
*/
#ifdef PNG_TEXT_SUPPORTED
-PNG_EXPORT(163, void, png_set_text,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_textp text_ptr, int num_text));
+PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_textp text_ptr, int num_text));
#endif
#ifdef PNG_tIME_SUPPORTED
-PNG_EXPORT(164, png_uint_32, png_get_tIME,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_timep *mod_time));
+PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_timep *mod_time));
#endif
#ifdef PNG_tIME_SUPPORTED
-PNG_EXPORT(165, void, png_set_tIME,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_timep mod_time));
+PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_timep mod_time));
#endif
#ifdef PNG_tRNS_SUPPORTED
-PNG_EXPORT(166, png_uint_32, png_get_tRNS,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_bytep *trans_alpha, int *num_trans,
+PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans,
png_color_16p *trans_color));
#endif
#ifdef PNG_tRNS_SUPPORTED
-PNG_EXPORT(167, void, png_set_tRNS,
- (png_structrp png_ptr, png_inforp info_ptr,
- png_const_bytep trans_alpha, int num_trans,
+PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr,
+ png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans,
png_const_color_16p trans_color));
#endif
#ifdef PNG_sCAL_SUPPORTED
-PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- int *unit, double *width, double *height))
+PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, int *unit, double *width, double *height))
#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \
defined(PNG_FLOATING_POINT_SUPPORTED)
/* NOTE: this API is currently implemented using floating point arithmetic,
@@ -2420,22 +2292,21 @@ PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL,
* is highly recommended that png_get_sCAL_s be used instead.
*/
PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- int *unit, png_fixed_point *width, png_fixed_point *height))
+ (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,
+ png_fixed_point *width, png_fixed_point *height))
#endif
PNG_EXPORT(169, png_uint_32, png_get_sCAL_s,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- int *unit, png_charpp swidth, png_charpp sheight));
-
-PNG_FP_EXPORT(170, void, png_set_sCAL,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- int unit, double width, double height))
-PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- int unit, png_fixed_point width, png_fixed_point height))
-PNG_EXPORT(171, void, png_set_sCAL_s,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- int unit, png_const_charp swidth, png_const_charp sheight));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit,
+ png_charpp swidth, png_charpp sheight));
+
+PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int unit, double width, double height))
+PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int unit, png_fixed_point width,
+ png_fixed_point height))
+PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int unit,
+ png_const_charp swidth, png_const_charp sheight));
#endif /* sCAL */
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
@@ -2538,8 +2409,7 @@ PNG_EXPORT(171, void, png_set_sCAL_s,
* be processed by libpng.
*/
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
-PNG_EXPORT(172, void, png_set_keep_unknown_chunks,
- (png_structrp png_ptr,
+PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,
int keep, png_const_bytep chunk_list, int num_chunks));
#endif /* HANDLE_AS_UNKNOWN */
@@ -2547,14 +2417,14 @@ PNG_EXPORT(172, void, png_set_keep_unknown_chunks,
* the result is therefore true (non-zero) if special handling is required,
* false for the default handling.
*/
-PNG_EXPORT(173, int, png_handle_as_unknown,
- (png_const_structrp png_ptr, png_const_bytep chunk_name));
+PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,
+ png_const_bytep chunk_name));
#endif /* SET_UNKNOWN_CHUNKS */
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
-PNG_EXPORT(174, void, png_set_unknown_chunks,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_const_unknown_chunkp unknowns, int num_unknowns));
+PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_unknown_chunkp unknowns,
+ int num_unknowns));
/* NOTE: prior to 1.6.0 this routine set the 'location' field of the added
* unknowns to the location currently stored in the png_struct. This is
* invariably the wrong value on write. To fix this call the following API
@@ -2565,47 +2435,43 @@ PNG_EXPORT(174, void, png_set_unknown_chunks,
*/
PNG_EXPORT(175, void, png_set_unknown_chunk_location,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- int chunk, int location));
+ (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location));
-PNG_EXPORT(176, int, png_get_unknown_chunks,
- (png_const_structrp png_ptr, png_inforp info_ptr,
- png_unknown_chunkpp entries));
+PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr,
+ png_inforp info_ptr, png_unknown_chunkpp entries));
#endif
/* Png_free_data() will turn off the "valid" flag for anything it frees.
* If you need to turn it off for a chunk that your application has freed,
* you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
*/
-PNG_EXPORT(177, void, png_set_invalid,
- (png_const_structrp png_ptr, png_inforp info_ptr, int mask));
+PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr,
+ png_inforp info_ptr, int mask));
#ifdef PNG_INFO_IMAGE_SUPPORTED
/* The "params" pointer is currently not used and is for future expansion. */
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
-PNG_EXPORT(178, void, png_read_png,
- (png_structrp png_ptr, png_inforp info_ptr,
+PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr,
int transforms, png_voidp params));
#endif
#ifdef PNG_WRITE_SUPPORTED
-PNG_EXPORT(179, void, png_write_png,
- (png_structrp png_ptr, png_inforp info_ptr,
+PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr,
int transforms, png_voidp params));
#endif
#endif
PNG_EXPORT(180, png_const_charp, png_get_copyright,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
PNG_EXPORT(181, png_const_charp, png_get_header_ver,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
PNG_EXPORT(182, png_const_charp, png_get_header_version,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
PNG_EXPORT(183, png_const_charp, png_get_libpng_ver,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
#ifdef PNG_MNG_FEATURES_SUPPORTED
-PNG_EXPORT(184, png_uint_32, png_permit_mng_features,
- (png_structrp png_ptr, png_uint_32 mng_features_permitted));
+PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr,
+ png_uint_32 mng_features_permitted));
#endif
/* For use in png_set_keep_unknown, added to version 1.2.6 */
@@ -2619,74 +2485,71 @@ PNG_EXPORT(184, png_uint_32, png_permit_mng_features,
* messages before passing them to the error or warning handler.
*/
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
-PNG_EXPORT(185, void, png_set_strip_error_numbers,
- (png_structrp png_ptr, png_uint_32 strip_mode));
+PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr,
+ png_uint_32 strip_mode));
#endif
/* Added in libpng-1.2.6 */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
-PNG_EXPORT(186, void, png_set_user_limits,
- (png_structrp png_ptr,
+PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr,
png_uint_32 user_width_max, png_uint_32 user_height_max));
PNG_EXPORT(187, png_uint_32, png_get_user_width_max,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
PNG_EXPORT(188, png_uint_32, png_get_user_height_max,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
/* Added in libpng-1.4.0 */
-PNG_EXPORT(189, void, png_set_chunk_cache_max,
- (png_structrp png_ptr, png_uint_32 user_chunk_cache_max));
+PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr,
+ png_uint_32 user_chunk_cache_max));
PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
/* Added in libpng-1.4.1 */
-PNG_EXPORT(191, void, png_set_chunk_malloc_max,
- (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max));
+PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr,
+ png_alloc_size_t user_chunk_cache_max));
PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
#endif
#if defined(PNG_INCH_CONVERSIONS_SUPPORTED)
PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch,
- (png_const_structrp png_ptr, png_const_inforp info_ptr));
+ (png_const_structrp png_ptr, png_const_inforp info_ptr));
PNG_FP_EXPORT(196, float, png_get_x_offset_inches,
- (png_const_structrp png_ptr, png_const_inforp info_ptr))
+ (png_const_structrp png_ptr, png_const_inforp info_ptr))
#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr))
+ (png_const_structrp png_ptr, png_const_inforp info_ptr))
#endif
-PNG_FP_EXPORT(197, float, png_get_y_offset_inches,
- (png_const_structrp png_ptr, png_const_inforp info_ptr))
+PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr))
#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */
PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed,
- (png_const_structrp png_ptr, png_const_inforp info_ptr))
+ (png_const_structrp png_ptr, png_const_inforp info_ptr))
#endif
# ifdef PNG_pHYs_SUPPORTED
-PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi,
- (png_const_structrp png_ptr, png_const_inforp info_ptr,
- png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
+PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr,
+ png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
+ int *unit_type));
# endif /* pHYs */
#endif /* INCH_CONVERSIONS */
/* Added in libpng-1.4.0 */
#ifdef PNG_IO_STATE_SUPPORTED
-PNG_EXPORT(199, png_uint_32, png_get_io_state,
- (png_const_structrp png_ptr));
+PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr));
/* Removed from libpng 1.6; use png_get_io_chunk_type. */
-PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name,
- (png_structrp png_ptr),
- PNG_DEPRECATED)
+PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr),
+ PNG_DEPRECATED)
PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
- (png_const_structrp png_ptr));
+ (png_const_structrp png_ptr));
/* The flags returned by png_get_io_state() are the following: */
# define PNG_IO_NONE 0x0000 /* no I/O at this moment */
@@ -2811,26 +2674,21 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
#endif /* READ_COMPOSITE_NODIV */
#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
-PNG_EXPORT(201, png_uint_32, png_get_uint_32,
- (png_const_bytep buf));
-PNG_EXPORT(202, png_uint_16, png_get_uint_16,
- (png_const_bytep buf));
-PNG_EXPORT(203, png_int_32, png_get_int_32,
- (png_const_bytep buf));
+PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf));
+PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf));
+PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf));
#endif
-PNG_EXPORT(204, png_uint_32, png_get_uint_31,
- (png_const_structrp png_ptr, png_const_bytep buf));
+PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr,
+ png_const_bytep buf));
/* No png_get_int_16 -- may be added if there's a real need for it. */
/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */
#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
-PNG_EXPORT(205, void, png_save_uint_32,
- (png_bytep buf, png_uint_32 i));
+PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i));
#endif
#ifdef PNG_SAVE_INT_32_SUPPORTED
-PNG_EXPORT(206, void, png_save_int_32,
- (png_bytep buf, png_int_32 i));
+PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i));
#endif
/* Place a 16-bit number into a buffer in PNG byte order.
@@ -2838,8 +2696,7 @@ PNG_EXPORT(206, void, png_save_int_32,
* just to avoid potential problems on pre-ANSI C compilers.
*/
#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
-PNG_EXPORT(207, void, png_save_uint_16,
- (png_bytep buf, unsigned int i));
+PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
/* No png_save_int_16 -- may be added if there's a real need for it. */
#endif
@@ -2886,10 +2743,10 @@ PNG_EXPORT(207, void, png_save_uint_16,
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
PNG_EXPORT(242, void, png_set_check_for_invalid_index,
- (png_structrp png_ptr, int allowed));
+ (png_structrp png_ptr, int allowed));
# ifdef PNG_GET_PALETTE_MAX_SUPPORTED
-PNG_EXPORT(243, int, png_get_palette_max,
- (png_const_structp png_ptr, png_const_infop info_ptr));
+PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
+ png_const_infop info_ptr));
# endif
#endif /* CHECK_FOR_INVALID_INDEX */
@@ -3253,25 +3110,24 @@ typedef struct
* the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.)
*/
#ifdef PNG_STDIO_SUPPORTED
-PNG_EXPORT(234, int, png_image_begin_read_from_file,
- (png_imagep image, const char *file_name));
+PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,
+ const char *file_name));
/* The named file is opened for read and the image header is filled in
* from the PNG header in the file.
*/
-PNG_EXPORT(235, int, png_image_begin_read_from_stdio,
- (png_imagep image, FILE *file));
+PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
+ FILE *file));
/* The PNG header is read from the stdio FILE object. */
#endif /* STDIO */
-PNG_EXPORT(236, int, png_image_begin_read_from_memory,
- (png_imagep image, png_const_voidp memory, size_t size));
+PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image,
+ png_const_voidp memory, size_t size));
/* The PNG header is read from the given memory buffer. */
-PNG_EXPORT(237, int, png_image_finish_read,
- (png_imagep image,
- png_const_colorp background, void *buffer, png_int_32 row_stride,
- void *colormap));
+PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image,
+ png_const_colorp background, void *buffer, png_int_32 row_stride,
+ void *colormap));
/* Finish reading the image into the supplied buffer and clean up the
* png_image structure.
*
@@ -3304,8 +3160,7 @@ PNG_EXPORT(237, int, png_image_finish_read,
* written to the colormap; this may be less than the original value.
*/
-PNG_EXPORT(238, void, png_image_free,
- (png_imagep image));
+PNG_EXPORT(238, void, png_image_free, (png_imagep image));
/* Free any data allocated by libpng in image->opaque, setting the pointer to
* NULL. May be called at any time after the structure is initialized.
*/
@@ -3329,16 +3184,14 @@ PNG_EXPORT(238, void, png_image_free,
* colormap_entries: set to the number of entries in the color-map (0 to 256)
*/
#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED
-PNG_EXPORT(239, int, png_image_write_to_file,
- (png_imagep image,
- const char *file, int convert_to_8bit, const void *buffer,
- png_int_32 row_stride, const void *colormap));
+PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,
+ const char *file, int convert_to_8bit, const void *buffer,
+ png_int_32 row_stride, const void *colormap));
/* Write the image to the named file. */
-PNG_EXPORT(240, int, png_image_write_to_stdio,
- (png_imagep image,
- FILE *file, int convert_to_8_bit, const void *buffer,
- png_int_32 row_stride, const void *colormap));
+PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
+ int convert_to_8_bit, const void *buffer, png_int_32 row_stride,
+ const void *colormap));
/* Write the image to the given FILE object. */
#endif /* SIMPLIFIED_WRITE_STDIO */
@@ -3363,11 +3216,9 @@ PNG_EXPORT(240, int, png_image_write_to_stdio,
* notices) you need to use one of the other APIs.
*/
-PNG_EXPORT(245, int, png_image_write_to_memory,
- (png_imagep image,
- void *memory, png_alloc_size_t * PNG_RESTRICT memory_bytes,
- int convert_to_8_bit,
- const void *buffer, png_int_32 row_stride, const void *colormap));
+PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
+ png_alloc_size_t * PNG_RESTRICT memory_bytes, int convert_to_8_bit,
+ const void *buffer, png_int_32 row_stride, const void *colormap));
/* Write the image to the given memory buffer. The function both writes the
* whole PNG data stream to *memory and updates *memory_bytes with the count
* of bytes written.
@@ -3543,7 +3394,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
* one to use is one more than this.)
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
- PNG_EXPORT_LAST_ORDINAL(259);
+ PNG_EXPORT_LAST_ORDINAL(259);
#endif
#ifdef __cplusplus
diff --git a/jdk/src/share/native/sun/awt/libpng/pngconf.h b/jdk/src/share/native/sun/awt/libpng/pngconf.h
index 1a5bb7b60f..4bc5f7bb46 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngconf.h
+++ b/jdk/src/share/native/sun/awt/libpng/pngconf.h
@@ -29,9 +29,9 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * libpng version 1.6.57
+ * libpng version 1.6.51
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
diff --git a/jdk/src/share/native/sun/awt/libpng/pngerror.c b/jdk/src/share/native/sun/awt/libpng/pngerror.c
index 324d1951a5..44c86ebfef 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngerror.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngerror.c
@@ -78,8 +78,7 @@ png_error,(png_const_structrp png_ptr, png_const_charp error_message),
}
#else
PNG_FUNCTION(void,PNGAPI
-png_err,(png_const_structrp png_ptr),
- PNG_NORETURN)
+png_err,(png_const_structrp png_ptr),PNG_NORETURN)
{
/* Prior to 1.5.2 the error_fn received a NULL pointer, expressed
* erroneously as '\0', instead of the empty string "". This was
@@ -406,8 +405,8 @@ static const char png_digit[16] = {
};
static void /* PRIVATE */
-png_format_buffer(png_const_structrp png_ptr, png_charp buffer,
- png_const_charp error_message)
+png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
+ error_message)
{
png_uint_32 chunk_name = png_ptr->chunk_name;
int iout = 0, ishift = 24;
@@ -486,8 +485,8 @@ png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
#ifdef PNG_READ_SUPPORTED
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
void PNGAPI
-png_chunk_benign_error(png_const_structrp png_ptr,
- png_const_charp error_message)
+png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
+ error_message)
{
if ((png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) != 0)
png_chunk_warning(png_ptr, error_message);
@@ -544,8 +543,7 @@ png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
#ifdef PNG_ERROR_TEXT_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
PNG_FUNCTION(void,
-png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),
- PNG_NORETURN)
+png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
{
# define fixed_message "fixed point overflow in "
# define fixed_message_ln ((sizeof fixed_message)-1)
@@ -698,8 +696,7 @@ png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
}
PNG_FUNCTION(void,PNGAPI
-png_longjmp,(png_const_structrp png_ptr, int val),
- PNG_NORETURN)
+png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
{
#ifdef PNG_SETJMP_SUPPORTED
if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&
diff --git a/jdk/src/share/native/sun/awt/libpng/pngget.c b/jdk/src/share/native/sun/awt/libpng/pngget.c
index a5bdcd1b52..ed2e7f886f 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngget.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngget.c
@@ -151,8 +151,8 @@ png_get_compression_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
}
png_uint_32 PNGAPI
-png_get_x_pixels_per_meter(png_const_structrp png_ptr,
- png_const_inforp info_ptr)
+png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
+ info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
png_debug(1, "in png_get_x_pixels_per_meter");
@@ -172,8 +172,8 @@ png_get_x_pixels_per_meter(png_const_structrp png_ptr,
}
png_uint_32 PNGAPI
-png_get_y_pixels_per_meter(png_const_structrp png_ptr,
- png_const_inforp info_ptr)
+png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
+ info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
png_debug(1, "in png_get_y_pixels_per_meter");
@@ -215,8 +215,8 @@ png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr)
#ifdef PNG_FLOATING_POINT_SUPPORTED
float PNGAPI
-png_get_pixel_aspect_ratio(png_const_structrp png_ptr,
- png_const_inforp info_ptr)
+png_get_pixel_aspect_ratio(png_const_structrp png_ptr, png_const_inforp
+ info_ptr)
{
#ifdef PNG_READ_pHYs_SUPPORTED
png_debug(1, "in png_get_pixel_aspect_ratio");
@@ -766,6 +766,7 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
}
return 0;
+
}
#endif
diff --git a/jdk/src/share/native/sun/awt/libpng/pnglibconf.h b/jdk/src/share/native/sun/awt/libpng/pnglibconf.h
index 09adc3bd27..395b3199b3 100644
--- a/jdk/src/share/native/sun/awt/libpng/pnglibconf.h
+++ b/jdk/src/share/native/sun/awt/libpng/pnglibconf.h
@@ -31,9 +31,9 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*/
-/* libpng version 1.6.57 */
+/* libpng version 1.6.51 */
-/* Copyright (c) 2018-2026 Cosmin Truta */
+/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
diff --git a/jdk/src/share/native/sun/awt/libpng/pngmem.c b/jdk/src/share/native/sun/awt/libpng/pngmem.c
index 8ec703616e..12b71bcbc0 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngmem.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngmem.c
@@ -75,8 +75,7 @@ png_destroy_png_struct(png_structrp png_ptr)
* have the ability to do that.
*/
PNG_FUNCTION(png_voidp,PNGAPI
-png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED)
+png_calloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
{
png_voidp ret;
@@ -148,8 +147,7 @@ png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
PNG_FUNCTION(png_voidp /* PRIVATE */,
png_malloc_array,(png_const_structrp png_ptr, int nelements,
- size_t element_size),
- PNG_ALLOCATED)
+ size_t element_size),PNG_ALLOCATED)
{
if (nelements <= 0 || element_size == 0)
png_error(png_ptr, "internal error: array alloc");
@@ -159,8 +157,7 @@ png_malloc_array,(png_const_structrp png_ptr, int nelements,
PNG_FUNCTION(png_voidp /* PRIVATE */,
png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
- int old_elements, int add_elements, size_t element_size),
- PNG_ALLOCATED)
+ int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED)
{
/* These are internal errors: */
if (add_elements <= 0 || element_size == 0 || old_elements < 0 ||
@@ -199,8 +196,7 @@ png_realloc_array,(png_const_structrp png_ptr, png_const_voidp old_array,
* function png_malloc_default is also provided.
*/
PNG_FUNCTION(png_voidp,PNGAPI
-png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED)
+png_malloc,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
{
png_voidp ret;
@@ -274,8 +270,7 @@ png_free(png_const_structrp png_ptr, png_voidp ptr)
}
PNG_FUNCTION(void,PNGAPI
-png_free_default,(png_const_structrp png_ptr, png_voidp ptr),
- PNG_DEPRECATED)
+png_free_default,(png_const_structrp png_ptr, png_voidp ptr),PNG_DEPRECATED)
{
if (png_ptr == NULL || ptr == NULL)
return;
@@ -289,8 +284,8 @@ png_free_default,(png_const_structrp png_ptr, png_voidp ptr),
* of allocating and freeing memory.
*/
void PNGAPI
-png_set_mem_fn(png_structrp png_ptr, png_voidp mem_ptr,
- png_malloc_ptr malloc_fn, png_free_ptr free_fn)
+png_set_mem_fn(png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr
+ malloc_fn, png_free_ptr free_fn)
{
if (png_ptr != NULL)
{
diff --git a/jdk/src/share/native/sun/awt/libpng/pngpriv.h b/jdk/src/share/native/sun/awt/libpng/pngpriv.h
index 086a2f76ee..dcd005efb3 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngpriv.h
+++ b/jdk/src/share/native/sun/awt/libpng/pngpriv.h
@@ -986,7 +986,7 @@
*
* At present these index values are not exported (not part of the public API)
* so can be changed at will. For convenience the names are in lexical sort
- * order but with the critical chunks at the start in the order of occurrence in
+ * order but with the critical chunks at the start in the order of occurence in
* a PNG.
*
* PNG_INFO_ values do not exist for every one of these chunk handles; for
@@ -1104,17 +1104,15 @@ extern "C" {
*/
/* Zlib support */
#define PNG_UNEXPECTED_ZLIB_RETURN (-7)
-PNG_INTERNAL_FUNCTION(void, png_zstream_error,
- (png_structrp png_ptr, int ret),
+PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret),
PNG_EMPTY);
/* Used by the zlib handling functions to ensure that z_stream::msg is always
* set before they return.
*/
#ifdef PNG_WRITE_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_free_buffer_list,
- (png_structrp png_ptr, png_compression_bufferp *list),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr,
+ png_compression_bufferp *list),PNG_EMPTY);
/* Free the buffer list used by the compressed write code. */
#endif
@@ -1126,25 +1124,22 @@ PNG_INTERNAL_FUNCTION(void, png_free_buffer_list,
defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \
(defined(PNG_sCAL_SUPPORTED) && \
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED))
-PNG_INTERNAL_FUNCTION(png_fixed_point, png_fixed,
- (png_const_structrp png_ptr, double fp, png_const_charp text),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr,
+ double fp, png_const_charp text),PNG_EMPTY);
#endif
#if defined(PNG_FLOATING_POINT_SUPPORTED) && \
!defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \
(defined(PNG_cLLI_SUPPORTED) || defined(PNG_mDCV_SUPPORTED))
-PNG_INTERNAL_FUNCTION(png_uint_32, png_fixed_ITU,
- (png_const_structrp png_ptr, double fp, png_const_charp text),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_uint_32,png_fixed_ITU,(png_const_structrp png_ptr,
+ double fp, png_const_charp text),PNG_EMPTY);
#endif
/* Check the user version string for compatibility, returns false if the version
* numbers aren't compatible.
*/
-PNG_INTERNAL_FUNCTION(int, png_user_version_check,
- (png_structrp png_ptr, png_const_charp user_png_ver),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr,
+ png_const_charp user_png_ver),PNG_EMPTY);
#ifdef PNG_READ_SUPPORTED /* should only be used on read */
/* Security: read limits on the largest allocations while reading a PNG. This
@@ -1169,28 +1164,24 @@ PNG_INTERNAL_FUNCTION(int, png_user_version_check,
* does, however, call the application provided allocator and that could call
* png_error (although that would be a bug in the application implementation.)
*/
-PNG_INTERNAL_FUNCTION(png_voidp, png_malloc_base,
- (png_const_structrp png_ptr, png_alloc_size_t size),
- PNG_ALLOCATED);
+PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr,
+ png_alloc_size_t size),PNG_ALLOCATED);
#if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\
defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED)
/* Internal array allocator, outputs no error or warning messages on failure,
* just returns NULL.
*/
-PNG_INTERNAL_FUNCTION(png_voidp, png_malloc_array,
- (png_const_structrp png_ptr, int nelements, size_t element_size),
- PNG_ALLOCATED);
+PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr,
+ int nelements, size_t element_size),PNG_ALLOCATED);
/* The same but an existing array is extended by add_elements. This function
* also memsets the new elements to 0 and copies the old elements. The old
* array is not freed or altered.
*/
-PNG_INTERNAL_FUNCTION(png_voidp, png_realloc_array,
- (png_const_structrp png_ptr,
- png_const_voidp array, int old_elements, int add_elements,
- size_t element_size),
- PNG_ALLOCATED);
+PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr,
+ png_const_voidp array, int old_elements, int add_elements,
+ size_t element_size),PNG_ALLOCATED);
#endif /* text, sPLT or unknown chunks */
/* Magic to create a struct when there is no struct to call the user supplied
@@ -1199,106 +1190,84 @@ PNG_INTERNAL_FUNCTION(png_voidp, png_realloc_array,
* restriction so libpng has to assume that the 'free' handler, at least, might
* call png_error.
*/
-PNG_INTERNAL_FUNCTION(png_structp, png_create_png_struct,
- (png_const_charp user_png_ver,
- png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn,
- png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),
- PNG_ALLOCATED);
+PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct,
+ (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn,
+ png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn,
+ png_free_ptr free_fn),PNG_ALLOCATED);
/* Free memory from internal libpng struct */
-PNG_INTERNAL_FUNCTION(void, png_destroy_png_struct,
- (png_structrp png_ptr),
+PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr),
PNG_EMPTY);
/* Free an allocated jmp_buf (always succeeds) */
-PNG_INTERNAL_FUNCTION(void, png_free_jmpbuf,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY);
/* Function to allocate memory for zlib. PNGAPI is disallowed. */
-PNG_INTERNAL_FUNCTION(voidpf, png_zalloc,
- (voidpf png_ptr, uInt items, uInt size),
+PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size),
PNG_ALLOCATED);
/* Function to free memory for zlib. PNGAPI is disallowed. */
-PNG_INTERNAL_FUNCTION(void, png_zfree,
- (voidpf png_ptr, voidpf ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY);
/* Next four functions are used internally as callbacks. PNGCBAPI is required
* but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to
* PNGCBAPI at 1.5.0
*/
-PNG_INTERNAL_FUNCTION(void PNGCBAPI, png_default_read_data,
- (png_structp png_ptr, png_bytep data, size_t length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr,
+ png_bytep data, size_t length),PNG_EMPTY);
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
-PNG_INTERNAL_FUNCTION(void PNGCBAPI, png_push_fill_buffer,
- (png_structp png_ptr, png_bytep buffer, size_t length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr,
+ png_bytep buffer, size_t length),PNG_EMPTY);
#endif
-PNG_INTERNAL_FUNCTION(void PNGCBAPI, png_default_write_data,
- (png_structp png_ptr, png_bytep data, size_t length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr,
+ png_bytep data, size_t length),PNG_EMPTY);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
# ifdef PNG_STDIO_SUPPORTED
-PNG_INTERNAL_FUNCTION(void PNGCBAPI, png_default_flush,
- (png_structp png_ptr),
+PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr),
PNG_EMPTY);
# endif
#endif
/* Reset the CRC variable */
-PNG_INTERNAL_FUNCTION(void, png_reset_crc,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY);
/* Write the "data" buffer to whatever output you are using */
-PNG_INTERNAL_FUNCTION(void, png_write_data,
- (png_structrp png_ptr, png_const_bytep data, size_t length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr,
+ png_const_bytep data, size_t length),PNG_EMPTY);
/* Read and check the PNG file signature */
-PNG_INTERNAL_FUNCTION(void, png_read_sig,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
/* Read the chunk header (length + type name) */
-PNG_INTERNAL_FUNCTION(png_uint_32, png_read_chunk_header,
- (png_structrp png_ptr),
+PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr),
PNG_EMPTY);
/* Read data from whatever input you are using into the "data" buffer */
-PNG_INTERNAL_FUNCTION(void, png_read_data,
- (png_structrp png_ptr, png_bytep data, size_t length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data,
+ size_t length),PNG_EMPTY);
/* Read bytes into buf, and update png_ptr->crc */
-PNG_INTERNAL_FUNCTION(void, png_crc_read,
- (png_structrp png_ptr, png_bytep buf, png_uint_32 length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf,
+ png_uint_32 length),PNG_EMPTY);
/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
-PNG_INTERNAL_FUNCTION(int, png_crc_finish,
- (png_structrp png_ptr, png_uint_32 skip),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr,
+ png_uint_32 skip),PNG_EMPTY);
/* Calculate the CRC over a section of data. Note that we are only
* passing a maximum of 64K on systems that have this as a memory limit,
* since this is the maximum buffer size we can specify.
*/
-PNG_INTERNAL_FUNCTION(void, png_calculate_crc,
- (png_structrp png_ptr, png_const_bytep ptr, size_t length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr,
+ png_const_bytep ptr, size_t length),PNG_EMPTY);
#ifdef PNG_WRITE_FLUSH_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_flush,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY);
#endif
/* Write various chunks */
@@ -1306,86 +1275,68 @@ PNG_INTERNAL_FUNCTION(void, png_flush,
/* Write the IHDR chunk, and update the png_struct with the necessary
* information.
*/
-PNG_INTERNAL_FUNCTION(void, png_write_IHDR,
- (png_structrp png_ptr,
- png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
- int compression_method, int filter_method, int interlace_method),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr,
+ png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
+ int compression_method, int filter_method, int interlace_method),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_write_PLTE,
- (png_structrp png_ptr,
- png_const_colorp palette, png_uint_32 num_pal),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr,
+ png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_compress_IDAT,
- (png_structrp png_ptr,
- png_const_bytep row_data, png_alloc_size_t row_data_length, int flush),
+PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr,
+ png_const_bytep row_data, png_alloc_size_t row_data_length, int flush),
PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_write_IEND,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY);
#ifdef PNG_WRITE_gAMA_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_gAMA_fixed,
- (png_structrp png_ptr, png_fixed_point file_gamma),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr,
+ png_fixed_point file_gamma),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_sBIT_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_sBIT,
- (png_structrp png_ptr, png_const_color_8p sbit, int color_type),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr,
+ png_const_color_8p sbit, int color_type),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_cHRM_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_cHRM_fixed,
- (png_structrp png_ptr, const png_xy *xy),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr,
+ const png_xy *xy), PNG_EMPTY);
/* The xy value must have been previously validated */
#endif
#ifdef PNG_WRITE_cICP_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_cICP,
- (png_structrp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_cICP,(png_structrp png_ptr,
png_byte colour_primaries, png_byte transfer_function,
- png_byte matrix_coefficients, png_byte video_full_range_flag),
- PNG_EMPTY);
+ png_byte matrix_coefficients, png_byte video_full_range_flag), PNG_EMPTY);
#endif
#ifdef PNG_WRITE_cLLI_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_cLLI_fixed,
- (png_structrp png_ptr, png_uint_32 maxCLL, png_uint_32 maxFALL),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_cLLI_fixed,(png_structrp png_ptr,
+ png_uint_32 maxCLL, png_uint_32 maxFALL), PNG_EMPTY);
#endif
#ifdef PNG_WRITE_mDCV_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_mDCV_fixed,
- (png_structrp png_ptr,
- png_uint_16 red_x, png_uint_16 red_y,
- png_uint_16 green_x, png_uint_16 green_y,
- png_uint_16 blue_x, png_uint_16 blue_y,
- png_uint_16 white_x, png_uint_16 white_y,
- png_uint_32 maxDL, png_uint_32 minDL),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_mDCV_fixed,(png_structrp png_ptr,
+ png_uint_16 red_x, png_uint_16 red_y,
+ png_uint_16 green_x, png_uint_16 green_y,
+ png_uint_16 blue_x, png_uint_16 blue_y,
+ png_uint_16 white_x, png_uint_16 white_y,
+ png_uint_32 maxDL, png_uint_32 minDL), PNG_EMPTY);
#endif
#ifdef PNG_WRITE_sRGB_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_sRGB,
- (png_structrp png_ptr, int intent),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr,
+ int intent),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_eXIf_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_eXIf,
- (png_structrp png_ptr, png_bytep exif, int num_exif),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_eXIf,(png_structrp png_ptr,
+ png_bytep exif, int num_exif),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_iCCP_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_iCCP,
- (png_structrp png_ptr,
- png_const_charp name, png_const_bytep profile, png_uint_32 proflen),
+PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
+ png_const_charp name, png_const_bytep profile, png_uint_32 proflen),
PNG_EMPTY);
/* Writes a previously 'set' profile. The profile argument is **not**
* compressed.
@@ -1393,106 +1344,82 @@ PNG_INTERNAL_FUNCTION(void, png_write_iCCP,
#endif
#ifdef PNG_WRITE_sPLT_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_sPLT,
- (png_structrp png_ptr, png_const_sPLT_tp palette),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr,
+ png_const_sPLT_tp palette),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_tRNS_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_tRNS,
- (png_structrp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr,
png_const_bytep trans, png_const_color_16p values, int number,
- int color_type),
- PNG_EMPTY);
+ int color_type),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_bKGD_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_bKGD,
- (png_structrp png_ptr, png_const_color_16p values, int color_type),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr,
+ png_const_color_16p values, int color_type),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_hIST_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_hIST,
- (png_structrp png_ptr, png_const_uint_16p hist, int num_hist),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr,
+ png_const_uint_16p hist, int num_hist),PNG_EMPTY);
#endif
/* Chunks that have keywords */
#ifdef PNG_WRITE_tEXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_tEXt,
- (png_structrp png_ptr,
- png_const_charp key, png_const_charp text, size_t text_len),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr,
+ png_const_charp key, png_const_charp text, size_t text_len),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_zTXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_zTXt,
- (png_structrp png_ptr,
- png_const_charp key, png_const_charp text, int compression),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp
+ key, png_const_charp text, int compression),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_iTXt_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_iTXt,
- (png_structrp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr,
int compression, png_const_charp key, png_const_charp lang,
- png_const_charp lang_key, png_const_charp text),
- PNG_EMPTY);
+ png_const_charp lang_key, png_const_charp text),PNG_EMPTY);
#endif
#ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */
-PNG_INTERNAL_FUNCTION(int, png_set_text_2,
- (png_const_structrp png_ptr,
- png_inforp info_ptr, png_const_textp text_ptr, int num_text),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr,
+ png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_oFFs_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_oFFs,
- (png_structrp png_ptr,
- png_int_32 x_offset, png_int_32 y_offset, int unit_type),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr,
+ png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_pCAL_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_pCAL,
- (png_structrp png_ptr,
- png_charp purpose, png_int_32 X0, png_int_32 X1,
- int type, int nparams, png_const_charp units, png_charpp params),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr,
+ png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams,
+ png_const_charp units, png_charpp params),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_pHYs_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_pHYs,
- (png_structrp png_ptr,
+PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr,
png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
- int unit_type),
- PNG_EMPTY);
+ int unit_type),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_tIME_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_tIME,
- (png_structrp png_ptr, png_const_timep mod_time),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr,
+ png_const_timep mod_time),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_sCAL_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_write_sCAL_s,
- (png_structrp png_ptr,
- int unit, png_const_charp width, png_const_charp height),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr,
+ int unit, png_const_charp width, png_const_charp height),PNG_EMPTY);
#endif
/* Called when finished processing a row of data */
-PNG_INTERNAL_FUNCTION(void, png_write_finish_row,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr),
+ PNG_EMPTY);
/* Internal use only. Called before first row of data */
-PNG_INTERNAL_FUNCTION(void, png_write_start_row,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr),
+ PNG_EMPTY);
/* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an
* array of png_ptr->width pixels. If the image is not interlaced or this
@@ -1520,9 +1447,8 @@ PNG_INTERNAL_FUNCTION(void, png_write_start_row,
#ifndef PNG_USE_COMPILE_TIME_MASKS
# define PNG_USE_COMPILE_TIME_MASKS 1
#endif
-PNG_INTERNAL_FUNCTION(void, png_combine_row,
- (png_const_structrp png_ptr, png_bytep row, int display),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr,
+ png_bytep row, int display),PNG_EMPTY);
#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Expand an interlaced row: the 'row_info' describes the pass data that has
@@ -1531,230 +1457,170 @@ PNG_INTERNAL_FUNCTION(void, png_combine_row,
* the pixels are *replicated* to the intervening space. This is essential for
* the correct operation of png_combine_row, above.
*/
-PNG_INTERNAL_FUNCTION(void, png_do_read_interlace,
- (png_row_infop row_info,
- png_bytep row, int pass, png_uint_32 transformations),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info,
+ png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY);
#endif
/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
/* Grab pixels out of a row for an interlaced pass */
-PNG_INTERNAL_FUNCTION(void, png_do_write_interlace,
- (png_row_infop row_info, png_bytep row, int pass),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info,
+ png_bytep row, int pass),PNG_EMPTY);
#endif
/* Unfilter a row: check the filter value before calling this, there is no point
* calling it for PNG_FILTER_VALUE_NONE.
*/
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row,
- (png_structrp pp, png_row_infop row_info,
- png_bytep row, png_const_bytep prev_row, int filter),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY);
#if PNG_ARM_NEON_OPT > 0
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_up_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_neon,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_MIPS_MSA_IMPLEMENTATION == 1
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_up_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_msa,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_msa,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_msa,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_msa,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_msa,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_MIPS_MMI_IMPLEMENTATION > 0
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_up_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_mmi,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_mmi,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_POWERPC_VSX_OPT > 0
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_up_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_vsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_vsx,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_INTEL_SSE_IMPLEMENTATION > 0
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_sse2,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_sse2,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_sse2,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_sse2,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_sse2,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_sse2,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_LOONGARCH_LSX_IMPLEMENTATION == 1
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_up_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_lsx,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_RISCV_RVV_IMPLEMENTATION == 1
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_up_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub3_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_sub4_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg3_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_avg4_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth3_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_filter_row_paeth4_rvv,
- (png_row_infop row_info, png_bytep row, png_const_bytep prev_row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_rvv,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
/* Choose the best filter to use and filter the row data */
-PNG_INTERNAL_FUNCTION(void, png_write_find_filter,
- (png_structrp png_ptr, png_row_infop row_info),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
+ png_row_infop row_info),PNG_EMPTY);
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_read_IDAT_data,
- (png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr,
+ png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY);
/* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer
* is NULL the function checks, instead, for the end of the stream. In this
* case a benign error will be issued if the stream end is not found or if
* extra data has to be consumed.
*/
-PNG_INTERNAL_FUNCTION(void, png_read_finish_IDAT,
- (png_structrp png_ptr),
+PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr),
PNG_EMPTY);
/* This cleans up when the IDAT LZ stream does not end when the last image
* byte is read; there is still some pending input.
*/
-PNG_INTERNAL_FUNCTION(void, png_read_finish_row,
- (png_structrp png_ptr),
+PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr),
PNG_EMPTY);
/* Finish a row while reading, dealing with interlacing passes, etc. */
#endif /* SEQUENTIAL_READ */
/* Initialize the row buffers, etc. */
-PNG_INTERNAL_FUNCTION(void, png_read_start_row,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
#if ZLIB_VERNUM >= 0x1240
-PNG_INTERNAL_FUNCTION(int, png_zlib_inflate,
- (png_structrp png_ptr, int flush),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
+ PNG_EMPTY);
# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
#else /* Zlib < 1.2.4 */
# define PNG_INFLATE(pp, flush) inflate(&(pp)->zstream, flush)
@@ -1762,44 +1628,38 @@ PNG_INTERNAL_FUNCTION(int, png_zlib_inflate,
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
/* Optional call to update the users info structure */
-PNG_INTERNAL_FUNCTION(void, png_read_transform_info,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
#endif
/* Shared transform functions, defined in pngtran.c */
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_do_strip_channel,
- (png_row_infop row_info, png_bytep row, int at_start),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info,
+ png_bytep row, int at_start),PNG_EMPTY);
#endif
#ifdef PNG_16BIT_SUPPORTED
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_do_swap,
- (png_row_infop row_info, png_bytep row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info,
+ png_bytep row),PNG_EMPTY);
#endif
#endif
#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
defined(PNG_WRITE_PACKSWAP_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_do_packswap,
- (png_row_infop row_info, png_bytep row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info,
+ png_bytep row),PNG_EMPTY);
#endif
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_do_invert,
- (png_row_infop row_info, png_bytep row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info,
+ png_bytep row),PNG_EMPTY);
#endif
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_do_bgr,
- (png_row_infop row_info, png_bytep row),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info,
+ png_bytep row),PNG_EMPTY);
#endif
/* The following decodes the appropriate chunks, and does error correction,
@@ -1820,27 +1680,25 @@ typedef enum
handled_ok /* known, supported and handled without error */
} png_handle_result_code;
-PNG_INTERNAL_FUNCTION(png_handle_result_code, png_handle_unknown,
- (png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_handle_result_code,png_handle_unknown,
+ (png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),
+ PNG_EMPTY);
/* This is the function that gets called for unknown chunks. The 'keep'
* argument is either non-zero for a known chunk that has been set to be
* handled as unknown or zero for an unknown chunk. By default the function
* just skips the chunk or errors out if it is critical.
*/
-PNG_INTERNAL_FUNCTION(png_handle_result_code, png_handle_chunk,
- (png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_handle_result_code,png_handle_chunk,
+ (png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
/* This handles the current chunk png_ptr->chunk_name with unread
* data[length] and returns one of the above result codes.
*/
#if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\
defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
-PNG_INTERNAL_FUNCTION(int, png_chunk_unknown_handling,
- (png_const_structrp png_ptr, png_uint_32 chunk_name),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling,
+ (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY);
/* Exactly as the API png_handle_as_unknown() except that the argument is a
* 32-bit chunk name, not a string.
*/
@@ -1848,122 +1706,93 @@ PNG_INTERNAL_FUNCTION(int, png_chunk_unknown_handling,
/* Handle the transformations for reading and writing */
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_do_read_transformations,
- (png_structrp png_ptr, png_row_infop row_info),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr,
+ png_row_infop row_info),PNG_EMPTY);
#endif
#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_do_write_transformations,
- (png_structrp png_ptr, png_row_infop row_info),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr,
+ png_row_infop row_info),PNG_EMPTY);
#endif
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_init_read_transformations,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr),
+ PNG_EMPTY);
#endif
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_push_read_chunk,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_read_sig,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_check_crc,
- (png_structrp png_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_save_buffer,
- (png_structrp png_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_restore_buffer,
- (png_structrp png_ptr, png_bytep buffer, size_t buffer_length),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_read_IDAT,
- (png_structrp png_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_process_IDAT_data,
- (png_structrp png_ptr, png_bytep buffer, size_t buffer_length),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_process_row,
- (png_structrp png_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_have_info,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_have_end,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_have_row,
- (png_structrp png_ptr, png_bytep row),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_push_read_end,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_process_some_data,
- (png_structrp png_ptr, png_inforp info_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_read_push_finish_row,
- (png_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr),
+ PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr,
+ png_bytep buffer, size_t buffer_length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr,
+ png_bytep buffer, size_t buffer_length),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr),
+ PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr,
+ png_bytep row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr,
+ png_inforp info_ptr),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr),
+ PNG_EMPTY);
#endif /* PROGRESSIVE_READ */
#ifdef PNG_iCCP_SUPPORTED
/* Routines for checking parts of an ICC profile. */
#ifdef PNG_READ_iCCP_SUPPORTED
-PNG_INTERNAL_FUNCTION(int, png_icc_check_length,
- (png_const_structrp png_ptr,
- png_const_charp name, png_uint_32 profile_length),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
+ png_const_charp name, png_uint_32 profile_length), PNG_EMPTY);
#endif /* READ_iCCP */
-PNG_INTERNAL_FUNCTION(int, png_icc_check_header,
- (png_const_structrp png_ptr,
- png_const_charp name, png_uint_32 profile_length,
- png_const_bytep profile /* first 132 bytes only */, int color_type),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(int, png_icc_check_tag_table,
- (png_const_structrp png_ptr,
- png_const_charp name, png_uint_32 profile_length,
- png_const_bytep profile /* header plus whole tag table */),
+PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
+ png_const_charp name, png_uint_32 profile_length,
+ png_const_bytep profile /* first 132 bytes only */, int color_type),
PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr,
+ png_const_charp name, png_uint_32 profile_length,
+ png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY);
#endif /* iCCP */
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_set_rgb_coefficients,
- (png_structrp png_ptr),
+PNG_INTERNAL_FUNCTION(void,png_set_rgb_coefficients, (png_structrp png_ptr),
PNG_EMPTY);
/* Set the rgb_to_gray coefficients from the cHRM Y values (if unset) */
#endif /* READ_RGB_TO_GRAY */
/* Added at libpng version 1.4.0 */
-PNG_INTERNAL_FUNCTION(void, png_check_IHDR,
- (png_const_structrp png_ptr,
- png_uint_32 width, png_uint_32 height, int bit_depth, int color_type,
- int interlace_type, int compression_type, int filter_type),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr,
+ png_uint_32 width, png_uint_32 height, int bit_depth,
+ int color_type, int interlace_type, int compression_type,
+ int filter_type),PNG_EMPTY);
/* Added at libpng version 1.5.10 */
#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_do_check_palette_indexes,
- (png_structrp png_ptr, png_row_infop row_info),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes,
+ (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY);
#endif
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
-PNG_INTERNAL_FUNCTION(void, png_fixed_error,
- (png_const_structrp png_ptr, png_const_charp name),
- PNG_NORETURN);
+PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr,
+ png_const_charp name),PNG_NORETURN);
#endif
/* Puts 'string' into 'buffer' at buffer[pos], taking care never to overwrite
* the end. Always leaves the buffer nul terminated. Never errors out (and
* there is no error code.)
*/
-PNG_INTERNAL_FUNCTION(size_t, png_safecat,
- (png_charp buffer, size_t bufsize, size_t pos, png_const_charp string),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize,
+ size_t pos, png_const_charp string),PNG_EMPTY);
/* Various internal functions to handle formatted warning messages, currently
* only implemented for warnings.
@@ -1974,9 +1803,8 @@ PNG_INTERNAL_FUNCTION(size_t, png_safecat,
* Returns the pointer to the start of the formatted string. This utility only
* does unsigned values.
*/
-PNG_INTERNAL_FUNCTION(png_charp, png_format_number,
- (png_const_charp start, png_charp end, int format, png_alloc_size_t number),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start,
+ png_charp end, int format, png_alloc_size_t number),PNG_EMPTY);
/* Convenience macro that takes an array: */
#define PNG_FORMAT_NUMBER(buffer,format,number) \
@@ -2008,26 +1836,23 @@ PNG_INTERNAL_FUNCTION(png_charp, png_format_number,
typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][
PNG_WARNING_PARAMETER_SIZE];
-PNG_INTERNAL_FUNCTION(void, png_warning_parameter,
- (png_warning_parameters p, int number, png_const_charp string),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p,
+ int number, png_const_charp string),PNG_EMPTY);
/* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters,
* including the trailing '\0'.
*/
-PNG_INTERNAL_FUNCTION(void, png_warning_parameter_unsigned,
+PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned,
(png_warning_parameters p, int number, int format, png_alloc_size_t value),
PNG_EMPTY);
/* Use png_alloc_size_t because it is an unsigned type as big as any we
* need to output. Use the following for a signed value.
*/
-PNG_INTERNAL_FUNCTION(void, png_warning_parameter_signed,
+PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed,
(png_warning_parameters p, int number, int format, png_int_32 value),
PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_formatted_warning,
- (png_const_structrp png_ptr,
- png_warning_parameters p, png_const_charp message),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr,
+ png_warning_parameters p, png_const_charp message),PNG_EMPTY);
/* 'message' follows the X/Open approach of using @1, @2 to insert
* parameters previously supplied using the above functions. Errors in
* specifying the parameters will simply result in garbage substitutions.
@@ -2049,16 +1874,14 @@ PNG_INTERNAL_FUNCTION(void, png_formatted_warning,
* If benign errors aren't supported they end up as the corresponding base call
* (png_warning or png_error.)
*/
-PNG_INTERNAL_FUNCTION(void, png_app_warning,
- (png_const_structrp png_ptr, png_const_charp message),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr,
+ png_const_charp message),PNG_EMPTY);
/* The application provided invalid parameters to an API function or called
* an API function at the wrong time, libpng can completely recover.
*/
-PNG_INTERNAL_FUNCTION(void, png_app_error,
- (png_const_structrp png_ptr, png_const_charp message),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr,
+ png_const_charp message),PNG_EMPTY);
/* As above but libpng will ignore the call, or attempt some other partial
* recovery from the error.
*/
@@ -2067,9 +1890,8 @@ PNG_INTERNAL_FUNCTION(void, png_app_error,
# define png_app_error(pp,s) png_error(pp,s)
#endif
-PNG_INTERNAL_FUNCTION(void, png_chunk_report,
- (png_const_structrp png_ptr, png_const_charp message, int error),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr,
+ png_const_charp message, int error),PNG_EMPTY);
/* Report a recoverable issue in chunk data. On read this is used to report
* a problem found while reading a particular chunk and the
* png_chunk_benign_error or png_chunk_warning function is used as
@@ -2095,17 +1917,14 @@ PNG_INTERNAL_FUNCTION(void, png_chunk_report,
#define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/)
#ifdef PNG_FLOATING_POINT_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_ascii_from_fp,
- (png_const_structrp png_ptr,
- png_charp ascii, size_t size, double fp, unsigned int precision),
+PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr,
+ png_charp ascii, size_t size, double fp, unsigned int precision),
PNG_EMPTY);
#endif /* FLOATING_POINT */
#ifdef PNG_FIXED_POINT_SUPPORTED
-PNG_INTERNAL_FUNCTION(void, png_ascii_from_fixed,
- (png_const_structrp png_ptr,
- png_charp ascii, size_t size, png_fixed_point fp),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr,
+ png_charp ascii, size_t size, png_fixed_point fp),PNG_EMPTY);
#endif /* FIXED_POINT */
#endif /* sCAL */
@@ -2115,7 +1934,7 @@ PNG_INTERNAL_FUNCTION(void, png_ascii_from_fixed,
* not valid it will be the index of a character in the supposed number.
*
* The format of a number is defined in the PNG extensions specification
- * and this API is strictly conformant to that spec, not anyone else's!
+ * and this API is strictly conformant to that spec, not anyone elses!
*
* The format as a regular expression is:
*
@@ -2197,9 +2016,8 @@ PNG_INTERNAL_FUNCTION(void, png_ascii_from_fixed,
* that omits the last character (i.e. set the size to the index of
* the problem character.) This has not been tested within libpng.
*/
-PNG_INTERNAL_FUNCTION(int, png_check_fp_number,
- (png_const_charp string, size_t size, int *statep, size_t *whereami),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string,
+ size_t size, int *statep, size_t *whereami),PNG_EMPTY);
/* This is the same but it checks a complete string and returns true
* only if it just contains a floating point number. As of 1.5.4 this
@@ -2207,9 +2025,8 @@ PNG_INTERNAL_FUNCTION(int, png_check_fp_number,
* it was valid (otherwise it returns 0.) This can be used for testing
* for negative or zero values using the sticky flag.
*/
-PNG_INTERNAL_FUNCTION(int, png_check_fp_string,
- (png_const_charp string, size_t size),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string,
+ size_t size),PNG_EMPTY);
#endif /* pCAL || sCAL */
#if defined(PNG_READ_GAMMA_SUPPORTED) ||\
@@ -2222,17 +2039,14 @@ PNG_INTERNAL_FUNCTION(int, png_check_fp_string,
* for overflow, true (1) if no overflow, in which case *res
* holds the result.
*/
-PNG_INTERNAL_FUNCTION(int, png_muldiv,
- (png_fixed_point_p res, png_fixed_point a,
- png_int_32 multiplied_by, png_int_32 divided_by),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a,
+ png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY);
/* Calculate a reciprocal - used for gamma values. This returns
* 0 if the argument is 0 in order to maintain an undefined value;
* there are no warnings.
*/
-PNG_INTERNAL_FUNCTION(png_fixed_point, png_reciprocal,
- (png_fixed_point a),
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a),
PNG_EMPTY);
#endif
@@ -2241,13 +2055,11 @@ PNG_INTERNAL_FUNCTION(png_fixed_point, png_reciprocal,
* values. Accuracy is suitable for gamma calculations but this is
* not exact - use png_muldiv for that. Only required at present on read.
*/
-PNG_INTERNAL_FUNCTION(png_fixed_point, png_reciprocal2,
- (png_fixed_point a, png_fixed_point b),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a,
+ png_fixed_point b),PNG_EMPTY);
/* Return true if the gamma value is significantly different from 1.0 */
-PNG_INTERNAL_FUNCTION(int, png_gamma_significant,
- (png_fixed_point gamma_value),
+PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value),
PNG_EMPTY);
/* PNGv3: 'resolve' the file gamma according to the new PNGv3 rules for colour
@@ -2258,9 +2070,8 @@ PNG_INTERNAL_FUNCTION(int, png_gamma_significant,
* transforms. For this reason a gamma specified by png_set_gamma always takes
* precedence.
*/
-PNG_INTERNAL_FUNCTION(png_fixed_point, png_resolve_file_gamma,
- (png_const_structrp png_ptr),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_fixed_point,png_resolve_file_gamma,
+ (png_const_structrp png_ptr),PNG_EMPTY);
/* Internal fixed point gamma correction. These APIs are called as
* required to convert single values - they don't need to be fast,
@@ -2269,45 +2080,37 @@ PNG_INTERNAL_FUNCTION(png_fixed_point, png_resolve_file_gamma,
* While the input is an 'unsigned' value it must actually be the
* correct bit value - 0..255 or 0..65535 as required.
*/
-PNG_INTERNAL_FUNCTION(png_uint_16, png_gamma_correct,
- (png_structrp png_ptr, unsigned int value, png_fixed_point gamma_value),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(png_uint_16, png_gamma_16bit_correct,
- (unsigned int value, png_fixed_point gamma_value),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(png_byte, png_gamma_8bit_correct,
- (unsigned int value, png_fixed_point gamma_value),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_destroy_gamma_table,
- (png_structrp png_ptr),
- PNG_EMPTY);
-PNG_INTERNAL_FUNCTION(void, png_build_gamma_table,
- (png_structrp png_ptr, int bit_depth),
+PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr,
+ unsigned int value, png_fixed_point gamma_value),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value,
+ png_fixed_point gamma_value),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value,
+ png_fixed_point gamma_value),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr),
PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr,
+ int bit_depth),PNG_EMPTY);
#endif /* READ_GAMMA */
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
/* Set the RGB coefficients if not already set by png_set_rgb_to_gray */
-PNG_INTERNAL_FUNCTION(void, png_set_rgb_coefficients,
- (png_structrp png_ptr),
+PNG_INTERNAL_FUNCTION(void,png_set_rgb_coefficients,(png_structrp png_ptr),
PNG_EMPTY);
#endif
#if defined(PNG_cHRM_SUPPORTED) || defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
-PNG_INTERNAL_FUNCTION(int, png_XYZ_from_xy,
- (png_XYZ *XYZ, const png_xy *xy),
+PNG_INTERNAL_FUNCTION(int,png_XYZ_from_xy,(png_XYZ *XYZ, const png_xy *xy),
PNG_EMPTY);
#endif /* cHRM || READ_RGB_TO_GRAY */
#ifdef PNG_COLORSPACE_SUPPORTED
-PNG_INTERNAL_FUNCTION(int, png_xy_from_XYZ,
- (png_xy *xy, const png_XYZ *XYZ),
+PNG_INTERNAL_FUNCTION(int,png_xy_from_XYZ,(png_xy *xy, const png_XYZ *XYZ),
PNG_EMPTY);
#endif
/* SIMPLIFIED READ/WRITE SUPPORT */
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\
- defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
+ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/* The internal structure that png_image::opaque points to. */
typedef struct png_control
{
@@ -2335,34 +2138,28 @@ typedef struct png_control
* errors that might occur. Returns true on success, false on failure (either
* of the function or as a result of a png_error.)
*/
-PNG_INTERNAL_CALLBACK(void, png_safe_error,
- (png_structp png_ptr, png_const_charp error_message),
- PNG_NORETURN);
+PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr,
+ png_const_charp error_message),PNG_NORETURN);
#ifdef PNG_WARNINGS_SUPPORTED
-PNG_INTERNAL_CALLBACK(void, png_safe_warning,
- (png_structp png_ptr, png_const_charp warning_message),
- PNG_EMPTY);
+PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr,
+ png_const_charp warning_message),PNG_EMPTY);
#else
# define png_safe_warning 0/*dummy argument*/
#endif
-PNG_INTERNAL_FUNCTION(int, png_safe_execute,
- (png_imagep image, int (*function)(png_voidp), png_voidp arg),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image,
+ int (*function)(png_voidp), png_voidp arg),PNG_EMPTY);
/* Utility to log an error; this also cleans up the png_image; the function
* always returns 0 (false).
*/
-PNG_INTERNAL_FUNCTION(int, png_image_error,
- (png_imagep image, png_const_charp error_message),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image,
+ png_const_charp error_message),PNG_EMPTY);
#ifndef PNG_SIMPLIFIED_READ_SUPPORTED
/* png_image_free is used by the write code but not exported */
-PNG_INTERNAL_FUNCTION(void, png_image_free,
- (png_imagep image),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY);
#endif /* !SIMPLIFIED_READ */
#endif /* SIMPLIFIED READ/WRITE */
@@ -2373,9 +2170,8 @@ PNG_INTERNAL_FUNCTION(void, png_image_free,
* the generic code is used.
*/
#ifdef PNG_FILTER_OPTIMIZATIONS
-PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr,
+ unsigned int bpp), PNG_EMPTY);
/* Just declare the optimization that will be used */
#else
/* List *all* the possible optimizations here - this branch is required if
@@ -2384,44 +2180,37 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS,
*/
# if PNG_ARM_NEON_OPT > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
#if PNG_MIPS_MSA_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_mips,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
# if PNG_MIPS_MMI_IMPLEMENTATION > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_mips,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
# endif
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
# endif
#endif
#if PNG_LOONGARCH_LSX_OPT > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_lsx,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
# if PNG_RISCV_RVV_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_rvv,
- (png_structp png_ptr, unsigned int bpp),
- PNG_EMPTY);
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
-PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword,
- (png_structrp png_ptr, png_const_charp key, png_bytep new_key),
- PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
+ png_const_charp key, png_bytep new_key), PNG_EMPTY);
#if PNG_ARM_NEON_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void,
diff --git a/jdk/src/share/native/sun/awt/libpng/pngread.c b/jdk/src/share/native/sun/awt/libpng/pngread.c
index 70df18926f..b53668a09c 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngread.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngread.c
@@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -52,8 +52,7 @@
/* Create a PNG structure for reading, and allocate any memory needed. */
PNG_FUNCTION(png_structp,PNGAPI
png_create_read_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
- png_error_ptr error_fn, png_error_ptr warn_fn),
- PNG_ALLOCATED)
+ png_error_ptr error_fn, png_error_ptr warn_fn),PNG_ALLOCATED)
{
#ifndef PNG_USER_MEM_SUPPORTED
png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
@@ -69,8 +68,7 @@ png_create_read_struct,(png_const_charp user_png_ver, png_voidp error_ptr,
PNG_FUNCTION(png_structp,PNGAPI
png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
- png_malloc_ptr malloc_fn, png_free_ptr free_fn),
- PNG_ALLOCATED)
+ png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED)
{
png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
@@ -550,6 +548,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
if (png_ptr->read_row_fn != NULL)
(*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
+
}
#endif /* SEQUENTIAL_READ */
@@ -720,7 +719,7 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr)
png_read_finish_IDAT(png_ptr);
#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
- /* Report invalid palette index; added at libpng-1.5.10 */
+ /* Report invalid palette index; added at libng-1.5.10 */
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
png_ptr->num_palette_max >= png_ptr->num_palette)
png_benign_error(png_ptr, "Read palette index exceeding num_palette");
@@ -808,19 +807,21 @@ png_read_destroy(png_structrp png_ptr)
png_ptr->quantize_index = NULL;
#endif
- /* png_ptr->palette is always independently allocated (not aliased
- * with info_ptr->palette), so free it unconditionally.
- */
- png_free(png_ptr, png_ptr->palette);
- png_ptr->palette = NULL;
+ if ((png_ptr->free_me & PNG_FREE_PLTE) != 0)
+ {
+ png_zfree(png_ptr, png_ptr->palette);
+ png_ptr->palette = NULL;
+ }
+ png_ptr->free_me &= ~PNG_FREE_PLTE;
#if defined(PNG_tRNS_SUPPORTED) || \
defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
- /* png_ptr->trans_alpha is always independently allocated (not aliased
- * with info_ptr->trans_alpha), so free it unconditionally.
- */
- png_free(png_ptr, png_ptr->trans_alpha);
- png_ptr->trans_alpha = NULL;
+ if ((png_ptr->free_me & PNG_FREE_TRNS) != 0)
+ {
+ png_free(png_ptr, png_ptr->trans_alpha);
+ png_ptr->trans_alpha = NULL;
+ }
+ png_ptr->free_me &= ~PNG_FREE_TRNS;
#endif
inflateEnd(&png_ptr->zstream);
@@ -895,7 +896,7 @@ png_set_read_status_fn(png_structrp png_ptr, png_read_status_ptr read_row_fn)
#ifdef PNG_INFO_IMAGE_SUPPORTED
void PNGAPI
png_read_png(png_structrp png_ptr, png_inforp info_ptr,
- int transforms, png_voidp params)
+ int transforms, voidp params)
{
png_debug(1, "in png_read_png");
@@ -1132,20 +1133,19 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
typedef struct
{
- /* Arguments */
+ /* Arguments: */
png_imagep image;
- png_voidp buffer;
+ png_voidp buffer;
png_int_32 row_stride;
- png_voidp colormap;
+ png_voidp colormap;
png_const_colorp background;
-
- /* Instance variables */
- png_voidp local_row;
- png_voidp first_row;
- ptrdiff_t row_step; /* step between rows */
- int file_encoding; /* E_ values above */
- png_fixed_point gamma_to_linear; /* For P_FILE, reciprocal of gamma */
- int colormap_processing; /* PNG_CMAP_ values above */
+ /* Local variables: */
+ png_voidp local_row;
+ png_voidp first_row;
+ ptrdiff_t row_bytes; /* step between rows */
+ int file_encoding; /* E_ values above */
+ png_fixed_point gamma_to_linear; /* For P_FILE, reciprocal of gamma */
+ int colormap_processing; /* PNG_CMAP_ values above */
} png_image_read_control;
/* Do all the *safe* initialization - 'safe' means that png_error won't be
@@ -1283,7 +1283,7 @@ png_image_is_not_sRGB(png_const_structrp png_ptr)
* png_struct::chromaticities always exists since the simplified API
* requires rgb-to-gray. The mDCV, cICP and cHRM chunks may all set it to
* a non-sRGB value, so it needs to be checked but **only** if one of
- * those chunks occurred in the file.
+ * those chunks occured in the file.
*/
/* Highest priority: check to be safe. */
if (png_has_chunk(png_ptr, cICP) || png_has_chunk(png_ptr, mDCV))
@@ -2623,7 +2623,7 @@ png_image_read_colormap(png_voidp argument)
{
r = back_r;
g = back_g;
- b = back_b;
+ b = back_g;
}
/* Compare the newly-created color-map entry with the one the
@@ -2866,17 +2866,17 @@ png_image_read_and_map(png_voidp argument)
}
{
- png_uint_32 height = image->height;
- png_uint_32 width = image->width;
- int proc = display->colormap_processing;
- png_bytep first_row = png_voidcast(png_bytep, display->first_row);
- ptrdiff_t row_step = display->row_step;
+ png_uint_32 height = image->height;
+ png_uint_32 width = image->width;
+ int proc = display->colormap_processing;
+ png_bytep first_row = png_voidcast(png_bytep, display->first_row);
+ ptrdiff_t step_row = display->row_bytes;
int pass;
for (pass = 0; pass < passes; ++pass)
{
- unsigned int startx, stepx, stepy;
- png_uint_32 y;
+ unsigned int startx, stepx, stepy;
+ png_uint_32 y;
if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
{
@@ -2900,10 +2900,10 @@ png_image_read_and_map(png_voidp argument)
for (; y<height; y += stepy)
{
png_bytep inrow = png_voidcast(png_bytep, display->local_row);
- png_bytep outrow = first_row + y * row_step;
- png_const_bytep row_end = outrow + width;
+ png_bytep outrow = first_row + y * step_row;
+ png_const_bytep end_row = outrow + width;
- /* Read the libpng data into the temporary buffer. */
+ /* Read read the libpng data into the temporary buffer. */
png_read_row(png_ptr, inrow, NULL);
/* Now process the row according to the processing option, note
@@ -2914,7 +2914,7 @@ png_image_read_and_map(png_voidp argument)
switch (proc)
{
case PNG_CMAP_GA:
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
/* The data is always in the PNG order */
unsigned int gray = *inrow++;
@@ -2943,7 +2943,7 @@ png_image_read_and_map(png_voidp argument)
break;
case PNG_CMAP_TRANS:
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
png_byte gray = *inrow++;
png_byte alpha = *inrow++;
@@ -2960,7 +2960,7 @@ png_image_read_and_map(png_voidp argument)
break;
case PNG_CMAP_RGB:
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
*outrow = PNG_RGB_INDEX(inrow[0], inrow[1], inrow[2]);
inrow += 3;
@@ -2968,7 +2968,7 @@ png_image_read_and_map(png_voidp argument)
break;
case PNG_CMAP_RGB_ALPHA:
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
unsigned int alpha = inrow[3];
@@ -3005,10 +3005,10 @@ png_image_read_and_map(png_voidp argument)
*/
if (inrow[0] & 0x80) back_i += 9; /* red */
if (inrow[0] & 0x40) back_i += 9;
- if (inrow[1] & 0x80) back_i += 3; /* green */
- if (inrow[1] & 0x40) back_i += 3;
- if (inrow[2] & 0x80) back_i += 1; /* blue */
- if (inrow[2] & 0x40) back_i += 1;
+ if (inrow[0] & 0x80) back_i += 3; /* green */
+ if (inrow[0] & 0x40) back_i += 3;
+ if (inrow[0] & 0x80) back_i += 1; /* blue */
+ if (inrow[0] & 0x40) back_i += 1;
*outrow = (png_byte)back_i;
}
@@ -3109,20 +3109,20 @@ png_image_read_colormapped(png_voidp argument)
*/
{
png_voidp first_row = display->buffer;
- ptrdiff_t row_step = display->row_stride;
+ ptrdiff_t row_bytes = display->row_stride;
- /* The following adjustment is to ensure that calculations are correct,
- * regardless whether row_step is positive or negative.
+ /* The following expression is designed to work correctly whether it gives
+ * a signed or an unsigned result.
*/
- if (row_step < 0)
+ if (row_bytes < 0)
{
char *ptr = png_voidcast(char*, first_row);
- ptr += (image->height-1) * (-row_step);
+ ptr += (image->height-1) * (-row_bytes);
first_row = png_voidcast(png_voidp, ptr);
}
display->first_row = first_row;
- display->row_step = row_step;
+ display->row_bytes = row_bytes;
}
if (passes == 0)
@@ -3140,17 +3140,17 @@ png_image_read_colormapped(png_voidp argument)
else
{
- ptrdiff_t row_step = display->row_step;
+ png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes;
while (--passes >= 0)
{
- png_uint_32 y = image->height;
- png_bytep row = png_voidcast(png_bytep, display->first_row);
+ png_uint_32 y = image->height;
+ png_bytep row = png_voidcast(png_bytep, display->first_row);
for (; y > 0; --y)
{
png_read_row(png_ptr, row, NULL);
- row += row_step;
+ row += row_bytes;
}
}
@@ -3166,11 +3166,9 @@ png_image_read_direct_scaled(png_voidp argument)
argument);
png_imagep image = display->image;
png_structrp png_ptr = image->opaque->png_ptr;
- png_inforp info_ptr = image->opaque->info_ptr;
png_bytep local_row = png_voidcast(png_bytep, display->local_row);
png_bytep first_row = png_voidcast(png_bytep, display->first_row);
- ptrdiff_t row_step = display->row_step;
- size_t row_bytes = png_get_rowbytes(png_ptr, info_ptr);
+ ptrdiff_t row_bytes = display->row_bytes;
int passes;
/* Handle interlacing. */
@@ -3199,14 +3197,9 @@ png_image_read_direct_scaled(png_voidp argument)
/* Read into local_row (gets transformed 8-bit data). */
png_read_row(png_ptr, local_row, NULL);
- /* Copy from local_row to user buffer.
- * Use row_bytes (i.e. the actual size in bytes of the row data) for
- * copying into output_row. Use row_step for advancing output_row,
- * to respect the caller's stride for padding or negative (bottom-up)
- * layouts.
- */
- memcpy(output_row, local_row, row_bytes);
- output_row += row_step;
+ /* Copy from local_row to user buffer. */
+ memcpy(output_row, local_row, (size_t)row_bytes);
+ output_row += row_bytes;
}
}
@@ -3238,18 +3231,17 @@ png_image_read_composite(png_voidp argument)
}
{
- png_uint_32 height = image->height;
- png_uint_32 width = image->width;
- ptrdiff_t row_step = display->row_step;
+ png_uint_32 height = image->height;
+ png_uint_32 width = image->width;
+ ptrdiff_t step_row = display->row_bytes;
unsigned int channels =
(image->format & PNG_FORMAT_FLAG_COLOR) != 0 ? 3 : 1;
- int optimize_alpha = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0;
int pass;
for (pass = 0; pass < passes; ++pass)
{
- unsigned int startx, stepx, stepy;
- png_uint_32 y;
+ unsigned int startx, stepx, stepy;
+ png_uint_32 y;
if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
{
@@ -3275,18 +3267,18 @@ png_image_read_composite(png_voidp argument)
{
png_bytep inrow = png_voidcast(png_bytep, display->local_row);
png_bytep outrow;
- png_const_bytep row_end;
+ png_const_bytep end_row;
/* Read the row, which is packed: */
png_read_row(png_ptr, inrow, NULL);
outrow = png_voidcast(png_bytep, display->first_row);
- outrow += y * row_step;
- row_end = outrow + width * channels;
+ outrow += y * step_row;
+ end_row = outrow + width * channels;
/* Now do the composition on each pixel in this row. */
outrow += startx;
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
png_byte alpha = inrow[channels];
@@ -3300,44 +3292,20 @@ png_image_read_composite(png_voidp argument)
if (alpha < 255) /* else just use component */
{
- if (optimize_alpha != 0)
- {
- /* This is PNG_OPTIMIZED_ALPHA, the component value
- * is a linear 8-bit value. Combine this with the
- * current outrow[c] value which is sRGB encoded.
- * Arithmetic here is 16-bits to preserve the output
- * values correctly.
- */
- component *= 257*255; /* =65535 */
- component += (255-alpha)*png_sRGB_table[outrow[c]];
-
- /* Clamp to the valid range to defend against
- * unforeseen cases where the data might be sRGB
- * instead of linear premultiplied.
- * (Belt-and-suspenders for CVE-2025-66293.)
- */
- if (component > 255*65535)
- component = 255*65535;
+ /* This is PNG_OPTIMIZED_ALPHA, the component value
+ * is a linear 8-bit value. Combine this with the
+ * current outrow[c] value which is sRGB encoded.
+ * Arithmetic here is 16-bits to preserve the output
+ * values correctly.
+ */
+ component *= 257*255; /* =65535 */
+ component += (255-alpha)*png_sRGB_table[outrow[c]];
- /* So 'component' is scaled by 255*65535 and is
- * therefore appropriate for the sRGB-to-linear
- * conversion table.
- */
- component = PNG_sRGB_FROM_LINEAR(component);
- }
- else
- {
- /* Compositing was already done on the palette
- * entries. The data is sRGB premultiplied on black.
- * Composite with the background in sRGB space.
- * This is not gamma-correct, but matches what was
- * done to the palette.
- */
- png_uint_32 background = outrow[c];
- component += ((255-alpha) * background + 127) / 255;
- if (component > 255)
- component = 255;
- }
+ /* So 'component' is scaled by 255*65535 and is
+ * therefore appropriate for the sRGB to linear
+ * conversion table.
+ */
+ component = PNG_sRGB_FROM_LINEAR(component);
}
outrow[c] = (png_byte)component;
@@ -3426,12 +3394,12 @@ png_image_read_background(png_voidp argument)
*/
{
png_bytep first_row = png_voidcast(png_bytep, display->first_row);
- ptrdiff_t row_step = display->row_step;
+ ptrdiff_t step_row = display->row_bytes;
for (pass = 0; pass < passes; ++pass)
{
- unsigned int startx, stepx, stepy;
- png_uint_32 y;
+ unsigned int startx, stepx, stepy;
+ png_uint_32 y;
if (png_ptr->interlaced == PNG_INTERLACE_ADAM7)
{
@@ -3458,15 +3426,15 @@ png_image_read_background(png_voidp argument)
{
png_bytep inrow = png_voidcast(png_bytep,
display->local_row);
- png_bytep outrow = first_row + y * row_step;
- png_const_bytep row_end = outrow + width;
+ png_bytep outrow = first_row + y * step_row;
+ png_const_bytep end_row = outrow + width;
/* Read the row, which is packed: */
png_read_row(png_ptr, inrow, NULL);
/* Now do the composition on each pixel in this row. */
outrow += startx;
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
png_byte alpha = inrow[1];
@@ -3503,15 +3471,15 @@ png_image_read_background(png_voidp argument)
{
png_bytep inrow = png_voidcast(png_bytep,
display->local_row);
- png_bytep outrow = first_row + y * row_step;
- png_const_bytep row_end = outrow + width;
+ png_bytep outrow = first_row + y * step_row;
+ png_const_bytep end_row = outrow + width;
/* Read the row, which is packed: */
png_read_row(png_ptr, inrow, NULL);
/* Now do the composition on each pixel in this row. */
outrow += startx;
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
png_byte alpha = inrow[1];
@@ -3549,9 +3517,9 @@ png_image_read_background(png_voidp argument)
png_uint_16p first_row = png_voidcast(png_uint_16p,
display->first_row);
/* The division by two is safe because the caller passed in a
- * stride which was multiplied by 2 (below) to get row_step.
+ * stride which was multiplied by 2 (below) to get row_bytes.
*/
- ptrdiff_t row_step = display->row_step / 2;
+ ptrdiff_t step_row = display->row_bytes / 2;
unsigned int preserve_alpha = (image->format &
PNG_FORMAT_FLAG_ALPHA) != 0;
unsigned int outchannels = 1U+preserve_alpha;
@@ -3565,8 +3533,8 @@ png_image_read_background(png_voidp argument)
for (pass = 0; pass < passes; ++pass)
{
- unsigned int startx, stepx, stepy;
- png_uint_32 y;
+ unsigned int startx, stepx, stepy;
+ png_uint_32 y;
/* The 'x' start and step are adjusted to output components here.
*/
@@ -3593,8 +3561,8 @@ png_image_read_background(png_voidp argument)
for (; y<height; y += stepy)
{
png_const_uint_16p inrow;
- png_uint_16p outrow = first_row + y * row_step;
- png_uint_16p row_end = outrow + width * outchannels;
+ png_uint_16p outrow = first_row + y*step_row;
+ png_uint_16p end_row = outrow + width * outchannels;
/* Read the row, which is packed: */
png_read_row(png_ptr, png_voidcast(png_bytep,
@@ -3604,7 +3572,7 @@ png_image_read_background(png_voidp argument)
/* Now do the pre-multiplication on each pixel in this row.
*/
outrow += startx;
- for (; outrow < row_end; outrow += stepx)
+ for (; outrow < end_row; outrow += stepx)
{
png_uint_32 component = inrow[0];
png_uint_16 alpha = inrow[1];
@@ -4030,23 +3998,23 @@ png_image_read_direct(png_voidp argument)
*/
{
png_voidp first_row = display->buffer;
- ptrdiff_t row_step = display->row_stride;
+ ptrdiff_t row_bytes = display->row_stride;
if (linear != 0)
- row_step *= 2;
+ row_bytes *= 2;
- /* The following adjustment is to ensure that calculations are correct,
- * regardless whether row_step is positive or negative.
+ /* The following expression is designed to work correctly whether it gives
+ * a signed or an unsigned result.
*/
- if (row_step < 0)
+ if (row_bytes < 0)
{
char *ptr = png_voidcast(char*, first_row);
- ptr += (image->height - 1) * (-row_step);
+ ptr += (image->height-1) * (-row_bytes);
first_row = png_voidcast(png_voidp, ptr);
}
display->first_row = first_row;
- display->row_step = row_step;
+ display->row_bytes = row_bytes;
}
if (do_local_compose != 0)
@@ -4095,17 +4063,17 @@ png_image_read_direct(png_voidp argument)
else
{
- ptrdiff_t row_step = display->row_step;
+ png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes;
while (--passes >= 0)
{
- png_uint_32 y = image->height;
- png_bytep row = png_voidcast(png_bytep, display->first_row);
+ png_uint_32 y = image->height;
+ png_bytep row = png_voidcast(png_bytep, display->first_row);
for (; y > 0; --y)
{
png_read_row(png_ptr, row, NULL);
- row += row_step;
+ row += row_bytes;
}
}
@@ -4140,7 +4108,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
row_stride = (png_int_32)/*SAFE*/png_row_stride;
if (row_stride < 0)
- check = -(png_uint_32)row_stride;
+ check = (png_uint_32)(-row_stride);
else
check = (png_uint_32)row_stride;
diff --git a/jdk/src/share/native/sun/awt/libpng/pngrtran.c b/jdk/src/share/native/sun/awt/libpng/pngrtran.c
index 838c8460f9..a19615f49f 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngrtran.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngrtran.c
@@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -259,7 +259,7 @@ png_set_strip_alpha(png_structrp png_ptr)
*
* Terminology (assuming power law, "gamma", encodings):
* "screen" gamma: a power law imposed by the output device when digital
- * samples are converted to visible light output. The EOTF - voltage to
+ * samples are converted to visible light output. The EOTF - volage to
* luminance on output.
*
* "file" gamma: a power law used to encode luminance levels from the input
@@ -524,9 +524,6 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
if (png_rtran_ok(png_ptr, 0) == 0)
return;
- if (palette == NULL)
- return;
-
png_ptr->transformations |= PNG_QUANTIZE;
if (full_quantize == 0)
@@ -740,8 +737,8 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
break;
t->next = hash[d];
- t->left = png_ptr->palette_to_index[i];
- t->right = png_ptr->palette_to_index[j];
+ t->left = (png_byte)i;
+ t->right = (png_byte)j;
hash[d] = t;
}
}
@@ -843,13 +840,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
}
if (png_ptr->palette == NULL)
{
- /* Allocate an owned copy rather than aliasing the caller's pointer,
- * so that png_read_destroy can free png_ptr->palette unconditionally.
- */
- png_ptr->palette = png_voidcast(png_colorp, png_calloc(png_ptr,
- PNG_MAX_PALETTE_LENGTH * (sizeof (png_color))));
- memcpy(png_ptr->palette, palette, (unsigned int)num_palette *
- (sizeof (png_color)));
+ png_ptr->palette = palette;
}
png_ptr->num_palette = (png_uint_16)num_palette;
@@ -1158,8 +1149,8 @@ png_set_rgb_to_gray(png_structrp png_ptr, int error_action, double red,
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
void PNGAPI
-png_set_read_user_transform_fn(png_structrp png_ptr,
- png_user_transform_ptr read_user_transform_fn)
+png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr
+ read_user_transform_fn)
{
png_debug(1, "in png_set_read_user_transform_fn");
@@ -1402,7 +1393,7 @@ png_resolve_file_gamma(png_const_structrp png_ptr)
if (file_gamma != 0)
return file_gamma;
- /* If png_reciprocal overflows, it returns 0, indicating to the caller that
+ /* If png_reciprocal oveflows it returns 0 which indicates to the caller that
* there is no usable file gamma. (The checks added to png_set_gamma and
* png_set_alpha_mode should prevent a screen_gamma which would overflow.)
*/
@@ -1881,7 +1872,6 @@ png_init_read_transformations(png_structrp png_ptr)
* transformations elsewhere.
*/
png_ptr->transformations &= ~(PNG_COMPOSE | PNG_GAMMA);
- png_ptr->flags &= ~PNG_FLAG_OPTIMIZE_ALPHA;
} /* color_type == PNG_COLOR_TYPE_PALETTE */
/* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
@@ -2099,21 +2089,6 @@ png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr)
{
png_debug(1, "in png_read_transform_info");
- if (png_ptr->transformations != 0)
- {
- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
- info_ptr->palette != NULL && png_ptr->palette != NULL)
- {
- /* Sync info_ptr->palette with png_ptr->palette.
- * The function png_init_read_transformations may have modified
- * png_ptr->palette in place (e.g. for gamma correction or for
- * background compositing).
- */
- memcpy(info_ptr->palette, png_ptr->palette,
- PNG_MAX_PALETTE_LENGTH * (sizeof (png_color)));
- }
- }
-
#ifdef PNG_READ_EXPAND_SUPPORTED
if ((png_ptr->transformations & PNG_EXPAND) != 0)
{
@@ -2408,7 +2383,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
}
row_info->bit_depth = 8;
row_info->pixel_depth = (png_byte)(8 * row_info->channels);
- row_info->rowbytes = (size_t)row_width * row_info->channels;
+ row_info->rowbytes = row_width * row_info->channels;
}
}
#endif
@@ -2610,7 +2585,7 @@ png_do_scale_16_to_8(png_row_infop row_info, png_bytep row)
row_info->bit_depth = 8;
row_info->pixel_depth = (png_byte)(8 * row_info->channels);
- row_info->rowbytes = (size_t)row_info->width * row_info->channels;
+ row_info->rowbytes = row_info->width * row_info->channels;
}
}
#endif
@@ -2638,7 +2613,7 @@ png_do_chop(png_row_infop row_info, png_bytep row)
row_info->bit_depth = 8;
row_info->pixel_depth = (png_byte)(8 * row_info->channels);
- row_info->rowbytes = (size_t)row_info->width * row_info->channels;
+ row_info->rowbytes = row_info->width * row_info->channels;
}
}
#endif
@@ -2874,7 +2849,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
*(--dp) = lo_filler;
row_info->channels = 2;
row_info->pixel_depth = 16;
- row_info->rowbytes = (size_t)row_width * 2;
+ row_info->rowbytes = row_width * 2;
}
else
@@ -2889,7 +2864,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
}
row_info->channels = 2;
row_info->pixel_depth = 16;
- row_info->rowbytes = (size_t)row_width * 2;
+ row_info->rowbytes = row_width * 2;
}
}
@@ -2912,7 +2887,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
*(--dp) = hi_filler;
row_info->channels = 2;
row_info->pixel_depth = 32;
- row_info->rowbytes = (size_t)row_width * 4;
+ row_info->rowbytes = row_width * 4;
}
else
@@ -2929,7 +2904,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
}
row_info->channels = 2;
row_info->pixel_depth = 32;
- row_info->rowbytes = (size_t)row_width * 4;
+ row_info->rowbytes = row_width * 4;
}
}
#endif
@@ -2953,7 +2928,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
*(--dp) = lo_filler;
row_info->channels = 4;
row_info->pixel_depth = 32;
- row_info->rowbytes = (size_t)row_width * 4;
+ row_info->rowbytes = row_width * 4;
}
else
@@ -2970,7 +2945,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
}
row_info->channels = 4;
row_info->pixel_depth = 32;
- row_info->rowbytes = (size_t)row_width * 4;
+ row_info->rowbytes = row_width * 4;
}
}
@@ -2997,7 +2972,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
*(--dp) = hi_filler;
row_info->channels = 4;
row_info->pixel_depth = 64;
- row_info->rowbytes = (size_t)row_width * 8;
+ row_info->rowbytes = row_width * 8;
}
else
@@ -3019,7 +2994,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
row_info->channels = 4;
row_info->pixel_depth = 64;
- row_info->rowbytes = (size_t)row_width * 8;
+ row_info->rowbytes = row_width * 8;
}
}
#endif
@@ -4513,7 +4488,7 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
}
row_info->bit_depth = 8;
row_info->pixel_depth = 32;
- row_info->rowbytes = (size_t)row_width * 4;
+ row_info->rowbytes = row_width * 4;
row_info->color_type = 6;
row_info->channels = 4;
}
@@ -4521,7 +4496,7 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
else
{
sp = row + (size_t)row_width - 1;
- dp = row + (size_t)row_width * 3 - 1;
+ dp = row + (size_t)(row_width * 3) - 1;
i = 0;
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
i = png_do_expand_palette_rgb8_neon(png_ptr, row_info, row,
@@ -4540,7 +4515,7 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
row_info->bit_depth = 8;
row_info->pixel_depth = 24;
- row_info->rowbytes = (size_t)row_width * 3;
+ row_info->rowbytes = row_width * 3;
row_info->color_type = 2;
row_info->channels = 3;
}
diff --git a/jdk/src/share/native/sun/awt/libpng/pngrutil.c b/jdk/src/share/native/sun/awt/libpng/pngrutil.c
index 4712dfd418..07d53cb2c7 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngrutil.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngrutil.c
@@ -465,7 +465,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
* be gained by using this when it is known *if* the zlib stream itself does
* not record the number; however, this is an illusion: the original writer
* of the PNG may have selected a lower window size, and we really must
- * follow that because, for systems with limited capabilities, we
+ * follow that because, for systems with with limited capabilities, we
* would otherwise reject the application's attempts to use a smaller window
* size (zlib doesn't have an interface to say "this or lower"!).
*
@@ -1035,7 +1035,7 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
* in the case of an 8-bit display with a decoder which controls the palette.
*
* The alternative here is to ignore the error and store the palette anyway;
- * destroying the tRNS will definitely cause problems.
+ * destroying the tRNS will definately cause problems.
*
* NOTE: the case of PNG_COLOR_TYPE_PALETTE need not be considered because
* the png_handle_ routines for the three 'after PLTE' chunks tRNS, bKGD and
@@ -1082,6 +1082,19 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
/* A valid PLTE chunk has been read */
png_ptr->mode |= PNG_HAVE_PLTE;
+ /* TODO: png_set_PLTE has the side effect of setting png_ptr->palette to
+ * its own copy of the palette. This has the side effect that when
+ * png_start_row is called (this happens after any call to
+ * png_read_update_info) the info_ptr palette gets changed. This is
+ * extremely unexpected and confusing.
+ *
+ * REVIEW: there have been consistent bugs in the past about gamma and
+ * similar transforms to colour mapped images being useless because the
+ * modified palette cannot be accessed because of the above.
+ *
+ * CONSIDER: Fix this by not sharing the palette in this way. But does
+ * this completely fix the problem?
+ */
png_set_PLTE(png_ptr, info_ptr, palette, num);
return handled_ok;
}
@@ -1283,7 +1296,7 @@ png_handle_cHRM(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
/* png_set_cHRM may complain about some of the values but this doesn't matter
* because it was a cHRM and it did have vaguely (if, perhaps, ridiculous)
- * values. Ridiculosity will be checked if the values are used later.
+ * values. Ridiculousity will be checked if the values are used later.
*/
png_set_cHRM_fixed(png_ptr, info_ptr, xy.whitex, xy.whitey, xy.redx, xy.redy,
xy.greenx, xy.greeny, xy.bluex, xy.bluey);
@@ -1580,8 +1593,7 @@ static png_handle_result_code /* PRIVATE */
png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
/* Note: this does not properly handle chunks that are > 64K under DOS */
{
- png_bytep buffer;
- png_bytep entry_start;
+ png_bytep entry_start, buffer;
png_sPLT_t new_palette;
png_sPLT_entryp pp;
png_uint_32 data_length;
@@ -1788,6 +1800,10 @@ png_handle_tRNS(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
return handled_error;
}
+ /* TODO: this is a horrible side effect in the palette case because the
+ * png_struct ends up with a pointer to the tRNS buffer owned by the
+ * png_info. Fix this.
+ */
png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans,
&(png_ptr->trans_color));
return handled_ok;
@@ -2046,7 +2062,7 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
return handled_error;
/* PNGv3: the code used to check the byte order mark at the start for MM or
- * II, however PNGv3 states that the first 4 bytes should be checked.
+ * II, however PNGv3 states that the the first 4 bytes should be checked.
* The caller ensures that there are four bytes available.
*/
{
@@ -2168,13 +2184,9 @@ png_handle_oFFs(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
static png_handle_result_code /* PRIVATE */
png_handle_pCAL(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
- png_bytep buffer;
- png_bytep buf;
- png_bytep endptr;
png_int_32 X0, X1;
- png_byte type;
- png_byte nparams;
- png_byte *units;
+ png_byte type, nparams;
+ png_bytep buffer, buf, units, endptr;
png_charpp params;
int i;
@@ -2403,7 +2415,7 @@ png_handle_tIME(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
static png_handle_result_code /* PRIVATE */
png_handle_tEXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
- png_text text_info;
+ png_text text_info;
png_bytep buffer;
png_charp key;
png_charp text;
@@ -2476,8 +2488,8 @@ static png_handle_result_code /* PRIVATE */
png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
{
png_const_charp errmsg = NULL;
- png_bytep buffer;
- png_uint_32 keyword_length;
+ png_bytep buffer;
+ png_uint_32 keyword_length;
png_debug(1, "in png_handle_zTXt");
@@ -3028,7 +3040,7 @@ static const struct
png_uint_32 max_length :12; /* Length min, max in bytes */
png_uint_32 min_length :8;
/* Length errors on critical chunks have special handling to preserve the
- * existing behaviour in libpng 1.6. Ancillary chunks are checked below
+ * existing behaviour in libpng 1.6. Anciallary chunks are checked below
* and produce a 'benign' error.
*/
png_uint_32 pos_before :4; /* PNG_HAVE_ values chunk must precede */
@@ -3036,7 +3048,7 @@ static const struct
/* NOTE: PLTE, tRNS and bKGD require special handling which depends on
* the colour type of the base image.
*/
- png_uint_32 multiple :1; /* Multiple occurrences permitted */
+ png_uint_32 multiple :1; /* Multiple occurences permitted */
/* This is enabled for PLTE because PLTE may, in practice, be optional */
}
read_chunks[PNG_INDEX_unknown] =
@@ -3070,7 +3082,7 @@ read_chunks[PNG_INDEX_unknown] =
# define CDIHDR 13U, 13U, hIHDR, 0, 0
# define CDPLTE NoCheck, 0U, 0, hIHDR, 1
/* PLTE errors are only critical for colour-map images, consequently the
- * handler does all the checks.
+ * hander does all the checks.
*/
# define CDIDAT NoCheck, 0U, aIDAT, hIHDR, 1
# define CDIEND NoCheck, 0U, 0, aIDAT, 0
diff --git a/jdk/src/share/native/sun/awt/libpng/pngset.c b/jdk/src/share/native/sun/awt/libpng/pngset.c
index 29082a6be0..0b2844f186 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngset.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngset.c
@@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -362,8 +362,7 @@ png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
png_debug1(1, "in %s storage function", "eXIf");
if (png_ptr == NULL || info_ptr == NULL ||
- (png_ptr->mode & PNG_WROTE_eXIf) != 0 ||
- exif == NULL)
+ (png_ptr->mode & PNG_WROTE_eXIf) != 0)
return;
new_exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr, num_exif));
@@ -414,12 +413,11 @@ void PNGAPI
png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
png_const_uint_16p hist)
{
- png_uint_16 safe_hist[PNG_MAX_PALETTE_LENGTH];
int i;
png_debug1(1, "in %s storage function", "hIST");
- if (png_ptr == NULL || info_ptr == NULL || hist == NULL)
+ if (png_ptr == NULL || info_ptr == NULL)
return;
if (info_ptr->num_palette == 0 || info_ptr->num_palette
@@ -431,13 +429,6 @@ png_set_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
return;
}
- /* Snapshot the caller's hist before freeing, in case it points to
- * info_ptr->hist (getter-to-setter aliasing).
- */
- memcpy(safe_hist, hist, (unsigned int)info_ptr->num_palette *
- (sizeof (png_uint_16)));
- hist = safe_hist;
-
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
/* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in
@@ -779,7 +770,7 @@ void PNGAPI
png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
png_const_colorp palette, int num_palette)
{
- png_color safe_palette[PNG_MAX_PALETTE_LENGTH];
+
png_uint_32 max_palette_length;
png_debug1(1, "in %s storage function", "PLTE");
@@ -813,47 +804,28 @@ png_set_PLTE(png_structrp png_ptr, png_inforp info_ptr,
png_error(png_ptr, "Invalid palette");
}
- /* Snapshot the caller's palette before freeing, in case it points to
- * info_ptr->palette (getter-to-setter aliasing).
+ /* It may not actually be necessary to set png_ptr->palette here;
+ * we do it for backward compatibility with the way the png_handle_tRNS
+ * function used to do the allocation.
+ *
+ * 1.6.0: the above statement appears to be incorrect; something has to set
+ * the palette inside png_struct on read.
*/
- if (num_palette > 0)
- memcpy(safe_palette, palette, (unsigned int)num_palette *
- (sizeof (png_color)));
-
- palette = safe_palette;
-
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
/* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
* of num_palette entries, in case of an invalid PNG file or incorrect
* call to png_set_PLTE() with too-large sample values.
- *
- * Allocate independent buffers for info_ptr and png_ptr so that the
- * lifetime of png_ptr->palette is decoupled from the lifetime of
- * info_ptr->palette. Previously, these two pointers were aliased,
- * which caused a use-after-free vulnerability if png_free_data freed
- * info_ptr->palette while png_ptr->palette was still in use by the
- * row transform functions (e.g. png_do_expand_palette).
- *
- * Both buffers are allocated with png_calloc to zero-fill, because
- * the ARM NEON palette riffle reads all 256 entries unconditionally,
- * regardless of num_palette.
*/
- png_free(png_ptr, png_ptr->palette);
png_ptr->palette = png_voidcast(png_colorp, png_calloc(png_ptr,
PNG_MAX_PALETTE_LENGTH * (sizeof (png_color))));
- info_ptr->palette = png_voidcast(png_colorp, png_calloc(png_ptr,
- PNG_MAX_PALETTE_LENGTH * (sizeof (png_color))));
- png_ptr->num_palette = info_ptr->num_palette = (png_uint_16)num_palette;
if (num_palette > 0)
- {
- memcpy(info_ptr->palette, palette, (unsigned int)num_palette *
- (sizeof (png_color)));
memcpy(png_ptr->palette, palette, (unsigned int)num_palette *
(sizeof (png_color)));
- }
+ info_ptr->palette = png_ptr->palette;
+ info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
info_ptr->free_me |= PNG_FREE_PLTE;
info_ptr->valid |= PNG_INFO_PLTE;
}
@@ -983,7 +955,6 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
png_const_textp text_ptr, int num_text)
{
int i;
- png_textp old_text = NULL;
png_debug1(1, "in text storage function, chunk typeid = 0x%lx",
png_ptr == NULL ? 0xabadca11UL : (unsigned long)png_ptr->chunk_name);
@@ -1031,10 +1002,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
return 1;
}
- /* Defer freeing the old array until after the copy loop below,
- * in case text_ptr aliases info_ptr->text (getter-to-setter).
- */
- old_text = info_ptr->text;
+ png_free(png_ptr, info_ptr->text);
info_ptr->text = new_text;
info_ptr->free_me |= PNG_FREE_TEXT;
@@ -1119,7 +1087,6 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
{
png_chunk_report(png_ptr, "text chunk: out of memory",
PNG_CHUNK_WRITE_ERROR);
- png_free(png_ptr, old_text);
return 1;
}
@@ -1173,8 +1140,6 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
png_debug1(3, "transferred text chunk %d", info_ptr->num_text);
}
- png_free(png_ptr, old_text);
-
return 0;
}
#endif
@@ -1218,50 +1183,28 @@ png_set_tRNS(png_structrp png_ptr, png_inforp info_ptr,
if (trans_alpha != NULL)
{
- /* Snapshot the caller's trans_alpha before freeing, in case it
- * points to info_ptr->trans_alpha (getter-to-setter aliasing).
+ /* It may not actually be necessary to set png_ptr->trans_alpha here;
+ * we do it for backward compatibility with the way the png_handle_tRNS
+ * function used to do the allocation.
+ *
+ * 1.6.0: The above statement is incorrect; png_handle_tRNS effectively
+ * relies on png_set_tRNS storing the information in png_struct
+ * (otherwise it won't be there for the code in pngrtran.c).
*/
- png_byte safe_trans[PNG_MAX_PALETTE_LENGTH];
-
- if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
- memcpy(safe_trans, trans_alpha, (size_t)num_trans);
-
- trans_alpha = safe_trans;
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
{
- /* Allocate info_ptr's copy of the transparency data.
- * Initialize all entries to fully opaque (0xff), then overwrite
- * the first num_trans entries with the actual values.
- */
+ /* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
info_ptr->trans_alpha = png_voidcast(png_bytep,
png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
- memset(info_ptr->trans_alpha, 0xff, PNG_MAX_PALETTE_LENGTH);
memcpy(info_ptr->trans_alpha, trans_alpha, (size_t)num_trans);
+
info_ptr->free_me |= PNG_FREE_TRNS;
info_ptr->valid |= PNG_INFO_tRNS;
-
- /* Allocate an independent copy for png_struct, so that the
- * lifetime of png_ptr->trans_alpha is decoupled from the
- * lifetime of info_ptr->trans_alpha. Previously these two
- * pointers were aliased, which caused a use-after-free if
- * png_free_data freed info_ptr->trans_alpha while
- * png_ptr->trans_alpha was still in use by the row transform
- * functions (e.g. png_do_expand_palette).
- */
- png_free(png_ptr, png_ptr->trans_alpha);
- png_ptr->trans_alpha = png_voidcast(png_bytep,
- png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH));
- memset(png_ptr->trans_alpha, 0xff, PNG_MAX_PALETTE_LENGTH);
- memcpy(png_ptr->trans_alpha, trans_alpha, (size_t)num_trans);
- }
- else
- {
- png_free(png_ptr, png_ptr->trans_alpha);
- png_ptr->trans_alpha = NULL;
}
+ png_ptr->trans_alpha = info_ptr->trans_alpha;
}
if (trans_color != NULL)
@@ -1312,7 +1255,6 @@ png_set_sPLT(png_const_structrp png_ptr,
*/
{
png_sPLT_tp np;
- png_sPLT_tp old_spalettes;
png_debug1(1, "in %s storage function", "sPLT");
@@ -1333,10 +1275,7 @@ png_set_sPLT(png_const_structrp png_ptr,
return;
}
- /* Defer freeing the old array until after the copy loop below,
- * in case entries aliases info_ptr->splt_palettes (getter-to-setter).
- */
- old_spalettes = info_ptr->splt_palettes;
+ png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes = np;
info_ptr->free_me |= PNG_FREE_SPLT;
@@ -1400,8 +1339,6 @@ png_set_sPLT(png_const_structrp png_ptr,
}
while (--nentries);
- png_free(png_ptr, old_spalettes);
-
if (nentries > 0)
png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
}
@@ -1450,7 +1387,6 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
{
png_unknown_chunkp np;
- png_unknown_chunkp old_unknowns;
if (png_ptr == NULL || info_ptr == NULL || num_unknowns <= 0 ||
unknowns == NULL)
@@ -1497,10 +1433,7 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
return;
}
- /* Defer freeing the old array until after the copy loop below,
- * in case unknowns aliases info_ptr->unknown_chunks (getter-to-setter).
- */
- old_unknowns = info_ptr->unknown_chunks;
+ png_free(png_ptr, info_ptr->unknown_chunks);
info_ptr->unknown_chunks = np; /* safe because it is initialized */
info_ptr->free_me |= PNG_FREE_UNKN;
@@ -1546,8 +1479,6 @@ png_set_unknown_chunks(png_const_structrp png_ptr,
++np;
++(info_ptr->unknown_chunks_num);
}
-
- png_free(png_ptr, old_unknowns);
}
void PNGAPI
@@ -1971,7 +1902,7 @@ png_set_benign_errors(png_structrp png_ptr, int allowed)
#endif /* BENIGN_ERRORS */
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
- /* Whether to report invalid palette index; added at libpng-1.5.10.
+ /* Whether to report invalid palette index; added at libng-1.5.10.
* It is possible for an indexed (color-type==3) PNG file to contain
* pixels with invalid (out-of-range) indexes if the PLTE chunk has
* fewer entries than the image's bit-depth would allow. We recover
diff --git a/jdk/src/share/native/sun/awt/libpng/pngstruct.h b/jdk/src/share/native/sun/awt/libpng/pngstruct.h
index f02365e8d8..8edb4bc393 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngstruct.h
+++ b/jdk/src/share/native/sun/awt/libpng/pngstruct.h
@@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -135,7 +135,7 @@ typedef enum
* TODO: C23: convert these macros to C23 inlines (which are static).
*/
#define png_chunk_flag_from_index(i) (0x80000000U >> (31 - (i)))
- /* The flag corresponding to the given png_index enum value. This is defined
+ /* The flag coresponding to the given png_index enum value. This is defined
* for png_unknown as well (until it reaches the value 32) but this should
* not be relied on.
*/
@@ -144,7 +144,7 @@ typedef enum
(((png_ptr)->chunks & png_chunk_flag_from_index(i)) != 0)
/* The chunk has been recorded in png_struct */
-#define png_file_add_chunk(png_ptr, i)\
+#define png_file_add_chunk(pnt_ptr, i)\
((void)((png_ptr)->chunks |= png_chunk_flag_from_index(i)))
/* Record the chunk in the png_struct */
diff --git a/jdk/src/share/native/sun/awt/libpng/pngtrans.c b/jdk/src/share/native/sun/awt/libpng/pngtrans.c
index 86ff2812e2..2350057e70 100644
--- a/jdk/src/share/native/sun/awt/libpng/pngtrans.c
+++ b/jdk/src/share/native/sun/awt/libpng/pngtrans.c
@@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
- * Copyright (c) 2018-2026 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -113,38 +113,9 @@ png_set_shift(png_structrp png_ptr, png_const_color_8p true_bits)
{
png_debug(1, "in png_set_shift");
- if (png_ptr == NULL || true_bits == NULL)
+ if (png_ptr == NULL)
return;
- /* Check the shift values before passing them on to png_do_shift. */
- {
- png_byte bit_depth = png_ptr->bit_depth;
- int invalid = 0;
-
- if ((png_ptr->color_type & PNG_COLOR_MASK_COLOR) != 0)
- {
- if (true_bits->red == 0 || true_bits->red > bit_depth ||
- true_bits->green == 0 || true_bits->green > bit_depth ||
- true_bits->blue == 0 || true_bits->blue > bit_depth)
- invalid = 1;
- }
- else
- {
- if (true_bits->gray == 0 || true_bits->gray > bit_depth)
- invalid = 1;
- }
-
- if ((png_ptr->color_type & PNG_COLOR_MASK_ALPHA) != 0 &&
- (true_bits->alpha == 0 || true_bits->alpha > bit_depth))
- invalid = 1;
-
- if (invalid)
- {
- png_app_error(png_ptr, "png_set_shift: invalid shift values");
- return;
- }
- }
-
png_ptr->transformations |= PNG_SHIFT;
png_ptr->shift = *true_bits;
}
@@ -515,9 +486,10 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
if (row_info->bit_depth < 8)
{
- png_const_bytep table;
png_bytep rp;
- png_bytep row_end = row + row_info->rowbytes;
+ png_const_bytep end, table;
+
+ end = row + row_info->rowbytes;
if (row_info->bit_depth == 1)
table = onebppswaptable;
@@ -531,7 +503,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
else
return;
- for (rp = row; rp < row_end; rp++)
+ for (rp = row; rp < end; rp++)
*rp = table[*rp];
}
}
@@ -859,8 +831,8 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
void PNGAPI
-png_set_user_transform_info(png_structrp png_ptr, png_voidp user_transform_ptr,
- int user_transform_depth, int user_transform_channels)
+png_set_user_transform_info(png_structrp png_ptr, png_voidp
+ user_transform_ptr, int user_transform_depth, int user_transform_channels)
{
png_debug(1, "in png_set_user_transform_info");
diff --git a/jdk/src/share/native/sun/awt/medialib/mlib_ImageScanPoly.c b/jdk/src/share/native/sun/awt/medialib/mlib_ImageScanPoly.c
index ef688e7b85..cd11cd563d 100644
--- a/jdk/src/share/native/sun/awt/medialib/mlib_ImageScanPoly.c
+++ b/jdk/src/share/native/sun/awt/medialib/mlib_ImageScanPoly.c
@@ -74,7 +74,6 @@ mlib_status mlib_AffineEdges(mlib_affine_param *param,
mlib_s32 top, bot;
mlib_s32 topIdx, max_xsize = 0;
mlib_s32 i, j, t;
- int intSize;
srcData = mlib_ImageGetData(src);
dstData = mlib_ImageGetData(dst);
@@ -102,7 +101,7 @@ mlib_status mlib_AffineEdges(mlib_affine_param *param,
return MLIB_FAILURE;
}
- intSize = sizeof(mlib_s32);
+ int intSize = sizeof(mlib_s32);
if (!SAFE_TO_MULT(dstHeight, intSize) ||
!SAFE_TO_ADD(dstHeight * intSize, 7)) {
return MLIB_FAILURE;
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsalpha.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
index e69259e8a5..c6a37e7972 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsalpha.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
index 71a48d43de..23f1241967 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmscam02.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -353,7 +353,7 @@ CAM02COLOR HPEtoCAT02(CAM02COLOR clr)
M[5] = ((-0.7036 * 0.201908) + (1.6975 * 0.000008) + 0.0061);
M[6] = (( 0.0030 * 1.910197) + (0.0136 * 0.370950));
M[7] = (( 0.0030 * -1.112124) + (0.0136 * 0.629054));
- M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);
+ M[8] = (( 0.0030 * 0.201908) + (0.0136 * 0.000008) + 0.9834);;
clr.RGBc[0] = (clr.RGBp[0] * M[0]) + (clr.RGBp[1] * M[1]) + (clr.RGBp[2] * M[2]);
clr.RGBc[1] = (clr.RGBp[0] * M[3]) + (clr.RGBp[1] * M[4]) + (clr.RGBp[2] * M[5]);
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c
index 9d0aea27d7..61d5533e54 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmscgats.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -1968,15 +1968,13 @@ cmsBool CMSEXPORT cmsIT8SaveToMem(cmsHANDLE hIT8, void *MemPtr, cmsUInt32Number*
memset(&sd, 0, sizeof(sd));
sd.stream = NULL;
- sd.Base = (cmsUInt8Number*) MemPtr;
+ sd.Base = (cmsUInt8Number*) MemPtr;
sd.Ptr = sd.Base;
sd.Used = 0;
- if (sd.Base && (*BytesNeeded > 0)) {
-
- sd.Max = (*BytesNeeded) - 1; // Write to memory?
- }
+ if (sd.Base)
+ sd.Max = *BytesNeeded; // Write to memory?
else
sd.Max = 0; // Just counting the needed bytes
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
index b73d594f2e..535a9e12d7 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmscnvrt.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -399,11 +399,11 @@ cmsBool ComputeConversion(cmsUInt32Number i,
cmsCIEXYZ WhitePointIn, WhitePointOut;
cmsMAT3 ChromaticAdaptationMatrixIn, ChromaticAdaptationMatrixOut;
- if (!_cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i - 1])) return FALSE;
- if (!_cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i - 1])) return FALSE;
+ _cmsReadMediaWhitePoint(&WhitePointIn, hProfiles[i-1]);
+ _cmsReadCHAD(&ChromaticAdaptationMatrixIn, hProfiles[i-1]);
- if (!_cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i])) return FALSE;
- if (!_cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i])) return FALSE;
+ _cmsReadMediaWhitePoint(&WhitePointOut, hProfiles[i]);
+ _cmsReadCHAD(&ChromaticAdaptationMatrixOut, hProfiles[i]);
if (!ComputeAbsoluteIntent(AdaptationState,
&WhitePointIn, &ChromaticAdaptationMatrixIn,
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c
index 739cc0b2c9..772a0a169e 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmserr.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
index 0840943406..b5fd47a8ed 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsgamma.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -852,10 +852,6 @@ cmsToneCurve* CMSEXPORT cmsBuildTabulatedToneCurveFloat(cmsContext ContextID, cm
{
cmsCurveSegment Seg[3];
- // Do some housekeeping
- if (nEntries == 0 || values == NULL)
- return NULL;
-
// A segmented tone curve should have function segments in the first and last positions
// Initialize segmented curve part up to 0 to constant value = samples[0]
Seg[0].x0 = MINUS_INF;
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmshalf.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmshalf.c
index 5babb063eb..eb1d4aa6ea 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmshalf.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmshalf.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
index 9837454df0..7fe74feafd 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsintrp.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c
index fe6b3d43a5..7578535590 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio0.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -1949,7 +1949,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si
if (data != NULL) {
if (BufferSize < TagSize)
- TagSize = BufferSize;
+ goto Error;
if (!Icc ->IOhandler ->Seek(Icc ->IOhandler, Offset)) goto Error;
if (!Icc ->IOhandler ->Read(Icc ->IOhandler, data, 1, TagSize)) goto Error;
@@ -1962,7 +1962,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si
return Icc ->TagSizes[i];
}
- // The data has been already read, or written. But wait!, maybe the user choose to save as
+ // The data has been already read, or written. But wait!, maybe the user chose to save as
// raw data. In this case, return the raw data directly
if (Icc ->TagSaveAsRaw[i]) {
@@ -1971,7 +1971,7 @@ cmsUInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature si
TagSize = Icc ->TagSizes[i];
if (BufferSize < TagSize)
- TagSize = BufferSize;
+ goto Error;
memmove(data, Icc ->TagPtrs[i], TagSize);
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c
index bd8a832ac4..85d9f6788b 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsio1.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -880,10 +880,6 @@ cmsBool CMSEXPORT cmsIsCLUT(cmsHPROFILE hProfile, cmsUInt32Number Intent, cmsUI
return FALSE;
}
- // Extended intents are not strictly CLUT-based
- if (Intent > INTENT_ABSOLUTE_COLORIMETRIC)
- return FALSE;
-
return cmsIsTag(hProfile, TagTable[Intent]);
}
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c
index 24114632ad..457ab6ecf5 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmd5.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
index 01aa44de85..ea97c0d877 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmd5.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
index 599c290bd7..9bbe82871f 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsmtrx.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
index 0428018023..c710ba3937 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsnamed.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -399,8 +399,6 @@ const wchar_t* _cmsMLUgetWide(const cmsMLU* mlu,
if (len != NULL) *len = v ->Len;
- if (v->StrW + v->Len > mlu->PoolSize) return NULL;
-
return(wchar_t*) ((cmsUInt8Number*) mlu ->MemPool + v ->StrW);
}
@@ -792,13 +790,7 @@ cmsStage* CMSEXPORT _cmsStageAllocNamedColor(cmsNAMEDCOLORLIST* NamedColorList,
cmsNAMEDCOLORLIST* CMSEXPORT cmsGetNamedColorList(cmsHTRANSFORM xform)
{
_cmsTRANSFORM* v = (_cmsTRANSFORM*) xform;
- cmsStage* mpe;
-
- if (v == NULL) return NULL;
- if (v->Lut == NULL) return NULL;
-
- mpe = v->Lut->Elements;
- if (mpe == NULL) return NULL;
+ cmsStage* mpe = v ->Lut->Elements;
if (mpe ->Type != cmsSigNamedColorElemType) return NULL;
return (cmsNAMEDCOLORLIST*) mpe ->Data;
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
index 3e81ae1df1..e32f73b86e 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsopt.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -1724,10 +1724,6 @@ cmsBool OptimizeMatrixShaper(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3
_cmsStageMatrixData* Data1 = (_cmsStageMatrixData*)cmsStageData(Matrix1);
_cmsStageMatrixData* Data2 = (_cmsStageMatrixData*)cmsStageData(Matrix2);
- // Only RGB to RGB
- if (Matrix1->InputChannels != 3 || Matrix1->OutputChannels != 3 ||
- Matrix2->InputChannels != 3 || Matrix2->OutputChannels != 3) return FALSE;
-
// Input offset should be zero
if (Data1->Offset != NULL) return FALSE;
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c
index da5fc6019d..e90e45656f 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmspack.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -1736,7 +1736,7 @@ cmsUInt8Number* PackChunkyBytes(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);
- if (Premul)
+ if (Premul && alpha_factor != 0)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
@@ -1805,7 +1805,7 @@ cmsUInt8Number* PackChunkyWords(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);
- if (Premul)
+ if (Premul && alpha_factor != 0)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
@@ -1872,7 +1872,7 @@ cmsUInt8Number* PackPlanarBytes(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);
- if (Premul)
+ if (Premul && alpha_factor != 0)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
@@ -1932,7 +1932,7 @@ cmsUInt8Number* PackPlanarWords(CMSREGISTER _cmsTRANSFORM* info,
if (Reverse)
v = REVERSE_FLAVOR_16(v);
- if (Premul)
+ if (Premul && alpha_factor != 0)
{
v = (cmsUInt16Number)((cmsUInt32Number)((cmsUInt32Number)v * alpha_factor + 0x8000) >> 16);
}
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c
index c473984005..f17c74b4b2 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmspcs.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c
index c2808bb927..87c74390bd 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsplugin.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -825,6 +825,8 @@ void* _cmsContextGetClientChunk(cmsContext ContextID, _cmsMemoryClient mc)
// identify which plug-in to unregister.
void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID)
{
+ struct _cmsContext_struct* ctx = _cmsGetContext(ContextID);
+
_cmsRegisterMemHandlerPlugin(ContextID, NULL);
_cmsRegisterInterpPlugin(ContextID, NULL);
_cmsRegisterTagTypePlugin(ContextID, NULL);
@@ -838,6 +840,9 @@ void CMSEXPORT cmsUnregisterPluginsTHR(cmsContext ContextID)
_cmsRegisterMutexPlugin(ContextID, NULL);
_cmsRegisterParallelizationPlugin(ContextID, NULL);
+ if (ctx->MemPool != NULL)
+ _cmsSubAllocDestroy(ctx->MemPool);
+ ctx->MemPool = NULL;
}
@@ -1005,14 +1010,7 @@ cmsContext CMSEXPORT cmsDupContext(cmsContext ContextID, void* NewUserData)
// The ContextID can no longer be used in any THR operation.
void CMSEXPORT cmsDeleteContext(cmsContext ContextID)
{
- if (ContextID == NULL) {
-
- cmsUnregisterPlugins();
- if (globalContext.MemPool != NULL)
- _cmsSubAllocDestroy(globalContext.MemPool);
- globalContext.MemPool = NULL;
- }
- else {
+ if (ContextID != NULL) {
struct _cmsContext_struct* ctx = (struct _cmsContext_struct*) ContextID;
struct _cmsContext_struct fakeContext;
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsps2.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsps2.c
index 537f685406..c0816347d2 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsps2.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsps2.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmssamp.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmssamp.c
index 8a01f7ec68..cf4a13968d 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmssamp.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmssamp.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -152,9 +152,10 @@ cmsBool BlackPointAsDarkerColorant(cmsHPROFILE hInput,
// Convert black to Lab
cmsDoTransform(xform, Black, &Lab, 1);
- // Force it to be neutral, check for inconsistences
+ // Force it to be neutral, clip to max. L* of 50
Lab.a = Lab.b = 0;
- if (Lab.L > 50 || Lab.L < 0) Lab.L = 0;
+ if (Lab.L > 50) Lab.L = 50;
+ if (Lab.L < 0) Lab.L = 0;
// Free the resources
cmsDeleteTransform(xform);
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmssm.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmssm.c
index 3e1486ae3a..4300d164df 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmssm.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmssm.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c
index 7b07b6b9cf..898b5e8ffd 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmstypes.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -1549,12 +1549,6 @@ void *Type_MLU_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsU
if (!_cmsReadUInt32Number(io, &Len)) goto Error;
if (!_cmsReadUInt32Number(io, &Offset)) goto Error;
- // Offset MUST be even because it indexes a block of utf16 chars.
- // Tricky profiles that uses odd positions will not work anyway
- // because the whole utf16 block is previously converted to wchar_t
- // and sizeof this type may be of 4 bytes. On Linux systems, for example.
- if (Offset & 1) goto Error;
-
// Check for overflow
if (Offset < (SizeOfHeader + 8)) goto Error;
if (((Offset + Len) < Len) || ((Offset + Len) > SizeOfTag + 8)) goto Error;
@@ -1582,12 +1576,8 @@ void *Type_MLU_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsU
}
else
{
- // Make sure this is an even utf16 size.
- if (SizeOfTag & 1) goto Error;
-
- Block = (wchar_t*) _cmsCalloc(self ->ContextID, 1, SizeOfTag);
+ Block = (wchar_t*) _cmsMalloc(self ->ContextID, SizeOfTag);
if (Block == NULL) goto Error;
-
NumOfWchar = SizeOfTag / sizeof(wchar_t);
if (!_cmsReadWCharArray(io, NumOfWchar, Block)) {
_cmsFree(self->ContextID, Block);
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c
index 6ce0479617..6d15f1fde1 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsvirt.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c
index 27d7180353..96bad5de7c 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmswtpnt.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -244,15 +244,12 @@ cmsBool ComputeChromaticAdaptation(cmsMAT3* Conversion,
_cmsMAT3eval(&ConeSourceRGB, Chad, &ConeSourceXYZ);
_cmsMAT3eval(&ConeDestRGB, Chad, &ConeDestXYZ);
- if ((fabs(ConeSourceRGB.n[0]) < MATRIX_DET_TOLERANCE) ||
- (fabs(ConeSourceRGB.n[1]) < MATRIX_DET_TOLERANCE) ||
- (fabs(ConeSourceRGB.n[2]) < MATRIX_DET_TOLERANCE)) return FALSE;
-
// Build matrix
_cmsVEC3init(&Cone.v[0], ConeDestRGB.n[0]/ConeSourceRGB.n[0], 0.0, 0.0);
_cmsVEC3init(&Cone.v[1], 0.0, ConeDestRGB.n[1]/ConeSourceRGB.n[1], 0.0);
_cmsVEC3init(&Cone.v[2], 0.0, 0.0, ConeDestRGB.n[2]/ConeSourceRGB.n[2]);
+
// Normalize
_cmsMAT3per(&Tmp, &Cone, Chad);
_cmsMAT3per(Conversion, &Chad_Inv, &Tmp);
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c
index 3f3ad28c6c..8b8f831f0a 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmsxform.c
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h b/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h
index d5b8c477f2..ab122f3b34 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2.h
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -52,7 +52,7 @@
//
//---------------------------------------------------------------------------------
//
-// Version 2.15
+// Version 2.14
//
#ifndef _lcms2_H
@@ -110,7 +110,7 @@ extern "C" {
#endif
// Version/release
-#define LCMS_VERSION 2150
+#define LCMS_VERSION 2140
// I will give the chance of redefining basic types for compilers that are not fully C99 compliant
#ifndef CMS_BASIC_TYPES_ALREADY_DEFINED
@@ -256,7 +256,7 @@ typedef int cmsBool;
// Calling convention -- this is hardly platform and compiler dependent
-#if defined(CMS_IS_WINDOWS_) && !defined(__GNUC__)
+#ifdef CMS_IS_WINDOWS_
# if defined(CMS_DLL) || defined(CMS_DLL_BUILD)
# ifdef __BORLANDC__
# define CMSEXPORT __stdcall _export
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h b/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h
index 4c29a6c021..3999e24d77 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_internal.h
@@ -27,9 +27,10 @@
// However, the following notice accompanied the original version of this
// file:
//
+
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h b/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h
index e7e7bd1f0c..1dc1a4661e 100644
--- a/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h
+++ b/jdk/src/share/native/sun/java2d/cmm/lcms/lcms2_plugin.h
@@ -30,7 +30,7 @@
//---------------------------------------------------------------------------------
//
// Little Color Management System
-// Copyright (c) 1998-2023 Marti Maria Saguer
+// Copyright (c) 1998-2022 Marti Maria Saguer
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
diff --git a/jdk/src/solaris/bin/java_md.h b/jdk/src/solaris/bin/java_md.h
index 82fb43a411..ec0615c132 100644
--- a/jdk/src/solaris/bin/java_md.h
+++ b/jdk/src/solaris/bin/java_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -43,12 +43,6 @@
#define MAXNAMELEN PATH_MAX
#endif
-#ifdef _LP64
-#define JLONG_FORMAT_SPECIFIER "%ld"
-#else
-#define JLONG_FORMAT_SPECIFIER "%lld"
-#endif
-
/*
* Common function prototypes and sundries.
*/
diff --git a/jdk/src/solaris/bin/java_md_common.c b/jdk/src/solaris/bin/java_md_common.c
index 37458758b8..fb446db739 100644
--- a/jdk/src/solaris/bin/java_md_common.c
+++ b/jdk/src/solaris/bin/java_md_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -463,6 +463,11 @@ UnsetEnv(char *name)
return(borrowed_unsetenv(name));
}
+const char *
+jlong_format_specifier() {
+ return "%lld";
+}
+
jboolean
IsJavaw()
{
diff --git a/jdk/src/solaris/bin/java_md_solinux.c b/jdk/src/solaris/bin/java_md_solinux.c
index e5056c44a7..a96713757d 100644
--- a/jdk/src/solaris/bin/java_md_solinux.c
+++ b/jdk/src/solaris/bin/java_md_solinux.c
@@ -1043,7 +1043,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp;
pthread_join(tid, &tmp);
- rslt = (int)(intptr_t)tmp;
+ rslt = (int)tmp;
} else {
/*
* Continue execution in current thread if for some reason (e.g. out of
@@ -1061,7 +1061,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
void * tmp;
thr_join(tid, NULL, &tmp);
- rslt = (int)(intptr_t)tmp;
+ rslt = (int)tmp;
} else {
/* See above. Continue in current thread if thr_create() failed */
rslt = continuation(args);
diff --git a/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java b/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
index 036e78cbfd..6c28d20177 100644
--- a/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
+++ b/jdk/src/solaris/classes/sun/awt/motif/MFontConfiguration.java
@@ -177,9 +177,7 @@ public class MFontConfiguration extends FontConfiguration {
* For Ubuntu the ID is "Ubuntu".
*/
Properties props = new Properties();
- try (FileInputStream fis = new FileInputStream(f)) {
- props.load(fis);
- }
+ props.load(new FileInputStream(f));
osName = props.getProperty("DISTRIB_ID");
osVersion = props.getProperty("DISTRIB_RELEASE");
}
diff --git a/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java b/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java
index 44983445bb..ecb813de50 100644
--- a/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java
+++ b/jdk/src/solaris/classes/sun/font/FcFontConfiguration.java
@@ -317,9 +317,7 @@ public class FcFontConfiguration extends FontConfiguration {
* For Ubuntu the ID is "Ubuntu".
*/
Properties props = new Properties();
- try (FileInputStream fis = new FileInputStream(f)) {
- props.load(fis);
- }
+ props.load(new FileInputStream(f));
osName = props.getProperty("DISTRIB_ID");
osVersion = props.getProperty("DISTRIB_RELEASE");
} else if ((f = new File("/etc/redhat-release")).canRead()) {
@@ -402,9 +400,10 @@ public class FcFontConfiguration extends FontConfiguration {
File dir = fcInfoFile.getParentFile();
dir.mkdirs();
File tempFile = Files.createTempFile(dir.toPath(), "fcinfo", null).toFile();
- try (FileOutputStream fos = new FileOutputStream(tempFile)) {
- props.store(fos, "JDK Font Configuration Generated File: *Do Not Edit*");
- }
+ FileOutputStream fos = new FileOutputStream(tempFile);
+ props.store(fos,
+ "JDK Font Configuration Generated File: *Do Not Edit*");
+ fos.close();
boolean renamed = tempFile.renameTo(fcInfoFile);
if (!renamed && FontUtilities.debugFonts()) {
System.out.println("rename failed");
diff --git a/jdk/src/windows/bin/cmdtoargs.c b/jdk/src/windows/bin/cmdtoargs.c
index dc00e8346e..29e5e77ae1 100644
--- a/jdk/src/windows/bin/cmdtoargs.c
+++ b/jdk/src/windows/bin/cmdtoargs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,7 +77,7 @@ static char* next_arg(char* cmdline, char* arg, jboolean* wildcard) {
USHORT ch = 0;
int i;
jboolean done = JNI_FALSE;
- ptrdiff_t charLength;
+ int charLength;
*wildcard = JNI_FALSE;
while (!done) {
@@ -209,12 +209,10 @@ void JLI_CmdToArgs(char* cmdline) {
argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg));
argv[nargs].arg = JLI_StringDup(arg);
argv[nargs].has_wildcard = wildcard;
- *arg = '\0';
+ *arg = NULL;
nargs++;
} while (src != NULL);
- JLI_MemFree(arg);
-
stdargc = nargs;
stdargs = argv;
}
diff --git a/jdk/src/windows/bin/java_md.c b/jdk/src/windows/bin/java_md.c
index 99a00a7e59..20dd104a8a 100644
--- a/jdk/src/windows/bin/java_md.c
+++ b/jdk/src/windows/bin/java_md.c
@@ -108,7 +108,7 @@ int awtPreloadD3D = -1;
* GetParamValue("theParam", "theParam=value") returns pointer to "value".
*/
const char * GetParamValue(const char *paramName, const char *arg) {
- size_t nameLen = JLI_StrLen(paramName);
+ int nameLen = JLI_StrLen(paramName);
if (JLI_StrNCmp(paramName, arg, nameLen) == 0) {
/* arg[nameLen] is valid (may contain final NULL) */
if (arg[nameLen] == '=') {
@@ -583,7 +583,7 @@ JLI_Snprintf(char* buffer, size_t size, const char* format, ...) {
if (rc < 0) {
/* apply ansi semantics */
buffer[size - 1] = '\0';
- return (int)size;
+ return size;
} else if (rc == size) {
/* force a null terminator */
buffer[size - 1] = '\0';
@@ -1164,6 +1164,11 @@ void SplashFreeLibrary() {
}
}
+const char *
+jlong_format_specifier() {
+ return "%I64d";
+}
+
/*
* Block current thread and continue execution in a new thread
*/
@@ -1313,7 +1318,7 @@ int AWTPreload(const char *funcName)
if (hPreloadAwt == NULL) {
/* awt.dll is not loaded yet */
char libraryPath[MAXPATHLEN];
- size_t jrePathLen = 0;
+ int jrePathLen = 0;
HMODULE hJava = NULL;
HMODULE hVerify = NULL;
@@ -1455,8 +1460,7 @@ filterArgs(StdArg *stdargs, const int nargc, StdArg **pargv) {
jobjectArray
CreateApplicationArgs(JNIEnv *env, char **strv, int argc)
{
- int i, j, idx;
- size_t tlen;
+ int i, j, idx, tlen;
jobjectArray outArray, inArray;
char *ostart, *astart, **nargv;
jboolean needs_expansion = JNI_FALSE;
diff --git a/jdk/src/windows/bin/java_md.h b/jdk/src/windows/bin/java_md.h
index 878952dca5..72151b92e5 100644
--- a/jdk/src/windows/bin/java_md.h
+++ b/jdk/src/windows/bin/java_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,6 @@
#define MAXPATHLEN MAX_PATH
#define MAXNAMELEN MAX_PATH
-#define JLONG_FORMAT_SPECIFIER "%I64d"
/*
* Support for doing cheap, accurate interval timing.
diff --git a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp
index df171d4a6a..bda2d752b6 100644
--- a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp
@@ -30,7 +30,6 @@
#include <float.h>
#include <Windows.h>
#include <shlwapi.h> // for AssocQueryStringW
-#include "awt_Desktop.h"
#include <wchar.h>
#include <cwchar>
#include <string.h>
diff --git a/jdk/src/windows/native/sun/windows/awt_Desktop.h b/jdk/src/windows/native/sun/windows/awt_Desktop.h
deleted file mode 100644
index 7e5e42e1ce..0000000000
--- a/jdk/src/windows/native/sun/windows/awt_Desktop.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2026, IBM Corporation. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef AWT_DESKTOP_H
-#define AWT_DESKTOP_H
-
-// Work around build failure on 32-bit Windows.
-#if !defined(_WIN64)
-#ifndef ASSOCF_NONE
-#define ASSOCF_NONE 0x00000000
-#endif // ASSOCF_NONE
-#endif // 32 bit Windows
-
-#endif // AWT_DESKTOP_H
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index e6d7f64985..477be97512 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -509,5 +509,4 @@ security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#certignarootca 8331883 generic-all
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#entrustrootcag4 8367256 generic-all
security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#teliasonerarootcav1 8333640 generic-all
-security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java#microsoftrsa2017 8374886 generic-all
security/infra/java/security/cert/CertPathValidator/certification/LuxTrustCA.java 8314509 generic-all
diff --git a/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java b/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java
index 455e5cf461..1bc4a30027 100644
--- a/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java
+++ b/jdk/test/com/sun/jndi/ldap/LdapDnsProviderTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,12 +27,8 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.Permission;
-import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Random;
-import java.util.Set;
import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import javax.naming.Context;
@@ -41,22 +37,10 @@ import javax.naming.NamingException;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
-import sun.net.PortConfig;
-
-import jdk.test.lib.RandomFactory;
-
/**
* @test
* @bug 8160768
- * @key randomness intermittent
- * @summary ctx provider tests for ldap.
- * Two test cases need to establish connection to the
- * unreachable port on localhost. Each tries 5 connection
- * attempts with a random port expecting for connection to fail.
- * In rare cases it could establish connections due to services
- * running on these ports, therefore it can fail intermittently.
- * @library /test/lib
- * @build jdk.test.lib.RandomFactory
+ * @summary ctx provider tests for ldap
* @compile dnsprovider/TestDnsProvider.java
* @run main/othervm LdapDnsProviderTest
* @run main/othervm LdapDnsProviderTest nosm
@@ -67,6 +51,16 @@ import jdk.test.lib.RandomFactory;
class DNSSecurityManager extends SecurityManager {
+
+
+ /* run main/othervm LdapDnsProviderTest
+
+ * run main/othervm LdapDnsProviderTest nosm
+ * run main/othervm LdapDnsProviderTest smnodns
+ * run main/othervm LdapDnsProviderTest smdns
+ * run main/othervm LdapDnsProviderTest nosmbaddns
+ */
+
private boolean dnsProvider = false;
public void setAllowDnsProvider(boolean allow) {
@@ -110,13 +104,6 @@ class ProviderTest implements Callable<Boolean> {
env.put(Context.PROVIDER_URL, url);
}
- // Set JNDI LDAP connect timeout property. It helps to prevent
- // initial bind operation from blocking in case of a local process
- // listening on the port specified in the URL. With the property set,
- // the bind operation will fail with timeout exception, and then it
- // could be retried with another port number.
- env.put("com.sun.jndi.ldap.connect.timeout", "1000");
-
try {
ctx = new InitialDirContext(env);
SearchControls scl = new SearchControls();
@@ -125,13 +112,8 @@ class ProviderTest implements Callable<Boolean> {
"ou=People,o=Test", "(objectClass=*)", scl);
throw new RuntimeException("Search should not complete");
} catch (NamingException e) {
+ e.printStackTrace();
passed = e.toString().contains(expected);
- System.err.println((passed ? "Expected" : "Unexpected") +
- " NamingException observed: " + e.toString());
- // Print stack trace only for unexpected exceptions
- if (!passed) {
- e.printStackTrace();
- }
} finally {
shutItDown(ctx);
}
@@ -211,85 +193,21 @@ public class LdapDnsProviderTest {
// no SecurityManager
runTest("ldap:///dc=example,dc=com", "localhost:389");
runTest("ldap://localhost/dc=example,dc=com", "localhost:389");
- runLocalHostTestWithRandomPort("ldap", "/dc=example,dc=com", 5);
- runLocalHostTestWithRandomPort("ldaps", "/dc=example,dc=com", 5);
+ runTest("ldap://localhost:111/dc=example,dc=com", "localhost:111");
+ runTest("ldaps://localhost:111/dc=example,dc=com", "localhost:111");
runTest("ldaps://localhost/dc=example,dc=com", "localhost:636");
runTest(null, "localhost:389");
runTest("", "ConfigurationException");
}
}
- // Pseudorandom number generator
- private static final Random RND = RandomFactory.getRandom();
- // Port numbers already seen to be generated by pseudorandom generator
- private static final Set<Integer> SEEN_PORTS = new HashSet<>();
-
- // Get random, previously unseen port number from [1111, PortConfig.getUpper()) range
- private static int generateUnseenPort() {
- int port;
- do {
- port = 1111 + RND.nextInt(PortConfig.getUpper() - 1111);
- // Seen ports will never contain more than maxAttempts*2 ports
- } while (SEEN_PORTS.contains(port));
- SEEN_PORTS.add(port);
- return port;
- }
-
- // Run test with ldap connection to localhost and random port. The test is expected to fail
- // with CommunicationException that is caused by connection refuse exception.
- // But in case if there is a service running on the same port the connection
- // will be established and then closed or timed-out. Both cases will generate exception
- // messages which differ from the expected one.
- // For such cases the test will be repeated with another random port. That will be done
- // maxAttempts times. If the expected exception won't be observed - test will be treated
- // as failed.
- private static void runLocalHostTestWithRandomPort(String scheme, String path, int maxAttempts) {
- for (int attempt = 0; attempt <= maxAttempts; attempt++) {
- boolean attemptSuccessful = true;
- int port = generateUnseenPort();
-
- // Construct URL for the current attempt
- String url = scheme + "://localhost" + ":" + port + path;
-
- // Construct text expected to be present in Exception message
- String expected = "localhost:" + port;
-
- System.err.printf("Iteration %d: Testing: %s, %s%n", attempt, url, expected);
-
- FutureTask<Boolean> future = new FutureTask<>(
- new ProviderTest(url, expected));
- new Thread(future).start();
- while (!future.isDone()) {
- try {
- if (!future.get()) {
- if (attempt == maxAttempts) {
- throw new RuntimeException("Test failed, ProviderTest" +
- " returned false " + maxAttempts + " times");
- } else {
- System.err.printf("Iteration %d failed:" +
- " ProviderTest returned false%n", attempt);
- attemptSuccessful = false;
- }
- }
- } catch (InterruptedException | ExecutionException e) {
- System.err.println("Iteration %d failed to execute provider test: " + e.getMessage());
- attemptSuccessful = false;
- }
- }
- if (attemptSuccessful) {
- System.err.println("Test passed. It took " + (attempt + 1) + " iterations to complete");
- break;
- }
- }
- }
-
private static void runTest(String url, String expected) {
FutureTask<Boolean> future =
new FutureTask<>(
new ProviderTest(url, expected));
new Thread(future).start();
- System.err.printf("Testing: url='%s', expected content='%s'%n", url, expected);
+ System.err.println("Testing: " + url + ", " + expected);
while (!future.isDone()) {
try {
if (!future.get()) {
diff --git a/jdk/test/com/sun/net/httpserver/bugs/B6361557.java b/jdk/test/com/sun/net/httpserver/bugs/B6361557.java
index 70ed5392cc..d854c77250 100644
--- a/jdk/test/com/sun/net/httpserver/bugs/B6361557.java
+++ b/jdk/test/com/sun/net/httpserver/bugs/B6361557.java
@@ -69,8 +69,7 @@ public class B6361557 {
public static void main (String[] args) throws Exception {
Handler handler = new Handler();
- InetAddress loopback = InetAddress.getLoopbackAddress();
- InetSocketAddress addr = new InetSocketAddress (loopback, 0);
+ InetSocketAddress addr = new InetSocketAddress (0);
HttpServer server = HttpServer.create (addr, 0);
HttpContext ctx = server.createContext ("/test", handler);
@@ -79,7 +78,7 @@ public class B6361557 {
server.start ();
InetSocketAddress destaddr = new InetSocketAddress (
- loopback, server.getAddress().getPort()
+ "127.0.0.1", server.getAddress().getPort()
);
System.out.println ("destaddr " + destaddr);
@@ -87,10 +86,7 @@ public class B6361557 {
int requests = 0;
int responses = 0;
while (true) {
- // we need to read responses from time to time: slightly
- // increase the timeout with the amount of pending responses
- // to give a chance to the server to reply.
- int selres = selector.select (requests - responses + 1);
+ int selres = selector.select (1);
Set<SelectionKey> selkeys = selector.selectedKeys();
for (SelectionKey key : selkeys) {
if (key.isReadable()) {
@@ -99,18 +95,14 @@ public class B6361557 {
try {
int x = chan.read(buf);
if (x == -1 || responseComplete(buf)) {
- System.out.print("_");
key.attach(null);
chan.close();
responses++;
}
- } catch (IOException e) {
- System.out.println(e);
- }
+ } catch (IOException e) {}
}
}
if (requests < NUM) {
- System.out.print(".");
SocketChannel schan = SocketChannel.open(destaddr);
requestBuf.rewind();
int c = 0;
diff --git a/jdk/test/java/awt/FullScreen/SetFullScreenTest.java b/jdk/test/java/awt/FullScreen/SetFullScreenTest.java
deleted file mode 100644
index 316bc2f64f..0000000000
--- a/jdk/test/java/awt/FullScreen/SetFullScreenTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import java.awt.Color;
-import java.awt.Frame;
-import java.awt.GraphicsDevice;
-import java.awt.GraphicsEnvironment;
-import java.awt.Robot;
-import jtreg.SkippedException;
-
-import static java.awt.EventQueue.invokeAndWait;
-
-/*
- * @test
- * @key headful
- * @bug 8312518
- * @library /test/lib
- * @summary Setting fullscreen window using setFullScreenWindow() shows up
- * as black screen on newer macOS versions (13 & 14).
- */
-
-public class SetFullScreenTest {
- private static Frame frame;
- private static GraphicsDevice gd;
- private static Robot robot;
- private static volatile int width;
- private static volatile int height;
-
- public static void main(String[] args) throws Exception {
- try {
- robot = new Robot();
- invokeAndWait(() -> {
- gd = GraphicsEnvironment.getLocalGraphicsEnvironment().
- getDefaultScreenDevice();
- if (!gd.isFullScreenSupported()) {
- throw new SkippedException("Full Screen mode not supported");
- }
- });
-
- invokeAndWait(() -> {
- frame = new Frame("Test FullScreen mode");
- frame.setBackground(Color.RED);
- frame.setSize(100, 100);
- frame.setLocation(10, 10);
- frame.setVisible(true);
- });
- robot.delay(1000);
-
- invokeAndWait(() -> gd.setFullScreenWindow(frame));
- robot.waitForIdle();
- robot.delay(300);
-
- invokeAndWait(() -> {
- width = gd.getFullScreenWindow().getWidth();
- height = gd.getFullScreenWindow().getHeight();
- });
-
- if (!robot.getPixelColor(width / 2, height / 2).equals(Color.RED)) {
- System.err.println("Actual color: " + robot.getPixelColor(width / 2, height / 2)
- + " Expected color: " + Color.RED);
- throw new RuntimeException("Test Failed! Window not in full screen mode");
- }
- } finally {
- if (frame != null) {
- frame.dispose();
- }
- }
- }
-}
diff --git a/jdk/test/java/awt/image/XBMDecoder/XBMDecoderTest.java b/jdk/test/java/awt/image/XBMDecoder/XBMDecoderTest.java
deleted file mode 100644
index d21e8aa0dd..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/XBMDecoderTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8361748
- * @summary Tests XBM image size limits and if XBMImageDecoder.produceImage()
- * throws appropriate error when parsing invalid XBM image data.
- * @run main XBMDecoderTest
- */
-
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.PrintStream;
-import java.nio.file.Files;
-import java.util.Arrays;
-import javax.swing.ImageIcon;
-
-public class XBMDecoderTest {
-
- public static void main(String[] args) throws Exception {
- String dir = System.getProperty("test.src");
- PrintStream originalErr = System.err;
- boolean validCase;
-
- File currentDir = new File(dir);
- File[] files = currentDir.listFiles((File d, String s)
- -> s.endsWith(".xbm"));
-
- for (File file : files) {
- String fileName = file.getName();
- validCase = fileName.startsWith("valid");
-
- System.out.println("--- Testing " + fileName + " ---");
- try (ByteArrayOutputStream errContent = new ByteArrayOutputStream()) {
- System.setErr(new PrintStream(errContent));
-
- ImageIcon icon = new ImageIcon(Files.readAllBytes(file.toPath()));
- boolean isErrEmpty = errContent.toString().isEmpty();
-
- if (!isErrEmpty) {
- System.out.println("Expected ImageFormatException occurred.");
- System.out.print(errContent);
- }
- if (validCase && !isErrEmpty) {
- throw new RuntimeException("Test failed: Error stream not empty");
- } else if (!validCase && isErrEmpty && hasPixelData(icon.getImage())) {
- throw new RuntimeException("Test failed: ImageFormatException"
- + " expected but not thrown");
- }
- if (validCase && !hasPixelData(icon.getImage())) {
- throw new RuntimeException("Test failed: the parsed image " +
- "does not contain any pixel data");
- }
- System.out.println("PASSED\n");
- } finally {
- System.setErr(originalErr);
- }
- }
- }
-
- private static boolean hasPixelData(Image img) {
- int w = img.getWidth(null);
- int h = img.getHeight(null);
- BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
- Graphics2D g = bi.createGraphics();
- g.drawImage(img, 0, 0, null);
- g.dispose();
- int[] pixels = bi.getRGB(0, 0, w, h, null, 0, w);
- if (Arrays.stream(pixels).allMatch(i -> i == 0)) {
- return false;
- }
- return true;
- }
-}
diff --git a/jdk/test/java/awt/image/XBMDecoder/invalid.xbm b/jdk/test/java/awt/image/XBMDecoder/invalid.xbm
deleted file mode 100644
index 8a8cfc2763..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/invalid.xbm
+++ /dev/null
@@ -1,2 +0,0 @@
-#define k_ht 3
-h` k[] = { 01x0, 42222222222236319330::
diff --git a/jdk/test/java/awt/image/XBMDecoder/invalid_empty.xbm b/jdk/test/java/awt/image/XBMDecoder/invalid_empty.xbm
deleted file mode 100644
index 5cfb8e21cf..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/invalid_empty.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define test_width 16
-#define test_height 3
-#define ht_x 1
-#define ht_y 2
-static unsigned char test_bits[] = {
-};
diff --git a/jdk/test/java/awt/image/XBMDecoder/invalid_hex.xbm b/jdk/test/java/awt/image/XBMDecoder/invalid_hex.xbm
deleted file mode 100644
index 1286eee1d9..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/invalid_hex.xbm
+++ /dev/null
@@ -1,3 +0,0 @@
-#define k_width 16
-#define k_height 1
-k[] = { 0x10, 1234567890};
diff --git a/jdk/test/java/awt/image/XBMDecoder/invalid_ht.xbm b/jdk/test/java/awt/image/XBMDecoder/invalid_ht.xbm
deleted file mode 100644
index 5244651a4c..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/invalid_ht.xbm
+++ /dev/null
@@ -1,3 +0,0 @@
-#define k_wt 16
-#define k_ht 0
-k[] = { 0x10, 0x12};
diff --git a/jdk/test/java/awt/image/XBMDecoder/invalid_plus.xbm b/jdk/test/java/awt/image/XBMDecoder/invalid_plus.xbm
deleted file mode 100644
index 714907084f..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/invalid_plus.xbm
+++ /dev/null
@@ -1,3 +0,0 @@
-#define test_width 16
-#define test_height 2
-static unsigned char test_bits[] = { 0x13, 0x11, 0xAB+, 0xff };
\ No newline at end of file
diff --git a/jdk/test/java/awt/image/XBMDecoder/valid.xbm b/jdk/test/java/awt/image/XBMDecoder/valid.xbm
deleted file mode 100644
index 23b57b2c81..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/valid.xbm
+++ /dev/null
@@ -1,6 +0,0 @@
-#define test_width 16
-#define test_height 3
-#define ht_x 1
-#define ht_y 2
-static unsigned char test_bits[] = {
-0x13, 0x11, 0x15, 0x00, 0xAB, 0xcd };
diff --git a/jdk/test/java/awt/image/XBMDecoder/valid_hex.xbm b/jdk/test/java/awt/image/XBMDecoder/valid_hex.xbm
deleted file mode 100644
index e365d80244..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/valid_hex.xbm
+++ /dev/null
@@ -1,4 +0,0 @@
-#define test_width 16
-#define test_height 2
-static unsigned char test_bits[] = { 0x13, 0x11,
- 0xAB, 0xff };
diff --git a/jdk/test/java/awt/image/XBMDecoder/valid_multiline.xbm b/jdk/test/java/awt/image/XBMDecoder/valid_multiline.xbm
deleted file mode 100644
index e24bc10e9b..0000000000
--- a/jdk/test/java/awt/image/XBMDecoder/valid_multiline.xbm
+++ /dev/null
@@ -1,8 +0,0 @@
-#define test_width 16
-#define test_height 3
-#define ht_x 1
-#define ht_y 2
-static unsigned char test_bits[] = {
-0x20, 0x10,
-0x25, 0x01,
-0xAC, 0xab };
diff --git a/jdk/test/java/net/Authenticator/B4722333.java b/jdk/test/java/net/Authenticator/B4722333.java
index 4ed2466d8d..441e110788 100644
--- a/jdk/test/java/net/Authenticator/B4722333.java
+++ b/jdk/test/java/net/Authenticator/B4722333.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -120,14 +120,13 @@ public class B4722333 implements HttpCallback {
MyAuthenticator auth = new MyAuthenticator ();
Authenticator.setDefault (auth);
try {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- server = new TestHttpServer (new B4722333(), 1, 10, loopback, 0);
+ server = new TestHttpServer (new B4722333(), 1, 10, 0);
System.out.println ("Server started: listening on port: " + server.getLocalPort());
- client ("http://" + server.getAuthority() + "/d1/d2/d3/foo.html");
- client ("http://" + server.getAuthority() + "/ASD/d3/x.html");
- client ("http://" + server.getAuthority() + "/biz/d3/x.html");
- client ("http://" + server.getAuthority() + "/bar/d3/x.html");
- client ("http://" + server.getAuthority() + "/fuzz/d3/x.html");
+ client ("http://localhost:"+server.getLocalPort()+"/d1/d2/d3/foo.html");
+ client ("http://localhost:"+server.getLocalPort()+"/ASD/d3/x.html");
+ client ("http://localhost:"+server.getLocalPort()+"/biz/d3/x.html");
+ client ("http://localhost:"+server.getLocalPort()+"/bar/d3/x.html");
+ client ("http://localhost:"+server.getLocalPort()+"/fuzz/d3/x.html");
} catch (Exception e) {
if (server != null) {
server.terminate();
diff --git a/jdk/test/java/net/BindException/Test.java b/jdk/test/java/net/BindException/Test.java
index ab13b083ff..03a7e83bdb 100644
--- a/jdk/test/java/net/BindException/Test.java
+++ b/jdk/test/java/net/BindException/Test.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
/*
* @test
* @bug 4417734
- * @key intermittent
* @summary Test that we get a BindException in all expected combinations
*/
import java.net.*;
diff --git a/jdk/test/java/net/HttpURLConnection/UnmodifiableMaps.java b/jdk/test/java/net/HttpURLConnection/UnmodifiableMaps.java
index 64c63729e1..c8c6e1b54f 100644
--- a/jdk/test/java/net/HttpURLConnection/UnmodifiableMaps.java
+++ b/jdk/test/java/net/HttpURLConnection/UnmodifiableMaps.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,11 @@
/**
* @test
* @bug 7128648
- * @library /lib/testlibrary
* @modules jdk.httpserver
* @summary HttpURLConnection.getHeaderFields should return an unmodifiable Map
*/
import java.io.IOException;
-import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.HttpURLConnection;
@@ -43,7 +41,6 @@ import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import com.sun.net.httpserver.Headers;
import static java.net.Proxy.NO_PROXY;
-import jdk.testlibrary.net.URIBuilder;
public class UnmodifiableMaps {
@@ -51,12 +48,7 @@ public class UnmodifiableMaps {
HttpServer server = startHttpServer();
try {
InetSocketAddress address = server.getAddress();
- URI uri = URIBuilder.newBuilder()
- .scheme("http")
- .host(address.getAddress())
- .port(address.getPort())
- .path("/foo")
- .build();
+ URI uri = new URI("http://localhost:" + address.getPort() + "/foo");
doClient(uri);
} finally {
server.stop(0);
@@ -86,8 +78,7 @@ public class UnmodifiableMaps {
// HTTP Server
HttpServer startHttpServer() throws IOException {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- HttpServer httpServer = HttpServer.create(new InetSocketAddress(loopback, 0), 0);
+ HttpServer httpServer = HttpServer.create(new InetSocketAddress(0), 0);
httpServer.createContext("/foo", new SimpleHandler());
httpServer.start();
return httpServer;
@@ -155,3 +146,4 @@ public class UnmodifiableMaps {
System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
if (failed > 0) throw new AssertionError("Some tests failed");}
}
+
diff --git a/jdk/test/java/net/ResponseCache/ResponseCacheTest.java b/jdk/test/java/net/ResponseCache/ResponseCacheTest.java
index cf43274041..57d87c0449 100644
--- a/jdk/test/java/net/ResponseCache/ResponseCacheTest.java
+++ b/jdk/test/java/net/ResponseCache/ResponseCacheTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
/* @test
* @summary Unit test for java.net.ResponseCache
* @bug 4837267
- * @library /lib/testlibrary
* @author Yingxian Wang
*/
@@ -33,7 +32,6 @@ import java.util.*;
import java.io.*;
import sun.net.www.ParseUtil;
import javax.net.ssl.*;
-import jdk.testlibrary.net.URIBuilder;
/**
* Request should get serviced by the cache handler. Response get
@@ -93,17 +91,14 @@ public class ResponseCacheTest implements Runnable {
try { fis.close(); } catch (IOException unused) {}
}
}
- static class NameVerifier implements HostnameVerifier {
+static class NameVerifier implements HostnameVerifier {
public boolean verify(String hostname, SSLSession session) {
return true;
}
}
ResponseCacheTest() throws Exception {
/* start the server */
- InetAddress loopback = InetAddress.getLoopbackAddress();
- ss = new ServerSocket();
- ss.bind(new InetSocketAddress(loopback, 0));
-
+ ss = new ServerSocket(0);
(new Thread(this)).start();
/* establish http connection to server */
url1 = new URL("http://localhost/file1.cache");
@@ -132,12 +127,8 @@ public class ResponseCacheTest implements Runnable {
http.disconnect();
// testing ResponseCacheHandler.put()
- url2 = URIBuilder.newBuilder()
- .scheme("http")
- .host(ss.getInetAddress())
- .port(ss.getLocalPort())
- .path("/file2.1")
- .toURL();
+ url2 = new URL("http://localhost:" +
+ Integer.toString(ss.getLocalPort())+"/file2.1");
http = (HttpURLConnection)url2.openConnection();
System.out.println("responsecode2 is :"+http.getResponseCode());
Map<String,List<String>> headers2 = http.getHeaderFields();
diff --git a/jdk/test/java/net/Socket/GetLocalAddress.java b/jdk/test/java/net/Socket/GetLocalAddress.java
index aade594df7..3133f92ca5 100644
--- a/jdk/test/java/net/Socket/GetLocalAddress.java
+++ b/jdk/test/java/net/Socket/GetLocalAddress.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,8 +45,7 @@ public class GetLocalAddress implements Runnable {
int linger = 65546;
int value = 0;
addr = InetAddress.getLocalHost();
- ss = new ServerSocket();
- ss.bind(new InetSocketAddress(addr, 0));
+ ss = new ServerSocket(0);
port = ss.getLocalPort();
Thread t = new Thread(new GetLocalAddress());
diff --git a/jdk/test/java/net/Socket/SetReceiveBufferSize.java b/jdk/test/java/net/Socket/SetReceiveBufferSize.java
index 00a5d396bd..3f848f1fee 100644
--- a/jdk/test/java/net/Socket/SetReceiveBufferSize.java
+++ b/jdk/test/java/net/Socket/SetReceiveBufferSize.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,6 @@
*
*/
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.ServerSocket;
@@ -39,10 +37,8 @@ public class SetReceiveBufferSize {
}
public SetReceiveBufferSize() throws Exception {
- ServerSocket ss = new ServerSocket();
- InetAddress loopback = InetAddress.getLoopbackAddress();
- ss.bind(new InetSocketAddress(loopback, 0));
- Socket s = new Socket(loopback, ss.getLocalPort());
+ ServerSocket ss = new ServerSocket(0);
+ Socket s = new Socket("localhost", ss.getLocalPort());
Socket accepted = ss.accept();
try {
s.setReceiveBufferSize(0);
diff --git a/jdk/test/java/net/Socket/SoTimeout.java b/jdk/test/java/net/Socket/SoTimeout.java
index 5432c392bf..9c2204746d 100644
--- a/jdk/test/java/net/Socket/SoTimeout.java
+++ b/jdk/test/java/net/Socket/SoTimeout.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,8 +44,7 @@ public class SoTimeout implements Runnable {
public static void main(String[] args) throws Exception {
addr = InetAddress.getLocalHost();
- serverSocket = new ServerSocket();
- serverSocket.bind(new InetSocketAddress(addr, 0));
+ serverSocket = new ServerSocket(0);
port = serverSocket.getLocalPort();
byte[] b = new byte[12];
diff --git a/jdk/test/java/net/Socket/TestAfterClose.java b/jdk/test/java/net/Socket/TestAfterClose.java
index 9da1364e2f..a3f819c0df 100644
--- a/jdk/test/java/net/Socket/TestAfterClose.java
+++ b/jdk/test/java/net/Socket/TestAfterClose.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -36,9 +36,8 @@ public class TestAfterClose
public static void main(String[] args) {
try {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- ServerSocket ss = new ServerSocket(0, 0, loopback);
- Socket socket = new Socket(loopback, ss.getLocalPort());
+ ServerSocket ss = new ServerSocket(0, 0, null);
+ Socket socket = new Socket("localhost", ss.getLocalPort());
ss.accept();
ss.close();
test(socket);
diff --git a/jdk/test/java/net/Socket/UrgentDataTest.java b/jdk/test/java/net/Socket/UrgentDataTest.java
index 4664415027..198712ebbe 100644
--- a/jdk/test/java/net/Socket/UrgentDataTest.java
+++ b/jdk/test/java/net/Socket/UrgentDataTest.java
@@ -53,12 +53,10 @@ public class UrgentDataTest {
try {
UrgentDataTest test = new UrgentDataTest ();
if (args.length == 0) {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- test.listener = new ServerSocket ();
- test.listener.bind(new InetSocketAddress(loopback, 0));
+ test.listener = new ServerSocket (0);
test.isClient = true;
test.isServer = true;
- test.clHost = loopback.getHostAddress();
+ test.clHost = "127.0.0.1";
test.clPort = test.listener.getLocalPort();
test.run();
} else if (args[0].equals ("-server")) {
diff --git a/jdk/test/java/net/URL/GetContent.java b/jdk/test/java/net/URL/GetContent.java
index 5efe6cfdc8..70dbf219bd 100644
--- a/jdk/test/java/net/URL/GetContent.java
+++ b/jdk/test/java/net/URL/GetContent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,11 @@
/**
* @test
* @bug 4145315
- * @library /lib/testlibrary
* @summary Test a read from nonexistant URL
*/
import java.net.*;
import java.io.*;
-import jdk.testlibrary.net.URIBuilder;
public class GetContent implements Runnable {
@@ -73,12 +71,10 @@ public class GetContent implements Runnable {
boolean error = true;
try {
- java.net.URL url = URIBuilder.newBuilder()
- .scheme("http")
- .host(ss.getInetAddress())
- .port(ss.getLocalPort())
- .path("/no-such-name")
- .toURL();
+ String name = "http://localhost:" + ss.getLocalPort() +
+ "/no-such-name";
+ java.net.URL url = null;
+ url = new java.net.URL(name);
Object obj = url.getContent();
InputStream in = (InputStream) obj;
byte buff[] = new byte[200];
diff --git a/jdk/test/java/net/URLConnection/B5052093.java b/jdk/test/java/net/URLConnection/B5052093.java
index 3af5cf1e11..be1f23ff31 100644
--- a/jdk/test/java/net/URLConnection/B5052093.java
+++ b/jdk/test/java/net/URLConnection/B5052093.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,10 +63,9 @@ public class B5052093 implements HttpCallback {
}
public static void main(String[] args) throws Exception {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- server = new TestHttpServer(new B5052093(), 1, 10, loopback, 0);
+ server = new TestHttpServer(new B5052093(), 1, 10, 0);
try {
- URL url = new URL("http://" + server.getAuthority() + "/foo");
+ URL url = new URL("http://localhost:"+server.getLocalPort()+"/foo");
URLConnection conn = url.openConnection();
int i = conn.getContentLength();
long l = conn.getContentLengthLong();
diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java
index d14ae3fec7..5c8e53f5d0 100644
--- a/jdk/test/java/nio/file/FileStore/Basic.java
+++ b/jdk/test/java/nio/file/FileStore/Basic.java
@@ -25,7 +25,7 @@
* @bug 4313887 6873621 6979526 7006126 7020517
* @summary Unit test for java.nio.file.FileStore
* @key intermittent
- * @library .. /lib/testlibrary /test/lib
+ * @library .. /lib/testlibrary
* @build jdk.testlibrary.FileUtils
* @run main Basic
*/
@@ -36,7 +36,6 @@ import java.io.File;
import java.io.IOException;
import java.util.*;
import jdk.testlibrary.FileUtils;
-import jdk.test.lib.Platform;
public class Basic {
@@ -135,16 +134,6 @@ public class Basic {
// reflect whether the space attributes would be accessible
// were access to be permitted
System.err.format("%s is inaccessible\n", store);
- } catch (FileSystemException fse) {
- // On Linux, ignore the FSE if the path is one of the
- // /run/user/$UID mounts created by pam_systemd(8) as it
- // might be mounted as a fuse.portal filesystem and
- // its access attempt might fail with EPERM
- if (!Platform.isLinux() || store.toString().indexOf("/run/user") == -1) {
- throw new RuntimeException(fse);
- } else {
- System.err.format("%s error: %s\n", store, fse);
- }
}
// two distinct FileStores should not be equal
diff --git a/jdk/test/java/security/cert/CertPathValidator/OCSP/AIACheck.java b/jdk/test/java/security/cert/CertPathValidator/OCSP/AIACheck.java
index 8563f13e19..8c6e0458b3 100644
--- a/jdk/test/java/security/cert/CertPathValidator/OCSP/AIACheck.java
+++ b/jdk/test/java/security/cert/CertPathValidator/OCSP/AIACheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
*/
import java.io.*;
-import java.net.*;
+import java.net.SocketException;
import java.util.*;
import java.security.Security;
import java.security.cert.*;
@@ -94,9 +94,7 @@ public class AIACheck {
throw new Exception("Successfully validated an invalid path");
} catch (CertPathValidatorException e ) {
- Throwable rootCause = e.getCause();
- if (!(rootCause instanceof SocketException ||
- rootCause instanceof SocketTimeoutException)) {
+ if (! (e.getCause() instanceof SocketException)) {
throw e;
}
diff --git a/jdk/test/java/util/TimeZone/TimeZoneData/VERSION b/jdk/test/java/util/TimeZone/TimeZoneData/VERSION
index 2f72d7dbcb..750d9fae2b 100644
--- a/jdk/test/java/util/TimeZone/TimeZoneData/VERSION
+++ b/jdk/test/java/util/TimeZone/TimeZoneData/VERSION
@@ -1 +1 @@
-tzdata2026a
+tzdata2025b
diff --git a/jdk/test/javax/sound/midi/BulkSoundBank/BulkSoundBank.java b/jdk/test/javax/sound/midi/BulkSoundBank/BulkSoundBank.java
deleted file mode 100644
index 259b5b5283..0000000000
--- a/jdk/test/javax/sound/midi/BulkSoundBank/BulkSoundBank.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import javax.sound.midi.InvalidMidiDataException;
-import javax.sound.midi.MidiSystem;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-
-/**
- * @test
- * @bug 8350813
- * @summary Rendering of bulky sound bank from MIDI sequence can cause OutOfMemoryError.
- * @run main/othervm -Xmx1g BulkSoundBank
- */
-
-public class BulkSoundBank {
- static final byte[] midi = {77, 84, 104, 100, 0, 0, 0, 6, 0, 0, 0, 1, 1,
- -32, 77, 84, 114, 107, 0, 0, 0, 50, 0, -1, 88, 4, 4, 2, 24, 8, 0, -1,
- 81, 3, 7, -95, 32, 0, -112, 60, 64, -125, 96, -128, 60, 64, -125, -44,
- -51, 32, -112, 48, 64, 1, -128, 48, 64, -127, -64, -45, 127, -112, 60,
- 64, 1, -128, 60, 64, 0, -1, 47, 0};
-
- public static void main(String[] args) throws IOException {
- try (ByteArrayInputStream bis = new ByteArrayInputStream(midi)) {
- MidiSystem.getSoundbank(bis);
- throw new RuntimeException("Test should throw InvalidMidiDataException"
- + " but it did not.");
- } catch (InvalidMidiDataException imda) {
- System.out.println("Caught InvalidMidiDataException as expected");
- }
- }
-}
-
diff --git a/jdk/test/jdk/internal/platform/cgroup/TestCgroupMetrics.java b/jdk/test/jdk/internal/platform/cgroup/TestCgroupMetrics.java
index 3004acaeca..c6bdaf1823 100644
--- a/jdk/test/jdk/internal/platform/cgroup/TestCgroupMetrics.java
+++ b/jdk/test/jdk/internal/platform/cgroup/TestCgroupMetrics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
/*
* @test
- * @requires os.family == "linux"
* @library /test/lib /
* @run main TestCgroupMetrics
*/
diff --git a/jdk/test/jdk/internal/platform/docker/TestDockerMemoryMetrics.java b/jdk/test/jdk/internal/platform/docker/TestDockerMemoryMetrics.java
index af841fde16..9b05e42928 100644
--- a/jdk/test/jdk/internal/platform/docker/TestDockerMemoryMetrics.java
+++ b/jdk/test/jdk/internal/platform/docker/TestDockerMemoryMetrics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@ import jdk.test.lib.process.OutputAnalyzer;
/*
* @test
- * @requires os.family == "linux"
* @summary Test JDK Metrics class when running inside docker container
* @library /test/lib /
* @build MetricsMemoryTester
@@ -109,23 +108,6 @@ public class TestDockerMemoryMetrics {
private static void testMemoryFailCount(String value) throws Exception {
Common.logNewTestCase("testMemoryFailCount" + value);
-
- // Check whether swapping really works for this test
- // On some systems there is no swap space enabled. And running
- // 'java -Xms{mem-limit} -Xmx{mem-limit} -version' would fail due to swap space size being 0.
- DockerRunOptions preOpts =
- new DockerRunOptions(imageName, "/jdk/bin/java", "-version");
- preOpts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/")
- .addDockerOpts("--memory=" + value)
- .addJavaOpts("-Xms" + value)
- .addJavaOpts("-Xmx" + value);
- OutputAnalyzer oa = DockerTestUtils.dockerRunJava(preOpts);
- String output = oa.getOutput();
- if (!output.contains("version")) {
- System.out.println("Swapping doesn't work for this test.");
- return;
- }
-
DockerRunOptions opts =
new DockerRunOptions(imageName, "/jdk/bin/java", "MetricsMemoryTester");
opts.addDockerOpts("--volume", Utils.TEST_CLASSES + ":/test-classes/")
@@ -133,13 +115,7 @@ public class TestDockerMemoryMetrics {
.addJavaOpts("-Xmx" + value)
.addJavaOpts("-cp", "/test-classes/")
.addClassOptions("failcount");
- oa = DockerTestUtils.dockerRunJava(opts);
- output = oa.getOutput();
- if (output.contains("Ignoring test")) {
- System.out.println("Ignored by the tester");
- return;
- }
- oa.shouldHaveExitValue(0).shouldContain("TEST PASSED!!!");
+ DockerTestUtils.dockerRunJava(opts).shouldHaveExitValue(0).shouldContain("TEST PASSED!!!");
}
private static void testMemoryAndSwapLimit(String memory, String memandswap) throws Exception {
diff --git a/jdk/test/jdk/internal/platform/docker/TestSystemMetrics.java b/jdk/test/jdk/internal/platform/docker/TestSystemMetrics.java
index 7fc648662e..1c1129e35b 100644
--- a/jdk/test/jdk/internal/platform/docker/TestSystemMetrics.java
+++ b/jdk/test/jdk/internal/platform/docker/TestSystemMetrics.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,6 @@
/*
* @test
- * @requires os.family == "linux"
* @summary Test JDK Metrics class when running inside docker container
* @library /test/lib
* @run main TestSystemMetrics
diff --git a/jdk/test/lib/testlibrary/jdk/testlibrary/net/URIBuilder.java b/jdk/test/lib/testlibrary/jdk/testlibrary/net/URIBuilder.java
index 0f4a037888..78844678e5 100644
--- a/jdk/test/lib/testlibrary/jdk/testlibrary/net/URIBuilder.java
+++ b/jdk/test/lib/testlibrary/jdk/testlibrary/net/URIBuilder.java
@@ -61,12 +61,6 @@ public class URIBuilder {
return this;
}
- public URIBuilder host(InetAddress address) {
- String hostaddr = address.isAnyLocalAddress()
- ? "localhost" : address.getHostAddress();
- return host(hostaddr);
- }
-
public URIBuilder loopback() {
return host(InetAddress.getLoopbackAddress().getHostAddress());
}
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
index 287ccda2d0..b3de63042a 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 4858522 8174734
+ * @bug 4858522
* @summary Basic unit test of HotspotRuntimeMBean.getSafepointSyncTime()
* @author Steve Bohne
*/
@@ -41,71 +41,50 @@ public class GetSafepointSyncTime {
private static final long NUM_THREAD_DUMPS = 300;
- static void checkPositive(long value, String label) {
- if (value < 0)
- throw new RuntimeException(label + " had a negative value of "
- + value);
- }
-
- static void validate(long count1, long count2, long time1, long time2,
- String label) {
- checkPositive(count1, label + ":count1");
- checkPositive(count2, label + ":count2");
- checkPositive(time1, label + ":time1");
- checkPositive(time2, label + ":time2");
-
- long countDiff = count2 - count1;
- long timeDiff = time2 - time1;
-
- if (countDiff < NUM_THREAD_DUMPS) {
- throw new RuntimeException(label +
- ": Expected at least " + NUM_THREAD_DUMPS +
- " safepoints but only got " + countDiff);
- }
-
- // getSafepointSyncTime is the accumulated time spent getting to a
- // safepoint, so each safepoint will add a little to this, but the
- // resolution is only milliseconds so we may not see it.
- if (timeDiff < 0) {
- throw new RuntimeException(label + ": Safepoint sync time " +
- "decreased unexpectedly " +
- "(time1 = " + time1 + "; " +
- "time2 = " + time2 + ")");
- }
-
- System.out.format("%s: Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
- label, count2, countDiff, time2, timeDiff);
-
- }
+ // Careful with these values.
+ private static final long MIN_VALUE_FOR_PASS = 1;
+ private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
public static void main(String args[]) throws Exception {
long count = mbean.getSafepointCount();
- long time = mbean.getSafepointSyncTime();
-
- checkPositive(count, "count");
- checkPositive(time, "time");
-
- // Thread.getAllStackTraces() should cause a safepoint.
+ long value = mbean.getSafepointSyncTime();
+ // Thread.getAllStackTraces() should cause safepoints.
+ // If this test is failing because it doesn't,
+ // MIN_VALUE_FOR_PASS should be reset to 0
for (int i = 0; i < NUM_THREAD_DUMPS; i++) {
Thread.getAllStackTraces();
}
long count1 = mbean.getSafepointCount();
- long time1 = mbean.getSafepointSyncTime();
+ long value1 = mbean.getSafepointSyncTime();
- validate(count, count1, time, time1, "Pass 1");
+ System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
+ count1, count1-count, value1, value1-value);
- // repeat the experiment
+ if (value1 < MIN_VALUE_FOR_PASS || value1 > MAX_VALUE_FOR_PASS) {
+ throw new RuntimeException("Safepoint sync time " +
+ "illegal value: " + value1 + " ms " +
+ "(MIN = " + MIN_VALUE_FOR_PASS + "; " +
+ "MAX = " + MAX_VALUE_FOR_PASS + ")");
+ }
for (int i = 0; i < NUM_THREAD_DUMPS; i++) {
Thread.getAllStackTraces();
}
long count2 = mbean.getSafepointCount();
- long time2 = mbean.getSafepointSyncTime();
+ long value2 = mbean.getSafepointSyncTime();
+
+ System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
+ count2, count2-count1, value2, value2-value1);
- validate(count1, count2, time1, time2, "Pass 2");
+ if (value2 <= value1) {
+ throw new RuntimeException("Safepoint sync time " +
+ "did not increase " +
+ "(value1 = " + value1 + "; " +
+ "value2 = " + value2 + ")");
+ }
System.out.println("Test passed.");
}
diff --git a/jdk/test/sun/net/ftp/TestFtpClientNameListWithNull.java b/jdk/test/sun/net/ftp/TestFtpClientNameListWithNull.java
index e89439cd57..7a142f628c 100644
--- a/jdk/test/sun/net/ftp/TestFtpClientNameListWithNull.java
+++ b/jdk/test/sun/net/ftp/TestFtpClientNameListWithNull.java
@@ -37,7 +37,6 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
-import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
@@ -53,8 +52,7 @@ public class TestFtpClientNameListWithNull {
FtpClient client = FtpClient.create()) {
(new Thread(server)).start();
int port = server.getPort();
- InetAddress loopback = InetAddress.getLoopbackAddress();
- client.connect(new InetSocketAddress(loopback, port));
+ client.connect(new InetSocketAddress("localhost", port));
client.nameList(null);
} finally {
if (commandHasArgs) {
@@ -68,9 +66,7 @@ public class TestFtpClientNameListWithNull {
private final ServerSocket serverSocket;
FtpServer() throws IOException {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- serverSocket = new ServerSocket();
- serverSocket.bind(new InetSocketAddress(loopback, 0));
+ serverSocket = new ServerSocket(0);
}
public void handleClient(Socket client) throws IOException {
diff --git a/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java b/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java
index 71b8660e4e..5bbd578146 100644
--- a/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java
+++ b/jdk/test/sun/net/www/http/HttpClient/ProxyTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -126,9 +126,7 @@ public class ProxyTest {
}
public HttpProxyServer() throws IOException {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- server = new ServerSocket();
- server.bind(new InetSocketAddress(loopback, 0));
+ server = new ServerSocket(0);
}
public int getPort() {
@@ -185,8 +183,7 @@ public class ProxyTest {
server.start();
int port = server.getPort();
- InetAddress loopback = InetAddress.getLoopbackAddress();
- Proxy ftpProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(loopback, port));
+ Proxy ftpProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", port));
URL url = new URL(testURL);
InputStream ins = (url.openConnection(ftpProxy)).getInputStream();
in = new BufferedReader(new InputStreamReader(ins));
diff --git a/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java b/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java
index 5228c905a3..07d353cba8 100644
--- a/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java
+++ b/jdk/test/sun/net/www/http/HttpURLConnection/PostOnDelete.java
@@ -80,13 +80,6 @@ public class PostOnDelete {
server.start();
}
- public String getAuthority() {
- InetAddress address = server.getAddress().getAddress();
- String hostaddr = address.isAnyLocalAddress() ? "localhost" : address.getHostAddress();
- hostaddr = (hostaddr.indexOf(':') >= 0) ? ("[" + hostaddr + "]") : hostaddr;
- return hostaddr + ":" + getPort();
- }
-
public int getPort() {
return server.getAddress().getPort();
}
diff --git a/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java b/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java
index e0ef3db957..afea35e48b 100644
--- a/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java
+++ b/jdk/test/sun/net/www/http/KeepAliveCache/KeepAliveProperty.java
@@ -40,7 +40,6 @@ import static java.net.Proxy.NO_PROXY;
public class KeepAliveProperty {
static volatile boolean pass = false;
- static Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection");
static class Server extends Thread {
final ServerSocket server;
@@ -139,6 +138,7 @@ public class KeepAliveProperty {
public static void main(String args[]) throws Exception {
// exercise the logging code
+ Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection");
logger.setLevel(Level.FINEST);
ConsoleHandler h = new ConsoleHandler();
h.setLevel(Level.FINEST);
@@ -171,7 +171,6 @@ public class KeepAliveProperty {
if (!expectClose)
throw e;
}
- s.join();
if (!pass)
throw new RuntimeException("Failed in server");
diff --git a/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java b/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java
index 7b972c3415..d2f5490e9e 100644
--- a/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java
+++ b/jdk/test/sun/net/www/http/KeepAliveStream/KeepAliveStreamClose.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -25,13 +25,11 @@
* @test
* @bug 4392195
* @summary Infinite loop in sun.net.www.http.KeepAliveStream [due to skip()]
- * @library /lib/testlibrary
* @run main/othervm/timeout=30 KeepAliveStreamClose
*/
import java.net.*;
import java.io.*;
-import jdk.testlibrary.net.URIBuilder;
public class KeepAliveStreamClose {
static class XServer extends Thread {
@@ -80,16 +78,11 @@ public class KeepAliveStreamClose {
public static void main (String[] args) {
try {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- ServerSocket serversocket = new ServerSocket (0, 50, loopback);
+ ServerSocket serversocket = new ServerSocket (0);
int port = serversocket.getLocalPort ();
XServer server = new XServer (serversocket);
server.start ();
- URL url = URIBuilder.newBuilder()
- .scheme("http")
- .loopback()
- .port(port)
- .toURL();
+ URL url = new URL ("http://localhost:"+port);
URLConnection urlc = url.openConnection ();
InputStream is = urlc.getInputStream ();
int i=0, c;
diff --git a/jdk/test/sun/net/www/httptest/TestHttpServer.java b/jdk/test/sun/net/www/httptest/TestHttpServer.java
index 0802b71f77..13f2098915 100644
--- a/jdk/test/sun/net/www/httptest/TestHttpServer.java
+++ b/jdk/test/sun/net/www/httptest/TestHttpServer.java
@@ -68,22 +68,6 @@ public class TestHttpServer {
this (cb, 1, 10, 0);
}
- /**
- * Create a <code>TestHttpServer<code> instance with the specified callback object
- * for handling requests. One thread is created to handle requests,
- * and up to ten TCP connections will be handled simultaneously.
- * @param cb the callback object which is invoked to handle each
- * incoming request
- * @param address the address to bind the server to. <code>Null</code>
- * means bind to the wildcard address.
- * @param port the port number to bind the server to. <code>Zero</code>
- * means choose any free port.
- */
-
- public TestHttpServer (HttpCallback cb, InetAddress address, int port) throws IOException {
- this (cb, 1, 10, address, 0);
- }
-
/**
* Create a <code>TestHttpServer<code> instance with the specified number of
* threads and maximum number of connections per thread. This functions
@@ -118,33 +102,9 @@ public class TestHttpServer {
*/
public TestHttpServer (HttpCallback cb, int threads, int cperthread, int port)
- throws IOException {
- this(cb, threads, cperthread, null, port);
- }
-
- /**
- * Create a <code>TestHttpServer<code> instance with the specified number
- * of threads and maximum number of connections per thread and running on
- * the specified port. The specified number of threads are created to
- * handle incoming requests, and each thread is allowed
- * to handle a number of simultaneous TCP connections.
- * @param cb the callback object which is invoked to handle
- * each incoming request
- * @param threads the number of threads to create to handle
- * requests in parallel
- * @param cperthread the number of simultaneous TCP connections
- * to handle per thread
- * @param address the address to bind the server to. <code>Null</code>
- * means bind to the wildcard address.
- * @param port the port number to bind the server to. <code>Zero</code>
- * means choose any free port.
- */
-
- public TestHttpServer (HttpCallback cb, int threads, int cperthread,
- InetAddress address, int port)
throws IOException {
schan = ServerSocketChannel.open ();
- InetSocketAddress addr = new InetSocketAddress (address, port);
+ InetSocketAddress addr = new InetSocketAddress (port);
schan.socket().bind (addr);
this.threads = threads;
this.cb = cb;
@@ -176,14 +136,6 @@ public class TestHttpServer {
return schan.socket().getLocalPort ();
}
- public String getAuthority() {
- InetAddress address = schan.socket().getInetAddress();
- String hostaddr = address.getHostAddress();
- if (address.isAnyLocalAddress()) hostaddr = "localhost";
- if (hostaddr.indexOf(':') > -1) hostaddr = "[" + hostaddr + "]";
- return hostaddr + ":" + getLocalPort();
- }
-
static class Server extends Thread {
ServerSocketChannel schan;
diff --git a/jdk/test/sun/net/www/protocol/http/B8012625.java b/jdk/test/sun/net/www/protocol/http/B8012625.java
index 7283009f84..c8c8ef0c03 100644
--- a/jdk/test/sun/net/www/protocol/http/B8012625.java
+++ b/jdk/test/sun/net/www/protocol/http/B8012625.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -72,8 +72,7 @@ public class B8012625 implements HttpHandler {
ExecutorService ex;
public B8012625 () throws Exception {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- server = HttpServer.create(new InetSocketAddress(loopback, 0), 10);
+ server = HttpServer.create(new InetSocketAddress(0), 10);
HttpContext ctx = server.createContext("/", this);
ex = Executors.newFixedThreadPool(5);
server.setExecutor(ex);
diff --git a/jdk/test/sun/net/www/protocol/http/Finalizer.java b/jdk/test/sun/net/www/protocol/http/Finalizer.java
index 2808bab939..6d6b33bc95 100644
--- a/jdk/test/sun/net/www/protocol/http/Finalizer.java
+++ b/jdk/test/sun/net/www/protocol/http/Finalizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -80,11 +80,8 @@ class XServer extends Thread {
public class Finalizer {
public static void main (String args[]) {
- ServerSocket serversocket = null;
try {
- InetAddress loopback = InetAddress.getLoopbackAddress();
- serversocket = new ServerSocket();
- serversocket.bind(new InetSocketAddress(loopback, 0));
+ ServerSocket serversocket = new ServerSocket (0);
int port = serversocket.getLocalPort ();
XServer server = new XServer (serversocket);
server.start ();
@@ -110,10 +107,6 @@ public class Finalizer {
} catch (IOException e) {
throw new RuntimeException("finalize method failure."+e);
} catch (InterruptedException ie) {
- } finally {
- if (serversocket != null) {
- try {serversocket.close();} catch (IOException io) {}
- }
}
}
diff --git a/jdk/test/sun/net/www/protocol/http/ResponseCacheStream.java b/jdk/test/sun/net/www/protocol/http/ResponseCacheStream.java
index b6a5a1f3e0..bff2a765d6 100644
--- a/jdk/test/sun/net/www/protocol/http/ResponseCacheStream.java
+++ b/jdk/test/sun/net/www/protocol/http/ResponseCacheStream.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -96,9 +96,8 @@ public class ResponseCacheStream implements HttpCallback {
public static void main(String[] args) throws Exception {
MyResponseCache cache = new MyResponseCache();
try {
- InetAddress loopback = InetAddress.getLoopbackAddress();
ResponseCache.setDefault(cache);
- server = new TestHttpServer (new ResponseCacheStream(), loopback, 0);
+ server = new TestHttpServer (new ResponseCacheStream());
System.out.println ("Server: listening on port: " + server.getLocalPort());
URL url = new URL ("http://127.0.0.1:"+server.getLocalPort()+"/");
System.out.println ("Client: connecting to " + url);
diff --git a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java
index 110179da3c..565138c143 100644
--- a/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java
+++ b/jdk/test/sun/net/www/protocol/https/HttpsURLConnection/CookieHandlerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,6 @@
/* @test
* @bug 4696506 4942650
* @summary Unit test for java.net.CookieHandler
- * @library /lib/testlibrary
* @run main/othervm CookieHandlerTest
*
* SunJSSE does not support dynamic system properties, no way to re-use
@@ -36,7 +35,6 @@ import java.net.*;
import java.util.*;
import java.io.*;
import javax.net.ssl.*;
-import jdk.testlibrary.net.URIBuilder;
public class CookieHandlerTest {
static Map<String,String> cookies;
@@ -80,12 +78,10 @@ public class CookieHandlerTest {
* to avoid infinite hangs.
*/
void doServerSide() throws Exception {
- InetAddress loopback = InetAddress.getLoopbackAddress();
SSLServerSocketFactory sslssf =
(SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
SSLServerSocket sslServerSocket =
- (SSLServerSocket) sslssf.createServerSocket();
- sslServerSocket.bind(new InetSocketAddress(loopback, serverPort));
+ (SSLServerSocket) sslssf.createServerSocket(serverPort);
serverPort = sslServerSocket.getLocalPort();
/*
@@ -155,11 +151,8 @@ public class CookieHandlerTest {
}
HttpsURLConnection http = null;
/* establish http connection to server */
- URL url = URIBuilder.newBuilder()
- .scheme("https")
- .loopback()
- .port(serverPort)
- .toURL();
+ String uri = "https://localhost:" + +serverPort ;
+ URL url = new URL(uri);
HttpsURLConnection.setDefaultHostnameVerifier(new NameVerifier());
http = (HttpsURLConnection)url.openConnection();
diff --git a/jdk/test/sun/security/krb5/NullStringToKey.java b/jdk/test/sun/security/krb5/NullStringToKey.java
deleted file mode 100644
index 07ca07e7fc..0000000000
--- a/jdk/test/sun/security/krb5/NullStringToKey.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-/*
- * @test
- * @bug 8343622
- * @summary KerberosKey created with null key bytes
- * @run main/othervm NullStringToKey
- */
-
-import javax.security.auth.kerberos.KerberosKey;
-import javax.security.auth.kerberos.KerberosPrincipal;
-import java.security.Security;
-import java.util.List;
-
-public class NullStringToKey {
- public static void main(String[] args) throws Exception {
-
- Security.removeProvider("SUN");
- Security.removeProvider("SunJCE");
-
- KerberosPrincipal name = new KerberosPrincipal("me@ME.COM");
- char[] pass = "password".toCharArray();
- for (String alg : new String[] {
- "aes128-cts-hmac-sha1-96", "aes256-cts-hmac-sha1-96"}) {
- System.out.println(alg);
- // Do not use Utils.runAndCheckException as it might call
- // MessageDigest.getInstance("MD5") at class initialization
- // and we have already removed the SUN provider.
- try {
- new KerberosKey(name, pass, alg);
- throw new RuntimeException("Didn't get expected exception");
- } catch (IllegalArgumentException e) {
- // expected
- System.out.println(e);
- }
- }
- }
-}
diff --git a/jdk/test/sun/security/krb5/RFC396xTest.java b/jdk/test/sun/security/krb5/RFC396xTest.java
index 5cee175727..76016c3881 100644
--- a/jdk/test/sun/security/krb5/RFC396xTest.java
+++ b/jdk/test/sun/security/krb5/RFC396xTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,6 @@ public class RFC396xTest {
public static void main(String[] args) throws Exception {
System.setProperty("sun.security.krb5.msinterop.des.s2kcharset",
"utf-8");
- DkCrypto.ALLOW_WEAK_PBKDF2_ITERATION_COUNT = true;
test();
}
diff --git a/jdk/test/sun/security/krb5/auto/DiffSaltParams.java b/jdk/test/sun/security/krb5/auto/DiffSaltParams.java
index c2a5df05d6..275b827098 100644
--- a/jdk/test/sun/security/krb5/auto/DiffSaltParams.java
+++ b/jdk/test/sun/security/krb5/auto/DiffSaltParams.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -35,11 +35,11 @@ public class DiffSaltParams {
OneKDC kdc = new OneKDC(null).writeJAASConf();
kdc.addPrincipal("user1", "user1pass".toCharArray(),
- "hello", new byte[]{0, 1, 0, 0});
+ "hello", new byte[]{0, 0, 1, 0});
kdc.addPrincipal("user2", "user2pass".toCharArray(),
"hello", null);
kdc.addPrincipal("user3", "user3pass".toCharArray(),
- null, new byte[]{0, 1, 0, 0});
+ null, new byte[]{0, 0, 1, 0});
kdc.addPrincipal("user4", "user4pass".toCharArray());
Context.fromUserPass("user1", "user1pass".toCharArray(), true);
diff --git a/jdk/test/sun/security/krb5/auto/KDC.java b/jdk/test/sun/security/krb5/auto/KDC.java
index 72658e5717..34dd482a2a 100644
--- a/jdk/test/sun/security/krb5/auto/KDC.java
+++ b/jdk/test/sun/security/krb5/auto/KDC.java
@@ -355,12 +355,11 @@ public class KDC {
name.indexOf('/') < 0 ?
PrincipalName.KRB_NT_UNKNOWN :
PrincipalName.KRB_NT_SRV_HST);
- int[] etypes = EType.getDefaults("default_tkt_enctypes");
- EncryptionKey[] keys = new EncryptionKey[etypes.length];
- for (int i = 0; i < etypes.length; i++) {
- keys[i] = keyForUser(pn, etypes[i], false);
- }
- ktab.addEntry(pn, keys, kvno, true);
+ ktab.addEntry(pn,
+ getSalt(pn),
+ pass,
+ kvno,
+ true);
} else {
nativeKdc.ktadd(name, tab);
}
@@ -658,7 +657,10 @@ public class KDC {
*/
private char[] getPassword(PrincipalName p, boolean server)
throws KrbException {
- String pn = nameOf(p);
+ String pn = p.toString();
+ if (p.getRealmString() == null) {
+ pn = pn + "@" + getRealm();
+ }
char[] pass = passwords.get(pn);
if (pass == null) {
throw new KrbException(server?
@@ -674,7 +676,10 @@ public class KDC {
* @return the salt
*/
protected String getSalt(PrincipalName p) {
- String pn = nameOf(p);
+ String pn = p.toString();
+ if (p.getRealmString() == null) {
+ pn = pn + "@" + getRealm();
+ }
if (salts.containsKey(pn)) {
return salts.get(pn);
}
@@ -704,7 +709,10 @@ public class KDC {
switch (etype) {
case EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96:
case EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96:
- String pn = nameOf(p);
+ String pn = p.toString();
+ if (p.getRealmString() == null) {
+ pn = pn + "@" + getRealm();
+ }
if (s2kparamses.containsKey(pn)) {
return s2kparamses.get(pn);
}
@@ -714,23 +722,6 @@ public class KDC {
}
}
- /**
- * Returns the name of a PrincipalName inside KDC dbs.
- * @param p the principal name
- * @return the name
- */
- private String nameOf(PrincipalName p) {
- String pn = p.toString();
- if (p.getRealmString() == null) {
- pn = pn + "@" + getRealm();
- }
- if (pn.startsWith("krbtgt/")) {
- // We always register krbtgt using REALM
- pn = "krbtgt/" + pn.substring(7).toUpperCase(Locale.ROOT);
- }
- return pn;
- }
-
/**
* Returns the key for a given principal of the given encryption type
* @param p the principal
diff --git a/jdk/test/sun/security/krb5/auto/UserIterCount.java b/jdk/test/sun/security/krb5/auto/UserIterCount.java
deleted file mode 100644
index 8dcf45267c..0000000000
--- a/jdk/test/sun/security/krb5/auto/UserIterCount.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * @test
- * @bug 8370615
- * @summary Improve Kerberos credentialing
- * @library /test/lib
- * @compile -XDignore.symbol.file UserIterCount.java
- * @run main/othervm -Dsun.net.spi.nameservice.provider.1=ns,mock UserIterCount
- */
-import sun.security.krb5.PrincipalName;
-
-public class UserIterCount {
-
- static class MyKDC extends OneKDC {
- public MyKDC() throws Exception {
- super(null);
- }
-
- @Override
- protected byte[] getParams(PrincipalName p, int etype) {
- if (etype == 18) {
- if (p.toString().startsWith(OneKDC.USER)) {
- return new byte[]{0, 0, 16, 01};
- } else {
- return new byte[]{0, 79, (byte)255, (byte)255};
- }
- } else {
- return super.getParams(p, etype);
- }
- }
- }
-
- public static void main(String[] args) throws Exception {
- new MyKDC().writeJAASConf();
- Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
- Context.fromUserPass(OneKDC.USER2, OneKDC.PASS2, false);
- }
-}
diff --git a/jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/Chunghwa.java b/jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/Chunghwa.java
deleted file mode 100644
index 8512640bb0..0000000000
--- a/jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/Chunghwa.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import javax.net.ssl.X509TrustManager;
-import java.io.File;
-import java.security.Security;
-import java.time.LocalDate;
-import java.time.ZoneOffset;
-import java.time.ZonedDateTime;
-import java.util.Date;
-
-/*
- * @test
- * @bug 8369282
- * @summary Check that TLS Server certificates chaining back to distrusted
- * Chunghwa root are invalid
- * @library /test/lib
- * @modules java.base/sun.security.validator
- * @run main/othervm Chunghwa after policyOn invalid
- * @run main/othervm Chunghwa after policyOff valid
- * @run main/othervm Chunghwa before policyOn valid
- * @run main/othervm Chunghwa before policyOff valid
- */
-
-public class Chunghwa {
-
- private static final String CERT_PATH = "chains" + File.separator + "chunghwa";
-
- // The ePKI root has a test certificate chain stored in a file
- // named "<root>-chain.pem".
- private static final String ROOT_TO_TEST = "chunghwaepkirootca";
-
- // Date after the restrictions take effect
- private static final ZonedDateTime DISTRUST_DATE =
- LocalDate.of(2026, 03, 18).atStartOfDay(ZoneOffset.UTC);
-
- public static void main(String[] args) throws Exception {
-
- Distrust distrust = new Distrust(args);
-
- X509TrustManager[] tms = new X509TrustManager[]{
- distrust.getTMF("PKIX", null),
- distrust.getTMF("SunX509", null)
- };
-
- Date notBefore = distrust.getNotBefore(DISTRUST_DATE);
- distrust.testCertificateChain(CERT_PATH, notBefore, tms, ROOT_TO_TEST);
- }
-}
diff --git a/jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/chunghwa/chunghwaepkirootca-chain.pem b/jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/chunghwa/chunghwaepkirootca-chain.pem
deleted file mode 100644
index fdaa6ee04d..0000000000
--- a/jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/chunghwa/chunghwaepkirootca-chain.pem
+++ /dev/null
@@ -1,50 +0,0 @@
-Owner: CN=HiPKI Root CA - G1,
- O="Chunghwa Telecom Co., Ltd.", C=TW
-Issuer: OU=ePKI Root Certification Authority,
- O="Chunghwa Telecom Co., Ltd.", C=TW
-Serial number: 23fba648360e15e92ba78aedb67a0ae5
-Valid from: Wed Dec 20 19:11:23 MST 2023 until: Tue Dec 19 08:59:59 MST 2034
-Certificate fingerprints:
- SHA1: 87:F1:DD:3B:8E:F1:E0:8C:A8:CA:CB:9B:CE:4E:26:5A:E4:4E:05:F2
- SHA256: 68:07:C9:72:35:C5:EC:60:90:26:9A:4B:5F:ED:FA:B4:69:86:E4:2F:4D:67:D2:ED:DD:CF:6E:45:CF:0D:FA:80
-Signature algorithm name: SHA256withRSA
-Subject Public Key Algorithm: 4096-bit RSA key
-Version: 3
-
------BEGIN CERTIFICATE-----
-MIIGjDCCBHSgAwIBAgIQI/umSDYOFekrp4rttnoK5TANBgkqhkiG9w0BAQsFADBe
-MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0
-ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe
-Fw0yMzEyMjEwMjExMjNaFw0zNDEyMTkxNTU5NTlaME8xCzAJBgNVBAYTAlRXMSMw
-IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEbMBkGA1UEAwwSSGlQ
-S0kgUm9vdCBDQSAtIEcxMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA
-9B5/UnMyDHPkvRN0o9QwqNCuS9i233VHZvR85zkEHmpwINJaR3JnVfSl6J3VHiGh
-8Ge6zCFovkRTv4354twvVcg3Px+kwJyz5HdcoEb+d/oaoDjq7Zpy3iu9lFc6uux5
-5199QmQ5eiY29yTw1S+6lZgRZq2XNdZ1AYDgr/SEYYwNHl98h5ZeQa/rh+r4XfEu
-iAU+TCK72h8q3VJGZDnzQs7ZngyzsHeXZJzA9KMuH5UHsBffMNsAGJZMoYFL3QRt
-U6M9/Aes1MU3guvklQgZKILSQjqj2FPseYlgSGDIcpJQ3AOPgz+yQlda22rpEZfd
-hSi8MEyr48KxRURHH+CKFgeW0iEPU8DtqX7UTuybCeyvQqww1r/REEXgphaypcXT
-T3OUM3ECoWqj1jOXTyFjHluP2cFeRXF3D4FdXyGarYPM+l7WjSNfGz1BryB1ZlpK
-9p/7qxj3ccC2HTHsOyDry+K49a6SsvfhhEvyovKTmiKe0xRvNlS9H15ZFblzqMF8
-b3ti6RZsR1pl8w4Rm0bZ/W3c1pzAtH2lsN0/Vm+h+fbkEkj9Bn8SV7apI09bA8Pg
-cSojt/ewsTu8mL3WmKgMa/aOEmem8rJY5AIJEzypuxC00jBF8ez3ABHfZfjcK0NV
-vxaXxA/VLGGEqnKG/uY6fsI/fe78LxQ+5oXdUG+3Se0CAwEAAaOCAVMwggFPMB8G
-A1UdIwQYMBaAFB4M97Zn8uGSJglFwFU5Lnc/QkqiMB0GA1UdDgQWBBTydxf6Xqj+
-9j1x1Wi6yUYMONivsDAOBgNVHQ8BAf8EBAMCAYYwQAYDVR0fBDkwNzA1oDOgMYYv
-aHR0cDovL2VjYS5oaW5ldC5uZXQvcmVwb3NpdG9yeS9DUkxfU0hBMi9DQS5jcmww
-gYIGCCsGAQUFBwEBBHYwdDA7BggrBgEFBQcwAoYvaHR0cDovL2VjYS5oaW5ldC5u
-ZXQvcmVwb3NpdG9yeS9DZXJ0cy9lQ0FHMS5jcnQwNQYIKwYBBQUHMAGGKWh0dHA6
-Ly9vY3NwLmVjYS5oaW5ldC5uZXQvT0NTUC9vY3NwRzFzaGEyMBIGA1UdEwEB/wQI
-MAYBAf8CAQEwIgYDVR0gBBswGTAIBgZngQwBAgIwDQYLKwYBBAGBtyNkAAMwDQYJ
-KoZIhvcNAQELBQADggIBACY9pps8fqk3p8Xqv/qr26I1aFA4jOEG3VWd2bqn68Y9
-InOMZozTMVh7iOnOfat7mEqn/RNhikvR5MOV3qAeg4gwgNb1OMuGltwfXWGiuGeT
-vhimsV6E2hhJFAmZyXtfuoV9vSrnr1a5pCWqhVYWSCvoAQ/8Kv0tATKbIe21CYXz
-NIo7O9QBSXt0BiaP9+CVQtJAYYuy2MNAcXgzgL4rownrYYAixhPmkxQE0Dt1gVbW
-s2htBLJGse0z1fJDblY0Zar4t2ly+kIScx5DhRrrd8XKMK0YvID9Ythb+ao8m7Wd
-Kymqr36benGL3GsvmSypLPlqZtfEqVITFhXwQiL8ruxoL+3WfNQJ09x0iV4xaP+E
-bZSLLVzIiyhU49YdFHaqKyAJQvzgF2Za3DOwQWlP7OngtUx0ScEGHsoo78AM+Y0T
-eLFxmr82kuyH18wZkUT9bLZlot11P2aC8VTprBGr+jEAMJjpmEjSA83ja/ttmqgh
-qjj29Jnw3Lgy91XIhzBFMxMYo+hhYeBRmBFWl5+Y5oxBgPVLZpDJvg2rKa8xdqim
-KgvF0DMKHntE0hhVy7JfUCnKovNQ0pf0NodLfjpqcCS2GBZ1mNcsW2MG2uBPANcn
-LRXmt7N4XX11mctQTADwt8yZZ+2HDrST4kghOz+FXgftrPBdtDtM0T6WJcHWR1uS
------END CERTIFICATE-----
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/VERSION b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
index a2974d757c..4bd54efbcd 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION
+++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2026a
+tzdata2025b
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/africa b/jdk/test/sun/util/calendar/zi/tzdata/africa
index 75ddbe88f7..af92bd5763 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/africa
+++ b/jdk/test/sun/util/calendar/zi/tzdata/africa
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2018-05-27):
#
@@ -138,9 +138,8 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia
-1:00 - -01
# Chad
-# Fort-Lamy was renamed to N’Djamena on 1973-04-06.
# Zone NAME STDOFF RULES FORMAT [UNTIL]
-Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # Fort-Lamy
+Zone Africa/Ndjamena 1:00:12 - LMT 1912 Jan 1 # N'Djamena
1:00 - WAT 1979 Oct 14
1:00 1:00 WAST 1980 Mar 8
1:00 - WAT
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/antarctica b/jdk/test/sun/util/calendar/zi/tzdata/antarctica
index ca6aac61b3..47f64f2cee 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/antarctica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/antarctica
@@ -26,10 +26,13 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
-# From Paul Eggert (2025-08-16):
-# To keep things manageable, list only locations occupied year-round; see
-# Antarctic Facilities Information
-# https://www.comnap.aq/antarctic-facilities-information
+# From Paul Eggert (1999-11-15):
+# To keep things manageable, we list only locations occupied year-round; see
+# COMNAP - Stations and Bases
+# http://www.comnap.aq/comnap/comnap.nsf/P/Stations/
+# and
+# Summary of the Peri-Antarctic Islands (1998-07-23)
+# http://www.spri.cam.ac.uk/bob/periant.htm
# for information.
# Unless otherwise specified, we have no time zone information.
@@ -164,7 +167,6 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13
# China - year-round bases
# Great Wall, King George Island, -6213-05858, since 1985-02-20
# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
-# Qinling, Inexpressible I, Terra Nova Bay, -7456+16343, since 2024-02-07
# France - year-round bases (also see "France & Italy")
#
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/asia b/jdk/test/sun/util/calendar/zi/tzdata/asia
index cc69802ddc..bfb50ca7a8 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/asia
+++ b/jdk/test/sun/util/calendar/zi/tzdata/asia
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2019-07-11):
#
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/australasia b/jdk/test/sun/util/calendar/zi/tzdata/australasia
index 31a1cef795..3703fc31cb 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/australasia
+++ b/jdk/test/sun/util/calendar/zi/tzdata/australasia
@@ -960,9 +960,9 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
# NOTES
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2018-11-18):
#
@@ -2011,7 +2011,6 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
# From Paul Eggert (2018-11-19):
# The 1921-01-15 introduction of standard time is in Shanks; it is also in
# "Standard Time Throughout the World", US National Bureau of Standards (1935),
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular406.pdf
# page 3, which does not give the UT offset. In response to a comment by
# Phake Nick I set the Nauru time of occupation by Japan to
# 1942-08-29/1945-09-08 by using dates from:
@@ -2079,10 +2078,9 @@ Zone Pacific/Efate 11:13:16 - LMT 1912 Jan 13 # Vila
# https://webspace.science.uu.nl/~gent0113/idl/idl_alaska_samoa.htm
# Although Shanks & Pottenger says they both switched to UT -11:30
-# in 1911, and to -11 in 1950, many earlier sources give -11
+# in 1911, and to -11 in 1950. many earlier sources give -11
# for American Samoa, e.g., the US National Bureau of Standards
# circular "Standard Time Throughout the World", 1932.
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular399.pdf
# Assume American Samoa switched to -11 in 1911, not 1950,
# and that after 1950 they agreed until (western) Samoa skipped a
# day in 2011. Assume also that the Samoas follow the US and New
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/etcetera b/jdk/test/sun/util/calendar/zi/tzdata/etcetera
index 30542fc811..b767fe871c 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/etcetera
+++ b/jdk/test/sun/util/calendar/zi/tzdata/etcetera
@@ -43,8 +43,7 @@
# which load the "UTC" file to handle seconds properly.
Zone Etc/UTC 0 - UTC
-# If leap second support is enabled, functions like gmtime
-# load the "GMT" file to handle leap seconds properly.
+# Functions like gmtime load the "GMT" file to handle leap seconds properly.
# Vanguard section, which works with most .zi parsers.
#Zone GMT 0 - GMT
# Rearguard section, for TZUpdater 2.3.2 and earlier.
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/europe b/jdk/test/sun/util/calendar/zi/tzdata/europe
index 62d0c7fdaf..43a9f4e1fe 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/europe
+++ b/jdk/test/sun/util/calendar/zi/tzdata/europe
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2017-02-10):
#
@@ -65,7 +65,7 @@
# <https://www.jstor.org/stable/1774359>. He writes:
# "It is requested that corrections and additions to these tables
# may be sent to Mr. John Milne, Royal Geographical Society,
-# Savile Row, London." Nowadays please see the file CONTRIBUTING.
+# Savile Row, London." Nowadays please email them to tz@iana.org.
#
# Byalokoz EL. New Counting of Time in Russia since July 1, 1919.
# This Russian-language source was consulted by Vladimir Karpinsky; see
@@ -77,7 +77,7 @@
# Десятая гос. тип., 1919.
# http://resolver.gpntb.ru/purl?docushare/dsweb/Get/Resource-2011/Byalokoz__E.L.__Novyy__schet__vremeni__v__techenie__sutok__izd__2(1).pdf
#
-# Brazil's Divisão de Serviços da Hora (DISHO)
+# Brazil's Divisão Serviço da Hora (DSHO),
# History of Summer Time
# <http://pcdsh01.on.br/HISTHV.htm>
# (1998-09-21, in Portuguese)
@@ -937,7 +937,7 @@ Rule Belgium 1922 1927 - Oct Sat>=1 23:00s 0 -
Rule Belgium 1923 only - Apr 21 23:00s 1:00 S
Rule Belgium 1924 only - Mar 29 23:00s 1:00 S
Rule Belgium 1925 only - Apr 4 23:00s 1:00 S
-# DISHO writes that a royal decree of 1926-02-22 specified the Sun following 3rd
+# DSH writes that a royal decree of 1926-02-22 specified the Sun following 3rd
# Sat in Apr (except if it's Easter, in which case it's one Sunday earlier),
# to Sun following 1st Sat in Oct, and that a royal decree of 1928-09-15
# changed the transition times to 02:00 GMT.
@@ -1064,19 +1064,9 @@ Zone Atlantic/Faroe -0:27:04 - LMT 1908 Jan 11 # Tórshavn
# Greenland
#
-# From Paul Eggert (2026-01-22):
-# During World War II, Greenland was effectively independent of Denmark and
-# observed daylight saving time. TIME, volume 37, page 23 (1941-04-21)
-# <https://time.com/archive/6770243/war-peace-greenlands-icy-mountains/> says,
-# "Penfield and West made their way to the U.S.'s most northerly consulate.
-# They were astonished to find that Greenlanders, with almost 24 hours of
-# sunlight a day during the summer, have daylight saving time."
-# As the details are unknown they are omitted from the data for now.
-#
+# From Paul Eggert (2004-10-31):
# During World War II, Germany maintained secret manned weather stations in
# East Greenland and Franz Josef Land, but we don't know their time zones.
-# Also, they're likely out of scope for the database
-# as we lack resources to track every bit of military activity.
# My source for this is Wilhelm Dege's book mentioned under Svalbard.
#
# From Paul Eggert (2017-12-10):
@@ -1343,13 +1333,6 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
# France
# Monaco
-# From Robert H. van Gent (2025-07-21):
-# The most recent issue of the Annuaire [par le Bureau des Longitudes]
-# on Gallica (2021) ... lists information for France
-# https://gallica.bnf.fr/ark:/12148/bpt6k9127672b/f52.item
-# From Paul Eggert (2025-07-21):
-# Go with the 2020 Annuaire (published 2021) except as noted below.
-
# From Ciro Discepolo (2000-12-20):
#
# Henri Le Corre, Régimes horaires pour le monde entier, Éditions
@@ -1411,6 +1394,7 @@ Zone Europe/Helsinki 1:39:49 - LMT 1878 May 31
# problems in Algiers, Monaco and Tunis.
#
+# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman.
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
Rule France 1916 only - Jun 14 23:00s 1:00 S
Rule France 1916 1919 - Oct Sun>=1 23:00s 0 -
@@ -1422,25 +1406,9 @@ Rule France 1920 only - Oct 23 23:00s 0 -
Rule France 1921 only - Mar 14 23:00s 1:00 S
Rule France 1921 only - Oct 25 23:00s 0 -
Rule France 1922 only - Mar 25 23:00s 1:00 S
-# From Robert H. van Gent (2025-07-22):
-# There is a curious history behind the erroneous date for the start of
-# daylight saving in France in 1923 as listed in the current issues of
-# the Annuaire du Bureau des Longitudes. [See:]
-# https://lists.iana.org/hyperkitty/list/tz@iana.org/message/MYQEJMSXO2AIEZ3UIXZKMTTAIPY7KNT2/
-# From Brian Inglis (2025-07-23):
-# Légifrance JORF No. 0073 du 15 mars 1922
-# https://www.legifrance.gouv.fr/jorf/jo/id/JORFCONT000000008324
-# Légifrance JORF No. 0139 du 25 mai 1923
-# https://www.legifrance.gouv.fr/jorf/jo/id/JORFCONT000000008416
-# From Paul Eggert (2025-07-23):
-# The latter specifies March's last Saturday at 23:00 to October's first
-# Saturday at 24:00, except that if neighboring allies agree the dates
-# can be moved to April's third Saturday and September's third Saturday.
-# Apparently spring 1923 was tricky. DISHO writes that in 1930,
-# because of Easter, the transitions were Apr 12 and Oct 5.
-# Use the 2020 Annuaire dates, except for spring 1923 where
-# Shanks & Pottenger's May 26 matches the dates given in the 1924 and
-# 1961-2001 issues of the Annuaire.
+# DSH writes that a law of 1923-05-24 specified 3rd Sat in Apr at 23:00 to 1st
+# Sat in Oct at 24:00; and that in 1930, because of Easter, the transitions
+# were Apr 12 and Oct 5. Go with Shanks & Pottenger.
Rule France 1922 1938 - Oct Sat>=1 23:00s 0 -
Rule France 1923 only - May 26 23:00s 1:00 S
Rule France 1924 only - Mar 29 23:00s 1:00 S
@@ -1990,6 +1958,7 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
# From Stepan Golosunov (2016-03-07):
# the act of the government of the Republic of Moldova Nr. 132 from 1990-05-04
+# http://lex.justice.md/viewdoc.php?action=view&view=doc&id=298782&lang=2
# ... says that since 1990-05-06 on the territory of the Moldavian SSR
# time would be calculated as the standard time of the second time belt
# plus one hour of the "summer" time. To implement that clocks would be
@@ -2044,61 +2013,9 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
# says the 2014-03-30 spring-forward transition was at 02:00 local time.
# Guess that since 1997 Moldova has switched one hour before the EU.
-# From Heitor David Pinto (2026-02-22):
-# Soviet Moldovan resolution 132 of 1990 defined the summer time period from
-# the last Sunday in March at 2:00 to the last Sunday in September at 3:00,
-# matching the dates used in most of Europe at the time:
-# https://web.archive.org/web/20211107050832/http://lex.justice.md/viewdoc.php?action=view&view=doc&id=298782&lang=1
-#
-# It seems that in 1996 Moldova changed the end date to October like most of
-# Europe, but kept the transitions at 2:00 and 3:00 rather than 1:00 UTC,
-# which would have been locally 3:00 and 4:00....
-#
-# The notices in the Moldovan government website and broadcaster showed the
-# transitions at 2:00 and 3:00 until 2021:
-# 2015 https://old.gov.md/en/node/7304
-# 2016 https://old.gov.md/en/node/12587
-# 2017 https://old.gov.md/en/node/20654
-# 2017 https://old.gov.md/en/content/moldova-upholds-winter-time-night-28-29-october
-# 2018 https://old.gov.md/en/content/moldova-switch-summer-time
-# 2018 https://old.gov.md/en/content/cabinet-ministers-informs-about-switch-winter-time-28-october
-# 2019 https://old.gov.md/en/content/moldova-switch-summer-time-31-march
-# 2019 https://old.gov.md/en/node/31122
-# 2020 https://old.gov.md/en/node/32771
-# 2020 https://old.gov.md/en/node/34497
-# 2021 https://trm.md/ro/social/moldova-trece-in-aceasta-noapte-la-ora-de-vara
-# 2021 https://trm.md/en/social/republica-moldova-trece-la-ora-de-iarna1
-#
-# However, since 2022, the notices showed the transitions at 3:00 and 4:00,
-# matching the EU rule at 1:00 UTC:
-# 2022 https://trm.md/en/social/in-acest-weekend-republica-moldova-trece-la-ora-de-vara
-# 2022 https://old.gov.md/en/content/moldova-switch-winter-time
-# 2023 https://moldova1.md/p/6587/ora-de-vara-2023-cum-schimbam-acele-ceasornicelor-si-cand-trecem-la-ora-de-vara
-# 2023 https://old.gov.md/en/node/46662
-# 2024 https://moldova1.md/p/26535/republica-moldova-trece-la-ora-de-vara-in-acest-weekend
-# 2024 https://moldova1.md/p/37768/republica-moldova-trece-in-aceasta-noapte-la-ora-de-iarna
-# 2025 https://moldova1.md/p/46349/republica-moldova-trece-la-ora-de-vara-pe-30-martie-cum-ne-afecteaza-si-ce-recomanda-medicii
-# 2025 https://moldova1.md/p/60469/republica-moldova-trece-la-ora-de-iarna-ceasurile-se-dau-inapoi-cu-o-ora
-#
-# It seems that the changes to the end date and transition times were just
-# done in practice without formally changing the resolution. In late 2025, the
-# government said that the Soviet resolution was still in force, and proposed
-# a new resolution to replace it and formally establish the EU rule:
-# ... based on the notices, it seems that in practice Moldova already
-# uses the EU rule since 2022. This was also the year when Moldova applied to
-# join the EU.
-#
-# From Robert Bastian (2026-02-26):
-# This has been approved and published in the government gazette:
-# https://monitorul.gov.md/ro/monitorul/view/pdf/3234/part/2#page=27
-#
-# From Paul Eggert (2026-02-24):
-# Also see Svetlana Rudenko, "Moldova abandons the 'Soviet era'", Logos Press,
-# 2026-02-21 <https://logos-pres.md/en/news/moldova-abandons-the-soviet-era/>.
-
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-Rule Moldova 1997 2021 - Mar lastSun 2:00 1:00 S
-Rule Moldova 1997 2021 - Oct lastSun 3:00 0 -
+Rule Moldova 1997 max - Mar lastSun 2:00 1:00 S
+Rule Moldova 1997 max - Oct lastSun 3:00 0 -
# Zone NAME STDOFF RULES FORMAT [UNTIL]
Zone Europe/Chisinau 1:55:20 - LMT 1880
@@ -2111,8 +2028,7 @@ Zone Europe/Chisinau 1:55:20 - LMT 1880
2:00 Russia EE%sT 1992
2:00 E-Eur EE%sT 1997
# See Romania commentary for the guessed 1997 transition to EU rules.
- 2:00 Moldova EE%sT 2022
- 2:00 EU EE%sT
+ 2:00 Moldova EE%sT
# Poland
@@ -2203,10 +2119,12 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
# all clocks therefore having to be advanced or set back correspondingly ...
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
-# From Tim Parenti (2024-07-01):
-# Decreto 1469 of 1915-03-30 ... had nothing to do with DST;
-# rather it regulated the sending of time signals.
-# But we do see linkage to Spain in the 1920s below.
+# From Tim Parenti (2024-07-01), per Paul Eggert (1999-01-30):
+# DSH writes in their history that Decreto 1469 of 1915-03-30 established
+# summer time and that, "despite" this, the change to the clocks was not done
+# every year, depending on what Spain did, because of railroad schedules.
+# In fact, that decree had nothing to do with DST; rather, it regulated the
+# sending of time signals. But we do see linkage to Spain in the 1920s below.
# https://dre.pt/dr/detalhe/decreto/1469-1915-285721
# https://dre.pt/application/conteudo/285721
#
@@ -2498,7 +2416,7 @@ Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
# Nine O'clock <http://www.nineoclock.ro/POL/1778pol.html>
# (1998-10-23) reports that the switch occurred at
# 04:00 local time in fall 1998. For lack of better info,
-# assume that Romania switched to EU rules in 1997,
+# assume that Romania and Moldova switched to EU rules in 1997,
# the same year as Bulgaria.
#
# Rule NAME FROM TO - IN ON AT SAVE LETTER/S
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab b/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
index ddcc841fe9..7fa350ecbe 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
+++ b/jdk/test/sun/util/calendar/zi/tzdata/iso3166.tab
@@ -26,22 +26,22 @@
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
-# From Paul Eggert (2025-07-01):
+# From Paul Eggert (2023-09-06):
# This file contains a table of two-letter country codes. Columns are
-# separated by a single tab. Lines beginning with ‘#’ are comments.
+# separated by a single tab. Lines beginning with '#' are comments.
# All text uses UTF-8 encoding. The columns of the table are as follows:
#
# 1. ISO 3166-1 alpha-2 country code, current as of
-# ISO/TC 46 N1127 (2024-02-29). See: ISO/TC 46 Documents
+# ISO/TC 46 N1108 (2023-04-05). See: ISO/TC 46 Documents
# https://www.iso.org/committee/48750.html?view=documents
# 2. The usual English name for the coded region. This sometimes
# departs from ISO-listed names, sometimes so that sorted subsets
-# of names are useful (e.g., “Samoa (American)” and “Samoa
-# (western)” rather than “American Samoa” and “Samoa”),
+# of names are useful (e.g., "Samoa (American)" and "Samoa
+# (western)" rather than "American Samoa" and "Samoa"),
# sometimes to avoid confusion among non-experts (e.g.,
-# “Czech Republic” and “Turkey” rather than “Czechia” and “Türkiye”),
-# and sometimes to omit needless detail or churn (e.g., “Netherlands”
-# rather than “Netherlands (the)” or “Netherlands (Kingdom of the)”).
+# "Czech Republic" and "Turkey" rather than "Czechia" and "Türkiye"),
+# and sometimes to omit needless detail or churn (e.g., "Netherlands"
+# rather than "Netherlands (the)" or "Netherlands (Kingdom of the)").
#
# The table is sorted by country code.
#
@@ -94,7 +94,7 @@ CD Congo (Dem. Rep.)
CF Central African Rep.
CG Congo (Rep.)
CH Switzerland
-CI Côte d’Ivoire
+CI Côte d'Ivoire
CK Cook Islands
CL Chile
CM Cameroon
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
index d431a7d360..042a32b052 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
+++ b/jdk/test/sun/util/calendar/zi/tzdata/leapseconds
@@ -28,8 +28,7 @@
# This file is generated automatically from the data in the public-domain
# NIST/IERS format leap-seconds.list file, which can be copied from
# <https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list>
-# or via a less-secure protocol and with different comments and
-# less volatile last-modified and expiration timestamps, from
+# or, in a variant with different comments, from
# <ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.list>.
# For more about leap-seconds.list, please see
# The NTP Timescale and Leap Seconds
@@ -93,17 +92,11 @@ Leap 2016 Dec 31 23:59:60 + S
# Any additional leap seconds will come after this.
# This Expires line is commented out for now,
# so that pre-2020a zic implementations do not reject this file.
-#Expires 2026 Dec 28 00:00:00
+#Expires 2025 Dec 28 00:00:00
-# Here are POSIX timestamps for the data in this file.
-# "#updated" gives the last time the leap seconds data changed
-# or, if this file was derived from the IERS leap-seconds.list,
-# the last time that file changed in any way.
-# "#expires" gives the first time this file might be wrong;
-# if this file was derived from the IERS leap-seconds.list,
-# this is typically a bit less than one year after "updated".
-#updated 1767698058 (2026-01-06 11:14:18 UTC)
-#expires 1798416000 (2026-12-28 00:00:00 UTC)
+# POSIX timestamps for the data in this file:
+#updated 1736208000 (2025-01-07 00:00:00 UTC)
+#expires 1766880000 (2025-12-28 00:00:00 UTC)
# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat)
-# File expires on 28 December 2026
+# File expires on 28 December 2025
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/northamerica b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
index b85a150a23..b0687f0fce 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica
@@ -29,9 +29,9 @@
# also includes Central America and the Caribbean
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (1999-03-22):
# A reliable and entertaining source about time zones is
@@ -1241,16 +1241,6 @@ Zone America/Menominee -5:50:27 - LMT 1885 Sep 18 12:00
# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
# Jimmy Skaggs, _The Great Guano Rush_ (1994).
-# From Rob van Gent (2025-07-23):
-# Another useful source for historical time zone information appears to be
-# a series of circulars with the title "Standard Time Throughout the World"
-# issued between 1925 and 1950 by the U.S. Bureau of Standards.
-# I found the following issues online:
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular280.pdf (1925)
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular399.pdf (1932)
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular406.pdf (1935)
-# https://nvlpubs.nist.gov/nistpubs/Legacy/circ/nbscircular496.pdf (1950)
-
################################################################################
@@ -2467,35 +2457,12 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# on the same dates or with a difference of one day.
# So it may be easier to implement these changes as DST with rule CA
# during this whole period.
-
-# From Alois Treindl (2025-07-29):
-# I did a quick newspaper archive research on https://hndm.iib.unam.mx/
-# and found that Periódico Oficial del Estado de Baja California Norte
-# (1973-04-20) states clearly that DST was observed from last Sunday
-# in April to last Sunday in October.... I have a few more data from the
-# official bulletin for DST begin or end in Baja California 1964 1967 1969
-# 1972 1973 (already sent) 1974 1975 1976 I do not know whether it is safe to
-# assume that it also applied in the years where I did not yet find proof.
-# The 1974 end of DST contains a reference to an Acuerdo of 1973-dec-20 which
-# I could not find.... One might assume that Baja California, which followed
-# US-CA in all these other yours, did the same.
-#
-# From Paul Eggert (2025-08-04):
-# Assume that Tijuana agreed with San Diego from 1953 through 1996,
-# as this agrees with Alois Treindl's data and with Shanks.
-# For now, keep the slightly-different 1948/1952 history for Baja California,
+#
+# From Paul Eggert (2024-08-18):
+# For now, maintain the slightly-different history for Baja California,
# as we have no information on whether 1948/1952 clocks in Tijuana followed
# the decrees or followed San Diego.
-# From Mark Schapiro, writing in The Nation (2002-10-28):
-# https://www.thenation.com/article/archive/sowing-disaster/
-# When Mexican clocks were turned back for daylight saving time in the spring,
-# the Zapotecs refused to make the adjustment, insisting that they live in
-# "God's time," not in what they derisively call "Fox time," referring to
-# President Vicente Fox in far-off Mexico City.
-# From Paul Eggert (2025-08-04):
-# Unfortunately we have no data to track this informal practice.
-
# From Alan Perry (1996-02-15):
# A guy from our Mexico subsidiary finally found the Presidential Decree
# outlining the timezone changes in Mexico.
@@ -2761,7 +2728,7 @@ Zone America/Mexico_City -6:36:36 - LMT 1922 Jan 1 7:00u
# Chihuahua (near US border - western side)
# This includes the municipios of Janos, Ascensión, Juárez, Guadalupe, and
# Práxedis G Guerrero.
-# https://gaceta.diputados.gob.mx/PDF/65/2022/nov/20221124-VII.pdf
+# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
@@ -2776,7 +2743,7 @@ Zone America/Ciudad_Juarez -7:05:56 - LMT 1922 Jan 1 7:00u
# Chihuahua (near US border - eastern side)
# This includes the municipios of Coyame del Sotol, Ojinaga, and Manuel
# Benavides.
-# https://gaceta.diputados.gob.mx/PDF/65/2022/nov/20221124-VII.pdf
+# http://gaceta.diputados.gob.mx/PDF/65/2a022/nov/20221124-VII.pdf
Zone America/Ojinaga -6:57:40 - LMT 1922 Jan 1 7:00u
-7:00 - MST 1927 Jun 10
-6:00 - CST 1930 Nov 15
@@ -2873,7 +2840,9 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 7:00u
-8:00 1:00 PDT 1951 Sep 30 2:00
-8:00 - PST 1952 Apr 27 2:00
-8:00 1:00 PDT 1952 Sep 28 2:00
- -8:00 CA P%sT 1967
+ -8:00 - PST 1954
+ -8:00 CA P%sT 1961
+ -8:00 - PST 1976
-8:00 US P%sT 1996
-8:00 Mexico P%sT 2001
-8:00 US P%sT 2002 Feb 20
diff --git a/jdk/test/sun/util/calendar/zi/tzdata/southamerica b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
index e36743506c..3b0b65be4a 100644
--- a/jdk/test/sun/util/calendar/zi/tzdata/southamerica
+++ b/jdk/test/sun/util/calendar/zi/tzdata/southamerica
@@ -27,9 +27,9 @@
# 2009-05-17 by Arthur David Olson.
# This file is by no means authoritative; if you think you know better,
-# go ahead and edit the file, and please send any changes to
-# the public mailing list tz@iana.org for general use in the future.
-# For more, please see the file CONTRIBUTING in the tz distribution.
+# go ahead and edit the file (and please send any changes to
+# tz@iana.org for general use in the future). For more, please see
+# the file CONTRIBUTING in the tz distribution.
# From Paul Eggert (2016-12-05):
#
diff --git a/jdk/test/tools/launcher/TestHelper.java b/jdk/test/tools/launcher/TestHelper.java
index 8ea8a0c934..40737320d5 100644
--- a/jdk/test/tools/launcher/TestHelper.java
+++ b/jdk/test/tools/launcher/TestHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,6 @@ public class TestHelper {
static final String CLASS_FILE_EXT = ".class";
static final String JAR_FILE_EXT = ".jar";
static final String EXE_FILE_EXT = ".exe";
- static final String NIX_DBGINFO_EXT = ".debuginfo";
static final String JLDEBUG_KEY = "_JAVA_LAUNCHER_DEBUG";
static final String EXPECTED_MARKER = "TRACER_MARKER:About to EXEC";
static final String TEST_PREFIX = "###TestError###: ";
diff --git a/jdk/test/tools/launcher/VersionCheck.java b/jdk/test/tools/launcher/VersionCheck.java
index dcf6cecfba..b084e58409 100644
--- a/jdk/test/tools/launcher/VersionCheck.java
+++ b/jdk/test/tools/launcher/VersionCheck.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -248,9 +248,6 @@ public class VersionCheck extends TestHelper {
if (isWindows && !name.endsWith(EXE_FILE_EXT)) {
return false;
}
- if (name.endsWith(NIX_DBGINFO_EXT)) {
- return false;
- }
for (String x : exclude) {
if (name.endsWith(x)) {
return false;
diff --git a/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java
index 7a12cc0eeb..ce60587f71 100644
--- a/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java
+++ b/test/lib/jdk/test/lib/containers/cgroup/MetricsTesterCgroupV2.java
@@ -1,6 +1,5 @@
/*
* Copyright (c) 2020, Red Hat Inc.
- * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -448,13 +447,13 @@ public class MetricsTesterCgroupV2 implements CgroupMetricsTester {
Metrics metrics = Metrics.systemMetrics();
long oldVal = metrics.getBlkIOServiceCount();
long newVal = getIoStatAccumulate(new String[] { "rios", "wios" });
- if (newVal < oldVal) {
+ if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) {
fail("io.stat->rios/wios: ", oldVal, newVal);
}
oldVal = metrics.getBlkIOServiced();
newVal = getIoStatAccumulate(new String[] { "rbytes", "wbytes" });
- if (newVal < oldVal) {
+ if (!CgroupMetricsTester.compareWithErrorMargin(oldVal, newVal)) {
fail("io.stat->rbytes/wbytes: ", oldVal, newVal);
}
}
diff --git a/version.txt b/version.txt
index 0234dfbd0c..6363c99be6 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-8.482.8.28.27.01-GA
\ No newline at end of file
+8.492.8.29.28.01-GA
\ No newline at end of file
Summary: Update dragonwell version Testing: CICD Reviewers: kuaiwei, yuleil Issue: #301
00b8e14 to
5e6fd2e
Compare
No description provided.