forked from minhngoc25a/freetype2
Compare commits
3 Commits
master
...
1100-sdf-i
Author | SHA1 | Date |
---|---|---|
![]() |
ab950e18f4 | |
![]() |
b3d917d2f8 | |
![]() |
5f9bc4b859 |
|
@ -5,7 +5,7 @@ stages:
|
|||
|
||||
# FIXME: Use --werror once warnings are fixed.
|
||||
variables:
|
||||
MESON_ARGS: --fatal-meson-warnings --default-library=both
|
||||
MESON_ARGS: --fatal-meson-warnings
|
||||
MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib
|
||||
|
||||
.build windows common:
|
||||
|
@ -47,18 +47,8 @@ variables:
|
|||
- Import-Certificate -CertStoreLocation "Cert:\LocalMachine\Root" "C:\roots.sst"
|
||||
# Make sure meson is up to date so we don't need to rebuild the image
|
||||
# with each release.
|
||||
- pip3 install -U 'meson==0.59.*'
|
||||
- pip3 install --upgrade certifi
|
||||
- pip3 install meson==0.59.1
|
||||
- pip3 install -U ninja
|
||||
|
||||
# Generate a UWP cross-file in case it's used
|
||||
- $PSDefaultParameterValues['Out-File:Encoding'] = 'ASCII'
|
||||
- echo "[binaries]" > uwp-crossfile.meson
|
||||
- echo "c = 'cl'" >> uwp-crossfile.meson
|
||||
- echo "strip = ['true']" >> uwp-crossfile.meson
|
||||
- echo "[built-in options]" >> uwp-crossfile.meson
|
||||
- echo "c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP', '-DUNICODE', '-D_WIN32_WINNT=0x0A00', '-we4013']" >> uwp-crossfile.meson
|
||||
- echo "c_winlibs = ['windowsapp.lib']" >> uwp-crossfile.meson
|
||||
script:
|
||||
# For some reason, options are separated by newlines instead of spaces,
|
||||
# so we have to replace them first.
|
||||
|
@ -69,10 +59,11 @@ variables:
|
|||
# script. Environment variables substitutions is done by PowerShell
|
||||
# before calling `cmd.exe`, that's why we use `$env:FOO` instead of
|
||||
# `%FOO%`.
|
||||
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH $env:VS_UWP &&
|
||||
meson setup build $env:MESON_ARGS_WINDOWS $env:MESON_ARGS_UWP &&
|
||||
meson compile --verbose -C build
|
||||
$env:MESON_WINDOWS_TESTS"
|
||||
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
|
||||
meson setup build $env:MESON_ARGS_WINDOWS &&
|
||||
meson compile --verbose -C build &&
|
||||
meson test -C build &&
|
||||
meson test -C build --benchmark"
|
||||
|
||||
|
||||
# Format of job names:
|
||||
|
@ -85,20 +76,12 @@ windows meson vs2017 amd64:
|
|||
extends: '.build windows meson'
|
||||
variables:
|
||||
ARCH: 'amd64'
|
||||
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
|
||||
|
||||
windows meson vs2017 x86:
|
||||
extends: '.build windows meson'
|
||||
variables:
|
||||
ARCH: 'x86'
|
||||
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
|
||||
|
||||
windows meson vs2017 amd64 uwp:
|
||||
extends: '.build windows meson'
|
||||
variables:
|
||||
ARCH: 'amd64'
|
||||
VS_UWP: '-app_platform=UWP'
|
||||
MESON_ARGS_UWP: '--cross-file uwp-crossfile.meson -Dc_winlibs="windowsapp.lib"'
|
||||
|
||||
# Linux Jobs.
|
||||
#
|
||||
|
@ -147,8 +130,7 @@ linux autotools libs clang:
|
|||
linux meson:
|
||||
extends: '.build linux common'
|
||||
script: |
|
||||
meson setup build ${MESON_ARGS} \
|
||||
-Dbrotli=disabled \
|
||||
meson setup build -Dbrotli=disabled \
|
||||
-Dbzip2=disabled \
|
||||
-Dharfbuzz=disabled \
|
||||
-Dpng=disabled \
|
||||
|
@ -160,8 +142,7 @@ linux meson:
|
|||
linux meson libs:
|
||||
extends: '.build linux common'
|
||||
script: |
|
||||
meson setup build ${MESON_ARGS} \
|
||||
-Dbrotli=enabled \
|
||||
meson setup build -Dbrotli=enabled \
|
||||
-Dbzip2=enabled \
|
||||
-Dharfbuzz=disabled \
|
||||
-Dpng=disabled \
|
||||
|
@ -224,7 +205,7 @@ macos meson:
|
|||
- pip3 install -U meson
|
||||
- pip3 install --upgrade certifi
|
||||
- pip3 install -U ninja
|
||||
|
||||
- meson setup build ${MESON_ARGS}
|
||||
|
||||
- meson setup build
|
||||
- meson compile --verbose -C build
|
||||
- sudo meson install -C build
|
||||
|
|
|
@ -121,6 +121,7 @@ endif ()
|
|||
|
||||
include(CheckIncludeFile)
|
||||
include(CMakeDependentOption)
|
||||
include(FindPkgConfig)
|
||||
|
||||
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
|
||||
# configures the base build environment and references the toolchain file
|
||||
|
@ -161,7 +162,7 @@ endif ()
|
|||
project(freetype C)
|
||||
|
||||
set(VERSION_MAJOR "2")
|
||||
set(VERSION_MINOR "12")
|
||||
set(VERSION_MINOR "11")
|
||||
set(VERSION_PATCH "1")
|
||||
|
||||
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
|
||||
|
@ -244,8 +245,6 @@ endif ()
|
|||
|
||||
|
||||
# Find dependencies
|
||||
include(FindPkgConfig)
|
||||
|
||||
if (NOT FT_DISABLE_HARFBUZZ)
|
||||
set(HARFBUZZ_MIN_VERSION "2.0.0")
|
||||
if (FT_REQUIRE_HARFBUZZ)
|
||||
|
@ -492,55 +491,46 @@ if (BUILD_FRAMEWORK)
|
|||
)
|
||||
set_target_properties(freetype PROPERTIES
|
||||
FRAMEWORK TRUE
|
||||
MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/builds/mac/freetype-Info.plist
|
||||
MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
|
||||
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||
)
|
||||
endif ()
|
||||
|
||||
# 'freetype-interface' is an interface library, to be accessed with
|
||||
# `EXPORT_NAME Freetype::Freetype`. This is the target name provided by
|
||||
# CMake's `FindFreetype.cmake`, so we provide it for compatibility.
|
||||
add_library(freetype-interface INTERFACE)
|
||||
set_target_properties(freetype-interface PROPERTIES
|
||||
EXPORT_NAME Freetype::Freetype
|
||||
INTERFACE_LINK_LIBRARIES freetype)
|
||||
|
||||
set(PKGCONFIG_REQUIRES "")
|
||||
set(PKGCONFIG_REQUIRES_PRIVATE "")
|
||||
set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
|
||||
set(PKGCONFIG_LIBS_PRIVATE "")
|
||||
set(PKG_CONFIG_REQUIRED_PRIVATE "")
|
||||
set(PKG_CONFIG_LIBS_PRIVATE "")
|
||||
|
||||
if (ZLIB_FOUND)
|
||||
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
|
||||
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "zlib")
|
||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib")
|
||||
endif ()
|
||||
if (BZIP2_FOUND)
|
||||
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
|
||||
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
|
||||
if (PC_BZIP2_FOUND)
|
||||
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "bzip2")
|
||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "bzip2")
|
||||
else ()
|
||||
list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
|
||||
list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
|
||||
endif ()
|
||||
endif ()
|
||||
if (PNG_FOUND)
|
||||
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
|
||||
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
|
||||
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
|
||||
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng")
|
||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libpng")
|
||||
endif ()
|
||||
if (HarfBuzz_FOUND)
|
||||
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
|
||||
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
|
||||
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
|
||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
|
||||
endif ()
|
||||
if (BROTLIDEC_FOUND)
|
||||
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
|
||||
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
|
||||
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
|
||||
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec")
|
||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libbrotlidec")
|
||||
endif ()
|
||||
|
||||
|
||||
|
@ -567,7 +557,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
|||
# Generate the pkg-config file
|
||||
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
|
||||
|
||||
string(REPLACE ";" ", " PKGCONFIG_REQUIRES_PRIVATE "${PKGCONFIG_REQUIRES_PRIVATE}")
|
||||
string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
|
||||
|
||||
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
|
@ -579,26 +569,10 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
|||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
else ()
|
||||
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES} ${PKGCONFIG_REQUIRES_PRIVATE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" ""
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS} ${PKGCONFIG_LIBS_PRIVATE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" ""
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
endif ()
|
||||
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
string(REPLACE "%LIBS_PRIVATE%" "${PKG_CONFIG_LIBS_PRIVATE}"
|
||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||
|
||||
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
|
||||
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
|
||||
|
@ -622,7 +596,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
|||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
install(
|
||||
TARGETS freetype freetype-interface
|
||||
TARGETS freetype
|
||||
EXPORT freetype-targets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
|
12
README
12
README
|
@ -1,4 +1,4 @@
|
|||
FreeType 2.12.1
|
||||
FreeType 2.11.1
|
||||
===============
|
||||
|
||||
Homepage: https://www.freetype.org
|
||||
|
@ -16,9 +16,7 @@ Read the files `docs/INSTALL*` for installation instructions; see the
|
|||
file `docs/LICENSE.TXT` for the available licenses.
|
||||
|
||||
For using FreeType's git repository instead of a distribution bundle,
|
||||
please read file `README.git`. Note that you have to actually clone
|
||||
the repository; using a snapshot will not work (in other words, don't
|
||||
use gitlab's 'Download' button).
|
||||
please read file `README.git`.
|
||||
|
||||
The FreeType 2 API reference is located in directory `docs/reference`;
|
||||
use the file `index.html` as the top entry point. [Please note that
|
||||
|
@ -32,9 +30,9 @@ sites. Go to
|
|||
|
||||
and download one of the following files.
|
||||
|
||||
freetype-doc-2.12.1.tar.xz
|
||||
freetype-doc-2.12.1.tar.gz
|
||||
ftdoc2121.zip
|
||||
freetype-doc-2.11.1.tar.xz
|
||||
freetype-doc-2.11.1.tar.gz
|
||||
ftdoc2111.zip
|
||||
|
||||
To view the documentation online, go to
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ copy_submodule_files ()
|
|||
cp $DLG_SRC_DIR/* src/dlg
|
||||
}
|
||||
|
||||
if test -e ".git"; then
|
||||
if test -d ".git"; then
|
||||
DLG_INC_DIR=subprojects/dlg/include/dlg
|
||||
DLG_SRC_DIR=subprojects/dlg/src/dlg
|
||||
|
||||
|
|
|
@ -304,12 +304,13 @@ do-dist: distclean refdoc
|
|||
cp $(CONFIG_GUESS) builds/unix
|
||||
cp $(CONFIG_SUB) builds/unix
|
||||
|
||||
@# Generate `ChangeLog' file with commits since release 2.11.0
|
||||
@# (when we stopped creating this file manually).
|
||||
@# Generate `ChangeLog' file with commits since previous release.
|
||||
$(CHANGELOG_SCRIPT) \
|
||||
--format='%B%n' \
|
||||
--no-cluster \
|
||||
-- VER-2-11-0..$(version_tag) \
|
||||
-- `git describe --tags \
|
||||
--abbrev=0 \
|
||||
$(version_tag)^`..$(version_tag) \
|
||||
> ChangeLog
|
||||
|
||||
@# Remove intermediate files created by the `refdoc' target.
|
||||
|
@ -317,6 +318,6 @@ do-dist: distclean refdoc
|
|||
rm -f docs/mkdocs.yml
|
||||
|
||||
@# Remove more stuff related to git.
|
||||
rm -rf subprojects/dlg
|
||||
rm -rf subprojects
|
||||
|
||||
# EOF
|
||||
|
|
|
@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.h.in])
|
|||
|
||||
# Don't forget to update `docs/VERSIONS.TXT'!
|
||||
|
||||
version_info='24:3:18'
|
||||
version_info='24:1:18'
|
||||
AC_SUBST([version_info])
|
||||
ft_version=`echo $version_info | tr : .`
|
||||
AC_SUBST([ft_version])
|
||||
|
@ -530,28 +530,16 @@ AC_SEARCH_LIBS([clock_gettime],
|
|||
[test "$ac_cv_search_clock_gettime" = "none required" \
|
||||
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
||||
|
||||
# 'librsvg' is needed to demonstrate SVG support.
|
||||
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
|
||||
[have_librsvg="yes (pkg-config)"], [have_librsvg=no])
|
||||
|
||||
FT_DEMO_CFLAGS=""
|
||||
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
|
||||
|
||||
# 'librsvg' is needed to demonstrate SVG support.
|
||||
AC_ARG_WITH([librsvg],
|
||||
[AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
|
||||
[support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
|
||||
[], [with_librsvg=auto])
|
||||
|
||||
have_librsvg=no
|
||||
if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
|
||||
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
|
||||
[have_librsvg="yes (pkg-config)"], [:])
|
||||
|
||||
if test "$have_librsvg" != no; then
|
||||
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
|
||||
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
|
||||
AC_MSG_ERROR([librsvg support requested but library not found])
|
||||
if test "$have_librsvg" != no; then
|
||||
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
|
||||
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
|
||||
fi
|
||||
|
||||
AC_SUBST([FT_DEMO_CFLAGS])
|
||||
|
@ -997,32 +985,32 @@ fi
|
|||
|
||||
|
||||
# entries in Requires.private are separated by commas
|
||||
PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
|
||||
$bzip2_reqpriv, \
|
||||
$libpng_reqpriv, \
|
||||
$harfbuzz_reqpriv, \
|
||||
$brotli_reqpriv"
|
||||
REQUIRES_PRIVATE="$zlib_reqpriv, \
|
||||
$bzip2_reqpriv, \
|
||||
$libpng_reqpriv, \
|
||||
$harfbuzz_reqpriv, \
|
||||
$brotli_reqpriv"
|
||||
# beautify
|
||||
PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
|
||||
| sed -e 's/^ *//' \
|
||||
-e 's/ *$//' \
|
||||
-e 's/, */,/g' \
|
||||
-e 's/,,*/,/g' \
|
||||
-e 's/^,*//' \
|
||||
-e 's/,*$//' \
|
||||
-e 's/,/, /g'`
|
||||
REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
|
||||
| sed -e 's/^ *//' \
|
||||
-e 's/ *$//' \
|
||||
-e 's/, */,/g' \
|
||||
-e 's/,,*/,/g' \
|
||||
-e 's/^,*//' \
|
||||
-e 's/,*$//' \
|
||||
-e 's/,/, /g'`
|
||||
|
||||
PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
|
||||
$bzip2_libspriv \
|
||||
$libpng_libspriv \
|
||||
$harfbuzz_libspriv \
|
||||
$brotli_libspriv \
|
||||
$ft2_extra_libs"
|
||||
LIBS_PRIVATE="$zlib_libspriv \
|
||||
$bzip2_libspriv \
|
||||
$libpng_libspriv \
|
||||
$harfbuzz_libspriv \
|
||||
$brotli_libspriv \
|
||||
$ft2_extra_libs"
|
||||
# beautify
|
||||
PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
|
||||
| sed -e 's/^ *//' \
|
||||
-e 's/ *$//' \
|
||||
-e 's/ */ /g'`
|
||||
LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
|
||||
| sed -e 's/^ *//' \
|
||||
-e 's/ *$//' \
|
||||
-e 's/ */ /g'`
|
||||
|
||||
LIBSSTATIC_CONFIG="-lfreetype \
|
||||
$zlib_libsstaticconf \
|
||||
|
@ -1040,28 +1028,10 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
|
|||
-e 's/ *$//' \
|
||||
-e 's/ */ /g'`
|
||||
|
||||
# If FreeType gets installed with `--disable-shared', don't use
|
||||
# 'private' fields. `pkg-config' only looks into `.pc' files and is
|
||||
# completely agnostic to whether shared libraries are actually present
|
||||
# or not. As a consequence, the user had to specify `--static' while
|
||||
# calling `pkg-config', which configure scripts are normally not
|
||||
# prepared for.
|
||||
|
||||
PKGCONFIG_REQUIRES=
|
||||
PKGCONFIG_LIBS='-L${libdir} -lfreetype'
|
||||
|
||||
if test $enable_shared = "no"; then
|
||||
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
|
||||
PKGCONFIG_REQUIRES_PRIVATE=
|
||||
PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
|
||||
PKGCONFIG_LIBS_PRIVATE=
|
||||
fi
|
||||
|
||||
AC_SUBST([ftmac_c])
|
||||
AC_SUBST([PKGCONFIG_REQUIRES])
|
||||
AC_SUBST([PKGCONFIG_LIBS])
|
||||
AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
|
||||
AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
|
||||
AC_SUBST([REQUIRES_PRIVATE])
|
||||
AC_SUBST([LIBS_PRIVATE])
|
||||
AC_SUBST([LIBSSTATIC_CONFIG])
|
||||
|
||||
AC_SUBST([hardcode_libdir_flag_spec])
|
||||
|
|
|
@ -7,8 +7,8 @@ Name: FreeType 2
|
|||
URL: https://freetype.org
|
||||
Description: A free, high-quality, and portable font engine.
|
||||
Version: %ft_version%
|
||||
Requires: %PKGCONFIG_REQUIRES%
|
||||
Requires.private: %PKGCONFIG_REQUIRES_PRIVATE%
|
||||
Libs: %PKGCONFIG_LIBS%
|
||||
Libs.private: %PKGCONFIG_LIBS_PRIVATE%
|
||||
Requires:
|
||||
Requires.private: %REQUIRES_PRIVATE%
|
||||
Libs: -L${libdir} -lfreetype
|
||||
Libs.private: %LIBS_PRIVATE%
|
||||
Cflags: -I${includedir}/freetype2
|
||||
|
|
|
@ -68,14 +68,12 @@ version_info := @version_info@
|
|||
|
||||
# Variables needed for `freetype-config' and `freetype.pc'.
|
||||
#
|
||||
PKG_CONFIG := @PKG_CONFIG@
|
||||
PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@
|
||||
PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@
|
||||
PKGCONFIG_LIBS := @PKGCONFIG_LIBS@
|
||||
PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@
|
||||
LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
|
||||
build_libtool_libs := @build_libtool_libs@
|
||||
ft_version := @ft_version@
|
||||
PKG_CONFIG := @PKG_CONFIG@
|
||||
REQUIRES_PRIVATE := @REQUIRES_PRIVATE@
|
||||
LIBS_PRIVATE := @LIBS_PRIVATE@
|
||||
LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
|
||||
build_libtool_libs := @build_libtool_libs@
|
||||
ft_version := @ft_version@
|
||||
|
||||
# The directory where all library files are placed.
|
||||
#
|
||||
|
@ -139,17 +137,15 @@ prefix_x := $(subst $(space),\\$(space),$(prefix))
|
|||
|
||||
$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
|
||||
rm -f $@ $@.tmp
|
||||
sed -e 's|%PKGCONFIG_REQUIRES%|$(PKGCONFIG_REQUIRES)|' \
|
||||
-e 's|%PKGCONFIG_REQUIRES_PRIVATE%|$(PKGCONFIG_REQUIRES_PRIVATE)|' \
|
||||
-e 's|%PKGCONFIG_LIBS%|$(PKGCONFIG_LIBS)|' \
|
||||
-e 's|%PKGCONFIG_LIBS_PRIVATE%|$(PKGCONFIG_LIBS_PRIVATE)|' \
|
||||
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
|
||||
-e 's|%exec_prefix%|$(exec_prefix_x)|' \
|
||||
-e 's|%ft_version%|$(ft_version)|' \
|
||||
-e 's|%includedir%|$(includedir_x)|' \
|
||||
-e 's|%libdir%|$(libdir_x)|' \
|
||||
-e 's|%prefix%|$(prefix_x)|' \
|
||||
$< \
|
||||
sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \
|
||||
-e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \
|
||||
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
|
||||
-e 's|%exec_prefix%|$(exec_prefix_x)|' \
|
||||
-e 's|%ft_version%|$(ft_version)|' \
|
||||
-e 's|%includedir%|$(includedir_x)|' \
|
||||
-e 's|%libdir%|$(libdir_x)|' \
|
||||
-e 's|%prefix%|$(prefix_x)|' \
|
||||
$< \
|
||||
> $@.tmp
|
||||
chmod a-w $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
|
|
@ -21,7 +21,7 @@ the following targets:
|
|||
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
||||
</ul>
|
||||
|
||||
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
||||
|
||||
<ul>
|
||||
<pre>
|
||||
|
|
|
@ -21,7 +21,7 @@ the following targets:
|
|||
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
||||
</ul>
|
||||
|
||||
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
||||
|
||||
<ul>
|
||||
<pre>
|
||||
|
|
|
@ -196,77 +196,37 @@
|
|||
}
|
||||
|
||||
|
||||
/* non-desktop Universal Windows Platform */
|
||||
#if defined( WINAPI_FAMILY ) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
||||
#if defined( NTDDI_VERSION ) && NTDDI_VERSION < 0x0A000007 && \
|
||||
defined( WINAPI_FAMILY_PARTITION ) && \
|
||||
!WINAPI_FAMILY_PARTITION( WINAPI_PARTITION_DESKTOP )
|
||||
|
||||
#define PACK_DWORD64( hi, lo ) ( ( (DWORD64)(hi) << 32 ) | (DWORD)(lo) )
|
||||
|
||||
#define CreateFileMapping( a, b, c, d, e, f ) \
|
||||
CreateFileMappingFromApp( a, b, c, PACK_DWORD64( d, e ), f )
|
||||
#define MapViewOfFile( a, b, c, d, e ) \
|
||||
MapViewOfFileFromApp( a, b, PACK_DWORD64( c, d ), e )
|
||||
#define CreateFileW( a, b, c, d, e, f, g ) \
|
||||
CreateFileFromAppW( a, b, c, d, e, f, g )
|
||||
#define CreateFileMapping( a, b, c, d, e, f ) \
|
||||
CreateFileMappingFromApp( a, b, c, PACK_DWORD64( d, e ), f )
|
||||
#define MapViewOfFile( a, b, c, d, e ) \
|
||||
MapViewOfFileFromApp( a, b, PACK_DWORD64( c, d ), e )
|
||||
|
||||
FT_LOCAL_DEF( HANDLE )
|
||||
CreateFileA( LPCSTR lpFileName,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes,
|
||||
HANDLE hTemplateFile )
|
||||
{
|
||||
int len;
|
||||
LPWSTR lpFileNameW;
|
||||
|
||||
CREATEFILE2_EXTENDED_PARAMETERS createExParams = {
|
||||
sizeof ( CREATEFILE2_EXTENDED_PARAMETERS ),
|
||||
dwFlagsAndAttributes & 0x0000FFFF,
|
||||
dwFlagsAndAttributes & 0xFFF00000,
|
||||
dwFlagsAndAttributes & 0x000F0000,
|
||||
lpSecurityAttributes,
|
||||
hTemplateFile };
|
||||
|
||||
|
||||
/* allocate memory space for converted path name */
|
||||
len = MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
|
||||
lpFileName, -1, NULL, 0 );
|
||||
|
||||
lpFileNameW = (LPWSTR)_alloca( len * sizeof ( WCHAR ) );
|
||||
|
||||
if ( !len || !lpFileNameW )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Open: cannot convert file name to LPWSTR\n" ));
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
/* now it is safe to do the translation */
|
||||
MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
|
||||
lpFileName, -1, lpFileNameW, len );
|
||||
|
||||
/* open the file */
|
||||
return CreateFile2( lpFileNameW, dwDesiredAccess, dwShareMode,
|
||||
dwCreationDisposition, &createExParams );
|
||||
}
|
||||
#define UWP_LEGACY
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined( _WIN32_WCE )
|
||||
|
||||
/* malloc.h provides implementation of alloca()/_alloca() */
|
||||
#include <malloc.h>
|
||||
#if defined( _WIN32_WCE ) || defined( UWP_LEGACY )
|
||||
|
||||
FT_LOCAL_DEF( HANDLE )
|
||||
CreateFileA( LPCSTR lpFileName,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes,
|
||||
HANDLE hTemplateFile )
|
||||
CreateFileA( LPCSTR lpFileName,
|
||||
DWORD dwDesiredAccess,
|
||||
DWORD dwShareMode,
|
||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||
DWORD dwCreationDisposition,
|
||||
DWORD dwFlagsAndAttributes,
|
||||
HANDLE hTemplateFile )
|
||||
{
|
||||
int len;
|
||||
LPWSTR lpFileNameW;
|
||||
int len;
|
||||
LPWSTR lpFileNameW;
|
||||
|
||||
|
||||
/* allocate memory space for converted path name */
|
||||
|
@ -293,13 +253,12 @@
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined( _WIN32_WCE ) || defined ( _WIN32_WINDOWS ) || \
|
||||
!defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400
|
||||
|
||||
FT_LOCAL_DEF( BOOL )
|
||||
GetFileSizeEx( HANDLE hFile,
|
||||
PLARGE_INTEGER lpFileSize )
|
||||
GetFileSizeEx( HANDLE hFile,
|
||||
PLARGE_INTEGER lpFileSize )
|
||||
{
|
||||
lpFileSize->u.LowPart = GetFileSize( hFile,
|
||||
(DWORD *)&lpFileSize->u.HighPart );
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<p>This directory contains solution and project files for
|
||||
Visual C++ 2010 or newer, named <tt>freetype.sln</tt>,
|
||||
and <tt>freetype.vcxproj</tt>. It compiles the following libraries
|
||||
from the FreeType 2.12.1 sources:</p>
|
||||
from the FreeType 2.11.1 sources:</p>
|
||||
|
||||
<ul>
|
||||
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<p>This directory contains project files <tt>freetype.dsp</tt> for
|
||||
Visual C++ 6.0, and <tt>freetype.vcproj</tt> for Visual C++ 2002
|
||||
through 2008, which you might need to upgrade automatically.
|
||||
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
||||
|
||||
<ul>
|
||||
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
||||
|
|
|
@ -21,7 +21,7 @@ the following targets:
|
|||
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
||||
</ul>
|
||||
|
||||
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
||||
|
||||
<ul>
|
||||
<pre>
|
||||
|
|
82
docs/CHANGES
82
docs/CHANGES
|
@ -1,49 +1,3 @@
|
|||
CHANGES BETWEEN 2.12.1 and 2.12.2
|
||||
|
||||
I. IMPORTANT BUG FIXES
|
||||
|
||||
II. MISCELLANEOUS
|
||||
|
||||
- TrueType interpreter version 38 (aka Infinality) that was first
|
||||
introduced about 10 years ago in FreeType 2.4.11 is now deprecated
|
||||
and slated to be removed in the next version. TrueType interpreter
|
||||
version 40 has been FreeType default version for 6 years now and
|
||||
provides an excelent alternative. This is the last FreeType version
|
||||
with TT_INTERPRETER_VERSION_38 and TT_INTERPRETER_VERSION_40 treated
|
||||
differently.
|
||||
|
||||
======================================================================
|
||||
|
||||
CHANGES BETWEEN 2.12.0 and 2.12.1
|
||||
|
||||
I. IMPORTANT BUG FIXES
|
||||
|
||||
- Loading CFF fonts sometimes made FreeType crash (bug introduced in
|
||||
version 2.12.0)
|
||||
|
||||
- Loading a fully hinted TrueType glyph a second time (without
|
||||
caching) sometimes yielded different rendering results if TrueType
|
||||
hinting was active (bug introduced in version 2.12.0).
|
||||
|
||||
- The generation of the pkg-config file `freetype2.pc` was broken if
|
||||
the build was done with cmake (bug introduced in version 2.12.0).
|
||||
|
||||
|
||||
II. MISCELLANEOUS
|
||||
|
||||
- New option `--with-librsvg` for the `configure` script for better
|
||||
FreeType demo support.
|
||||
|
||||
- The meson build no longer enforces both static and dynamic
|
||||
versions of the library by default.
|
||||
|
||||
- The internal zlib library was updated to version 1.2.12. Note,
|
||||
however, that FreeType is *not* affected by CVE-2018-25032 since
|
||||
it only does decompression.
|
||||
|
||||
|
||||
======================================================================
|
||||
|
||||
CHANGES BETWEEN 2.11.1 and 2.12.0
|
||||
|
||||
I. IMPORTANT CHANGES
|
||||
|
@ -56,41 +10,7 @@ CHANGES BETWEEN 2.11.1 and 2.12.0
|
|||
programs have been set up to use 'librsvg' as the rendering
|
||||
library.
|
||||
|
||||
This work was Moazin Khatti's GSoC 2019 project.
|
||||
|
||||
|
||||
II. MISCELLANEOUS
|
||||
|
||||
- The handling of fonts with an 'sbix' table has been improved.
|
||||
|
||||
- Corrected bitmap offsets.
|
||||
|
||||
- A new tag `FT_PARAM_TAG_IGNORE_SBIX` for `FT_Open_Face` makes
|
||||
FreeType ignore an 'sbix' table in a font, allowing applications
|
||||
to access the font's outline glyphs.
|
||||
|
||||
- `FT_FACE_FLAG_SBIX` and `FT_FACE_FLAG_SBIX_OVERLAY` together
|
||||
with their corresponding preprocessor macros `FT_HAS_SBIX` and
|
||||
`FT_HAS_SBIX_OVERLAY` enable applications to treat 'sbix' tables
|
||||
as described in the OpenType specification.
|
||||
|
||||
- The internal 'zlib' code has been updated to be in sync with the
|
||||
current 'zlib' version (1.2.11).
|
||||
|
||||
- The previously internal load flag `FT_LOAD_SBITS_ONLY` is now
|
||||
public.
|
||||
|
||||
- Some minor improvements of the building systems, in particular
|
||||
handling of the 'zlib' library (internal vs. external).
|
||||
|
||||
- Support for non-desktop Universal Windows Platform.
|
||||
|
||||
- Various other minor bug and documentation fixes.
|
||||
|
||||
- The `ftdump` demo program shows more information for Type1 fonts
|
||||
if option `-n` is given.
|
||||
|
||||
- `ftgrid` can now display embedded bitmap strikes.
|
||||
This work was Moazin Kathri's GSoC 2019 project.
|
||||
|
||||
|
||||
======================================================================
|
||||
|
|
|
@ -60,8 +60,6 @@ found on _most_ systems, but not all of them:
|
|||
|
||||
release libtool so
|
||||
-------------------------------
|
||||
2.12.1 24.3.18 6.18.3
|
||||
2.12.0 24.2.18 6.18.2
|
||||
2.11.1 24.1.18 6.18.1
|
||||
2.11.0 24.0.18 6.18.0
|
||||
2.10.4 23.4.17 6.17.4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.TH FREETYPE-CONFIG 1 "May 2022" "FreeType 2.12.1"
|
||||
.TH FREETYPE-CONFIG 1 "December 2021" "FreeType 2.11.1"
|
||||
.
|
||||
.
|
||||
.SH NAME
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -2411,9 +2411,9 @@
|
|||
units per em (e.g. Inter). This patch fixes it.
|
||||
|
||||
The return value of af_loader_compute_darkening was also changed to
|
||||
use 16.16 fixed-point to get rid of a redundant truncation operation.
|
||||
use 16.16 fixed point to get rid of a redundant truncation operation.
|
||||
This should slightly improve the precision, although it's still
|
||||
bottlenecked by the emboldening function, which uses 26.6 fixed-point.
|
||||
bottlenecked by the emboldening function, which uses 26.6 fixed point.
|
||||
|
||||
* src/autofit/afloader.[ch]
|
||||
(af_loader_compute_darkening): Return FT_Fixed.
|
||||
|
|
|
@ -707,7 +707,7 @@
|
|||
[base] Fix integer overflow.
|
||||
|
||||
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
|
||||
outgoing vectors and use fixed-point arithmetic.
|
||||
outgoing vectors and use fixed point arithmetic.
|
||||
|
||||
2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||
|
||||
|
|
|
@ -77,14 +77,13 @@ How to prepare a new release
|
|||
|
||||
#!/bin/sh
|
||||
|
||||
VERSION=2.12.0
|
||||
VERSION=2.10.4
|
||||
SAVANNAH_USER=wl
|
||||
SOURCEFORGE_USER=wlemb
|
||||
GPG_KEY_ID=BE6C3AAC63AD8E3F
|
||||
|
||||
#####################################################################
|
||||
|
||||
GPG="/usr/bin/gpg --batch --no-tty --local-user $GPG_KEY_ID"
|
||||
GPG='/usr/bin/gpg --batch --no-tty'
|
||||
|
||||
version=`echo $VERSION | sed "s/\\.//g"`
|
||||
|
||||
|
|
|
@ -154,8 +154,6 @@ FT_BEGIN_HEADER
|
|||
* FT_FACE_FLAG_EXTERNAL_STREAM
|
||||
* FT_FACE_FLAG_HINTER
|
||||
* FT_FACE_FLAG_SVG
|
||||
* FT_FACE_FLAG_SBIX
|
||||
* FT_FACE_FLAG_SBIX_OVERLAY
|
||||
*
|
||||
* FT_HAS_HORIZONTAL
|
||||
* FT_HAS_VERTICAL
|
||||
|
@ -165,8 +163,6 @@ FT_BEGIN_HEADER
|
|||
* FT_HAS_COLOR
|
||||
* FT_HAS_MULTIPLE_MASTERS
|
||||
* FT_HAS_SVG
|
||||
* FT_HAS_SBIX
|
||||
* FT_HAS_SBIX_OVERLAY
|
||||
*
|
||||
* FT_IS_SFNT
|
||||
* FT_IS_SCALABLE
|
||||
|
@ -231,7 +227,6 @@ FT_BEGIN_HEADER
|
|||
* FT_LOAD_NO_SCALE
|
||||
* FT_LOAD_NO_HINTING
|
||||
* FT_LOAD_NO_BITMAP
|
||||
* FT_LOAD_SBITS_ONLY
|
||||
* FT_LOAD_NO_AUTOHINT
|
||||
* FT_LOAD_COLOR
|
||||
*
|
||||
|
@ -1240,16 +1235,6 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* FT_FACE_FLAG_SVG ::
|
||||
* [Since 2.12] The face has an 'SVG~' OpenType table.
|
||||
*
|
||||
* FT_FACE_FLAG_SBIX ::
|
||||
* [Since 2.12] The face has an 'sbix' OpenType table *and* outlines.
|
||||
* For such fonts, @FT_FACE_FLAG_SCALABLE is not set by default to
|
||||
* retain backward compatibility.
|
||||
*
|
||||
* FT_FACE_FLAG_SBIX_OVERLAY ::
|
||||
* [Since 2.12] The face has an 'sbix' OpenType table where outlines
|
||||
* should be drawn on top of bitmap strikes.
|
||||
*
|
||||
*/
|
||||
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
|
||||
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
|
||||
|
@ -1268,8 +1253,6 @@ FT_BEGIN_HEADER
|
|||
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
|
||||
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
|
||||
#define FT_FACE_FLAG_SVG ( 1L << 16 )
|
||||
#define FT_FACE_FLAG_SBIX ( 1L << 17 )
|
||||
#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -1526,108 +1509,6 @@ FT_BEGIN_HEADER
|
|||
( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_HAS_SBIX
|
||||
*
|
||||
* @description:
|
||||
* A macro that returns true whenever a face object contains an 'sbix'
|
||||
* OpenType table *and* outline glyphs.
|
||||
*
|
||||
* Currently, FreeType only supports bitmap glyphs in PNG format for this
|
||||
* table (i.e., JPEG and TIFF formats are unsupported, as are
|
||||
* Apple-specific formats not part of the OpenType specification).
|
||||
*
|
||||
* @note:
|
||||
* For backward compatibility, a font with an 'sbix' table is treated as
|
||||
* a bitmap-only face. Using @FT_Open_Face with
|
||||
* @FT_PARAM_TAG_IGNORE_SBIX, an application can switch off 'sbix'
|
||||
* handling so that the face is treated as an ordinary outline font with
|
||||
* scalable outlines.
|
||||
*
|
||||
* Here is some pseudo code that roughly illustrates how to implement
|
||||
* 'sbix' handling according to the OpenType specification.
|
||||
*
|
||||
* ```
|
||||
* if ( FT_HAS_SBIX( face ) )
|
||||
* {
|
||||
* // open font as a scalable one without sbix handling
|
||||
* FT_Face face2;
|
||||
* FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL };
|
||||
* FT_Open_Args args = { FT_OPEN_PARAMS | ...,
|
||||
* ...,
|
||||
* 1, ¶m };
|
||||
*
|
||||
*
|
||||
* FT_Open_Face( library, &args, 0, &face2 );
|
||||
*
|
||||
* <sort `face->available_size` as necessary into
|
||||
* `preferred_sizes`[*]>
|
||||
*
|
||||
* for ( i = 0; i < face->num_fixed_sizes; i++ )
|
||||
* {
|
||||
* size = preferred_sizes[i].size;
|
||||
*
|
||||
* error = FT_Set_Pixel_Sizes( face, size, size );
|
||||
* <error handling omitted>
|
||||
*
|
||||
* // check whether we have a glyph in a bitmap strike
|
||||
* error = FT_Load_Glyph( face,
|
||||
* glyph_index,
|
||||
* FT_LOAD_SBITS_ONLY |
|
||||
* FT_LOAD_BITMAP_METRICS_ONLY );
|
||||
* if ( error == FT_Err_Invalid_Argument )
|
||||
* continue;
|
||||
* else if ( error )
|
||||
* <other error handling omitted>
|
||||
* else
|
||||
* break;
|
||||
* }
|
||||
*
|
||||
* if ( i != face->num_fixed_sizes )
|
||||
* <load embedded bitmap with `FT_Load_Glyph`,
|
||||
* scale it, display it, etc.>
|
||||
*
|
||||
* if ( i == face->num_fixed_sizes ||
|
||||
* FT_HAS_SBIX_OVERLAY( face ) )
|
||||
* <use `face2` to load outline glyph with `FT_Load_Glyph`,
|
||||
* scale it, display it on top of the bitmap, etc.>
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* [*] Assuming a target value of 400dpi and available strike sizes 100,
|
||||
* 200, 300, and 400dpi, a possible order might be [400, 200, 300, 100]:
|
||||
* scaling 200dpi to 400dpi usually gives better results than scaling
|
||||
* 300dpi to 400dpi; it is also much faster. However, scaling 100dpi to
|
||||
* 400dpi can yield a too pixelated result, thus the preference might be
|
||||
* 300dpi over 100dpi.
|
||||
*
|
||||
* @since:
|
||||
* 2.12
|
||||
*/
|
||||
#define FT_HAS_SBIX( face ) \
|
||||
( !!( (face)->face_flags & FT_FACE_FLAG_SBIX ) )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @macro:
|
||||
* FT_HAS_SBIX_OVERLAY
|
||||
*
|
||||
* @description:
|
||||
* A macro that returns true whenever a face object contains an 'sbix'
|
||||
* OpenType table with bit~1 in its `flags` field set, instructing the
|
||||
* application to overlay the bitmap strike with the corresponding
|
||||
* outline glyph. See @FT_HAS_SBIX for pseudo code how to use it.
|
||||
*
|
||||
* @since:
|
||||
* 2.12
|
||||
*/
|
||||
#define FT_HAS_SBIX_OVERLAY( face ) \
|
||||
( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
|
@ -1892,13 +1773,13 @@ FT_BEGIN_HEADER
|
|||
* The advance width of the unhinted glyph. Its value is expressed in
|
||||
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
|
||||
* loading the glyph. This field can be important to perform correct
|
||||
* WYSIWYG layout. Only relevant for scalable glyphs.
|
||||
* WYSIWYG layout. Only relevant for outline glyphs.
|
||||
*
|
||||
* linearVertAdvance ::
|
||||
* The advance height of the unhinted glyph. Its value is expressed in
|
||||
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
|
||||
* loading the glyph. This field can be important to perform correct
|
||||
* WYSIWYG layout. Only relevant for scalable glyphs.
|
||||
* WYSIWYG layout. Only relevant for outline glyphs.
|
||||
*
|
||||
* advance ::
|
||||
* This shorthand is, depending on @FT_LOAD_IGNORE_TRANSFORM, the
|
||||
|
@ -3095,15 +2976,6 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* @FT_LOAD_NO_SCALE always sets this flag.
|
||||
*
|
||||
* FT_LOAD_SBITS_ONLY ::
|
||||
* [Since 2.12] This is the opposite of @FT_LOAD_NO_BITMAP, more or
|
||||
* less: @FT_Load_Glyph returns `FT_Err_Invalid_Argument` if the face
|
||||
* contains a bitmap strike for the given size (or the strike selected
|
||||
* by @FT_Select_Size) but there is no glyph in the strike.
|
||||
*
|
||||
* Note that this load flag was part of FreeType since version 2.0.6
|
||||
* but previously tagged as internal.
|
||||
*
|
||||
* FT_LOAD_VERTICAL_LAYOUT ::
|
||||
* Load the glyph for vertical text layout. In particular, the
|
||||
* `advance` value in the @FT_GlyphSlotRec structure is set to the
|
||||
|
@ -3248,7 +3120,6 @@ FT_BEGIN_HEADER
|
|||
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
|
||||
#define FT_LOAD_MONOCHROME ( 1L << 12 )
|
||||
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
|
||||
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
|
||||
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
|
||||
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
|
||||
#define FT_LOAD_COLOR ( 1L << 20 )
|
||||
|
@ -3259,6 +3130,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* used internally only by certain font drivers */
|
||||
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
|
||||
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
|
||||
#define FT_LOAD_SVG_ONLY ( 1L << 23 )
|
||||
|
||||
|
||||
|
@ -3540,40 +3412,41 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* FreeType has two rasterizers for generating SDF, namely:
|
||||
*
|
||||
* 1. `sdf` for generating SDF directly from glyph's outline, and
|
||||
* 1. `sdf` - For generating SDF directly from glyph's outline.
|
||||
*
|
||||
* 2. `bsdf` for generating SDF from rasterized bitmaps.
|
||||
* 2. `bsdf` - For generating SDF from rasterized bitmaps.
|
||||
*
|
||||
* Depending on the glyph type (i.e., outline or bitmap), one of the two
|
||||
* rasterizers is chosen at runtime and used for generating SDFs. To
|
||||
* force the use of `bsdf` you should render the glyph with any of the
|
||||
* FreeType's other rendering modes (e.g., `FT_RENDER_MODE_NORMAL`) and
|
||||
* then re-render with `FT_RENDER_MODE_SDF`.
|
||||
* Depending on the glyph type (i.e. outline or bitmap), one of the two
|
||||
* rasterizer is chosen at runtime and used for generating SDF. To
|
||||
* force use `bsdf` you can simply render the glyph using any of the
|
||||
* FreeType's other rendering modes (e.g. `FT_RENDER_MODE_NORMAL`) and
|
||||
* then re-render using `FT_RENDER_MODE_SDF`.
|
||||
*
|
||||
* There are some issues with stability and possible failures of the SDF
|
||||
* renderers (specifically `sdf`).
|
||||
* Now, a few notes on the stability and point of failures for the SDF
|
||||
* renderers (specifically `sdf`):
|
||||
*
|
||||
* 1. The `sdf` rasterizer is sensitive to really small features (e.g.,
|
||||
* sharp turns that are less than 1~pixel) and imperfections in the
|
||||
* glyph's outline, causing artifacts in the final output.
|
||||
* 1. The `sdf` rasterizer is sensitive to really small features (e.g.
|
||||
* sharp turns which are less than 1 pixel) and imperfections in the
|
||||
* glyph's outline. Having these in the outline can cause artifats
|
||||
* in the final output.
|
||||
*
|
||||
* 2. The `sdf` rasterizer has limited support for handling intersecting
|
||||
* contours and *cannot* handle self-intersecting contours whatsoever.
|
||||
* Self-intersection happens when a single connected contour intersect
|
||||
* itself at some point; having these in your font definitely pose a
|
||||
* problem to the rasterizer and cause artifacts, too.
|
||||
* Self intersection happens when a single connected contour intersect
|
||||
* itself at some point and having these in your font will definately
|
||||
* pose a problem to the rasterizer and cause artifacts.
|
||||
*
|
||||
* 3. Generating SDF for really small glyphs may result in undesirable
|
||||
* output; the pixel grid (which stores distance information) becomes
|
||||
* too coarse.
|
||||
* output due to limited availability of pixel grid to store distance
|
||||
* information.
|
||||
*
|
||||
* 4. Since the output buffer is normalized, precision at smaller spreads
|
||||
* is greater than precision at larger spread values because the
|
||||
* output range of [0..255] gets mapped to a smaller SDF range. A
|
||||
* spread of~2 should be sufficient in most cases.
|
||||
* 4. Since the output buffer is normalized, precision at smaller spread
|
||||
* will be greater than precision at larger spread values, because the
|
||||
* output range of [0 .. 255] will be mapped to a smaller sdf range.
|
||||
* A spread of 2 should be sufficient in most cases.
|
||||
*
|
||||
* Points (1) and (2) can be avoided by using the `bsdf` rasterizer,
|
||||
* which is more stable than the `sdf` rasterizer in general.
|
||||
* Point (1) and (2) can be avoided by using `bsdf` and overall it is
|
||||
* more stable than the `sdf` rasterizer.
|
||||
*
|
||||
*/
|
||||
typedef enum FT_Render_Mode_
|
||||
|
@ -4941,7 +4814,7 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
*/
|
||||
#define FREETYPE_MAJOR 2
|
||||
#define FREETYPE_MINOR 12
|
||||
#define FREETYPE_MINOR 11
|
||||
#define FREETYPE_PATCH 1
|
||||
|
||||
|
||||
|
|
|
@ -521,26 +521,21 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* @description:
|
||||
* This iterator object is needed for @FT_Get_Colorline_Stops. It keeps
|
||||
* state while iterating over the stops of an @FT_ColorLine, representing
|
||||
* the `ColorLine` struct of the v1 extensions to 'COLR', see
|
||||
* 'https://github.com/googlefonts/colr-gradients-spec'. Do not manually
|
||||
* modify fields of this iterator.
|
||||
* state while iterating over the stops of an @FT_ColorLine,
|
||||
* representing the `ColorLine` struct of the v1 extensions to 'COLR',
|
||||
* see 'https://github.com/googlefonts/colr-gradients-spec'.
|
||||
*
|
||||
* @fields:
|
||||
* num_color_stops ::
|
||||
* The number of color stops for the requested glyph index. Set by
|
||||
* @FT_Get_Paint.
|
||||
* @FT_Get_Colorline_Stops.
|
||||
*
|
||||
* current_color_stop ::
|
||||
* The current color stop. Set by @FT_Get_Colorline_Stops.
|
||||
*
|
||||
* p ::
|
||||
* An opaque pointer into 'COLR' table data. Set by @FT_Get_Paint.
|
||||
* Updated by @FT_Get_Colorline_Stops.
|
||||
*
|
||||
* read_variable ::
|
||||
* A boolean keeping track of whether variable color lines are to be
|
||||
* read. Set by @FT_Get_Paint.
|
||||
* An opaque pointer into 'COLR' table data. The caller must set this
|
||||
* to `NULL` before the first call of @FT_Get_Colorline_Stops.
|
||||
*
|
||||
* @since:
|
||||
* 2.11 -- **currently experimental only!** There might be changes
|
||||
|
@ -554,8 +549,6 @@ FT_BEGIN_HEADER
|
|||
|
||||
FT_Byte* p;
|
||||
|
||||
FT_Bool read_variable;
|
||||
|
||||
} FT_ColorStopIterator;
|
||||
|
||||
|
||||
|
@ -599,8 +592,7 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* @fields:
|
||||
* stop_offset ::
|
||||
* The stop offset along the gradient, expressed as a 16.16 fixed-point
|
||||
* coordinate.
|
||||
* The stop offset between 0 and 1 along the gradient.
|
||||
*
|
||||
* color ::
|
||||
* The color information for this stop, see @FT_ColorIndex.
|
||||
|
@ -612,7 +604,7 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
typedef struct FT_ColorStop_
|
||||
{
|
||||
FT_Fixed stop_offset;
|
||||
FT_F2Dot14 stop_offset;
|
||||
FT_ColorIndex color;
|
||||
|
||||
} FT_ColorStop;
|
||||
|
|
|
@ -214,9 +214,9 @@ FT_BEGIN_HEADER
|
|||
* itself, it is possible to control its behaviour with @FT_Property_Set
|
||||
* and @FT_Property_Get.
|
||||
*
|
||||
* The TrueType driver's module name is 'truetype'; two properties are
|
||||
* available, @interpreter-version and @TEMPORARY-enable-variable-colrv1, as
|
||||
* documented in the @properties section.
|
||||
* The TrueType driver's module name is 'truetype'; a single property
|
||||
* @interpreter-version is available, as documented in the @properties
|
||||
* section.
|
||||
*
|
||||
* To help understand the differences between interpreter versions, we
|
||||
* introduce a list of definitions, kindly provided by Greg Hitchcock.
|
||||
|
@ -820,48 +820,6 @@ FT_BEGIN_HEADER
|
|||
* 2.5
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @property:
|
||||
* TEMPORARY-enable-variable-colrv1
|
||||
*
|
||||
* @description:
|
||||
* Controls experimental support of variable COLRv1 and whether the COLRv1
|
||||
* implementation should take into account variation deltas. This tells the
|
||||
* COLRv1 API methods whether they should read from the font and apply
|
||||
* variable deltas to COLRv1 properties. The feature is default off. When
|
||||
* on, variable COLRv1 deltas are applied for COLRv1 features for which they
|
||||
* are already implemented. When off, variable deltas are ignored even if
|
||||
* the respective PaintVar* table may already be understood.
|
||||
*
|
||||
* WARNING: Temporary flag during development of variable COLRv1. This flag
|
||||
* will be removed, do not rely on it. Full variable COLRv1 support will be
|
||||
* announced separately.
|
||||
*
|
||||
* @note:
|
||||
* This property cannot be set via the `FREETYPE_PROPERTIES` environment
|
||||
* variable.
|
||||
*
|
||||
* @example:
|
||||
* The following example code demonstrates how to enable variable
|
||||
* COLRv1.
|
||||
*
|
||||
* ```
|
||||
* FT_Library library;
|
||||
* FT_Face face;
|
||||
* FT_Bool variable_colrv1 = TRUE;
|
||||
*
|
||||
*
|
||||
* FT_Init_FreeType( &library );
|
||||
*
|
||||
* FT_Property_Set( library, "truetype",
|
||||
* "TEMPORARY-enable-variable-colrv1",
|
||||
* &variable_colr_v1 );
|
||||
* ```
|
||||
*
|
||||
* @since:
|
||||
* 2.12.2
|
||||
*/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
|
|
@ -401,11 +401,11 @@ FT_BEGIN_HEADER
|
|||
* information.
|
||||
*
|
||||
* FT_OUTLINE_OVERLAP ::
|
||||
* [Since 2.10.3] This flag indicates that this outline contains
|
||||
* overlapping contours and the anti-aliased renderer should perform
|
||||
* oversampling to mitigate possible artifacts. This flag should _not_
|
||||
* be set for well designed glyphs without overlaps because it quadruples
|
||||
* the rendering time.
|
||||
* This flag indicates that this outline contains overlapping contrours
|
||||
* and the anti-aliased renderer should perform oversampling to
|
||||
* mitigate possible artifacts. This flag should _not_ be set for
|
||||
* well designed glyphs without overlaps because it quadruples the
|
||||
* rendering time.
|
||||
*
|
||||
* FT_OUTLINE_HIGH_PRECISION ::
|
||||
* This flag indicates that the scan-line converter should try to
|
||||
|
|
|
@ -398,10 +398,6 @@ FT_BEGIN_HEADER
|
|||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The design coordinates are 16.16 fractional values for TrueType GX and
|
||||
* OpenType variation fonts. For Adobe MM fonts, the values are
|
||||
* integers.
|
||||
*
|
||||
* [Since 2.8.1] To reset all axes to the default values, call the
|
||||
* function with `num_coords` set to zero and `coords` set to `NULL`.
|
||||
* [Since 2.9] 'Default values' means the currently selected named
|
||||
|
@ -444,11 +440,6 @@ FT_BEGIN_HEADER
|
|||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
*
|
||||
* @note:
|
||||
* The design coordinates are 16.16 fractional values for TrueType GX and
|
||||
* OpenType variation fonts. For Adobe MM fonts, the values are
|
||||
* integers.
|
||||
*
|
||||
* @since:
|
||||
* 2.7.1
|
||||
*/
|
||||
|
@ -480,9 +471,9 @@ FT_BEGIN_HEADER
|
|||
* the number of axes, use default values for the remaining axes.
|
||||
*
|
||||
* coords ::
|
||||
* 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.
|
||||
* The design coordinates array (each element 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.
|
||||
|
@ -527,7 +518,7 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* @output:
|
||||
* coords ::
|
||||
* The normalized blend coordinates array (as 16.16 fractional values).
|
||||
* The normalized blend coordinates array.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0~means success.
|
||||
|
|
|
@ -112,21 +112,6 @@ FT_BEGIN_HEADER
|
|||
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_PARAM_TAG_IGNORE_SBIX
|
||||
*
|
||||
* @description:
|
||||
* A tag for @FT_Parameter to make @FT_Open_Face ignore an 'sbix' table
|
||||
* while loading a font. Use this if @FT_FACE_FLAG_SBIX is set and you
|
||||
* want to access the outline glyphs in the font.
|
||||
*
|
||||
*/
|
||||
#define FT_PARAM_TAG_IGNORE_SBIX \
|
||||
FT_MAKE_TAG( 'i', 's', 'b', 'x' )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
|
|
|
@ -293,7 +293,7 @@ FT_BEGIN_HEADER
|
|||
*
|
||||
* miter_limit ::
|
||||
* The maximum reciprocal sine of half-angle at the miter join,
|
||||
* expressed as 16.16 fixed-point value.
|
||||
* expressed as 16.16 fixed point value.
|
||||
*
|
||||
* @note:
|
||||
* The `radius` is expressed in the same units as the outline
|
||||
|
|
|
@ -229,8 +229,7 @@ FT_BEGIN_HEADER
|
|||
* A handle to the source stream.
|
||||
*
|
||||
* offset ::
|
||||
* The offset from the start of the stream to seek to if this is a seek
|
||||
* operation (see note).
|
||||
* The offset of read in stream (always from start).
|
||||
*
|
||||
* buffer ::
|
||||
* The address of the read buffer.
|
||||
|
@ -242,13 +241,8 @@ FT_BEGIN_HEADER
|
|||
* The number of bytes effectively read by the stream.
|
||||
*
|
||||
* @note:
|
||||
* This function performs a seek *or* a read operation depending on the
|
||||
* argument values. If `count` is zero, the operation is a seek to
|
||||
* `offset` bytes. If `count` is >~0, the operation is a read of `count`
|
||||
* bytes from the current position in the stream, and the `offset` value
|
||||
* should be ignored.
|
||||
*
|
||||
* For seek operations, a non-zero return value indicates an error.
|
||||
* This function might be called to perform a seek or skip operation with
|
||||
* a `count` of~0. A non-zero return value then indicates an error.
|
||||
*
|
||||
*/
|
||||
typedef unsigned long
|
||||
|
|
|
@ -315,7 +315,7 @@ FT_BEGIN_HEADER
|
|||
/* The normal stack then points to these values instead of the DICT */
|
||||
/* because all other operators in Private DICT clear the stack. */
|
||||
/* `blend_stack' could be cleared at each operator other than blend. */
|
||||
/* Blended values are stored as 5-byte fixed-point values. */
|
||||
/* Blended values are stored as 5-byte fixed point values. */
|
||||
|
||||
FT_Byte* blend_stack; /* base of stack allocation */
|
||||
FT_Byte* blend_top; /* first empty slot */
|
||||
|
|
|
@ -278,40 +278,6 @@ 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
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
/****************************************************************************
|
||||
*
|
||||
* ftmmtypes.h
|
||||
*
|
||||
* OpenType Variations type definitions for internal use
|
||||
* with the multi-masters service (specification).
|
||||
*
|
||||
* Copyright (C) 2022 by
|
||||
* David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
|
||||
* Dominik Röttsches.
|
||||
*
|
||||
* 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 FTMMTYPES_H_
|
||||
#define FTMMTYPES_H_
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef FT_Int32 FT_ItemVarDelta;
|
||||
|
||||
typedef struct GX_ItemVarDataRec_
|
||||
{
|
||||
FT_UInt itemCount; /* number of delta sets per item */
|
||||
FT_UInt regionIdxCount; /* number of region indices */
|
||||
FT_UInt* regionIndices; /* array of `regionCount' indices; */
|
||||
/* these index `varRegionList' */
|
||||
FT_ItemVarDelta* deltaSet; /* array of `itemCount' deltas */
|
||||
/* use `innerIndex' for this array */
|
||||
|
||||
} GX_ItemVarDataRec, *GX_ItemVarData;
|
||||
|
||||
|
||||
/* contribution of one axis to a region */
|
||||
typedef struct GX_AxisCoordsRec_
|
||||
{
|
||||
FT_Fixed startCoord;
|
||||
FT_Fixed peakCoord; /* zero means no effect (factor = 1) */
|
||||
FT_Fixed endCoord;
|
||||
|
||||
} GX_AxisCoordsRec, *GX_AxisCoords;
|
||||
|
||||
|
||||
typedef struct GX_VarRegionRec_
|
||||
{
|
||||
GX_AxisCoords axisList; /* array of axisCount records */
|
||||
|
||||
} GX_VarRegionRec, *GX_VarRegion;
|
||||
|
||||
|
||||
/* item variation store */
|
||||
typedef struct GX_ItemVarStoreRec_
|
||||
{
|
||||
FT_UInt dataCount;
|
||||
GX_ItemVarData varData; /* array of dataCount records; */
|
||||
/* use `outerIndex' for this array */
|
||||
FT_UShort axisCount;
|
||||
FT_UInt regionCount; /* total number of regions defined */
|
||||
GX_VarRegion varRegionList;
|
||||
|
||||
} GX_ItemVarStoreRec, *GX_ItemVarStore;
|
||||
|
||||
|
||||
typedef struct GX_DeltaSetIdxMapRec_
|
||||
{
|
||||
FT_ULong mapCount;
|
||||
FT_UInt* outerIndex; /* indices to item var data */
|
||||
FT_UInt* innerIndex; /* indices to delta set */
|
||||
|
||||
} GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTMMTYPES_H_ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -238,42 +238,42 @@ FT_BEGIN_HEADER
|
|||
#define FT_NEXT_BYTE( buffer ) \
|
||||
( (unsigned char)*buffer++ )
|
||||
|
||||
#define FT_NEXT_SHORT( buffer ) \
|
||||
( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) )
|
||||
#define FT_NEXT_SHORT( buffer ) \
|
||||
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_USHORT( buffer ) \
|
||||
( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) )
|
||||
#define FT_NEXT_USHORT( buffer ) \
|
||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_OFF3( buffer ) \
|
||||
( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) )
|
||||
#define FT_NEXT_OFF3( buffer ) \
|
||||
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_UOFF3( buffer ) \
|
||||
( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) )
|
||||
#define FT_NEXT_UOFF3( buffer ) \
|
||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_LONG( buffer ) \
|
||||
( buffer += 4, FT_PEEK_LONG( buffer - 4 ) )
|
||||
#define FT_NEXT_LONG( buffer ) \
|
||||
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
|
||||
|
||||
#define FT_NEXT_ULONG( buffer ) \
|
||||
( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) )
|
||||
#define FT_NEXT_ULONG( buffer ) \
|
||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
|
||||
|
||||
|
||||
#define FT_NEXT_SHORT_LE( buffer ) \
|
||||
( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) )
|
||||
#define FT_NEXT_SHORT_LE( buffer ) \
|
||||
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_USHORT_LE( buffer ) \
|
||||
( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) )
|
||||
#define FT_NEXT_USHORT_LE( buffer ) \
|
||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
|
||||
|
||||
#define FT_NEXT_OFF3_LE( buffer ) \
|
||||
( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) )
|
||||
#define FT_NEXT_OFF3_LE( buffer ) \
|
||||
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_UOFF3_LE( buffer ) \
|
||||
( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) )
|
||||
#define FT_NEXT_UOFF3_LE( buffer ) \
|
||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
|
||||
|
||||
#define FT_NEXT_LONG_LE( buffer ) \
|
||||
( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) )
|
||||
#define FT_NEXT_LONG_LE( buffer ) \
|
||||
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
|
||||
|
||||
#define FT_NEXT_ULONG_LE( buffer ) \
|
||||
( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) )
|
||||
#define FT_NEXT_ULONG_LE( buffer ) \
|
||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -307,17 +307,17 @@ FT_BEGIN_HEADER
|
|||
|
||||
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetByte, FT_Char )
|
||||
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetByte, FT_Byte )
|
||||
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Int16 )
|
||||
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UInt16 )
|
||||
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_UInt32 )
|
||||
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Int32 )
|
||||
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
|
||||
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
|
||||
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
|
||||
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
|
||||
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
|
||||
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
|
||||
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
||||
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
||||
|
||||
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Int32 )
|
||||
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UInt32 )
|
||||
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Int32 )
|
||||
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_UInt32 )
|
||||
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
|
||||
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
|
||||
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
|
||||
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -334,16 +334,16 @@ FT_BEGIN_HEADER
|
|||
*/
|
||||
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Byte, var )
|
||||
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Char, var )
|
||||
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Int16, var )
|
||||
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UInt16, var )
|
||||
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_UInt32, var )
|
||||
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Int32, var )
|
||||
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_UInt32, var )
|
||||
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
|
||||
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
|
||||
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
|
||||
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
|
||||
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
|
||||
|
||||
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Int16, var )
|
||||
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UInt16, var )
|
||||
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Int32, var )
|
||||
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_UInt32, var )
|
||||
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
|
||||
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
|
||||
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
|
||||
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
@ -459,23 +459,23 @@ FT_BEGIN_HEADER
|
|||
FT_Stream_GetByte( FT_Stream stream );
|
||||
|
||||
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UInt16 )
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_GetUShort( FT_Stream stream );
|
||||
|
||||
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_GetUOffset( FT_Stream stream );
|
||||
|
||||
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_GetULong( FT_Stream stream );
|
||||
|
||||
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UInt16 )
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_GetUShortLE( FT_Stream stream );
|
||||
|
||||
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_GetULongLE( FT_Stream stream );
|
||||
|
||||
|
||||
|
@ -485,7 +485,7 @@ FT_BEGIN_HEADER
|
|||
FT_Error* error );
|
||||
|
||||
/* read a 16-bit big-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_UInt16 )
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_ReadUShort( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
|
@ -495,17 +495,17 @@ FT_BEGIN_HEADER
|
|||
FT_Error* error );
|
||||
|
||||
/* read a 32-bit big-endian integer from a stream */
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_ReadULong( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 16-bit little-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_UInt16 )
|
||||
FT_BASE( FT_UShort )
|
||||
FT_Stream_ReadUShortLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 32-bit little-endian unsigned integer from a stream */
|
||||
FT_BASE( FT_UInt32 )
|
||||
FT_BASE( FT_ULong )
|
||||
FT_Stream_ReadULongLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* The FreeType Multiple Masters and GX var services (specification).
|
||||
*
|
||||
* Copyright (C) 2003-2022 by
|
||||
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
|
||||
* 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
|
||||
|
@ -20,7 +20,6 @@
|
|||
#define SVMM_H_
|
||||
|
||||
#include <freetype/internal/ftserv.h>
|
||||
#include <freetype/internal/ftmmtypes.h>
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
@ -97,94 +96,53 @@ FT_BEGIN_HEADER
|
|||
FT_UInt* len,
|
||||
FT_Fixed* weight_vector );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face,
|
||||
FT_ULong offset,
|
||||
GX_DeltaSetIdxMap map,
|
||||
GX_ItemVarStore itemStore,
|
||||
FT_ULong table_len );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Var_Load_Item_Var_Store_Func)( FT_Face face,
|
||||
FT_ULong offset,
|
||||
GX_ItemVarStore itemStore );
|
||||
|
||||
typedef FT_ItemVarDelta
|
||||
(*FT_Var_Get_Item_Delta_Func)( FT_Face face,
|
||||
GX_ItemVarStore itemStore,
|
||||
FT_UInt outerIndex,
|
||||
FT_UInt innerIndex );
|
||||
|
||||
typedef void
|
||||
(*FT_Var_Done_Item_Var_Store_Func)( FT_Face face,
|
||||
GX_ItemVarStore itemStore );
|
||||
|
||||
typedef void
|
||||
(*FT_Var_Done_Delta_Set_Idx_Map_Func)( FT_Face face,
|
||||
GX_DeltaSetIdxMap deltaSetIdxMap );
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE( MultiMasters )
|
||||
{
|
||||
FT_Get_MM_Func get_mm;
|
||||
FT_Set_MM_Design_Func set_mm_design;
|
||||
FT_Set_MM_Blend_Func set_mm_blend;
|
||||
FT_Get_MM_Blend_Func get_mm_blend;
|
||||
FT_Get_MM_Var_Func get_mm_var;
|
||||
FT_Set_Var_Design_Func set_var_design;
|
||||
FT_Get_Var_Design_Func get_var_design;
|
||||
FT_Set_Instance_Func set_instance;
|
||||
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
||||
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
||||
FT_Get_MM_Func get_mm;
|
||||
FT_Set_MM_Design_Func set_mm_design;
|
||||
FT_Set_MM_Blend_Func set_mm_blend;
|
||||
FT_Get_MM_Blend_Func get_mm_blend;
|
||||
FT_Get_MM_Var_Func get_mm_var;
|
||||
FT_Set_Var_Design_Func set_var_design;
|
||||
FT_Get_Var_Design_Func get_var_design;
|
||||
FT_Set_Instance_Func set_instance;
|
||||
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
||||
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
||||
|
||||
/* for internal use; only needed for code sharing between modules */
|
||||
FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
|
||||
FT_Var_Load_Item_Var_Store_Func load_item_var_store;
|
||||
FT_Var_Get_Item_Delta_Func get_item_delta;
|
||||
FT_Var_Done_Item_Var_Store_Func done_item_var_store;
|
||||
FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_idx_map;
|
||||
FT_Get_Var_Blend_Func get_var_blend;
|
||||
FT_Done_Blend_Func done_blend;
|
||||
FT_Get_Var_Blend_Func get_var_blend;
|
||||
FT_Done_Blend_Func done_blend;
|
||||
};
|
||||
|
||||
|
||||
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
||||
get_mm_, \
|
||||
set_mm_design_, \
|
||||
set_mm_blend_, \
|
||||
get_mm_blend_, \
|
||||
get_mm_var_, \
|
||||
set_var_design_, \
|
||||
get_var_design_, \
|
||||
set_instance_, \
|
||||
set_weightvector_, \
|
||||
get_weightvector_, \
|
||||
load_delta_set_idx_map_, \
|
||||
load_item_var_store_, \
|
||||
get_item_delta_, \
|
||||
done_item_var_store_, \
|
||||
done_delta_set_idx_map_, \
|
||||
get_var_blend_, \
|
||||
done_blend_ ) \
|
||||
static const FT_Service_MultiMastersRec class_ = \
|
||||
{ \
|
||||
get_mm_, \
|
||||
set_mm_design_, \
|
||||
set_mm_blend_, \
|
||||
get_mm_blend_, \
|
||||
get_mm_var_, \
|
||||
set_var_design_, \
|
||||
get_var_design_, \
|
||||
set_instance_, \
|
||||
set_weightvector_, \
|
||||
get_weightvector_, \
|
||||
load_delta_set_idx_map_, \
|
||||
load_item_var_store_, \
|
||||
get_item_delta_, \
|
||||
done_item_var_store_, \
|
||||
done_delta_set_idx_map_, \
|
||||
get_var_blend_, \
|
||||
done_blend_ \
|
||||
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
||||
get_mm_, \
|
||||
set_mm_design_, \
|
||||
set_mm_blend_, \
|
||||
get_mm_blend_, \
|
||||
get_mm_var_, \
|
||||
set_var_design_, \
|
||||
get_var_design_, \
|
||||
set_instance_, \
|
||||
set_weightvector_, \
|
||||
get_weightvector_, \
|
||||
get_var_blend_, \
|
||||
done_blend_ ) \
|
||||
static const FT_Service_MultiMastersRec class_ = \
|
||||
{ \
|
||||
get_mm_, \
|
||||
set_mm_design_, \
|
||||
set_mm_blend_, \
|
||||
get_mm_blend_, \
|
||||
get_mm_var_, \
|
||||
set_var_design_, \
|
||||
get_var_design_, \
|
||||
set_instance_, \
|
||||
set_weightvector_, \
|
||||
get_weightvector_, \
|
||||
get_var_blend_, \
|
||||
done_blend_ \
|
||||
};
|
||||
|
||||
/* */
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
project('freetype2', 'c',
|
||||
meson_version: '>= 0.55.0',
|
||||
default_options: ['default_library=both'],
|
||||
version: run_command('builds/meson/extract_freetype_version.py',
|
||||
'include/freetype/freetype.h',
|
||||
check: true).stdout().strip(),
|
||||
|
@ -335,8 +336,7 @@ endif
|
|||
# Harfbuzz support
|
||||
harfbuzz_dep = dependency('harfbuzz',
|
||||
version: '>= 2.0.0',
|
||||
required: get_option('harfbuzz'),
|
||||
default_options: ['freetype=disabled'])
|
||||
required: get_option('harfbuzz'))
|
||||
|
||||
if harfbuzz_dep.found()
|
||||
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_HARFBUZZ']
|
||||
|
|
|
@ -1085,71 +1085,4 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Int32 )
|
||||
FT_MulAddFix( FT_Fixed* s,
|
||||
FT_Int32* f,
|
||||
FT_UInt count )
|
||||
{
|
||||
FT_UInt i;
|
||||
FT_Int64 temp;
|
||||
#ifndef FT_INT64
|
||||
FT_Int64 halfUnit;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FT_INT64
|
||||
temp = 0;
|
||||
|
||||
for ( i = 0; i < count; ++i )
|
||||
temp += (FT_Int64)s[i] * f[i];
|
||||
|
||||
return ( 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;
|
||||
|
||||
|
||||
scalar = (FT_UInt32)s[i];
|
||||
factor = (FT_UInt32)f[i];
|
||||
|
||||
FT_MOVE_SIGN( s[i], scalar, sign );
|
||||
FT_MOVE_SIGN( 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 );
|
||||
}
|
||||
|
||||
/* Round value. */
|
||||
halfUnit.hi = 0;
|
||||
halfUnit.lo = 0x8000;
|
||||
FT_Add64( &temp, &halfUnit, &temp );
|
||||
|
||||
return (FT_Int32)( ( (FT_Int32)( temp.hi & 0xFFFF ) << 16 ) |
|
||||
( temp.lo >> 16 ) );
|
||||
|
||||
#endif /* !FT_INT64 */
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
|
||||
error = FT_GlyphLoader_CreateExtra( loader );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
return error;
|
||||
|
||||
/* check points & tags */
|
||||
new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points +
|
||||
|
@ -229,10 +229,7 @@
|
|||
new_max = FT_PAD_CEIL( new_max, 8 );
|
||||
|
||||
if ( new_max > FT_OUTLINE_POINTS_MAX )
|
||||
{
|
||||
error = FT_THROW( Array_Too_Large );
|
||||
goto Exit;
|
||||
}
|
||||
return FT_THROW( Array_Too_Large );
|
||||
|
||||
if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
|
||||
FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
|
||||
|
@ -257,7 +254,7 @@
|
|||
|
||||
error = FT_GlyphLoader_CreateExtra( loader );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
return error;
|
||||
|
||||
/* check contours */
|
||||
old_max = loader->max_contours;
|
||||
|
@ -268,10 +265,7 @@
|
|||
new_max = FT_PAD_CEIL( new_max, 4 );
|
||||
|
||||
if ( new_max > FT_OUTLINE_CONTOURS_MAX )
|
||||
{
|
||||
error = FT_THROW( Array_Too_Large );
|
||||
goto Exit;
|
||||
}
|
||||
return FT_THROW( Array_Too_Large );
|
||||
|
||||
if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
|
||||
goto Exit;
|
||||
|
|
|
@ -469,7 +469,7 @@
|
|||
FT_Error error = FT_Err_Ok;
|
||||
FT_Memory memory = svg_glyph->library->memory;
|
||||
|
||||
FT_SVG_Document document = NULL;
|
||||
FT_SVG_Document document;
|
||||
|
||||
|
||||
if ( FT_NEW( document ) )
|
||||
|
|
|
@ -314,7 +314,7 @@
|
|||
NULL, NULL, NULL ) )
|
||||
return ( OSType ) 0;
|
||||
|
||||
return ( (FInfo *)( info.finderInfo ) )->fdType;
|
||||
return ((FInfo *)(info.finderInfo))->fdType;
|
||||
}
|
||||
|
||||
|
||||
|
@ -462,7 +462,7 @@
|
|||
|
||||
if ( ps_name_len != 0 )
|
||||
{
|
||||
ft_memcpy( ps_name, names[0] + 1, ps_name_len );
|
||||
ft_memcpy(ps_name, names[0] + 1, ps_name_len);
|
||||
ps_name[ps_name_len] = 0;
|
||||
}
|
||||
if ( style->indexes[face_index] > 1 &&
|
||||
|
|
|
@ -334,7 +334,7 @@
|
|||
/* if SVG table exists, allocate the space in `slot->other` */
|
||||
if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
|
||||
{
|
||||
FT_SVG_Document document = NULL;
|
||||
FT_SVG_Document document;
|
||||
|
||||
|
||||
if ( FT_NEW( document ) )
|
||||
|
@ -605,7 +605,7 @@
|
|||
|
||||
|
||||
FT_FREE( doc->svg_document );
|
||||
slot->internal->flags &= ~FT_GLYPH_OWN_GZIP_SVG;
|
||||
slot->internal->load_flags &= ~FT_GLYPH_OWN_GZIP_SVG;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -2215,8 +2215,7 @@
|
|||
if ( FT_QALLOC( sfnt_data, rlen ) )
|
||||
return error;
|
||||
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, (FT_ULong)rlen );
|
||||
if ( error )
|
||||
{
|
||||
if ( error ) {
|
||||
FT_FREE( sfnt_data );
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -2528,16 +2527,6 @@
|
|||
#endif
|
||||
|
||||
|
||||
/* only use lower 31 bits together with sign bit */
|
||||
if ( face_index > 0 )
|
||||
face_index &= 0x7FFFFFFFL;
|
||||
else
|
||||
{
|
||||
face_index = -face_index;
|
||||
face_index &= 0x7FFFFFFFL;
|
||||
face_index = -face_index;
|
||||
}
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
FT_TRACE3(( "FT_Open_Face: " ));
|
||||
if ( face_index < 0 )
|
||||
|
@ -3410,9 +3399,6 @@
|
|||
if ( !face )
|
||||
return FT_THROW( Invalid_Face_Handle );
|
||||
|
||||
if ( !face->size )
|
||||
return FT_THROW( Invalid_Size_Handle );
|
||||
|
||||
if ( !req || req->width < 0 || req->height < 0 ||
|
||||
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
|
|
@ -402,17 +402,17 @@
|
|||
FT_Long *result_offset );
|
||||
|
||||
|
||||
CONST_FT_RFORK_RULE_ARRAY_BEGIN( ft_raccess_guess_table,
|
||||
ft_raccess_guess_rec )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( apple_double, apple_double )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( apple_single, apple_single )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_ufs_export, darwin_ufs_export )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_newvfs, darwin_newvfs )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_hfsplus, darwin_hfsplus )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( vfat, vfat )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( linux_cap, linux_cap )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( linux_double, linux_double )
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY( linux_netatalk, linux_netatalk )
|
||||
CONST_FT_RFORK_RULE_ARRAY_BEGIN(ft_raccess_guess_table,
|
||||
ft_raccess_guess_rec)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_double, apple_double)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_single, apple_single)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_ufs_export, darwin_ufs_export)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_newvfs, darwin_newvfs)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_hfsplus, darwin_hfsplus)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(vfat, vfat)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_cap, linux_cap)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_double, linux_double)
|
||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_netatalk, linux_netatalk)
|
||||
CONST_FT_RFORK_RULE_ARRAY_END
|
||||
|
||||
|
||||
|
|
|
@ -363,11 +363,11 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt16 )
|
||||
FT_BASE_DEF( FT_UShort )
|
||||
FT_Stream_GetUShort( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_UInt16 result;
|
||||
FT_UShort result;
|
||||
|
||||
|
||||
FT_ASSERT( stream && stream->cursor );
|
||||
|
@ -382,11 +382,11 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt16 )
|
||||
FT_BASE_DEF( FT_UShort )
|
||||
FT_Stream_GetUShortLE( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_UInt16 result;
|
||||
FT_UShort result;
|
||||
|
||||
|
||||
FT_ASSERT( stream && stream->cursor );
|
||||
|
@ -401,11 +401,11 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt32 )
|
||||
FT_BASE_DEF( FT_ULong )
|
||||
FT_Stream_GetUOffset( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_UInt32 result;
|
||||
FT_ULong result;
|
||||
|
||||
|
||||
FT_ASSERT( stream && stream->cursor );
|
||||
|
@ -419,11 +419,11 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt32 )
|
||||
FT_BASE_DEF( FT_ULong )
|
||||
FT_Stream_GetULong( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_UInt32 result;
|
||||
FT_ULong result;
|
||||
|
||||
|
||||
FT_ASSERT( stream && stream->cursor );
|
||||
|
@ -437,11 +437,11 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt32 )
|
||||
FT_BASE_DEF( FT_ULong )
|
||||
FT_Stream_GetULongLE( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_UInt32 result;
|
||||
FT_ULong result;
|
||||
|
||||
|
||||
FT_ASSERT( stream && stream->cursor );
|
||||
|
@ -493,13 +493,13 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt16 )
|
||||
FT_BASE_DEF( FT_UShort )
|
||||
FT_Stream_ReadUShort( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[2];
|
||||
FT_Byte* p;
|
||||
FT_UInt16 result = 0;
|
||||
FT_UShort result = 0;
|
||||
|
||||
|
||||
FT_ASSERT( stream );
|
||||
|
@ -538,13 +538,13 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt16 )
|
||||
FT_BASE_DEF( FT_UShort )
|
||||
FT_Stream_ReadUShortLE( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[2];
|
||||
FT_Byte* p;
|
||||
FT_UInt16 result = 0;
|
||||
FT_UShort result = 0;
|
||||
|
||||
|
||||
FT_ASSERT( stream );
|
||||
|
@ -628,13 +628,13 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt32 )
|
||||
FT_BASE_DEF( FT_ULong )
|
||||
FT_Stream_ReadULong( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[4];
|
||||
FT_Byte* p;
|
||||
FT_UInt32 result = 0;
|
||||
FT_ULong result = 0;
|
||||
|
||||
|
||||
FT_ASSERT( stream );
|
||||
|
@ -673,13 +673,13 @@
|
|||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_UInt32 )
|
||||
FT_BASE_DEF( FT_ULong )
|
||||
FT_Stream_ReadULongLE( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[4];
|
||||
FT_Byte* p;
|
||||
FT_UInt32 result = 0;
|
||||
FT_ULong result = 0;
|
||||
|
||||
|
||||
FT_ASSERT( stream );
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
#include<windows.h>
|
||||
|
||||
#define FT_VERSION 2,12,1,0
|
||||
#define FT_VERSION_STR "2.12.1"
|
||||
#define FT_VERSION 2,11,1,0
|
||||
#define FT_VERSION_STR "2.11.1"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION FT_VERSION
|
||||
|
@ -45,7 +45,7 @@ BEGIN
|
|||
VALUE "FileVersion", FT_VERSION_STR
|
||||
VALUE "ProductName", "FreeType"
|
||||
VALUE "ProductVersion", FT_VERSION_STR
|
||||
VALUE "LegalCopyright", "\251 2000-2022 The FreeType Project www.freetype.org. All rights reserved."
|
||||
VALUE "LegalCopyright", "\251 2000-2021 The FreeType Project www.freetype.org. All rights reserved."
|
||||
VALUE "InternalName", "freetype"
|
||||
VALUE "OriginalFilename", FT_FILENAME
|
||||
END
|
||||
|
|
|
@ -57,9 +57,8 @@
|
|||
/* it is better to use FreeType memory routines instead of raw
|
||||
'malloc/free' */
|
||||
|
||||
typedef void* (*alloc_func)( void*, int, int );
|
||||
typedef void (*free_func) ( void*, void* );
|
||||
|
||||
typedef void *(* alloc_func)(void*, int, int);
|
||||
typedef void (* free_func)(void*, void*);
|
||||
|
||||
static void*
|
||||
ft_bzip2_alloc( FT_Memory memory,
|
||||
|
|
|
@ -210,7 +210,7 @@ FT_BEGIN_HEADER
|
|||
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_Node *_bucket, *_pnode, _node; \
|
||||
FTC_Cache _cache = FTC_CACHE( cache ); \
|
||||
FTC_Cache _cache = FTC_CACHE(cache); \
|
||||
FT_Offset _hash = (FT_Offset)(hash); \
|
||||
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
|
||||
FT_Bool _list_changed = FALSE; \
|
||||
|
|
|
@ -112,7 +112,7 @@
|
|||
FTC_CMapQuery query = (FTC_CMapQuery)ftcquery;
|
||||
FT_Error error;
|
||||
FT_Memory memory = cache->memory;
|
||||
FTC_CMapNode node = NULL;
|
||||
FTC_CMapNode node;
|
||||
FT_UInt nn;
|
||||
|
||||
|
||||
|
|
|
@ -140,8 +140,8 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FTC_FamilyRec, *FTC_Family;
|
||||
|
||||
#define FTC_FAMILY( x ) ( (FTC_Family)(x) )
|
||||
#define FTC_FAMILY_P( x ) ( (FTC_Family*)(x) )
|
||||
#define FTC_FAMILY(x) ( (FTC_Family)(x) )
|
||||
#define FTC_FAMILY_P(x) ( (FTC_Family*)(x) )
|
||||
|
||||
|
||||
typedef struct FTC_GNodeRec_
|
||||
|
@ -245,7 +245,7 @@ FT_BEGIN_HEADER
|
|||
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
|
||||
|
||||
#define FTC_CACHE_GCACHE_CLASS( x ) \
|
||||
FTC_GCACHE_CLASS( FTC_CACHE( x )->org_class )
|
||||
FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
|
||||
#define FTC_CACHE_FAMILY_CLASS( x ) \
|
||||
( (FTC_MruListClass)FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
{
|
||||
FT_Memory memory = cache->memory;
|
||||
FT_Error error;
|
||||
FTC_INode inode = NULL;
|
||||
FTC_INode inode;
|
||||
|
||||
|
||||
if ( !FT_QNEW( inode ) )
|
||||
|
|
|
@ -51,8 +51,8 @@ FT_BEGIN_HEADER
|
|||
} FTC_INodeRec, *FTC_INode;
|
||||
|
||||
#define FTC_INODE( x ) ( (FTC_INode)( x ) )
|
||||
#define FTC_INODE_GINDEX( x ) FTC_GNODE( x )->gindex
|
||||
#define FTC_INODE_FAMILY( x ) FTC_GNODE( x )->family
|
||||
#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
|
||||
#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
|
@ -72,7 +72,7 @@ FT_BEGIN_HEADER
|
|||
#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
|
||||
|
||||
#define FTC_CACHE_IFAMILY_CLASS( x ) \
|
||||
FTC_IFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
||||
FTC_IFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS(x)->family_class )
|
||||
|
||||
|
||||
/* can be used as a @FTC_Node_FreeFunc */
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
sbit->xadvance = (FT_Char)xadvance;
|
||||
sbit->yadvance = (FT_Char)yadvance;
|
||||
sbit->format = (FT_Byte)bitmap->pixel_mode;
|
||||
sbit->max_grays = (FT_Byte)( bitmap->num_grays - 1 );
|
||||
sbit->max_grays = (FT_Byte)(bitmap->num_grays - 1);
|
||||
|
||||
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
typedef const FTC_SFamilyClassRec* FTC_SFamilyClass;
|
||||
|
||||
#define FTC_SFAMILY_CLASS( x ) ( (FTC_SFamilyClass)(x) )
|
||||
#define FTC_SFAMILY_CLASS( x ) ((FTC_SFamilyClass)(x))
|
||||
|
||||
#define FTC_CACHE_SFAMILY_CLASS( x ) \
|
||||
FTC_SFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
|
||||
if ( char_code < 255 )
|
||||
{
|
||||
FT_UInt code = (FT_UInt)( char_code + 1 );
|
||||
FT_UInt code = (FT_UInt)(char_code + 1);
|
||||
|
||||
|
||||
for (;;)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* OpenType font driver implementation (body).
|
||||
*
|
||||
* Copyright (C) 1996-2022 by
|
||||
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
|
||||
* 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
|
||||
|
@ -936,103 +936,22 @@
|
|||
}
|
||||
|
||||
|
||||
static FT_Error
|
||||
cff_load_item_variation_store( CFF_Face face,
|
||||
FT_ULong offset,
|
||||
GX_ItemVarStore itemStore )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
return mm->load_item_var_store( FT_FACE(face), offset, itemStore );
|
||||
}
|
||||
|
||||
|
||||
static FT_Error
|
||||
cff_load_delta_set_index_mapping( CFF_Face face,
|
||||
FT_ULong offset,
|
||||
GX_DeltaSetIdxMap map,
|
||||
GX_ItemVarStore itemStore,
|
||||
FT_ULong table_len )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
return mm->load_delta_set_idx_map( FT_FACE( face ), offset, map,
|
||||
itemStore, table_len );
|
||||
}
|
||||
|
||||
|
||||
static FT_Int
|
||||
cff_get_item_delta( CFF_Face face,
|
||||
GX_ItemVarStore itemStore,
|
||||
FT_UInt outerIndex,
|
||||
FT_UInt innerIndex )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
return mm->get_item_delta( FT_FACE( face ), itemStore,
|
||||
outerIndex, innerIndex );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cff_done_item_variation_store( CFF_Face face,
|
||||
GX_ItemVarStore itemStore )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
mm->done_item_var_store( FT_FACE( face ), itemStore );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cff_done_delta_set_index_map( CFF_Face face,
|
||||
GX_DeltaSetIdxMap deltaSetIdxMap )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
mm->done_delta_set_idx_map( FT_FACE ( face ), deltaSetIdxMap );
|
||||
}
|
||||
|
||||
|
||||
|
||||
FT_DEFINE_SERVICE_MULTIMASTERSREC(
|
||||
cff_service_multi_masters,
|
||||
|
||||
(FT_Get_MM_Func) NULL, /* get_mm */
|
||||
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
||||
(FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
|
||||
(FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
|
||||
(FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
|
||||
(FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */
|
||||
(FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */
|
||||
(FT_Set_Instance_Func) cff_set_instance, /* set_instance */
|
||||
(FT_Set_MM_WeightVector_Func)
|
||||
cff_set_mm_weightvector,
|
||||
/* set_mm_weightvector */
|
||||
(FT_Get_MM_WeightVector_Func)
|
||||
cff_get_mm_weightvector,
|
||||
/* get_mm_weightvector */
|
||||
(FT_Var_Load_Delta_Set_Idx_Map_Func)
|
||||
cff_load_delta_set_index_mapping,
|
||||
/* load_delta_set_idx_map */
|
||||
(FT_Var_Load_Item_Var_Store_Func)
|
||||
cff_load_item_variation_store,
|
||||
/* load_item_variation_store */
|
||||
(FT_Var_Get_Item_Delta_Func)
|
||||
cff_get_item_delta, /* get_item_delta */
|
||||
(FT_Var_Done_Item_Var_Store_Func)
|
||||
cff_done_item_variation_store,
|
||||
/* done_item_variation_store */
|
||||
(FT_Var_Done_Delta_Set_Idx_Map_Func)
|
||||
cff_done_delta_set_index_map,
|
||||
/* done_delta_set_index_map */
|
||||
(FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
|
||||
(FT_Done_Blend_Func) cff_done_blend /* done_blend */
|
||||
(FT_Get_MM_Func) NULL, /* get_mm */
|
||||
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
||||
(FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
|
||||
(FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
|
||||
(FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
|
||||
(FT_Set_Var_Design_Func) cff_set_var_design, /* set_var_design */
|
||||
(FT_Get_Var_Design_Func) cff_get_var_design, /* get_var_design */
|
||||
(FT_Set_Instance_Func) cff_set_instance, /* set_instance */
|
||||
(FT_Set_MM_WeightVector_Func)cff_set_mm_weightvector, /* set_mm_weightvector */
|
||||
(FT_Get_MM_WeightVector_Func)cff_get_mm_weightvector, /* get_mm_weightvector */
|
||||
|
||||
(FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
|
||||
(FT_Done_Blend_Func) cff_done_blend /* done_blend */
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -29,14 +29,6 @@
|
|||
|
||||
#include "cfferrs.h"
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
#define IS_DEFAULT_INSTANCE( _face ) \
|
||||
( !( FT_IS_NAMED_INSTANCE( _face ) || \
|
||||
FT_IS_VARIATION( _face ) ) )
|
||||
#else
|
||||
#define IS_DEFAULT_INSTANCE( _face ) 1
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
|
@ -75,7 +67,7 @@
|
|||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
||||
{
|
||||
CFF_Font cff = (CFF_Font)( face->extra.data );
|
||||
CFF_Font cff = (CFF_Font)(face->extra.data);
|
||||
|
||||
|
||||
return cff_index_access_element( &cff->charstrings_index, glyph_index,
|
||||
|
@ -111,7 +103,7 @@
|
|||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
|
||||
{
|
||||
CFF_Font cff = (CFF_Font)( face->extra.data );
|
||||
CFF_Font cff = (CFF_Font)(face->extra.data);
|
||||
|
||||
|
||||
cff_index_forget_element( &cff->charstrings_index, pointer );
|
||||
|
@ -263,8 +255,8 @@
|
|||
|
||||
|
||||
if ( size->strike_index != 0xFFFFFFFFUL &&
|
||||
( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
|
||||
IS_DEFAULT_INSTANCE( size->root.face ) )
|
||||
sfnt->load_eblc &&
|
||||
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
|
||||
{
|
||||
TT_SBit_MetricsRec metrics;
|
||||
|
||||
|
@ -370,8 +362,8 @@
|
|||
SFNT_Service sfnt;
|
||||
|
||||
|
||||
if ( size && (size->root.metrics.x_ppem < 1 ||
|
||||
size->root.metrics.y_ppem < 1 ) )
|
||||
if ( size->root.metrics.x_ppem < 1 ||
|
||||
size->root.metrics.y_ppem < 1 )
|
||||
{
|
||||
error = FT_THROW( Invalid_Size_Handle );
|
||||
return error;
|
||||
|
@ -404,9 +396,6 @@
|
|||
&dummy,
|
||||
&advanceY );
|
||||
|
||||
glyph->root.linearHoriAdvance = advanceX;
|
||||
glyph->root.linearVertAdvance = advanceY;
|
||||
|
||||
advanceX =
|
||||
(FT_UShort)FT_MulDiv( advanceX,
|
||||
glyph->root.face->size->metrics.x_ppem,
|
||||
|
|
|
@ -1288,7 +1288,7 @@
|
|||
/* Blended values are written to a different buffer, */
|
||||
/* using reserved operator 255. */
|
||||
/* */
|
||||
/* Blend calculation is done in 16.16 fixed-point. */
|
||||
/* Blend calculation is done in 16.16 fixed point. */
|
||||
FT_LOCAL_DEF( FT_Error )
|
||||
cff_blend_doBlend( CFF_SubFont subFont,
|
||||
CFF_Parser parser,
|
||||
|
@ -1364,7 +1364,7 @@
|
|||
FT_UInt32 sum;
|
||||
|
||||
|
||||
/* convert inputs to 16.16 fixed-point */
|
||||
/* convert inputs to 16.16 fixed point */
|
||||
sum = cff_parse_num( parser, &parser->stack[i + base] ) * 0x10000;
|
||||
|
||||
for ( j = 1; j < blend->lenBV; j++ )
|
||||
|
@ -1373,7 +1373,7 @@
|
|||
/* point parser stack to new value on blend_stack */
|
||||
parser->stack[i + base] = subFont->blend_top;
|
||||
|
||||
/* Push blended result as Type 2 5-byte fixed-point number. This */
|
||||
/* Push blended result as Type 2 5-byte fixed point number. This */
|
||||
/* will not conflict with actual DICTs because 255 is a reserved */
|
||||
/* opcode in both CFF and CFF2 DICTs. See `cff_parse_num' for */
|
||||
/* decode of this, which rounds to an integer. */
|
||||
|
|
|
@ -530,7 +530,7 @@
|
|||
|
||||
else if ( **d == 255 )
|
||||
{
|
||||
/* 16.16 fixed-point is used internally for CFF2 blend results. */
|
||||
/* 16.16 fixed point is used internally for CFF2 blend results. */
|
||||
/* Since these are trusted values, a limit check is not needed. */
|
||||
|
||||
/* After the 255, 4 bytes give the number. */
|
||||
|
|
|
@ -1033,7 +1033,7 @@
|
|||
GXV_NAME_ENTER( "StateArray" );
|
||||
|
||||
GXV_TRACE(( "parse %d bytes by stateSize=%d maxClassID=%d\n",
|
||||
(int)( *length_p ), stateSize, (int)maxClassID ));
|
||||
(int)(*length_p), stateSize, (int)(maxClassID) ));
|
||||
|
||||
/*
|
||||
* 2 states are predefined and must be described in StateArray:
|
||||
|
@ -1418,7 +1418,7 @@
|
|||
GXV_NAME_ENTER( "XStateArray" );
|
||||
|
||||
GXV_TRACE(( "parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\n",
|
||||
(int)( *length_p ), (int)stateSize, (int)maxClassID ));
|
||||
(int)(*length_p), (int)stateSize, (int)(maxClassID) ));
|
||||
|
||||
/*
|
||||
* 2 states are predefined and must be described:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Name: zlib
|
||||
Short Name: zlib
|
||||
URL: http://zlib.net/
|
||||
Version: 1.2.12
|
||||
Version: 1.2.11
|
||||
License: see `zlib.h`
|
||||
|
||||
Description:
|
||||
|
|
1294
src/gzip/crc32.c
1294
src/gzip/crc32.c
File diff suppressed because it is too large
Load Diff
9877
src/gzip/crc32.h
9877
src/gzip/crc32.h
File diff suppressed because it is too large
Load Diff
|
@ -790,9 +790,6 @@
|
|||
if ( err == Z_DATA_ERROR )
|
||||
return FT_THROW( Invalid_Table );
|
||||
|
||||
if ( err == Z_NEED_DICT )
|
||||
return FT_THROW( Invalid_Table );
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* gzguts.h -- zlib internal header definitions for gz* operations
|
||||
* Copyright (C) 2004-2019 Mark Adler
|
||||
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
|||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
# define WIDECHAR
|
||||
#endif
|
||||
|
||||
|
@ -190,7 +190,6 @@ typedef struct {
|
|||
/* just for writing */
|
||||
int level; /* compression level */
|
||||
int strategy; /* compression strategy */
|
||||
int reset; /* true if a reset is pending after a Z_FINISH */
|
||||
/* seek request */
|
||||
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
||||
int seek; /* true if seek request pending */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* infback.c -- inflate using a call-back interface
|
||||
* Copyright (C) 1995-2022 Mark Adler
|
||||
* Copyright (C) 1995-2016 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
|
@ -477,7 +477,6 @@ int ZEXPORT inflateBack(
|
|||
}
|
||||
Tracev((stderr, "inflate: codes ok\n"));
|
||||
state->mode = LEN;
|
||||
/* fallthrough */
|
||||
|
||||
case LEN:
|
||||
/* use inflate_fast() if we have enough input and output */
|
||||
|
|
|
@ -70,7 +70,7 @@ void ZLIB_INTERNAL inflate_fast(
|
|||
code const FAR *dcode; /* local strm->distcode */
|
||||
unsigned lmask; /* mask for first level of length codes */
|
||||
unsigned dmask; /* mask for first level of distance codes */
|
||||
code const *here; /* retrieved table entry */
|
||||
code here; /* retrieved table entry */
|
||||
unsigned op; /* code bits, operation, extra bits, or */
|
||||
/* window position, window bytes to copy */
|
||||
unsigned len; /* match length, unused bytes */
|
||||
|
@ -107,20 +107,20 @@ void ZLIB_INTERNAL inflate_fast(
|
|||
hold += (unsigned long)(*in++) << bits;
|
||||
bits += 8;
|
||||
}
|
||||
here = lcode + (hold & lmask);
|
||||
here = lcode[hold & lmask];
|
||||
dolen:
|
||||
op = (unsigned)(here->bits);
|
||||
op = (unsigned)(here.bits);
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
op = (unsigned)(here->op);
|
||||
op = (unsigned)(here.op);
|
||||
if (op == 0) { /* literal */
|
||||
Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
|
||||
Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
|
||||
"inflate: literal '%c'\n" :
|
||||
"inflate: literal 0x%02x\n", here->val));
|
||||
*out++ = (unsigned char)(here->val);
|
||||
"inflate: literal 0x%02x\n", here.val));
|
||||
*out++ = (unsigned char)(here.val);
|
||||
}
|
||||
else if (op & 16) { /* length base */
|
||||
len = (unsigned)(here->val);
|
||||
len = (unsigned)(here.val);
|
||||
op &= 15; /* number of extra bits */
|
||||
if (op) {
|
||||
if (bits < op) {
|
||||
|
@ -138,14 +138,14 @@ void ZLIB_INTERNAL inflate_fast(
|
|||
hold += (unsigned long)(*in++) << bits;
|
||||
bits += 8;
|
||||
}
|
||||
here = dcode + (hold & dmask);
|
||||
here = dcode[hold & dmask];
|
||||
dodist:
|
||||
op = (unsigned)(here->bits);
|
||||
op = (unsigned)(here.bits);
|
||||
hold >>= op;
|
||||
bits -= op;
|
||||
op = (unsigned)(here->op);
|
||||
op = (unsigned)(here.op);
|
||||
if (op & 16) { /* distance base */
|
||||
dist = (unsigned)(here->val);
|
||||
dist = (unsigned)(here.val);
|
||||
op &= 15; /* number of extra bits */
|
||||
if (bits < op) {
|
||||
hold += (unsigned long)(*in++) << bits;
|
||||
|
@ -264,7 +264,7 @@ void ZLIB_INTERNAL inflate_fast(
|
|||
}
|
||||
}
|
||||
else if ((op & 64) == 0) { /* 2nd level distance code */
|
||||
here = dcode + here->val + (hold & ((1U << op) - 1));
|
||||
here = dcode[here.val + (hold & ((1U << op) - 1))];
|
||||
goto dodist;
|
||||
}
|
||||
else {
|
||||
|
@ -274,7 +274,7 @@ void ZLIB_INTERNAL inflate_fast(
|
|||
}
|
||||
}
|
||||
else if ((op & 64) == 0) { /* 2nd level length code */
|
||||
here = lcode + here->val + (hold & ((1U << op) - 1));
|
||||
here = lcode[here.val + (hold & ((1U << op) - 1))];
|
||||
goto dolen;
|
||||
}
|
||||
else if (op & 32) { /* end-of-block */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* inflate.c -- zlib decompression
|
||||
* Copyright (C) 1995-2022 Mark Adler
|
||||
* Copyright (C) 1995-2016 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
|
@ -132,7 +132,6 @@ int ZEXPORT inflateResetKeep(
|
|||
state->mode = HEAD;
|
||||
state->last = 0;
|
||||
state->havedict = 0;
|
||||
state->flags = -1;
|
||||
state->dmax = 32768U;
|
||||
state->head = Z_NULL;
|
||||
state->hold = 0;
|
||||
|
@ -270,7 +269,7 @@ int ZEXPORT inflatePrime(
|
|||
return Z_OK;
|
||||
}
|
||||
|
||||
#endif /* !Z_FREETYPE */
|
||||
#endif /* Z_FREETYPE */
|
||||
|
||||
/*
|
||||
Return state with length and distance decoding tables and index sizes set to
|
||||
|
@ -454,10 +453,10 @@ local int updatewindow(
|
|||
|
||||
/* check function to use adler32() for zlib or crc32() for gzip */
|
||||
#ifdef GUNZIP
|
||||
# define UPDATE_CHECK(check, buf, len) \
|
||||
# define UPDATE(check, buf, len) \
|
||||
(state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
|
||||
#else
|
||||
# define UPDATE_CHECK(check, buf, len) adler32(check, buf, len)
|
||||
# define UPDATE(check, buf, len) adler32(check, buf, len)
|
||||
#endif
|
||||
|
||||
/* check macros for header crc */
|
||||
|
@ -677,6 +676,7 @@ int ZEXPORT inflate(
|
|||
state->mode = FLAGS;
|
||||
break;
|
||||
}
|
||||
state->flags = 0; /* expect zlib header */
|
||||
if (state->head != Z_NULL)
|
||||
state->head->done = -1;
|
||||
if (!(state->wrap & 1) || /* check if zlib header allowed */
|
||||
|
@ -703,7 +703,6 @@ int ZEXPORT inflate(
|
|||
break;
|
||||
}
|
||||
state->dmax = 1U << len;
|
||||
state->flags = 0; /* indicate zlib header */
|
||||
Tracev((stderr, "inflate: zlib header ok\n"));
|
||||
strm->adler = state->check = adler32(0L, Z_NULL, 0);
|
||||
state->mode = hold & 0x200 ? DICTID : TYPE;
|
||||
|
@ -729,7 +728,6 @@ int ZEXPORT inflate(
|
|||
CRC2(state->check, hold);
|
||||
INITBITS();
|
||||
state->mode = TIME;
|
||||
/* fallthrough */
|
||||
case TIME:
|
||||
NEEDBITS(32);
|
||||
if (state->head != Z_NULL)
|
||||
|
@ -738,7 +736,6 @@ int ZEXPORT inflate(
|
|||
CRC4(state->check, hold);
|
||||
INITBITS();
|
||||
state->mode = OS;
|
||||
/* fallthrough */
|
||||
case OS:
|
||||
NEEDBITS(16);
|
||||
if (state->head != Z_NULL) {
|
||||
|
@ -749,7 +746,6 @@ int ZEXPORT inflate(
|
|||
CRC2(state->check, hold);
|
||||
INITBITS();
|
||||
state->mode = EXLEN;
|
||||
/* fallthrough */
|
||||
case EXLEN:
|
||||
if (state->flags & 0x0400) {
|
||||
NEEDBITS(16);
|
||||
|
@ -763,7 +759,6 @@ int ZEXPORT inflate(
|
|||
else if (state->head != Z_NULL)
|
||||
state->head->extra = Z_NULL;
|
||||
state->mode = EXTRA;
|
||||
/* fallthrough */
|
||||
case EXTRA:
|
||||
if (state->flags & 0x0400) {
|
||||
copy = state->length;
|
||||
|
@ -786,7 +781,6 @@ int ZEXPORT inflate(
|
|||
}
|
||||
state->length = 0;
|
||||
state->mode = NAME;
|
||||
/* fallthrough */
|
||||
case NAME:
|
||||
if (state->flags & 0x0800) {
|
||||
if (have == 0) goto inf_leave;
|
||||
|
@ -808,7 +802,6 @@ int ZEXPORT inflate(
|
|||
state->head->name = Z_NULL;
|
||||
state->length = 0;
|
||||
state->mode = COMMENT;
|
||||
/* fallthrough */
|
||||
case COMMENT:
|
||||
if (state->flags & 0x1000) {
|
||||
if (have == 0) goto inf_leave;
|
||||
|
@ -829,7 +822,6 @@ int ZEXPORT inflate(
|
|||
else if (state->head != Z_NULL)
|
||||
state->head->comment = Z_NULL;
|
||||
state->mode = HCRC;
|
||||
/* fallthrough */
|
||||
case HCRC:
|
||||
if (state->flags & 0x0200) {
|
||||
NEEDBITS(16);
|
||||
|
@ -853,7 +845,6 @@ int ZEXPORT inflate(
|
|||
strm->adler = state->check = ZSWAP32(hold);
|
||||
INITBITS();
|
||||
state->mode = DICT;
|
||||
/* fallthrough */
|
||||
case DICT:
|
||||
if (state->havedict == 0) {
|
||||
RESTORE();
|
||||
|
@ -861,10 +852,8 @@ int ZEXPORT inflate(
|
|||
}
|
||||
strm->adler = state->check = adler32(0L, Z_NULL, 0);
|
||||
state->mode = TYPE;
|
||||
/* fallthrough */
|
||||
case TYPE:
|
||||
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
|
||||
/* fallthrough */
|
||||
case TYPEDO:
|
||||
if (state->last) {
|
||||
BYTEBITS();
|
||||
|
@ -915,10 +904,8 @@ int ZEXPORT inflate(
|
|||
INITBITS();
|
||||
state->mode = COPY_;
|
||||
if (flush == Z_TREES) goto inf_leave;
|
||||
/* fallthrough */
|
||||
case COPY_:
|
||||
state->mode = COPY;
|
||||
/* fallthrough */
|
||||
case COPY:
|
||||
copy = state->length;
|
||||
if (copy) {
|
||||
|
@ -954,7 +941,6 @@ int ZEXPORT inflate(
|
|||
Tracev((stderr, "inflate: table sizes ok\n"));
|
||||
state->have = 0;
|
||||
state->mode = LENLENS;
|
||||
/* fallthrough */
|
||||
case LENLENS:
|
||||
while (state->have < state->ncode) {
|
||||
NEEDBITS(3);
|
||||
|
@ -976,7 +962,6 @@ int ZEXPORT inflate(
|
|||
Tracev((stderr, "inflate: code lengths ok\n"));
|
||||
state->have = 0;
|
||||
state->mode = CODELENS;
|
||||
/* fallthrough */
|
||||
case CODELENS:
|
||||
while (state->have < state->nlen + state->ndist) {
|
||||
for (;;) {
|
||||
|
@ -1060,10 +1045,8 @@ int ZEXPORT inflate(
|
|||
Tracev((stderr, "inflate: codes ok\n"));
|
||||
state->mode = LEN_;
|
||||
if (flush == Z_TREES) goto inf_leave;
|
||||
/* fallthrough */
|
||||
case LEN_:
|
||||
state->mode = LEN;
|
||||
/* fallthrough */
|
||||
case LEN:
|
||||
if (have >= 6 && left >= 258) {
|
||||
RESTORE();
|
||||
|
@ -1113,7 +1096,6 @@ int ZEXPORT inflate(
|
|||
}
|
||||
state->extra = (unsigned)(here.op) & 15;
|
||||
state->mode = LENEXT;
|
||||
/* fallthrough */
|
||||
case LENEXT:
|
||||
if (state->extra) {
|
||||
NEEDBITS(state->extra);
|
||||
|
@ -1124,7 +1106,6 @@ int ZEXPORT inflate(
|
|||
Tracevv((stderr, "inflate: length %u\n", state->length));
|
||||
state->was = state->length;
|
||||
state->mode = DIST;
|
||||
/* fallthrough */
|
||||
case DIST:
|
||||
for (;;) {
|
||||
here = state->distcode[BITS(state->distbits)];
|
||||
|
@ -1152,7 +1133,6 @@ int ZEXPORT inflate(
|
|||
state->offset = (unsigned)here.val;
|
||||
state->extra = (unsigned)(here.op) & 15;
|
||||
state->mode = DISTEXT;
|
||||
/* fallthrough */
|
||||
case DISTEXT:
|
||||
if (state->extra) {
|
||||
NEEDBITS(state->extra);
|
||||
|
@ -1169,7 +1149,6 @@ int ZEXPORT inflate(
|
|||
#endif
|
||||
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
||||
state->mode = MATCH;
|
||||
/* fallthrough */
|
||||
case MATCH:
|
||||
if (left == 0) goto inf_leave;
|
||||
copy = out - left;
|
||||
|
@ -1229,7 +1208,7 @@ int ZEXPORT inflate(
|
|||
state->total += out;
|
||||
if ((state->wrap & 4) && out)
|
||||
strm->adler = state->check =
|
||||
UPDATE_CHECK(state->check, put - out, out);
|
||||
UPDATE(state->check, put - out, out);
|
||||
out = left;
|
||||
if ((state->wrap & 4) && (
|
||||
#ifdef GUNZIP
|
||||
|
@ -1245,11 +1224,10 @@ int ZEXPORT inflate(
|
|||
}
|
||||
#ifdef GUNZIP
|
||||
state->mode = LENGTH;
|
||||
/* fallthrough */
|
||||
case LENGTH:
|
||||
if (state->wrap && state->flags) {
|
||||
NEEDBITS(32);
|
||||
if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
|
||||
if (hold != (state->total & 0xffffffffUL)) {
|
||||
strm->msg = (char *)"incorrect length check";
|
||||
state->mode = BAD;
|
||||
break;
|
||||
|
@ -1259,7 +1237,6 @@ int ZEXPORT inflate(
|
|||
}
|
||||
#endif
|
||||
state->mode = DONE;
|
||||
/* fallthrough */
|
||||
case DONE:
|
||||
ret = Z_STREAM_END;
|
||||
goto inf_leave;
|
||||
|
@ -1269,7 +1246,6 @@ int ZEXPORT inflate(
|
|||
case MEM:
|
||||
return Z_MEM_ERROR;
|
||||
case SYNC:
|
||||
/* fallthrough */
|
||||
default:
|
||||
return Z_STREAM_ERROR;
|
||||
}
|
||||
|
@ -1295,7 +1271,7 @@ int ZEXPORT inflate(
|
|||
state->total += out;
|
||||
if ((state->wrap & 4) && out)
|
||||
strm->adler = state->check =
|
||||
UPDATE_CHECK(state->check, strm->next_out - out, out);
|
||||
UPDATE(state->check, strm->next_out - out, out);
|
||||
strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
|
||||
(state->mode == TYPE ? 128 : 0) +
|
||||
(state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
|
||||
|
@ -1433,7 +1409,6 @@ int ZEXPORT inflateSync(
|
|||
z_streamp strm)
|
||||
{
|
||||
unsigned len; /* number of bytes to look at or looked at */
|
||||
int flags; /* temporary to save header status */
|
||||
unsigned long in, out; /* temporary to save total_in and total_out */
|
||||
unsigned char buf[4]; /* to restore bit buffer to byte string */
|
||||
struct inflate_state FAR *state;
|
||||
|
@ -1466,15 +1441,9 @@ int ZEXPORT inflateSync(
|
|||
|
||||
/* return no joy or set up to restart inflate() on a new block */
|
||||
if (state->have != 4) return Z_DATA_ERROR;
|
||||
if (state->flags == -1)
|
||||
state->wrap = 0; /* if no header yet, treat as raw */
|
||||
else
|
||||
state->wrap &= ~4; /* no point in computing a check value now */
|
||||
flags = state->flags;
|
||||
in = strm->total_in; out = strm->total_out;
|
||||
inflateReset(strm);
|
||||
strm->total_in = in; strm->total_out = out;
|
||||
state->flags = flags;
|
||||
state->mode = TYPE;
|
||||
return Z_OK;
|
||||
}
|
||||
|
@ -1499,7 +1468,7 @@ int ZEXPORT inflateSyncPoint(
|
|||
return state->mode == STORED && state->bits == 0;
|
||||
}
|
||||
|
||||
#ifndef Z_FREETYPE
|
||||
#if !Z_FREETYPE
|
||||
|
||||
int ZEXPORT inflateCopy(
|
||||
z_streamp dest,
|
||||
|
@ -1576,7 +1545,7 @@ int ZEXPORT inflateValidate(
|
|||
|
||||
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
if (check && state->wrap)
|
||||
if (check)
|
||||
state->wrap |= 4;
|
||||
else
|
||||
state->wrap &= ~4;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* inflate.h -- internal inflate state definition
|
||||
* Copyright (C) 1995-2019 Mark Adler
|
||||
* Copyright (C) 1995-2016 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
|
@ -89,8 +89,7 @@ struct inflate_state {
|
|||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip,
|
||||
bit 2 true to validate check value */
|
||||
int havedict; /* true if dictionary provided */
|
||||
int flags; /* gzip header method and flags, 0 if zlib, or
|
||||
-1 if raw or no header yet */
|
||||
int flags; /* gzip header method and flags (0 if zlib) */
|
||||
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
|
||||
unsigned long check; /* protected copy of check value */
|
||||
unsigned long total; /* protected copy of output count */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* inftrees.c -- generate Huffman trees for efficient decoding
|
||||
* Copyright (C) 1995-2022 Mark Adler
|
||||
* Copyright (C) 1995-2017 Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define MAXBITS 15
|
||||
|
||||
const char inflate_copyright[] =
|
||||
" inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
|
||||
" inflate 1.2.11 Copyright 1995-2017 Mark Adler ";
|
||||
/*
|
||||
If you use the zlib library in a product, an acknowledgment is welcome
|
||||
in the documentation of your product. If for some reason you cannot
|
||||
|
@ -62,7 +62,7 @@ int ZLIB_INTERNAL inflate_table(
|
|||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
||||
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
||||
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
|
||||
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202};
|
||||
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||
|
|
|
@ -6,6 +6,8 @@ are compiled as part of `src/gzip/ftgzip.c`.
|
|||
* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
|
||||
is set.
|
||||
|
||||
* src/gzip/crc32.c (DO1, DO8): Undefine. Already defined in `adler32.c`.
|
||||
|
||||
* src/gzip/gzguts.h (COPY): Rename to...
|
||||
(COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
|
||||
which have the same name in `zlib.h`.
|
||||
|
@ -23,10 +25,10 @@ Omit unused function declarations when `Z_FREETYPE` is defined.
|
|||
* src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
|
||||
prevent compiler errors.
|
||||
|
||||
diff --git a/src/gzip/adler32.c b/src/gzip/adler32.c
|
||||
diff --git b/src/gzip/adler32.c a/src/gzip/adler32.c
|
||||
index be5e8a247..aa032e1dd 100644
|
||||
--- a/src/gzip/adler32.c
|
||||
+++ b/src/gzip/adler32.c
|
||||
--- b/src/gzip/adler32.c
|
||||
+++ a/src/gzip/adler32.c
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
#include "zutil.h"
|
||||
|
@ -52,10 +54,23 @@ index be5e8a247..aa032e1dd 100644
|
|||
}
|
||||
+
|
||||
+#endif /* !Z_FREETYPE */
|
||||
diff --git a/src/gzip/gzguts.h b/src/gzip/gzguts.h
|
||||
index 57faf3716..4f09a52a7 100644
|
||||
--- a/src/gzip/gzguts.h
|
||||
+++ b/src/gzip/gzguts.h
|
||||
diff --git b/src/gzip/crc32.c a/src/gzip/crc32.c
|
||||
index 3e3eb1794..ffced1ea7 100644
|
||||
--- b/src/gzip/crc32.c
|
||||
+++ a/src/gzip/crc32.c
|
||||
@@ -195,6 +195,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
|
||||
}
|
||||
|
||||
/* ========================================================================= */
|
||||
+#undef DO1
|
||||
+#undef DO8
|
||||
#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
|
||||
#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
|
||||
|
||||
diff --git b/src/gzip/gzguts.h a/src/gzip/gzguts.h
|
||||
index 990a4d251..c81f8f392 100644
|
||||
--- b/src/gzip/gzguts.h
|
||||
+++ a/src/gzip/gzguts.h
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
/* values for gz_state how */
|
||||
|
@ -65,10 +80,10 @@ index 57faf3716..4f09a52a7 100644
|
|||
#define GZIP 2 /* decompress a gzip stream */
|
||||
|
||||
/* internal gzip file state data structure */
|
||||
diff --git a/src/gzip/inflate.c b/src/gzip/inflate.c
|
||||
index 4375557b4..5bf5b815e 100644
|
||||
--- a/src/gzip/inflate.c
|
||||
+++ b/src/gzip/inflate.c
|
||||
diff --git b/src/gzip/inflate.c a/src/gzip/inflate.c
|
||||
index 3f7ea647b..7387e6f57 100644
|
||||
--- b/src/gzip/inflate.c
|
||||
+++ a/src/gzip/inflate.c
|
||||
@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
|
||||
#ifdef BUILDFIXED
|
||||
void makefixed OF((void));
|
||||
|
@ -80,7 +95,7 @@ index 4375557b4..5bf5b815e 100644
|
|||
|
||||
local int inflateStateCheck(
|
||||
z_streamp strm)
|
||||
@@ -245,6 +247,8 @@ int ZEXPORT inflateInit_(
|
||||
@@ -244,6 +246,8 @@ int ZEXPORT inflateInit_(
|
||||
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
|
||||
}
|
||||
|
||||
|
@ -89,16 +104,16 @@ index 4375557b4..5bf5b815e 100644
|
|||
int ZEXPORT inflatePrime(
|
||||
z_streamp strm,
|
||||
int bits,
|
||||
@@ -266,6 +270,8 @@ int ZEXPORT inflatePrime(
|
||||
@@ -265,6 +269,8 @@ int ZEXPORT inflatePrime(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
+#endif /* !Z_FREETYPE */
|
||||
+#endif /* Z_FREETYPE */
|
||||
+
|
||||
/*
|
||||
Return state with length and distance decoding tables and index sizes set to
|
||||
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
||||
@@ -1312,6 +1318,8 @@ int ZEXPORT inflateEnd(
|
||||
@@ -1288,6 +1294,8 @@ int ZEXPORT inflateEnd(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
|
@ -107,7 +122,7 @@ index 4375557b4..5bf5b815e 100644
|
|||
int ZEXPORT inflateGetDictionary(
|
||||
z_streamp strm,
|
||||
Bytef *dictionary,
|
||||
@@ -1471,6 +1479,8 @@ int ZEXPORT inflateSync(
|
||||
@@ -1440,6 +1448,8 @@ int ZEXPORT inflateSync(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
|
@ -116,16 +131,16 @@ index 4375557b4..5bf5b815e 100644
|
|||
/*
|
||||
Returns true if inflate is currently at the end of a block generated by
|
||||
Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
|
||||
@@ -1489,6 +1499,8 @@ int ZEXPORT inflateSyncPoint(
|
||||
@@ -1458,6 +1468,8 @@ int ZEXPORT inflateSyncPoint(
|
||||
return state->mode == STORED && state->bits == 0;
|
||||
}
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+#if !Z_FREETYPE
|
||||
+
|
||||
int ZEXPORT inflateCopy(
|
||||
z_streamp dest,
|
||||
z_streamp source)
|
||||
@@ -1536,6 +1548,8 @@ int ZEXPORT inflateCopy(
|
||||
@@ -1505,6 +1517,8 @@ int ZEXPORT inflateCopy(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
|
@ -134,7 +149,7 @@ index 4375557b4..5bf5b815e 100644
|
|||
int ZEXPORT inflateUndermine(
|
||||
z_streamp strm,
|
||||
int subvert)
|
||||
@@ -1569,6 +1583,8 @@ int ZEXPORT inflateValidate(
|
||||
@@ -1538,6 +1552,8 @@ int ZEXPORT inflateValidate(
|
||||
return Z_OK;
|
||||
}
|
||||
|
||||
|
@ -143,16 +158,16 @@ index 4375557b4..5bf5b815e 100644
|
|||
long ZEXPORT inflateMark(
|
||||
z_streamp strm)
|
||||
{
|
||||
@@ -1590,3 +1606,5 @@ unsigned long ZEXPORT inflateCodesUsed(
|
||||
@@ -1559,3 +1575,5 @@ unsigned long ZEXPORT inflateCodesUsed(
|
||||
state = (struct inflate_state FAR *)strm->state;
|
||||
return (unsigned long)(state->next - state->codes);
|
||||
}
|
||||
+
|
||||
+#endif /* !Z_FREETYPE */
|
||||
diff --git a/src/gzip/inflate.h b/src/gzip/inflate.h
|
||||
index f127b6b1f..c6f5a52e1 100644
|
||||
--- a/src/gzip/inflate.h
|
||||
+++ b/src/gzip/inflate.h
|
||||
diff --git b/src/gzip/inflate.h a/src/gzip/inflate.h
|
||||
index a46cce6b6..92ea758e2 100644
|
||||
--- b/src/gzip/inflate.h
|
||||
+++ a/src/gzip/inflate.h
|
||||
@@ -3,6 +3,9 @@
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
@ -163,16 +178,16 @@ index f127b6b1f..c6f5a52e1 100644
|
|||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
@@ -124,3 +127,5 @@ struct inflate_state {
|
||||
@@ -123,3 +126,5 @@ struct inflate_state {
|
||||
int back; /* bits back of last unprocessed length/lit */
|
||||
unsigned was; /* initial length of match */
|
||||
};
|
||||
+
|
||||
+#endif /* INFLATE_H */
|
||||
diff --git a/src/gzip/inftrees.h b/src/gzip/inftrees.h
|
||||
diff --git b/src/gzip/inftrees.h a/src/gzip/inftrees.h
|
||||
index baa53a0b1..c94eb78b5 100644
|
||||
--- a/src/gzip/inftrees.h
|
||||
+++ b/src/gzip/inftrees.h
|
||||
--- b/src/gzip/inftrees.h
|
||||
+++ a/src/gzip/inftrees.h
|
||||
@@ -3,6 +3,9 @@
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
@ -189,10 +204,10 @@ index baa53a0b1..c94eb78b5 100644
|
|||
unsigned FAR *bits, unsigned short FAR *work));
|
||||
+
|
||||
+#endif /* INFTREES_H_ */
|
||||
diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
|
||||
index 4a98e38bf..d760140c2 100644
|
||||
--- a/src/gzip/zlib.h
|
||||
+++ b/src/gzip/zlib.h
|
||||
diff --git b/src/gzip/zlib.h a/src/gzip/zlib.h
|
||||
index f09cdaf1e..1807c0645 100644
|
||||
--- b/src/gzip/zlib.h
|
||||
+++ a/src/gzip/zlib.h
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifndef ZLIB_H
|
||||
#define ZLIB_H
|
||||
|
@ -236,7 +251,7 @@ index 4a98e38bf..d760140c2 100644
|
|||
/*
|
||||
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||
int level,
|
||||
@@ -956,6 +960,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
||||
@@ -954,6 +958,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
||||
destination.
|
||||
*/
|
||||
|
||||
|
@ -245,7 +260,7 @@ index 4a98e38bf..d760140c2 100644
|
|||
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
|
||||
/*
|
||||
This function is equivalent to inflateEnd followed by inflateInit,
|
||||
@@ -980,6 +986,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
|
||||
@@ -978,6 +984,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
|
||||
the windowBits parameter is invalid.
|
||||
*/
|
||||
|
||||
|
@ -254,7 +269,7 @@ index 4a98e38bf..d760140c2 100644
|
|||
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
|
||||
int bits,
|
||||
int value));
|
||||
@@ -1069,6 +1077,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
|
||||
@@ -1067,6 +1075,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
|
||||
stream state was inconsistent.
|
||||
*/
|
||||
|
||||
|
@ -263,7 +278,7 @@ index 4a98e38bf..d760140c2 100644
|
|||
/*
|
||||
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
|
||||
unsigned char FAR *window));
|
||||
@@ -1095,6 +1105,8 @@ typedef unsigned (*in_func) OF((void FAR *,
|
||||
@@ -1093,6 +1103,8 @@ typedef unsigned (*in_func) OF((void FAR *,
|
||||
z_const unsigned char FAR * FAR *));
|
||||
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
|
||||
|
||||
|
@ -272,7 +287,7 @@ index 4a98e38bf..d760140c2 100644
|
|||
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
||||
in_func in, void FAR *in_desc,
|
||||
out_func out, void FAR *out_desc));
|
||||
@@ -1214,6 +1226,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
||||
@@ -1212,6 +1224,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
||||
27-31: 0 (reserved)
|
||||
*/
|
||||
|
||||
|
@ -281,16 +296,16 @@ index 4a98e38bf..d760140c2 100644
|
|||
#ifndef Z_SOLO
|
||||
|
||||
/* utility functions */
|
||||
@@ -1742,6 +1756,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||
@@ -1739,6 +1753,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||
if (crc != original_crc) error();
|
||||
*/
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
+
|
||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
||||
z_size_t len));
|
||||
/*
|
||||
@@ -1822,6 +1838,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
||||
@@ -1805,6 +1821,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
||||
ZLIB_VERSION, (int)sizeof(z_stream))
|
||||
#endif
|
||||
|
||||
|
@ -310,14 +325,13 @@ index 4a98e38bf..d760140c2 100644
|
|||
#ifndef Z_SOLO
|
||||
|
||||
/* gzgetc() macro and its supporting function and exposed data structure. Note
|
||||
@@ -1901,13 +1930,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||
@@ -1879,12 +1908,15 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||
|
||||
#else /* Z_SOLO */
|
||||
|
||||
+#ifndef Z_FREETYPE
|
||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||
+#endif
|
||||
|
||||
#endif /* !Z_SOLO */
|
||||
|
@ -327,7 +341,7 @@ index 4a98e38bf..d760140c2 100644
|
|||
ZEXTERN const char * ZEXPORT zError OF((int));
|
||||
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
|
||||
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
|
||||
@@ -1927,6 +1959,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
||||
@@ -1904,6 +1936,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
||||
va_list va));
|
||||
# endif
|
||||
#endif
|
||||
|
@ -335,11 +349,21 @@ index 4a98e38bf..d760140c2 100644
|
|||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
|
||||
index d9a20ae1b..14f0f1a85 100644
|
||||
--- a/src/gzip/zutil.h
|
||||
+++ b/src/gzip/zutil.h
|
||||
@@ -188,6 +188,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
diff --git b/src/gzip/zutil.h a/src/gzip/zutil.h
|
||||
index b079ea6a8..2d734a835 100644
|
||||
--- b/src/gzip/zutil.h
|
||||
+++ a/src/gzip/zutil.h
|
||||
@@ -30,7 +30,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef Z_SOLO
|
||||
+# ifndef Z_FREETYPE
|
||||
typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
|
||||
+# endif
|
||||
#endif
|
||||
|
||||
#ifndef local
|
||||
@@ -185,6 +187,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
#pragma warn -8066
|
||||
#endif
|
||||
|
||||
|
@ -348,7 +372,7 @@ index d9a20ae1b..14f0f1a85 100644
|
|||
/* provide prototypes for these when building zlib without LFS */
|
||||
#if !defined(_WIN32) && \
|
||||
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
@@ -195,6 +197,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
@@ -192,6 +196,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||
#endif
|
||||
|
||||
|
@ -357,7 +381,7 @@ index d9a20ae1b..14f0f1a85 100644
|
|||
/* common defaults */
|
||||
|
||||
#ifndef OS_CODE
|
||||
@@ -226,9 +230,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
@@ -223,9 +229,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
# define zmemcmp _fmemcmp
|
||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
||||
# else
|
||||
|
|
223
src/gzip/zlib.h
223
src/gzip/zlib.h
|
@ -1,7 +1,7 @@
|
|||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||
version 1.2.12, March 11th, 2022
|
||||
version 1.2.11, January 15th, 2017
|
||||
|
||||
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -37,11 +37,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ZLIB_VERSION "1.2.12"
|
||||
#define ZLIB_VERNUM 0x12c0
|
||||
#define ZLIB_VERSION "1.2.11"
|
||||
#define ZLIB_VERNUM 0x12b0
|
||||
#define ZLIB_VER_MAJOR 1
|
||||
#define ZLIB_VER_MINOR 2
|
||||
#define ZLIB_VER_REVISION 12
|
||||
#define ZLIB_VER_REVISION 11
|
||||
#define ZLIB_VER_SUBREVISION 0
|
||||
|
||||
/*
|
||||
|
@ -547,7 +547,8 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
|||
int strategy));
|
||||
|
||||
This is another version of deflateInit with more compression options. The
|
||||
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
||||
caller.
|
||||
|
||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||
this version of the library.
|
||||
|
@ -715,12 +716,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
|||
used to switch between compression and straight copy of the input data, or
|
||||
to switch to a different kind of input data requiring a different strategy.
|
||||
If the compression approach (which is a function of the level) or the
|
||||
strategy is changed, and if there have been any deflate() calls since the
|
||||
state was initialized or reset, then the input available so far is
|
||||
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||
respectively. The new level and strategy will take effect at the next call
|
||||
of deflate().
|
||||
strategy is changed, and if any input has been consumed in a previous
|
||||
deflate() call, then the input available so far is compressed with the old
|
||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
||||
and strategy will take effect at the next call of deflate().
|
||||
|
||||
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
|
||||
not have enough output space to complete, then the parameter change will not
|
||||
|
@ -869,11 +869,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
|||
detection, or add 16 to decode only the gzip format (the zlib format will
|
||||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
|
||||
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||
inflate() will return Z_STREAM_END at the end of the gzip member. The state
|
||||
would need to be reset to continue decoding a subsequent gzip member. This
|
||||
*must* be done if there is more data after a gzip member, in order for the
|
||||
decompression to be compliant with the gzip standard (RFC 1952).
|
||||
below), inflate() will not automatically decode concatenated gzip streams.
|
||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
||||
would need to be reset to continue decoding a subsequent gzip stream.
|
||||
|
||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||
|
@ -1318,14 +1316,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
|||
/*
|
||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||
|
||||
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||
as in "wb9F". (See the description of deflateInit2 for more information
|
||||
about the strategy parameter.) 'T' will request transparent writing or
|
||||
appending with no compression and not using the gzip format.
|
||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
||||
for fixed code compression as in "wb9F". (See the description of
|
||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
||||
request transparent writing or appending with no compression and not using
|
||||
the gzip format.
|
||||
|
||||
"a" can be used instead of "w" to request that the gzip stream that will
|
||||
be written be appended to the file. "+" will result in an error, since
|
||||
|
@ -1355,9 +1353,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
|||
|
||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||
/*
|
||||
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||
been previously opened with fopen). The mode parameter is as in gzopen.
|
||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
||||
|
||||
The next call of gzclose on the returned gzFile will also close the file
|
||||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||
|
@ -1378,13 +1376,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
|||
|
||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||
/*
|
||||
Set the internal buffer size used by this library's functions for file to
|
||||
size. The default buffer size is 8192 bytes. This function must be called
|
||||
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||
the file. The buffer memory allocation is always deferred to the first read
|
||||
or write. Three times that size in buffer space is allocated. A larger
|
||||
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||
speed of decompression (reading).
|
||||
Set the internal buffer size used by this library's functions. The
|
||||
default buffer size is 8192 bytes. This function must be called after
|
||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
||||
file. The buffer memory allocation is always deferred to the first read or
|
||||
write. Three times that size in buffer space is allocated. A larger buffer
|
||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
||||
of decompression (reading).
|
||||
|
||||
The new buffer size also affects the maximum length for gzprintf().
|
||||
|
||||
|
@ -1394,9 +1392,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
|||
|
||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||
/*
|
||||
Dynamically update the compression level and strategy for file. See the
|
||||
description of deflateInit2 for the meaning of these parameters. Previously
|
||||
provided data is flushed before applying the parameter changes.
|
||||
Dynamically update the compression level or strategy. See the description
|
||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
||||
data is flushed before the parameter change.
|
||||
|
||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
||||
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||
|
@ -1405,7 +1403,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
|||
|
||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||
/*
|
||||
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||
Reads the given number of uncompressed bytes from the compressed file. If
|
||||
the input file is not in gzip format, gzread copies the given number of
|
||||
bytes into the buffer directly from the file.
|
||||
|
||||
|
@ -1436,11 +1434,11 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
|||
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||
gzFile file));
|
||||
/*
|
||||
Read and decompress up to nitems items of size size from file into buf,
|
||||
otherwise operating as gzread() does. This duplicates the interface of
|
||||
stdio's fread(), with size_t request and return types. If the library
|
||||
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||
is an unsigned integer type that can contain a pointer.
|
||||
Read up to nitems items of size size from file to buf, otherwise operating
|
||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
||||
size_t request and return types. If the library defines size_t, then
|
||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
||||
integer type that can contain a pointer.
|
||||
|
||||
gzfread() returns the number of full items read of size size, or zero if
|
||||
the end of the file was reached and a full item could not be read, or if
|
||||
|
@ -1459,16 +1457,18 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
|||
file, reseting and retrying on end-of-file, when size is not 1.
|
||||
*/
|
||||
|
||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
||||
voidpc buf, unsigned len));
|
||||
/*
|
||||
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||
returns the number of uncompressed bytes written or 0 in case of error.
|
||||
Writes the given number of uncompressed bytes into the compressed file.
|
||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
||||
error.
|
||||
*/
|
||||
|
||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||
z_size_t nitems, gzFile file));
|
||||
/*
|
||||
Compress and write nitems items of size size from buf to file, duplicating
|
||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
||||
the interface of stdio's fwrite(), with size_t request and return types. If
|
||||
the library defines size_t, then z_size_t is identical to size_t. If not,
|
||||
then z_size_t is an unsigned integer type that can contain a pointer.
|
||||
|
@ -1481,22 +1481,22 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
|||
|
||||
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||
/*
|
||||
Convert, format, compress, and write the arguments (...) to file under
|
||||
control of the string format, as in fprintf. gzprintf returns the number of
|
||||
Converts, formats, and writes the arguments to the compressed file under
|
||||
control of the format string, as in fprintf. gzprintf returns the number of
|
||||
uncompressed bytes actually written, or a negative zlib error code in case
|
||||
of error. The number of uncompressed bytes written is limited to 8191, or
|
||||
one less than the buffer size given to gzbuffer(). The caller should assure
|
||||
that this limit is not exceeded. If it is exceeded, then gzprintf() will
|
||||
return an error (0) with nothing written. In this case, there may also be a
|
||||
buffer overflow with unpredictable consequences, which is possible only if
|
||||
zlib was compiled with the insecure functions sprintf() or vsprintf(),
|
||||
zlib was compiled with the insecure functions sprintf() or vsprintf()
|
||||
because the secure snprintf() or vsnprintf() functions were not available.
|
||||
This can be determined using zlibCompileFlags().
|
||||
*/
|
||||
|
||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||
/*
|
||||
Compress and write the given null-terminated string s to file, excluding
|
||||
Writes the given null-terminated string to the compressed file, excluding
|
||||
the terminating null character.
|
||||
|
||||
gzputs returns the number of characters written, or -1 in case of error.
|
||||
|
@ -1504,12 +1504,11 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
|||
|
||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||
/*
|
||||
Read and decompress bytes from file into buf, until len-1 characters are
|
||||
read, or until a newline character is read and transferred to buf, or an
|
||||
end-of-file condition is encountered. If any characters are read or if len
|
||||
is one, the string is terminated with a null character. If no characters
|
||||
are read due to an end-of-file or len is less than one, then the buffer is
|
||||
left untouched.
|
||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
||||
newline character is read and transferred to buf, or an end-of-file
|
||||
condition is encountered. If any characters are read or if len == 1, the
|
||||
string is terminated with a null character. If no characters are read due
|
||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
||||
|
||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
||||
for end-of-file or in case of error. If there was an error, the contents at
|
||||
|
@ -1518,13 +1517,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
|||
|
||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||
/*
|
||||
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
||||
returns the value that was written, or -1 in case of error.
|
||||
*/
|
||||
|
||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||
/*
|
||||
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
||||
in case of end of file or error. This is implemented as a macro for speed.
|
||||
As such, it does not do all of the checking the other functions do. I.e.
|
||||
it does not check to see if file is NULL, nor whether the structure file
|
||||
|
@ -1533,8 +1532,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
|||
|
||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||
/*
|
||||
Push c back onto the stream for file to be read as the first character on
|
||||
the next read. At least one character of push-back is always allowed.
|
||||
Push one character back onto the stream to be read as the first character
|
||||
on the next read. At least one character of push-back is allowed.
|
||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
||||
fail if c is -1, and may fail if a character has been pushed but not read
|
||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||
|
@ -1545,9 +1544,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
|||
|
||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||
/*
|
||||
Flush all pending output to file. The parameter flush is as in the
|
||||
deflate() function. The return value is the zlib error number (see function
|
||||
gzerror below). gzflush is only permitted when writing.
|
||||
Flushes all pending output into the compressed file. The parameter flush
|
||||
is as in the deflate() function. The return value is the zlib error number
|
||||
(see function gzerror below). gzflush is only permitted when writing.
|
||||
|
||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
||||
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||
|
@ -1562,8 +1561,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
|||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||
z_off_t offset, int whence));
|
||||
|
||||
Set the starting position to offset relative to whence for the next gzread
|
||||
or gzwrite on file. The offset represents a number of bytes in the
|
||||
Sets the starting position for the next gzread or gzwrite on the given
|
||||
compressed file. The offset represents a number of bytes in the
|
||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||
the value SEEK_END is not supported.
|
||||
|
||||
|
@ -1580,18 +1579,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
|||
|
||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||
/*
|
||||
Rewind file. This function is supported only for reading.
|
||||
Rewinds the given file. This function is supported only for reading.
|
||||
|
||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
|
||||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
|
||||
*/
|
||||
|
||||
/*
|
||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||
|
||||
Return the starting position for the next gzread or gzwrite on file.
|
||||
This position represents a number of bytes in the uncompressed data stream,
|
||||
and is zero when starting, even if appending or reading a gzip stream from
|
||||
the middle of a file using gzdopen().
|
||||
Returns the starting position for the next gzread or gzwrite on the given
|
||||
compressed file. This position represents a number of bytes in the
|
||||
uncompressed data stream, and is zero when starting, even if appending or
|
||||
reading a gzip stream from the middle of a file using gzdopen().
|
||||
|
||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||
*/
|
||||
|
@ -1599,22 +1598,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
|||
/*
|
||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||
|
||||
Return the current compressed (actual) read or write offset of file. This
|
||||
offset includes the count of bytes that precede the gzip stream, for example
|
||||
when appending or when using gzdopen() for reading. When reading, the
|
||||
offset does not include as yet unused buffered input. This information can
|
||||
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||
Returns the current offset in the file being read or written. This offset
|
||||
includes the count of bytes that precede the gzip stream, for example when
|
||||
appending or when using gzdopen() for reading. When reading, the offset
|
||||
does not include as yet unused buffered input. This information can be used
|
||||
for a progress indicator. On error, gzoffset() returns -1.
|
||||
*/
|
||||
|
||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||
/*
|
||||
Return true (1) if the end-of-file indicator for file has been set while
|
||||
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||
only if the read tried to go past the end of the input, but came up short.
|
||||
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||
more data to read, in the event that the last read request was for the exact
|
||||
number of bytes remaining in the input file. This will happen if the input
|
||||
file size is an exact multiple of the buffer size.
|
||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
||||
read tried to go past the end of the input, but came up short. Therefore,
|
||||
just like feof(), gzeof() may return false even if there is no more data to
|
||||
read, in the event that the last read request was for the exact number of
|
||||
bytes remaining in the input file. This will happen if the input file size
|
||||
is an exact multiple of the buffer size.
|
||||
|
||||
If gzeof() returns true, then the read functions will return no more data,
|
||||
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||
|
@ -1623,7 +1622,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
|||
|
||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||
/*
|
||||
Return true (1) if file is being copied directly while reading, or false
|
||||
Returns true (1) if file is being copied directly while reading, or false
|
||||
(0) if file is a gzip stream being decompressed.
|
||||
|
||||
If the input file is empty, gzdirect() will return true, since the input
|
||||
|
@ -1644,8 +1643,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
|||
|
||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||
/*
|
||||
Flush all pending output for file, if necessary, close file and
|
||||
deallocate the (de)compression state. Note that once file is closed, you
|
||||
Flushes all pending output if necessary, closes the compressed file and
|
||||
deallocates the (de)compression state. Note that once file is closed, you
|
||||
cannot call gzerror with file, since its structures have been deallocated.
|
||||
gzclose must not be called more than once on the same file, just as free
|
||||
must not be called more than once on the same allocation.
|
||||
|
@ -1669,10 +1668,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
|||
|
||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||
/*
|
||||
Return the error message for the last error which occurred on file.
|
||||
errnum is set to zlib error number. If an error occurred in the file system
|
||||
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||
application may consult errno to get the exact error code.
|
||||
Returns the error message for the last error which occurred on the given
|
||||
compressed file. errnum is set to zlib error number. If an error occurred
|
||||
in the file system and not in the compression library, errnum is set to
|
||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
||||
|
||||
The application must not modify the returned string. Future calls to
|
||||
this function may invalidate the previously returned string. If file is
|
||||
|
@ -1685,7 +1684,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
|||
|
||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||
/*
|
||||
Clear the error and end-of-file flags for file. This is analogous to the
|
||||
Clears the error and end-of-file flags for file. This is analogous to the
|
||||
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||
file that is being written concurrently.
|
||||
*/
|
||||
|
@ -1703,9 +1702,8 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
|||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
||||
/*
|
||||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||
unsigned integer. If buf is Z_NULL, this function returns the required
|
||||
initial value for the checksum.
|
||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
||||
required initial value for the checksum.
|
||||
|
||||
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||
much faster.
|
||||
|
@ -1738,13 +1736,12 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
|||
negative, the result has no meaning or utility.
|
||||
*/
|
||||
|
||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||
/*
|
||||
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||
If buf is Z_NULL, this function returns the required initial value for the
|
||||
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||
function so it shouldn't be done by the application.
|
||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
||||
performed within this function so it shouldn't be done by the application.
|
||||
|
||||
Usage example:
|
||||
|
||||
|
@ -1758,7 +1755,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
|||
|
||||
#ifndef Z_FREETYPE
|
||||
|
||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
||||
z_size_t len));
|
||||
/*
|
||||
Same as crc32(), but with a size_t length.
|
||||
|
@ -1774,20 +1771,6 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
|||
len2.
|
||||
*/
|
||||
|
||||
/*
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
|
||||
|
||||
Return the operator corresponding to length len2, to be used with
|
||||
crc32_combine_op().
|
||||
*/
|
||||
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
|
||||
/*
|
||||
Give the same result as crc32_combine(), using op in place of len2. op is
|
||||
is generated from len2 by crc32_combine_gen(). This will be faster than
|
||||
crc32_combine() if the generated op is used more than once.
|
||||
*/
|
||||
|
||||
|
||||
/* various hacks, don't look :) */
|
||||
|
||||
|
@ -1888,7 +1871,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||
#endif
|
||||
|
||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||
|
@ -1899,7 +1881,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|||
# define z_gzoffset z_gzoffset64
|
||||
# define z_adler32_combine z_adler32_combine64
|
||||
# define z_crc32_combine z_crc32_combine64
|
||||
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||
# else
|
||||
# define gzopen gzopen64
|
||||
# define gzseek gzseek64
|
||||
|
@ -1907,7 +1888,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|||
# define gzoffset gzoffset64
|
||||
# define adler32_combine adler32_combine64
|
||||
# define crc32_combine crc32_combine64
|
||||
# define crc32_combine_gen crc32_combine_gen64
|
||||
# endif
|
||||
# ifndef Z_LARGE64
|
||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||
|
@ -1916,7 +1896,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||
# endif
|
||||
#else
|
||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||
|
@ -1925,7 +1904,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||
#endif
|
||||
|
||||
#else /* Z_SOLO */
|
||||
|
@ -1933,7 +1911,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
|||
#ifndef Z_FREETYPE
|
||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
|
||||
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||
#endif
|
||||
|
||||
#endif /* !Z_SOLO */
|
||||
|
@ -1948,7 +1925,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
|||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||
const char *mode));
|
||||
#endif
|
||||
|
|
|
@ -136,8 +136,8 @@ const char * ZEXPORT zError(
|
|||
return ERR_MSG(err);
|
||||
}
|
||||
|
||||
#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
|
||||
/* The older Microsoft C Run-Time Library for Windows CE doesn't have
|
||||
#if defined(_WIN32_WCE)
|
||||
/* The Microsoft C Run-Time Library for Windows CE doesn't have
|
||||
* errno. We define it as a global variable to simplify porting.
|
||||
* Its value is always 0 and should not be used.
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* zutil.h -- internal interface and configuration of the compression library
|
||||
* Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
|
||||
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
|
@ -29,6 +29,12 @@
|
|||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef Z_SOLO
|
||||
# ifndef Z_FREETYPE
|
||||
typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef local
|
||||
# define local static
|
||||
#endif
|
||||
|
@ -42,17 +48,6 @@ typedef unsigned short ush;
|
|||
typedef ush FAR ushf;
|
||||
typedef unsigned long ulg;
|
||||
|
||||
#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC)
|
||||
# include <limits.h>
|
||||
# if (ULONG_MAX == 0xffffffffffffffff)
|
||||
# define Z_U8 unsigned long
|
||||
# elif (ULLONG_MAX == 0xffffffffffffffff)
|
||||
# define Z_U8 unsigned long long
|
||||
# elif (UINT_MAX == 0xffffffffffffffff)
|
||||
# define Z_U8 unsigned
|
||||
# endif
|
||||
#endif
|
||||
|
||||
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
/* (size given to avoid silly warnings with Visual C++) */
|
||||
|
||||
|
@ -177,6 +172,10 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|||
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
|
||||
# if defined(_WIN32_WCE)
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# ifndef _PTRDIFF_T_DEFINED
|
||||
typedef int ptrdiff_t;
|
||||
# define _PTRDIFF_T_DEFINED
|
||||
# endif
|
||||
# else
|
||||
# define fdopen(fd,type) _fdopen(fd,type)
|
||||
# endif
|
||||
|
|
|
@ -344,7 +344,7 @@
|
|||
{
|
||||
FT_Error error;
|
||||
FT_Memory memory;
|
||||
FT_LZWFile zip = NULL;
|
||||
FT_LZWFile zip;
|
||||
|
||||
|
||||
if ( !stream || !source )
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
return -1;
|
||||
}
|
||||
|
||||
if ( FT_QREALLOC( state->stack, old_size, new_size ) )
|
||||
if ( FT_QRENEW_ARRAY( state->stack, old_size, new_size ) )
|
||||
return -1;
|
||||
|
||||
/* if relocating to heap */
|
||||
|
|
|
@ -207,7 +207,7 @@
|
|||
|
||||
pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 );
|
||||
if ( pfrface->height < pfrface->ascender - pfrface->descender )
|
||||
pfrface->height = (FT_Short)( pfrface->ascender - pfrface->descender );
|
||||
pfrface->height = (FT_Short)(pfrface->ascender - pfrface->descender);
|
||||
|
||||
if ( phy_font->num_strikes > 0 )
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
else
|
||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
||||
{
|
||||
CFF_Font cff = (CFF_Font)( face->extra.data );
|
||||
CFF_Font cff = (CFF_Font)(face->extra.data);
|
||||
|
||||
|
||||
bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar );
|
||||
|
|
|
@ -535,11 +535,11 @@
|
|||
|
||||
if ( r & 1 )
|
||||
{
|
||||
*buffer = (FT_Byte)( *buffer + c );
|
||||
*buffer = (FT_Byte)(*buffer + c);
|
||||
buffer++;
|
||||
}
|
||||
else
|
||||
*buffer = (FT_Byte)( c << 4 );
|
||||
*buffer = (FT_Byte)(c << 4);
|
||||
|
||||
r++;
|
||||
}
|
||||
|
@ -572,8 +572,8 @@
|
|||
if ( p >= limit )
|
||||
return 0;
|
||||
|
||||
if ( n > (FT_UInt)( limit - p ) )
|
||||
n = (FT_UInt)( limit - p );
|
||||
if ( n > (FT_UInt)(limit - p) )
|
||||
n = (FT_UInt)(limit - p);
|
||||
|
||||
for ( r = 0; r < n; r++ )
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* psfixed.h
|
||||
*
|
||||
* Adobe's code for Fixed-Point Mathematics (specification only).
|
||||
* Adobe's code for Fixed Point Mathematics (specification only).
|
||||
*
|
||||
* Copyright 2007-2013 Adobe Systems Incorporated.
|
||||
*
|
||||
|
@ -43,10 +43,10 @@
|
|||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* rasterizer integer and fixed-point arithmetic must be 32-bit */
|
||||
/* rasterizer integer and fixed point arithmetic must be 32-bit */
|
||||
|
||||
#define CF2_Fixed CF2_F16Dot16
|
||||
typedef FT_Int32 CF2_Frac; /* 2.30 fixed-point */
|
||||
typedef FT_Int32 CF2_Frac; /* 2.30 fixed point */
|
||||
|
||||
|
||||
#define CF2_FIXED_MAX ( (CF2_Fixed)0x7FFFFFFFL )
|
||||
|
|
|
@ -72,7 +72,7 @@ FT_BEGIN_HEADER
|
|||
} CF2_PathOp;
|
||||
|
||||
|
||||
/* a matrix of fixed-point values */
|
||||
/* a matrix of fixed point values */
|
||||
typedef struct CF2_Matrix_
|
||||
{
|
||||
CF2_F16Dot16 a;
|
||||
|
|
|
@ -518,7 +518,7 @@
|
|||
|
||||
if ( *cur == '<' ) /* <...> */
|
||||
{
|
||||
if ( cur + 1 < limit && *( cur + 1 ) == '<' ) /* << */
|
||||
if ( cur + 1 < limit && *(cur + 1) == '<' ) /* << */
|
||||
{
|
||||
cur++;
|
||||
cur++;
|
||||
|
@ -1115,7 +1115,7 @@
|
|||
{
|
||||
FT_Memory memory = parser->memory;
|
||||
FT_UInt len = (FT_UInt)( limit - cur );
|
||||
FT_String* string = NULL;
|
||||
FT_String* string;
|
||||
|
||||
|
||||
if ( cur >= limit )
|
||||
|
|
|
@ -49,8 +49,8 @@ FT_BEGIN_HEADER
|
|||
{
|
||||
union
|
||||
{
|
||||
CF2_Fixed r; /* 16.16 fixed-point */
|
||||
CF2_Frac f; /* 2.30 fixed-point (for font matrix) */
|
||||
CF2_Fixed r; /* 16.16 fixed point */
|
||||
CF2_Frac f; /* 2.30 fixed point (for font matrix) */
|
||||
CF2_Int i;
|
||||
} u;
|
||||
|
||||
|
|
|
@ -646,7 +646,7 @@
|
|||
T1_Private* priv,
|
||||
PSH_Globals *aglobals )
|
||||
{
|
||||
PSH_Globals globals = NULL;
|
||||
PSH_Globals globals;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
|
|
|
@ -2269,7 +2269,7 @@
|
|||
/* This is due to the fact that, in the vast majority of cases, */
|
||||
/* the span length in bytes is relatively small. */
|
||||
while ( --c2 > 0 )
|
||||
*( ++target ) = 0xFF;
|
||||
*(++target) = 0xFF;
|
||||
|
||||
target[1] |= f2;
|
||||
}
|
||||
|
|
|
@ -738,13 +738,13 @@
|
|||
|
||||
contour = shape->contours;
|
||||
|
||||
/* If the control point coincides with any of the end points */
|
||||
/* then it is a line and should be treated as one to avoid */
|
||||
/* unnecessary complexity later in the algorithm. */
|
||||
/* If the control point coincide with any of the end point */
|
||||
/* then it's a line and should be treated as one to avoid */
|
||||
/* unnecessary complexity later in the algorithm. */
|
||||
if ( ( contour->last_pos.x == control_1->x &&
|
||||
contour->last_pos.y == control_1->y ) ||
|
||||
( control_1->x == to->x &&
|
||||
control_1->y == to->y ) )
|
||||
control_1->y == to->y ) )
|
||||
{
|
||||
sdf_line_to( to, user );
|
||||
goto Exit;
|
||||
|
@ -776,9 +776,9 @@
|
|||
const FT_26D6_Vec* to,
|
||||
void* user )
|
||||
{
|
||||
SDF_Shape* shape = ( SDF_Shape* )user;
|
||||
SDF_Edge* edge = NULL;
|
||||
SDF_Contour* contour = NULL;
|
||||
SDF_Shape* shape = ( SDF_Shape* )user;
|
||||
SDF_Edge* edge = NULL;
|
||||
SDF_Contour* contour = NULL;
|
||||
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_Memory memory = shape->memory;
|
||||
|
@ -1077,7 +1077,7 @@
|
|||
static FT_Error
|
||||
split_sdf_conic( FT_Memory memory,
|
||||
FT_26D6_Vec* control_points,
|
||||
FT_UInt max_splits,
|
||||
FT_Int max_splits,
|
||||
SDF_Edge** out )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
@ -1146,16 +1146,16 @@
|
|||
static FT_Error
|
||||
split_sdf_cubic( FT_Memory memory,
|
||||
FT_26D6_Vec* control_points,
|
||||
FT_UInt max_splits,
|
||||
FT_Int max_splits,
|
||||
SDF_Edge** out )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_26D6_Vec cpos[7];
|
||||
SDF_Edge* left, *right;
|
||||
SDF_Edge* left,* right;
|
||||
const FT_26D6 threshold = ONE_PIXEL / 4;
|
||||
|
||||
|
||||
if ( !memory || !out )
|
||||
if ( !memory || !out )
|
||||
{
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
goto Exit;
|
||||
|
@ -1166,16 +1166,15 @@
|
|||
cpos[1] = control_points[1];
|
||||
cpos[2] = control_points[2];
|
||||
cpos[3] = control_points[3];
|
||||
|
||||
/* If the segment is flat enough we won't get any benefit by */
|
||||
/* splitting it further, so we can just stop splitting. */
|
||||
/* */
|
||||
/* Check the deviation of the Bezier curve and stop if it is */
|
||||
/* smaller than the pre-defined `threshold` value. */
|
||||
|
||||
/* If the segment is flat enough, we won't get any benifit by */
|
||||
/* splitting it further, so we can just stop splitting. Here, */
|
||||
/* we check the deviation of the bezier and stop if it is */
|
||||
/* lower than a pre-defined `threhold` value. */
|
||||
if ( FT_ABS( 2 * cpos[0].x - 3 * cpos[1].x + cpos[3].x ) < threshold &&
|
||||
FT_ABS( 2 * cpos[0].y - 3 * cpos[1].y + cpos[3].y ) < threshold &&
|
||||
FT_ABS( 2 * cpos[0].y - 3 * cpos[1].y + cpos[3].y ) < threshold &&
|
||||
FT_ABS( cpos[0].x - 3 * cpos[2].x + 2 * cpos[3].x ) < threshold &&
|
||||
FT_ABS( cpos[0].y - 3 * cpos[2].y + 2 * cpos[3].y ) < threshold )
|
||||
FT_ABS( cpos[0].y - 3 * cpos[2].y + 2 * cpos[3].y ) < threshold )
|
||||
{
|
||||
split_cubic( cpos );
|
||||
goto Append;
|
||||
|
@ -1285,23 +1284,22 @@
|
|||
ctrls[1] = edge->control_a;
|
||||
ctrls[2] = edge->end_pos;
|
||||
|
||||
dx = FT_ABS( ctrls[2].x + ctrls[0].x - 2 * ctrls[1].x );
|
||||
dy = FT_ABS( ctrls[2].y + ctrls[0].y - 2 * ctrls[1].y );
|
||||
dx = FT_ABS( ctrls[2].x + ctrls[0].x - 2 * ctrls[1].x );
|
||||
dy = FT_ABS( ctrls[2].y + ctrls[0].y - 2 * ctrls[1].y );
|
||||
if ( dx < dy )
|
||||
dx = dy;
|
||||
|
||||
/* Calculate the number of necessary bisections. Each */
|
||||
/* bisection causes a four-fold reduction of the deviation, */
|
||||
/* hence we bisect the Bezier curve until the deviation */
|
||||
/* becomes less than 1/8th of a pixel. For more details */
|
||||
/* check file `ftgrays.c`. */
|
||||
num_splits = 1;
|
||||
while ( dx > ONE_PIXEL / 8 )
|
||||
{
|
||||
dx >>= 2;
|
||||
num_splits <<= 1;
|
||||
}
|
||||
dx = dy;
|
||||
|
||||
/* Here we calculate the number of necessary bisections. Each */
|
||||
/* bisection reduces the deviation by exactly 4-fold, hence */
|
||||
/* we bisect the bezier until the deviation becomes less than */
|
||||
/* 1/8th of a pixel. For more details check `ftgrays.c`. */
|
||||
num_splits = 1;
|
||||
while ( dx > ONE_PIXEL / 8 )
|
||||
{
|
||||
dx >>= 2;
|
||||
num_splits <<= 1;
|
||||
}
|
||||
|
||||
error = split_sdf_conic( memory, ctrls, num_splits, &new_edges );
|
||||
}
|
||||
break;
|
||||
|
@ -1939,7 +1937,7 @@
|
|||
/* now factor is 16.16 */
|
||||
factor = FT_DivFix( factor, sq_line_length );
|
||||
|
||||
/* clamp the factor between 0.0 and 1.0 in fixed-point */
|
||||
/* clamp the factor between 0.0 and 1.0 in fixed point */
|
||||
if ( factor > FT_INT_16D16( 1 ) )
|
||||
factor = FT_INT_16D16( 1 );
|
||||
if ( factor < 0 )
|
||||
|
@ -3014,7 +3012,7 @@
|
|||
diff = current_dist.distance - min_dist.distance;
|
||||
|
||||
|
||||
if ( FT_ABS( diff ) < CORNER_CHECK_EPSILON )
|
||||
if ( FT_ABS(diff ) < CORNER_CHECK_EPSILON )
|
||||
min_dist = resolve_corner( min_dist, current_dist );
|
||||
else if ( diff < 0 )
|
||||
min_dist = current_dist;
|
||||
|
@ -3164,7 +3162,7 @@
|
|||
if ( min_dist.distance > sp_sq )
|
||||
min_dist.distance = sp_sq;
|
||||
|
||||
/* square_root the values and fit in a 6.10 fixed-point */
|
||||
/* square_root the values and fit in a 6.10 fixed point */
|
||||
if ( USE_SQUARED_DISTANCES )
|
||||
min_dist.distance = square_root( min_dist.distance );
|
||||
|
||||
|
@ -3288,7 +3286,7 @@
|
|||
buffer = (FT_SDFFormat*)bitmap->buffer;
|
||||
|
||||
if ( USE_SQUARED_DISTANCES )
|
||||
sp_sq = FT_INT_16D16( (FT_Int)( spread * spread ) );
|
||||
sp_sq = FT_INT_16D16( spread * spread );
|
||||
else
|
||||
sp_sq = fixed_spread;
|
||||
|
||||
|
@ -3360,7 +3358,7 @@
|
|||
if ( dist.distance > sp_sq )
|
||||
continue;
|
||||
|
||||
/* take the square root of the distance if required */
|
||||
/* square_root the values if required */
|
||||
if ( USE_SQUARED_DISTANCES )
|
||||
dist.distance = square_root( dist.distance );
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
*
|
||||
* https://github.com/chmike/fpsqrt
|
||||
*
|
||||
* Use this to compute the square root of a 16.16 fixed-point number.
|
||||
* Use this to compute the square root of a 16.16 fixed point number.
|
||||
*/
|
||||
FT_LOCAL_DEF( FT_16D16 )
|
||||
square_root( FT_16D16 val )
|
||||
|
@ -72,8 +72,8 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* Convert 16.16 fixed-point values to the desired output format.
|
||||
* In this case we reduce 16.16 fixed-point values to normalized
|
||||
* Convert 16.16 fixed point values to the desired output format.
|
||||
* In this case we reduce 16.16 fixed point values to normalized
|
||||
* 8-bit values.
|
||||
*
|
||||
* The `max_value` in the parameter is the maximum value in the
|
||||
|
|
|
@ -298,9 +298,15 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
/* nothing to render */
|
||||
/* the rows and pitch must be valid after presetting the */
|
||||
/* bitmap using outline */
|
||||
if ( !bitmap->rows || !bitmap->pitch )
|
||||
return FT_Err_Ok;
|
||||
{
|
||||
FT_ERROR(( "ft_sdf_render: failed to preset bitmap\n" ));
|
||||
|
||||
error = FT_THROW( Cannot_Render_Glyph );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* the padding will simply be equal to the `spread' */
|
||||
x_pad = sdf_module->spread;
|
||||
|
@ -519,9 +525,13 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
/* nothing to render */
|
||||
if ( !bitmap->rows || !bitmap->pitch )
|
||||
return FT_Err_Ok;
|
||||
{
|
||||
FT_ERROR(( "ft_bsdf_render: invalid bitmap size\n" ));
|
||||
|
||||
error = FT_THROW( Invalid_Argument );
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
FT_Bitmap_New( &target );
|
||||
|
||||
|
|
|
@ -367,7 +367,7 @@
|
|||
}
|
||||
|
||||
/* transform transparency to alpha */
|
||||
if ( png_get_valid( png, info, PNG_INFO_tRNS ) )
|
||||
if ( png_get_valid(png, info, PNG_INFO_tRNS ) )
|
||||
png_set_tRNS_to_alpha( png );
|
||||
|
||||
if ( bitdepth == 16 )
|
||||
|
@ -387,7 +387,7 @@
|
|||
png_set_filler( png, 0xFF, PNG_FILLER_AFTER );
|
||||
|
||||
/* recheck header after setting EXPAND options */
|
||||
png_read_update_info( png, info );
|
||||
png_read_update_info(png, info );
|
||||
png_get_IHDR( png, info,
|
||||
&imgWidth, &imgHeight,
|
||||
&bitdepth, &color_type, &interlace,
|
||||
|
|
|
@ -657,7 +657,7 @@
|
|||
|
||||
|
||||
/*
|
||||
* Find the shortest decimal representation of a 16.16 fixed-point
|
||||
* Find the shortest decimal representation of a 16.16 fixed point
|
||||
* number. The function fills `buf' with the result, returning a pointer
|
||||
* to the position after the representation's last byte.
|
||||
*/
|
||||
|
@ -733,7 +733,7 @@
|
|||
an equivalent representation of `fixed'.
|
||||
|
||||
The above FOR loop always finds the larger of the two values; I
|
||||
verified this by iterating over all possible fixed-point numbers.
|
||||
verified this by iterating over all possible fixed point numbers.
|
||||
|
||||
If the remainder is 17232*10, both values are equally good, and we
|
||||
take the next even number (following IEEE 754's `round to nearest,
|
||||
|
@ -741,7 +741,7 @@
|
|||
|
||||
If the remainder is smaller than 17232*10, the lower of the two
|
||||
numbers is nearer to the exact result (values 17232 and 34480 were
|
||||
also found by testing all possible fixed-point values).
|
||||
also found by testing all possible fixed point values).
|
||||
|
||||
We use this to find a shorter decimal representation. If not ending
|
||||
with digit zero, we take the representation with less error.
|
||||
|
|
|
@ -566,7 +566,7 @@
|
|||
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
|
||||
|
||||
/* value -(N+1) requests information on index N */
|
||||
if ( face_instance_index < 0 && face_index > 0 )
|
||||
if ( face_instance_index < 0 )
|
||||
face_index--;
|
||||
|
||||
if ( face_index >= face->ttc_header.count )
|
||||
|
@ -784,23 +784,17 @@
|
|||
FT_Int num_params,
|
||||
FT_Parameter* params )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Error error;
|
||||
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
|
||||
FT_Error psnames_error;
|
||||
FT_Error psnames_error;
|
||||
#endif
|
||||
|
||||
FT_Bool has_outline;
|
||||
FT_Bool is_apple_sbit;
|
||||
|
||||
FT_Bool has_CBLC;
|
||||
FT_Bool has_CBDT;
|
||||
FT_Bool has_EBLC;
|
||||
FT_Bool has_bloc;
|
||||
FT_Bool has_sbix;
|
||||
|
||||
FT_Bool ignore_typographic_family = FALSE;
|
||||
FT_Bool ignore_typographic_subfamily = FALSE;
|
||||
FT_Bool ignore_sbix = FALSE;
|
||||
FT_Bool has_outline;
|
||||
FT_Bool is_apple_sbit;
|
||||
FT_Bool is_apple_sbix;
|
||||
FT_Bool has_CBLC;
|
||||
FT_Bool has_CBDT;
|
||||
FT_Bool ignore_typographic_family = FALSE;
|
||||
FT_Bool ignore_typographic_subfamily = FALSE;
|
||||
|
||||
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
|
||||
|
||||
|
@ -819,8 +813,6 @@
|
|||
ignore_typographic_family = TRUE;
|
||||
else if ( params[i].tag == FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY )
|
||||
ignore_typographic_subfamily = TRUE;
|
||||
else if ( params[i].tag == FT_PARAM_TAG_IGNORE_SBIX )
|
||||
ignore_sbix = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -856,17 +848,14 @@
|
|||
tt_face_lookup_table( face, TTAG_CFF2 ) );
|
||||
#endif
|
||||
|
||||
/* check which sbit formats are present */
|
||||
has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
|
||||
has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
|
||||
has_EBLC = !face->goto_table( face, TTAG_EBLC, stream, 0 );
|
||||
has_bloc = !face->goto_table( face, TTAG_bloc, stream, 0 );
|
||||
has_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );
|
||||
is_apple_sbit = 0;
|
||||
is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );
|
||||
|
||||
is_apple_sbit = FALSE;
|
||||
|
||||
if ( ignore_sbix )
|
||||
has_sbix = FALSE;
|
||||
/* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf'
|
||||
* outline rendered on top. We don't support that yet, so just ignore
|
||||
* the 'glyf' outline and advertise it as a bitmap-only font. */
|
||||
if ( is_apple_sbix )
|
||||
has_outline = FALSE;
|
||||
|
||||
/* if this font doesn't contain outlines, we try to load */
|
||||
/* a `bhed' table */
|
||||
|
@ -878,13 +867,16 @@
|
|||
|
||||
/* load the font header (`head' table) if this isn't an Apple */
|
||||
/* sbit font file */
|
||||
if ( !is_apple_sbit || has_sbix )
|
||||
if ( !is_apple_sbit || is_apple_sbix )
|
||||
{
|
||||
LOAD_( head );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
|
||||
has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
|
||||
|
||||
/* Ignore outlines for CBLC/CBDT fonts. */
|
||||
if ( has_CBLC || has_CBDT )
|
||||
has_outline = FALSE;
|
||||
|
@ -994,11 +986,7 @@
|
|||
/* the optional tables */
|
||||
|
||||
/* embedded bitmap support */
|
||||
/* TODO: Replace this clumsy check for all possible sbit tables */
|
||||
/* with something better (for example, by passing a parameter */
|
||||
/* to suppress 'sbix' loading). */
|
||||
if ( sfnt->load_eblc &&
|
||||
( has_CBLC || has_EBLC || has_bloc || has_sbix ) )
|
||||
if ( sfnt->load_eblc )
|
||||
LOAD_( eblc );
|
||||
|
||||
/* colored glyph support */
|
||||
|
@ -1066,19 +1054,11 @@
|
|||
*/
|
||||
if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_CBLC ||
|
||||
face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX ||
|
||||
face->colr ||
|
||||
face->svg )
|
||||
face->colr )
|
||||
flags |= FT_FACE_FLAG_COLOR; /* color glyphs */
|
||||
|
||||
if ( has_outline == TRUE )
|
||||
{
|
||||
/* by default (and for backward compatibility) we handle */
|
||||
/* fonts with an 'sbix' table as bitmap-only */
|
||||
if ( has_sbix )
|
||||
flags |= FT_FACE_FLAG_SBIX; /* with 'sbix' bitmaps */
|
||||
else
|
||||
flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
|
||||
}
|
||||
flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
|
||||
|
||||
/* The sfnt driver only supports bitmap fonts natively, thus we */
|
||||
/* don't set FT_FACE_FLAG_HINTER. */
|
||||
|
@ -1301,8 +1281,7 @@
|
|||
*
|
||||
* Set up metrics.
|
||||
*/
|
||||
if ( FT_IS_SCALABLE( root ) ||
|
||||
FT_HAS_SBIX( root ) )
|
||||
if ( FT_IS_SCALABLE( root ) )
|
||||
{
|
||||
/* XXX What about if outline header is missing */
|
||||
/* (e.g. sfnt wrapped bitmap)? */
|
||||
|
|
|
@ -162,7 +162,8 @@
|
|||
}
|
||||
|
||||
/* Don't trust `totalSfntSize' before thorough checks. */
|
||||
if ( FT_QALLOC( sfnt, 12 ) || FT_NEW( sfnt_stream ) )
|
||||
if ( FT_QALLOC( sfnt, 12 + woff.num_tables * 16UL ) ||
|
||||
FT_NEW( sfnt_stream ) )
|
||||
goto Exit;
|
||||
|
||||
sfnt_header = sfnt;
|
||||
|
@ -195,8 +196,8 @@
|
|||
/* tag value, the tables themselves are not. We thus have to */
|
||||
/* sort them by offset and check that they don't overlap. */
|
||||
|
||||
if ( FT_QNEW_ARRAY( tables, woff.num_tables ) ||
|
||||
FT_QNEW_ARRAY( indices, woff.num_tables ) )
|
||||
if ( FT_NEW_ARRAY( tables, woff.num_tables ) ||
|
||||
FT_NEW_ARRAY( indices, woff.num_tables ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "\n" ));
|
||||
|
@ -327,7 +328,9 @@
|
|||
}
|
||||
|
||||
/* Now use `totalSfntSize'. */
|
||||
if ( FT_QREALLOC( sfnt, 12, woff.totalSfntSize ) )
|
||||
if ( FT_REALLOC( sfnt,
|
||||
12 + woff.num_tables * 16UL,
|
||||
woff.totalSfntSize ) )
|
||||
goto Exit;
|
||||
|
||||
sfnt_header = sfnt + 12;
|
||||
|
|
|
@ -84,8 +84,6 @@
|
|||
#define BBOX_STREAM 5
|
||||
#define INSTRUCTION_STREAM 6
|
||||
|
||||
#define HAVE_OVERLAP_SIMPLE_BITMAP 0x1
|
||||
|
||||
|
||||
static void
|
||||
stream_close( FT_Stream stream )
|
||||
|
@ -229,9 +227,9 @@
|
|||
{
|
||||
FT_TRACE6(( "Reallocating %lu to %lu.\n",
|
||||
*dst_size, (*offset + size) ));
|
||||
if ( FT_QREALLOC( dst,
|
||||
(FT_ULong)( *dst_size ),
|
||||
(FT_ULong)( *offset + size ) ) )
|
||||
if ( FT_REALLOC( dst,
|
||||
(FT_ULong)( *dst_size ),
|
||||
(FT_ULong)( *offset + size ) ) )
|
||||
goto Exit;
|
||||
|
||||
*dst_size = *offset + size;
|
||||
|
@ -524,7 +522,6 @@
|
|||
const WOFF2_Point points,
|
||||
FT_UShort n_contours,
|
||||
FT_UShort instruction_len,
|
||||
FT_Bool have_overlap,
|
||||
FT_Byte* dst,
|
||||
FT_ULong dst_size,
|
||||
FT_ULong* glyph_size )
|
||||
|
@ -552,9 +549,6 @@
|
|||
FT_Int dy = point.y - last_y;
|
||||
|
||||
|
||||
if ( i == 0 && have_overlap )
|
||||
flag |= GLYF_OVERLAP_SIMPLE;
|
||||
|
||||
if ( dx == 0 )
|
||||
flag |= GLYF_THIS_X_IS_SAME;
|
||||
else if ( dx > -256 && dx < 256 )
|
||||
|
@ -784,7 +778,7 @@
|
|||
goto Fail;
|
||||
|
||||
loca_buf_size = loca_values_size * offset_size;
|
||||
if ( FT_QALLOC( loca_buf, loca_buf_size ) )
|
||||
if ( FT_QNEW_ARRAY( loca_buf, loca_buf_size ) )
|
||||
goto Fail;
|
||||
|
||||
dst = loca_buf;
|
||||
|
@ -839,18 +833,15 @@
|
|||
|
||||
FT_UInt num_substreams = 7;
|
||||
|
||||
FT_UShort option_flags;
|
||||
FT_UShort num_glyphs;
|
||||
FT_UShort index_format;
|
||||
FT_ULong expected_loca_length;
|
||||
FT_UInt offset;
|
||||
FT_UInt i;
|
||||
FT_ULong points_size;
|
||||
FT_ULong bitmap_length;
|
||||
FT_ULong glyph_buf_size;
|
||||
FT_ULong bbox_bitmap_offset;
|
||||
FT_ULong bbox_bitmap_length;
|
||||
FT_ULong overlap_bitmap_offset = 0;
|
||||
FT_ULong overlap_bitmap_length = 0;
|
||||
|
||||
const FT_ULong glyf_start = *out_offset;
|
||||
FT_ULong dest_offset = *out_offset;
|
||||
|
@ -863,20 +854,18 @@
|
|||
WOFF2_Point points = NULL;
|
||||
|
||||
|
||||
if ( FT_QNEW_ARRAY( substreams, num_substreams ) )
|
||||
if ( FT_NEW_ARRAY( substreams, num_substreams ) )
|
||||
goto Fail;
|
||||
|
||||
if ( FT_STREAM_SKIP( 2 ) )
|
||||
goto Fail;
|
||||
if ( FT_READ_USHORT( option_flags ) )
|
||||
if ( FT_STREAM_SKIP( 4 ) )
|
||||
goto Fail;
|
||||
if ( FT_READ_USHORT( num_glyphs ) )
|
||||
goto Fail;
|
||||
if ( FT_READ_USHORT( index_format ) )
|
||||
goto Fail;
|
||||
|
||||
FT_TRACE4(( "option_flags = %u; num_glyphs = %u; index_format = %u\n",
|
||||
option_flags, num_glyphs, index_format ));
|
||||
FT_TRACE4(( "num_glyphs = %u; index_format = %u\n",
|
||||
num_glyphs, index_format ));
|
||||
|
||||
info->num_glyphs = num_glyphs;
|
||||
|
||||
|
@ -889,7 +878,7 @@
|
|||
if ( info->loca_table->dst_length != expected_loca_length )
|
||||
goto Fail;
|
||||
|
||||
offset = 2 + 2 + 2 + 2 + ( num_substreams * 4 );
|
||||
offset = ( 2 + num_substreams ) * 4;
|
||||
if ( offset > info->glyf_table->TransformLength )
|
||||
goto Fail;
|
||||
|
||||
|
@ -912,36 +901,21 @@
|
|||
offset += substream_size;
|
||||
}
|
||||
|
||||
if ( option_flags & HAVE_OVERLAP_SIMPLE_BITMAP )
|
||||
{
|
||||
/* Size of overlapBitmap = floor((numGlyphs + 7) / 8) */
|
||||
overlap_bitmap_length = ( num_glyphs + 7U ) >> 3;
|
||||
if ( overlap_bitmap_length > info->glyf_table->TransformLength - offset )
|
||||
goto Fail;
|
||||
|
||||
overlap_bitmap_offset = pos + offset;
|
||||
|
||||
FT_TRACE5(( " Overlap bitmap: offset = %lu; size = %lu;\n",
|
||||
overlap_bitmap_offset, overlap_bitmap_length ));
|
||||
offset += overlap_bitmap_length;
|
||||
}
|
||||
|
||||
if ( FT_QNEW_ARRAY( loca_values, num_glyphs + 1 ) )
|
||||
if ( FT_NEW_ARRAY( loca_values, num_glyphs + 1 ) )
|
||||
goto Fail;
|
||||
|
||||
points_size = 0;
|
||||
bbox_bitmap_offset = substreams[BBOX_STREAM].offset;
|
||||
|
||||
/* Size of bboxBitmap = 4 * floor((numGlyphs + 31) / 32) */
|
||||
bbox_bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
|
||||
/* bboxStreamSize is the combined size of bboxBitmap and bboxStream. */
|
||||
substreams[BBOX_STREAM].offset += bbox_bitmap_length;
|
||||
bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
|
||||
substreams[BBOX_STREAM].offset += bitmap_length;
|
||||
|
||||
glyph_buf_size = WOFF2_DEFAULT_GLYPH_BUF;
|
||||
if ( FT_QALLOC( glyph_buf, glyph_buf_size ) )
|
||||
if ( FT_NEW_ARRAY( glyph_buf, glyph_buf_size ) )
|
||||
goto Fail;
|
||||
|
||||
if ( FT_QNEW_ARRAY( info->x_mins, num_glyphs ) )
|
||||
if ( FT_NEW_ARRAY( info->x_mins, num_glyphs ) )
|
||||
goto Fail;
|
||||
|
||||
for ( i = 0; i < num_glyphs; ++i )
|
||||
|
@ -973,7 +947,7 @@
|
|||
/* composite glyph */
|
||||
FT_Bool have_instructions = FALSE;
|
||||
FT_UShort instruction_size = 0;
|
||||
FT_ULong composite_size = 0;
|
||||
FT_ULong composite_size;
|
||||
FT_ULong size_needed;
|
||||
FT_Byte* pointer = NULL;
|
||||
|
||||
|
@ -999,7 +973,7 @@
|
|||
size_needed = 12 + composite_size + instruction_size;
|
||||
if ( glyph_buf_size < size_needed )
|
||||
{
|
||||
if ( FT_QREALLOC( glyph_buf, glyph_buf_size, size_needed ) )
|
||||
if ( FT_RENEW_ARRAY( glyph_buf, glyph_buf_size, size_needed ) )
|
||||
goto Fail;
|
||||
glyph_buf_size = size_needed;
|
||||
}
|
||||
|
@ -1051,11 +1025,8 @@
|
|||
FT_ULong flag_size;
|
||||
FT_ULong triplet_size;
|
||||
FT_ULong triplet_bytes_used;
|
||||
FT_Bool have_overlap = FALSE;
|
||||
FT_Byte overlap_bitmap;
|
||||
FT_ULong overlap_offset;
|
||||
FT_Byte* flags_buf = NULL;
|
||||
FT_Byte* triplet_buf = NULL;
|
||||
FT_Byte* flags_buf = NULL;
|
||||
FT_Byte* triplet_buf = NULL;
|
||||
FT_UShort instruction_size;
|
||||
FT_ULong size_needed;
|
||||
FT_Int end_point;
|
||||
|
@ -1064,18 +1035,7 @@
|
|||
FT_Byte* pointer = NULL;
|
||||
|
||||
|
||||
/* Set `have_overlap`. */
|
||||
if ( overlap_bitmap_offset )
|
||||
{
|
||||
overlap_offset = overlap_bitmap_offset + ( i >> 3 );
|
||||
if ( FT_STREAM_SEEK( overlap_offset ) ||
|
||||
FT_READ_BYTE( overlap_bitmap ) )
|
||||
goto Fail;
|
||||
if ( overlap_bitmap & ( 0x80 >> ( i & 7 ) ) )
|
||||
have_overlap = TRUE;
|
||||
}
|
||||
|
||||
if ( FT_QNEW_ARRAY( n_points_arr, n_contours ) )
|
||||
if ( FT_NEW_ARRAY( n_points_arr, n_contours ) )
|
||||
goto Fail;
|
||||
|
||||
if ( FT_STREAM_SEEK( substreams[N_POINTS_STREAM].offset ) )
|
||||
|
@ -1112,7 +1072,7 @@
|
|||
|
||||
/* Create array to store point information. */
|
||||
points_size = total_n_points;
|
||||
if ( FT_QNEW_ARRAY( points, points_size ) )
|
||||
if ( FT_NEW_ARRAY( points, points_size ) )
|
||||
goto Fail;
|
||||
|
||||
if ( triplet_decode( flags_buf,
|
||||
|
@ -1141,7 +1101,7 @@
|
|||
instruction_size;
|
||||
if ( glyph_buf_size < size_needed )
|
||||
{
|
||||
if ( FT_QREALLOC( glyph_buf, glyph_buf_size, size_needed ) )
|
||||
if ( FT_RENEW_ARRAY( glyph_buf, glyph_buf_size, size_needed ) )
|
||||
goto Fail;
|
||||
glyph_buf_size = size_needed;
|
||||
}
|
||||
|
@ -1195,7 +1155,6 @@
|
|||
points,
|
||||
n_contours,
|
||||
instruction_size,
|
||||
have_overlap,
|
||||
glyph_buf,
|
||||
glyph_buf_size,
|
||||
&glyph_size ) )
|
||||
|
@ -1226,7 +1185,8 @@
|
|||
*glyf_checksum += compute_ULong_sum( glyph_buf, glyph_size );
|
||||
|
||||
/* Store x_mins, may be required to reconstruct `hmtx'. */
|
||||
info->x_mins[i] = (FT_Short)x_min;
|
||||
if ( n_contours > 0 )
|
||||
info->x_mins[i] = (FT_Short)x_min;
|
||||
}
|
||||
|
||||
info->glyf_table->dst_length = dest_offset - info->glyf_table->dst_offset;
|
||||
|
@ -1343,7 +1303,7 @@
|
|||
offset_size = index_format ? 4 : 2;
|
||||
|
||||
/* Create `x_mins' array. */
|
||||
if ( FT_QNEW_ARRAY( info->x_mins, num_glyphs ) )
|
||||
if ( FT_NEW_ARRAY( info->x_mins, num_glyphs ) )
|
||||
return error;
|
||||
|
||||
loca_offset = info->loca_table->src_offset;
|
||||
|
@ -1431,8 +1391,8 @@
|
|||
if ( num_hmetrics < 1 )
|
||||
goto Fail;
|
||||
|
||||
if ( FT_QNEW_ARRAY( advance_widths, num_hmetrics ) ||
|
||||
FT_QNEW_ARRAY( lsbs, num_glyphs ) )
|
||||
if ( FT_NEW_ARRAY( advance_widths, num_hmetrics ) ||
|
||||
FT_NEW_ARRAY( lsbs, num_glyphs ) )
|
||||
goto Fail;
|
||||
|
||||
/* Read `advanceWidth' stream. Always present. */
|
||||
|
@ -1483,7 +1443,7 @@
|
|||
|
||||
/* Build the hmtx table. */
|
||||
hmtx_table_size = 2 * num_hmetrics + 2 * num_glyphs;
|
||||
if ( FT_QALLOC( hmtx_table, hmtx_table_size ) )
|
||||
if ( FT_NEW_ARRAY( hmtx_table, hmtx_table_size ) )
|
||||
goto Fail;
|
||||
|
||||
dst = hmtx_table;
|
||||
|
@ -1540,10 +1500,10 @@
|
|||
{
|
||||
/* Memory management of `transformed_buf' is handled by the caller. */
|
||||
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_Stream stream = NULL;
|
||||
FT_Byte* buf_cursor = NULL;
|
||||
FT_Byte table_entry[16];
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_Stream stream = NULL;
|
||||
FT_Byte* buf_cursor = NULL;
|
||||
FT_Byte* table_entry = NULL;
|
||||
|
||||
/* We are reallocating memory for `sfnt', so its pointer may change. */
|
||||
FT_Byte* sfnt = *sfnt_bytes;
|
||||
|
@ -1584,6 +1544,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* Create buffer for table entries. */
|
||||
if ( FT_NEW_ARRAY( table_entry, 16 ) )
|
||||
goto Fail;
|
||||
|
||||
/* Create a stream for the uncompressed buffer. */
|
||||
if ( FT_NEW( stream ) )
|
||||
goto Fail;
|
||||
|
@ -1746,6 +1710,7 @@
|
|||
/* Set pointer of sfnt stream to its correct value. */
|
||||
*sfnt_bytes = sfnt;
|
||||
|
||||
FT_FREE( table_entry );
|
||||
FT_Stream_Close( stream );
|
||||
FT_FREE( stream );
|
||||
|
||||
|
@ -1758,6 +1723,7 @@
|
|||
/* Set pointer of sfnt stream to its correct value. */
|
||||
*sfnt_bytes = sfnt;
|
||||
|
||||
FT_FREE( table_entry );
|
||||
FT_Stream_Close( stream );
|
||||
FT_FREE( stream );
|
||||
|
||||
|
@ -1870,8 +1836,8 @@
|
|||
woff2.ttc_fonts = NULL;
|
||||
|
||||
/* Read table directory. */
|
||||
if ( FT_QNEW_ARRAY( tables, woff2.num_tables ) ||
|
||||
FT_QNEW_ARRAY( indices, woff2.num_tables ) )
|
||||
if ( FT_NEW_ARRAY( tables, woff2.num_tables ) ||
|
||||
FT_NEW_ARRAY( indices, woff2.num_tables ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "\n" ));
|
||||
|
@ -1942,11 +1908,10 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
table->flags = flags;
|
||||
table->src_offset = src_offset;
|
||||
table->src_length = table->TransformLength;
|
||||
src_offset += table->TransformLength;
|
||||
table->dst_offset = 0;
|
||||
table->flags = flags;
|
||||
|
||||
FT_TRACE2(( " %c%c%c%c %08d %08d %08ld %08ld %08ld\n",
|
||||
(FT_Char)( table->Tag >> 24 ),
|
||||
|
@ -2004,7 +1969,6 @@
|
|||
|
||||
FT_TRACE4(( "Number of fonts in TTC: %d\n", woff2.num_fonts ));
|
||||
|
||||
/* pre-zero pointers within in case of failure */
|
||||
if ( FT_NEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -2018,7 +1982,7 @@
|
|||
if ( FT_READ_ULONG( ttc_font->flavor ) )
|
||||
goto Exit;
|
||||
|
||||
if ( FT_QNEW_ARRAY( ttc_font->table_indices, ttc_font->num_tables ) )
|
||||
if ( FT_NEW_ARRAY( ttc_font->table_indices, ttc_font->num_tables ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE5(( "Number of tables in font %d: %d\n",
|
||||
|
@ -2099,7 +2063,7 @@
|
|||
error = FT_THROW( Invalid_Table );
|
||||
goto Exit;
|
||||
}
|
||||
file_offset = ROUND4( woff2.metaOffset + woff2.metaLength );
|
||||
file_offset = ROUND4(woff2.metaOffset + woff2.metaLength);
|
||||
}
|
||||
|
||||
if ( woff2.privOffset )
|
||||
|
@ -2109,7 +2073,7 @@
|
|||
error = FT_THROW( Invalid_Table );
|
||||
goto Exit;
|
||||
}
|
||||
file_offset = ROUND4( woff2.privOffset + woff2.privLength );
|
||||
file_offset = ROUND4(woff2.privOffset + woff2.privLength);
|
||||
}
|
||||
|
||||
if ( file_offset != ( ROUND4( woff2.length ) ) )
|
||||
|
@ -2121,7 +2085,7 @@
|
|||
/* Validate requested face index. */
|
||||
*num_faces = woff2.num_fonts;
|
||||
/* value -(N+1) requests information on index N */
|
||||
if ( *face_instance_index < 0 && face_index > 0 )
|
||||
if ( *face_instance_index < 0 )
|
||||
face_index--;
|
||||
|
||||
if ( face_index >= woff2.num_fonts )
|
||||
|
@ -2297,9 +2261,9 @@
|
|||
{
|
||||
FT_TRACE5(( "Trimming sfnt stream from %lu to %lu.\n",
|
||||
sfnt_size, woff2.actual_sfnt_size ));
|
||||
if ( FT_QREALLOC( sfnt,
|
||||
(FT_ULong)( sfnt_size ),
|
||||
(FT_ULong)( woff2.actual_sfnt_size ) ) )
|
||||
if ( FT_REALLOC( sfnt,
|
||||
(FT_ULong)( sfnt_size ),
|
||||
(FT_ULong)( woff2.actual_sfnt_size ) ) )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ FT_BEGIN_HEADER
|
|||
#define GLYF_REPEAT 1 << 3
|
||||
#define GLYF_THIS_X_IS_SAME 1 << 4
|
||||
#define GLYF_THIS_Y_IS_SAME 1 << 5
|
||||
#define GLYF_OVERLAP_SIMPLE 1 << 6
|
||||
|
||||
/* Other constants */
|
||||
#define CONTOUR_OFFSET_END_POINT 10
|
||||
|
|
|
@ -465,7 +465,7 @@
|
|||
if ( subheader )
|
||||
{
|
||||
FT_Byte* p = subheader;
|
||||
FT_UInt idx = (FT_UInt)( char_code & 0xFF );
|
||||
FT_UInt idx = (FT_UInt)(char_code & 0xFF);
|
||||
FT_UInt start, count;
|
||||
FT_Int delta;
|
||||
FT_UInt offset;
|
||||
|
|
|
@ -30,17 +30,10 @@
|
|||
#include <freetype/internal/ftcalc.h>
|
||||
#include <freetype/internal/ftdebug.h>
|
||||
#include <freetype/internal/ftstream.h>
|
||||
#include <freetype/internal/services/svmm.h>
|
||||
#include <freetype/tttags.h>
|
||||
#include <freetype/ftcolor.h>
|
||||
#include <freetype/config/integer-types.h>
|
||||
|
||||
/* the next two code lines are a temporary hack, to be removed together */
|
||||
/* with `VARIABLE_COLRV1_ENABLED` and related code as soon as variable */
|
||||
/* 'COLR' support is complete and tested */
|
||||
#include "../truetype/ttobjs.h"
|
||||
#include "../truetype/ttdriver.h"
|
||||
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
|
||||
|
||||
|
@ -57,33 +50,13 @@
|
|||
#define COLR_HEADER_SIZE 14U
|
||||
|
||||
|
||||
#define VARIABLE_COLRV1_ENABLED \
|
||||
( ((TT_Driver)FT_FACE_DRIVER( face ))->root.clazz == \
|
||||
&tt_driver_class && \
|
||||
((TT_Driver)FT_FACE_DRIVER( face ))->enable_variable_colrv1 )
|
||||
|
||||
|
||||
typedef enum FT_PaintFormat_Internal_
|
||||
{
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID = 3,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT = 5,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT = 7,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT = 9,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM = 13,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE = 15,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE = 17,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER = 18,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER = 19,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM = 20,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM = 21,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM_CENTER = 22,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER = 23,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE = 25,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER = 26,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER = 27,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW = 29,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER = 30,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER = 31,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER = 18,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM = 20,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM_CENTER = 22,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER = 26,
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER = 30
|
||||
|
||||
} FT_PaintFormat_Internal;
|
||||
|
||||
|
@ -131,10 +104,6 @@
|
|||
*/
|
||||
FT_Byte* paints_start_v1;
|
||||
|
||||
/* Item Variation Store for variable 'COLR' v1. */
|
||||
GX_ItemVarStoreRec var_store;
|
||||
GX_DeltaSetIdxMapRec delta_set_idx_map;
|
||||
|
||||
/* The memory that backs up the `COLR' table. */
|
||||
void* table;
|
||||
FT_ULong table_size;
|
||||
|
@ -169,9 +138,7 @@
|
|||
FT_ULong base_glyph_offset, layer_offset;
|
||||
FT_ULong base_glyphs_offset_v1, num_base_glyphs_v1;
|
||||
FT_ULong layer_offset_v1, num_layers_v1, clip_list_offset;
|
||||
FT_ULong var_idx_map_offset, var_store_offset;
|
||||
FT_ULong table_size;
|
||||
FT_ULong colr_offset_in_stream;
|
||||
|
||||
|
||||
/* `COLR' always needs `CPAL' */
|
||||
|
@ -182,8 +149,6 @@
|
|||
if ( error )
|
||||
goto NoColr;
|
||||
|
||||
colr_offset_in_stream = FT_STREAM_POS();
|
||||
|
||||
if ( table_size < COLR_HEADER_SIZE )
|
||||
goto InvalidTable;
|
||||
|
||||
|
@ -274,64 +239,6 @@
|
|||
colr->clip_list = (FT_Byte*)( table + clip_list_offset );
|
||||
else
|
||||
colr->clip_list = 0;
|
||||
|
||||
colr->var_store.dataCount = 0;
|
||||
colr->var_store.varData = NULL;
|
||||
colr->var_store.axisCount = 0;
|
||||
colr->var_store.regionCount = 0;
|
||||
colr->var_store.varRegionList = 0;
|
||||
|
||||
colr->delta_set_idx_map.mapCount = 0;
|
||||
colr->delta_set_idx_map.outerIndex = NULL;
|
||||
colr->delta_set_idx_map.innerIndex = NULL;
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( face->variation_support & TT_FACE_FLAG_VAR_FVAR &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
var_idx_map_offset = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( var_idx_map_offset >= table_size )
|
||||
goto InvalidTable;
|
||||
|
||||
var_store_offset = FT_NEXT_ULONG( p );
|
||||
if ( var_store_offset >= table_size )
|
||||
goto InvalidTable;
|
||||
|
||||
if ( var_store_offset )
|
||||
{
|
||||
/* If variation info has not been initialized yet, try doing so, */
|
||||
/* otherwise loading the variation store will fail as it */
|
||||
/* requires access to `blend` for checking the number of axes. */
|
||||
if ( !face->blend )
|
||||
if ( mm->get_mm_var( FT_FACE( face ), NULL ) )
|
||||
goto InvalidTable;
|
||||
|
||||
/* Try loading `VarIdxMap` and `VarStore`. */
|
||||
error = mm->load_item_var_store(
|
||||
FT_FACE( face ),
|
||||
colr_offset_in_stream + var_store_offset,
|
||||
&colr->var_store );
|
||||
if ( error != FT_Err_Ok )
|
||||
goto InvalidTable;
|
||||
}
|
||||
|
||||
if ( colr->var_store.axisCount && var_idx_map_offset )
|
||||
{
|
||||
error = mm->load_delta_set_idx_map(
|
||||
FT_FACE( face ),
|
||||
colr_offset_in_stream + var_idx_map_offset,
|
||||
&colr->delta_set_idx_map,
|
||||
&colr->var_store,
|
||||
table_size );
|
||||
if ( error != FT_Err_Ok )
|
||||
goto InvalidTable;
|
||||
}
|
||||
}
|
||||
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
||||
}
|
||||
|
||||
colr->base_glyphs = (FT_Byte*)( table + base_glyph_offset );
|
||||
|
@ -344,19 +251,6 @@
|
|||
return FT_Err_Ok;
|
||||
|
||||
InvalidTable:
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
mm->done_delta_set_idx_map( FT_FACE( face ),
|
||||
&colr->delta_set_idx_map );
|
||||
mm->done_item_var_store( FT_FACE( face ),
|
||||
&colr->var_store );
|
||||
}
|
||||
#endif
|
||||
|
||||
error = FT_THROW( Invalid_Table );
|
||||
|
||||
NoColr:
|
||||
|
@ -378,18 +272,6 @@
|
|||
|
||||
if ( colr )
|
||||
{
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
|
||||
mm->done_delta_set_idx_map( FT_FACE( face ),
|
||||
&colr->delta_set_idx_map );
|
||||
mm->done_item_var_store( FT_FACE( face ),
|
||||
&colr->var_store );
|
||||
}
|
||||
#endif
|
||||
FT_FRAME_RELEASE( colr->table );
|
||||
FT_FREE( colr );
|
||||
}
|
||||
|
@ -490,9 +372,8 @@
|
|||
|
||||
|
||||
static FT_Bool
|
||||
read_color_line( FT_Byte* color_line_p,
|
||||
FT_ColorLine* colorline,
|
||||
FT_Bool read_variable )
|
||||
read_color_line( FT_Byte* color_line_p,
|
||||
FT_ColorLine *colorline )
|
||||
{
|
||||
FT_Byte* p = color_line_p;
|
||||
FT_PaintExtend paint_extend;
|
||||
|
@ -507,7 +388,6 @@
|
|||
colorline->color_stop_iterator.num_color_stops = FT_NEXT_USHORT( p );
|
||||
colorline->color_stop_iterator.p = p;
|
||||
colorline->color_stop_iterator.current_color_stop = 0;
|
||||
colorline->color_stop_iterator.read_variable = read_variable;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -548,81 +428,13 @@
|
|||
}
|
||||
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
|
||||
static FT_Bool
|
||||
get_deltas_for_var_index_base ( TT_Face face,
|
||||
Colr* colr,
|
||||
FT_ULong var_index_base,
|
||||
FT_UInt num_deltas,
|
||||
FT_ItemVarDelta* deltas )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
FT_UInt outer_index = 0;
|
||||
FT_UInt inner_index = 0;
|
||||
FT_ULong loop_var_index = var_index_base;
|
||||
|
||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
||||
|
||||
FT_UInt i = 0;
|
||||
|
||||
|
||||
if ( !VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
FT_ASSERT( 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( var_index_base == 0xFFFFFFFF )
|
||||
{
|
||||
for ( i = 0; i < num_deltas; ++i )
|
||||
deltas[i] = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
for ( i = 0; i < num_deltas; ++i )
|
||||
{
|
||||
loop_var_index = var_index_base + i;
|
||||
|
||||
if ( colr->delta_set_idx_map.innerIndex )
|
||||
{
|
||||
if ( loop_var_index >= colr->delta_set_idx_map.mapCount )
|
||||
loop_var_index = colr->delta_set_idx_map.mapCount - 1;
|
||||
|
||||
outer_index = colr->delta_set_idx_map.outerIndex[loop_var_index];
|
||||
inner_index = colr->delta_set_idx_map.innerIndex[loop_var_index];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* TODO: Direct lookup case not implemented or tested yet. */
|
||||
FT_ASSERT( 0 );
|
||||
error = FT_THROW( Unimplemented_Feature );
|
||||
return error;
|
||||
}
|
||||
|
||||
deltas[i] = mm->get_item_delta( FT_FACE( face ), &colr->var_store,
|
||||
outer_index, inner_index );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
||||
|
||||
|
||||
static FT_Bool
|
||||
read_paint( TT_Face face,
|
||||
Colr* colr,
|
||||
read_paint( Colr* colr,
|
||||
FT_Byte* p,
|
||||
FT_COLR_Paint* apaint )
|
||||
{
|
||||
FT_Byte* paint_base = p;
|
||||
FT_Byte* child_table_p = NULL;
|
||||
FT_Bool do_read_var = FALSE;
|
||||
FT_ULong var_index_base = 0;
|
||||
/* Longest varIndexBase offset is 5 in the spec. */
|
||||
FT_ItemVarDelta item_deltas[6] = { 0, 0, 0, 0, 0, 0 };
|
||||
FT_Byte* paint_base = p;
|
||||
FT_Byte* child_table_p = NULL;
|
||||
|
||||
|
||||
if ( !p || !colr || !colr->table )
|
||||
|
@ -663,30 +475,11 @@
|
|||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_SOLID ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID )
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_SOLID )
|
||||
{
|
||||
apaint->u.solid.color.palette_index = FT_NEXT_USHORT( p );
|
||||
apaint->u.solid.color.alpha = FT_NEXT_SHORT( p );
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SOLID &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 1,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.solid.color.alpha += item_deltas[0];
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_SOLID;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -707,14 +500,10 @@
|
|||
if ( !get_child_table_pointer( colr, paint_base, &p, &child_table_p ) )
|
||||
return 0;
|
||||
|
||||
if ( apaint->format == FT_COLR_PAINTFORMAT_LINEAR_GRADIENT ||
|
||||
( do_read_var =
|
||||
( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_LINEAR_GRADIENT ) ) )
|
||||
if ( apaint->format == FT_COLR_PAINTFORMAT_LINEAR_GRADIENT )
|
||||
{
|
||||
if ( !read_color_line( child_table_p,
|
||||
&apaint->u.linear_gradient.colorline,
|
||||
do_read_var ) )
|
||||
&apaint->u.linear_gradient.colorline ) )
|
||||
return 0;
|
||||
|
||||
/*
|
||||
|
@ -728,40 +517,16 @@
|
|||
apaint->u.linear_gradient.p2.x = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
apaint->u.linear_gradient.p2.y = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( do_read_var && VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG ( p );
|
||||
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 6,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.linear_gradient.p0.x += INT_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.linear_gradient.p0.y += INT_TO_FIXED( item_deltas[1] );
|
||||
apaint->u.linear_gradient.p1.x += INT_TO_FIXED( item_deltas[2] );
|
||||
apaint->u.linear_gradient.p1.y += INT_TO_FIXED( item_deltas[3] );
|
||||
apaint->u.linear_gradient.p2.x += INT_TO_FIXED( item_deltas[4] );
|
||||
apaint->u.linear_gradient.p2.y += INT_TO_FIXED( item_deltas[5] );
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_LINEAR_GRADIENT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_RADIAL_GRADIENT ||
|
||||
( do_read_var =
|
||||
( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_RADIAL_GRADIENT ) ) )
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_RADIAL_GRADIENT )
|
||||
{
|
||||
FT_Pos tmp;
|
||||
|
||||
|
||||
if ( !read_color_line( child_table_p,
|
||||
&apaint->u.radial_gradient.colorline,
|
||||
do_read_var ) )
|
||||
&apaint->u.radial_gradient.colorline ) )
|
||||
return 0;
|
||||
|
||||
/* In the OpenType specification, `r0` and `r1` are defined as */
|
||||
|
@ -781,41 +546,13 @@
|
|||
tmp = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
apaint->u.radial_gradient.r1 = tmp < 0 ? FT_INT_MAX : tmp;
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( do_read_var && VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG ( p );
|
||||
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 6,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.radial_gradient.c0.x += INT_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.radial_gradient.c0.y += INT_TO_FIXED( item_deltas[1] );
|
||||
|
||||
// TODO: Anything to be done about UFWORD deltas here?
|
||||
apaint->u.radial_gradient.r0 += INT_TO_FIXED( item_deltas[2] );
|
||||
|
||||
apaint->u.radial_gradient.c1.x += INT_TO_FIXED( item_deltas[3] );
|
||||
apaint->u.radial_gradient.c1.y += INT_TO_FIXED( item_deltas[4] );
|
||||
|
||||
apaint->u.radial_gradient.r1 += INT_TO_FIXED( item_deltas[5] );
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_RADIAL_GRADIENT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_SWEEP_GRADIENT ||
|
||||
( do_read_var =
|
||||
( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SWEEP_GRADIENT ) ) )
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_SWEEP_GRADIENT )
|
||||
{
|
||||
if ( !read_color_line( child_table_p,
|
||||
&apaint->u.sweep_gradient.colorline,
|
||||
do_read_var) )
|
||||
&apaint->u.sweep_gradient.colorline ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.sweep_gradient.center.x =
|
||||
|
@ -828,27 +565,6 @@
|
|||
apaint->u.sweep_gradient.end_angle =
|
||||
F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( do_read_var && VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG ( p );
|
||||
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 4,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
// TODO: Handle overflow?
|
||||
apaint->u.sweep_gradient.center.x += INT_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.sweep_gradient.center.y += INT_TO_FIXED( item_deltas[1] );
|
||||
|
||||
apaint->u.sweep_gradient.start_angle +=
|
||||
F2DOT14_TO_FIXED( item_deltas[2] );
|
||||
apaint->u.sweep_gradient.end_angle +=
|
||||
F2DOT14_TO_FIXED( item_deltas[3] );
|
||||
}
|
||||
#endif
|
||||
apaint->format = FT_COLR_PAINTFORMAT_SWEEP_GRADIENT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -861,9 +577,7 @@
|
|||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSFORM ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM )
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSFORM )
|
||||
{
|
||||
apaint->u.transform.paint.p = child_table_p;
|
||||
apaint->u.transform.paint.insert_root_transform = 0;
|
||||
|
@ -884,34 +598,10 @@
|
|||
apaint->u.transform.affine.dx = FT_NEXT_LONG( p );
|
||||
apaint->u.transform.affine.dy = FT_NEXT_LONG( p );
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSFORM &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 6,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.transform.affine.xx += (FT_Fixed)item_deltas[0];
|
||||
apaint->u.transform.affine.yx += (FT_Fixed)item_deltas[1];
|
||||
apaint->u.transform.affine.xy += (FT_Fixed)item_deltas[2];
|
||||
apaint->u.transform.affine.yy += (FT_Fixed)item_deltas[3];
|
||||
apaint->u.transform.affine.dx += (FT_Fixed)item_deltas[4];
|
||||
apaint->u.transform.affine.dy += (FT_Fixed)item_deltas[5];
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_TRANSFORM;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSLATE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE )
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSLATE )
|
||||
{
|
||||
apaint->u.translate.paint.p = child_table_p;
|
||||
apaint->u.translate.paint.insert_root_transform = 0;
|
||||
|
@ -919,30 +609,17 @@
|
|||
apaint->u.translate.dx = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
apaint->u.translate.dy = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_TRANSLATE &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 2,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.translate.dx += INT_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.translate.dy += INT_TO_FIXED( item_deltas[1] );
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_TRANSLATE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format >= FT_COLR_PAINTFORMAT_SCALE &&
|
||||
(FT_PaintFormat_Internal)apaint->format <=
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER )
|
||||
else if ( apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_SCALE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM_CENTER )
|
||||
{
|
||||
apaint->u.scale.paint.p = child_table_p;
|
||||
apaint->u.scale.paint.insert_root_transform = 0;
|
||||
|
@ -951,13 +628,10 @@
|
|||
apaint->u.scale.scale_x = F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
||||
/* Non-uniform ones read an extra y value. */
|
||||
if ( apaint->format == FT_COLR_PAINTFORMAT_SCALE ||
|
||||
if ( apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_SCALE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER )
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER )
|
||||
apaint->u.scale.scale_y = F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
else
|
||||
apaint->u.scale.scale_y = apaint->u.scale.scale_x;
|
||||
|
@ -965,13 +639,9 @@
|
|||
/* Scale paints that have a center read center coordinates, */
|
||||
/* otherwise the center is (0,0). */
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER ||
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER )
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SCALE_UNIFORM_CENTER )
|
||||
{
|
||||
apaint->u.scale.center_x = INT_TO_FIXED( FT_NEXT_SHORT ( p ) );
|
||||
apaint->u.scale.center_y = INT_TO_FIXED( FT_NEXT_SHORT ( p ) );
|
||||
|
@ -982,71 +652,6 @@
|
|||
apaint->u.scale.center_y = 0;
|
||||
}
|
||||
|
||||
/* Base values set, now handle variations. */
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER ) &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 2,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.scale.scale_x += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.scale.scale_y += F2DOT14_TO_FIXED( item_deltas[1] );
|
||||
}
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_CENTER )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 4,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.scale.scale_x += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.scale.scale_y += F2DOT14_TO_FIXED( item_deltas[1] );
|
||||
apaint->u.scale.center_x += INT_TO_FIXED( item_deltas[2] );
|
||||
apaint->u.scale.center_y += INT_TO_FIXED( item_deltas[3] );
|
||||
}
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 1,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.scale.scale_x += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.scale.scale_y += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
}
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SCALE_UNIFORM_CENTER )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 3,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.scale.scale_x += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.scale.scale_y += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.scale.center_x += INT_TO_FIXED( item_deltas[1] );
|
||||
apaint->u.scale.center_y += INT_TO_FIXED( item_deltas[2] );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* FT 'COLR' v1 API output format always returns fully defined */
|
||||
/* structs; we thus set the format to the public API value. */
|
||||
apaint->format = FT_COLR_PAINTFORMAT_SCALE;
|
||||
|
@ -1054,26 +659,17 @@
|
|||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_ROTATE ||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_ROTATE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER )
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER )
|
||||
{
|
||||
FT_UInt num_deltas = 0;
|
||||
|
||||
|
||||
apaint->u.rotate.paint.p = child_table_p;
|
||||
apaint->u.rotate.paint.insert_root_transform = 0;
|
||||
|
||||
apaint->u.rotate.angle = F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER )
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER )
|
||||
{
|
||||
apaint->u.rotate.center_x = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
apaint->u.rotate.center_y = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
@ -1084,52 +680,14 @@
|
|||
apaint->u.rotate.center_y = 0;
|
||||
}
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER ) &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE_CENTER )
|
||||
num_deltas = 3;
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_ROTATE )
|
||||
num_deltas = 1;
|
||||
|
||||
if ( num_deltas > 0 )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base,
|
||||
num_deltas, item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.rotate.angle += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
|
||||
if ( num_deltas == 3 )
|
||||
{
|
||||
apaint->u.rotate.center_x += INT_TO_FIXED( item_deltas[1] );
|
||||
apaint->u.rotate.center_y += INT_TO_FIXED( item_deltas[2] );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_ROTATE;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_SKEW ||
|
||||
else if ( apaint->format == FT_COLR_PAINTFORMAT_SKEW ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER )
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER )
|
||||
{
|
||||
apaint->u.skew.paint.p = child_table_p;
|
||||
apaint->u.skew.paint.insert_root_transform = 0;
|
||||
|
@ -1138,9 +696,7 @@
|
|||
apaint->u.skew.y_skew_angle = F2DOT14_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER )
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER )
|
||||
{
|
||||
apaint->u.skew.center_x = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
apaint->u.skew.center_y = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
|
||||
|
@ -1151,42 +707,6 @@
|
|||
apaint->u.skew.center_y = 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW ||
|
||||
(FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER ) &&
|
||||
VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 2,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.skew.x_skew_angle += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.skew.y_skew_angle += F2DOT14_TO_FIXED( item_deltas[1] );
|
||||
}
|
||||
|
||||
if ( (FT_PaintFormat_Internal)apaint->format ==
|
||||
FT_COLR_PAINTFORMAT_INTERNAL_VAR_SKEW_CENTER )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr, var_index_base, 4,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
apaint->u.skew.x_skew_angle += F2DOT14_TO_FIXED( item_deltas[0] );
|
||||
apaint->u.skew.y_skew_angle += F2DOT14_TO_FIXED( item_deltas[1] );
|
||||
apaint->u.skew.center_x += INT_TO_FIXED( item_deltas[2] );
|
||||
apaint->u.skew.center_y += INT_TO_FIXED( item_deltas[3] );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
apaint->format = FT_COLR_PAINTFORMAT_SKEW;
|
||||
|
||||
return 1;
|
||||
|
@ -1337,10 +857,10 @@
|
|||
|
||||
p = colr->clip_list;
|
||||
|
||||
/* Limit points to the first byte after the end of the color table. */
|
||||
/* Thus, in subsequent limit checks below we need to check whether the */
|
||||
/* read pointer is strictly greater than a position offset by certain */
|
||||
/* field sizes to the left of that position. */
|
||||
/* limit points to the first byte after the end of the color table. */
|
||||
/* Thus, in subsequent limit checks below we need to check whether the */
|
||||
/* read pointer is strictly greater than a position offset */
|
||||
/* by certain field sizes to the left of that position. */
|
||||
limit = (FT_Byte*)colr->table + colr->table_size;
|
||||
|
||||
/* Check whether we can extract one `uint8` and one `uint32`. */
|
||||
|
@ -1517,8 +1037,6 @@
|
|||
Colr* colr = (Colr*)face->colr;
|
||||
|
||||
FT_Byte* p;
|
||||
FT_Long var_index_base;
|
||||
FT_Int item_deltas[2];
|
||||
|
||||
|
||||
if ( !colr || !colr->table )
|
||||
|
@ -1536,34 +1054,12 @@
|
|||
/* Iterator points at first `ColorStop` of `ColorLine`. */
|
||||
p = iterator->p;
|
||||
|
||||
color_stop->stop_offset = (FT_Fixed)FT_NEXT_SHORT( p ) << 2;
|
||||
color_stop->stop_offset = FT_NEXT_SHORT( p );
|
||||
|
||||
color_stop->color.palette_index = FT_NEXT_USHORT( p );
|
||||
|
||||
color_stop->color.alpha = FT_NEXT_SHORT( p );
|
||||
|
||||
if ( iterator->read_variable )
|
||||
{
|
||||
/* Pointer p needs to be advanced independently of whether we intend */
|
||||
/* to take variable deltas into account or not. Otherwise iteration */
|
||||
/* would fail due to wrong offsets. */
|
||||
var_index_base = FT_NEXT_ULONG( p );
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( VARIABLE_COLRV1_ENABLED )
|
||||
{
|
||||
if ( !get_deltas_for_var_index_base( face, colr,
|
||||
var_index_base,
|
||||
2,
|
||||
item_deltas ) )
|
||||
return 0;
|
||||
|
||||
color_stop->stop_offset += (FT_Fixed)item_deltas[0] << 2;
|
||||
color_stop->color.alpha += item_deltas[1];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
iterator->p = p;
|
||||
iterator->current_color_stop++;
|
||||
|
||||
|
@ -1643,7 +1139,7 @@
|
|||
return 1;
|
||||
}
|
||||
|
||||
return read_paint( face, colr, opaque_paint.p, paint );
|
||||
return read_paint( colr, opaque_paint.p, paint );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -190,16 +190,10 @@
|
|||
FT_Int result = 0;
|
||||
FT_UInt count, mask;
|
||||
|
||||
FT_Byte* p;
|
||||
FT_Byte* p_limit;
|
||||
FT_Byte* p = face->kern_table;
|
||||
FT_Byte* p_limit = p + face->kern_table_size;
|
||||
|
||||
|
||||
if ( !face->kern_table )
|
||||
return result;
|
||||
|
||||
p = face->kern_table;
|
||||
p_limit = p + face->kern_table_size;
|
||||
|
||||
p += 4;
|
||||
mask = 0x0001;
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@
|
|||
}
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
if ( var && face->blend )
|
||||
if ( var )
|
||||
{
|
||||
FT_Face f = FT_FACE( face );
|
||||
FT_Int a = (FT_Int)*aadvance;
|
||||
|
|
|
@ -172,8 +172,17 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
/* we currently don't support bit 1; however, it is better to */
|
||||
/* draw at least something... */
|
||||
if ( flags == 3 )
|
||||
face->root.face_flags |= FT_FACE_FLAG_SBIX_OVERLAY;
|
||||
{
|
||||
FT_TRACE1(( "tt_face_load_sbit_strikes:"
|
||||
" sbix overlay not supported yet\n" ));
|
||||
FT_TRACE1(( " "
|
||||
" expect bad rendering results\n" ));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Count the number of strikes available in the table. We are a bit
|
||||
|
@ -1571,34 +1580,17 @@
|
|||
|
||||
if ( !error )
|
||||
{
|
||||
FT_Short abearing; /* not used here */
|
||||
FT_Short abearing;
|
||||
FT_UShort aadvance;
|
||||
|
||||
|
||||
tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance );
|
||||
|
||||
metrics->horiBearingX = (FT_Short)originOffsetX;
|
||||
metrics->vertBearingX = (FT_Short)originOffsetX;
|
||||
|
||||
metrics->horiBearingY = (FT_Short)( originOffsetY + metrics->height );
|
||||
metrics->vertBearingY = (FT_Short)originOffsetY;
|
||||
|
||||
metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height );
|
||||
metrics->horiAdvance = (FT_UShort)( aadvance *
|
||||
face->root.size->metrics.x_ppem /
|
||||
face->header.Units_Per_EM );
|
||||
|
||||
if ( face->vertical_info )
|
||||
tt_face_get_metrics( face, TRUE, glyph_index, &abearing, &aadvance );
|
||||
else if ( face->os2.version != 0xFFFFU )
|
||||
aadvance = (FT_UShort)FT_ABS( face->os2.sTypoAscender -
|
||||
face->os2.sTypoDescender );
|
||||
else
|
||||
aadvance = (FT_UShort)FT_ABS( face->horizontal.Ascender -
|
||||
face->horizontal.Descender );
|
||||
|
||||
metrics->vertAdvance = (FT_UShort)( aadvance *
|
||||
face->root.size->metrics.x_ppem /
|
||||
face->header.Units_Per_EM );
|
||||
}
|
||||
|
||||
return error;
|
||||
|
|
|
@ -319,7 +319,7 @@
|
|||
#ifdef FT_CONFIG_OPTION_USE_ZLIB
|
||||
|
||||
FT_ULong uncomp_size;
|
||||
FT_Byte* uncomp_buffer = NULL;
|
||||
FT_Byte* uncomp_buffer;
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1909,10 +1909,10 @@ typedef ptrdiff_t FT_PtrDist;
|
|||
|
||||
|
||||
static int
|
||||
gray_convert_glyph_inner( RAS_ARG_
|
||||
gray_convert_glyph_inner( RAS_ARG,
|
||||
int continued )
|
||||
{
|
||||
volatile int error;
|
||||
int error;
|
||||
|
||||
|
||||
if ( ft_setjmp( ras.jump_buffer ) == 0 )
|
||||
|
@ -2004,7 +2004,7 @@ typedef ptrdiff_t FT_PtrDist;
|
|||
ras.max_ey = band[0];
|
||||
ras.count_ey = width;
|
||||
|
||||
error = gray_convert_glyph_inner( RAS_VAR_ continued );
|
||||
error = gray_convert_glyph_inner( RAS_VAR, continued );
|
||||
continued = 1;
|
||||
|
||||
if ( !error )
|
||||
|
|
|
@ -108,23 +108,6 @@
|
|||
return error;
|
||||
}
|
||||
|
||||
if ( !ft_strcmp( property_name, "TEMPORARY-enable-variable-colrv1" ) )
|
||||
{
|
||||
/* This flag is temporary and can't be set with environment variables. */
|
||||
if ( !value_is_string )
|
||||
{
|
||||
FT_Bool* bv = (FT_Bool*)value;
|
||||
|
||||
if ( *bv == TRUE || *bv == FALSE)
|
||||
driver->enable_variable_colrv1 = *bv;
|
||||
else
|
||||
error = FT_ERR( Unimplemented_Feature );
|
||||
} else
|
||||
error = FT_ERR( Invalid_Argument );
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
FT_TRACE2(( "tt_property_set: missing property `%s'\n",
|
||||
property_name ));
|
||||
return FT_THROW( Missing_Property );
|
||||
|
@ -524,34 +507,19 @@
|
|||
FT_DEFINE_SERVICE_MULTIMASTERSREC(
|
||||
tt_service_gx_multi_masters,
|
||||
|
||||
(FT_Get_MM_Func) NULL, /* get_mm */
|
||||
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
||||
(FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
|
||||
(FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
|
||||
(FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
|
||||
(FT_Set_Var_Design_Func)TT_Set_Var_Design, /* set_var_design */
|
||||
(FT_Get_Var_Design_Func)TT_Get_Var_Design, /* get_var_design */
|
||||
(FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */
|
||||
(FT_Set_MM_WeightVector_Func)
|
||||
NULL, /* set_mm_weightvector */
|
||||
(FT_Get_MM_WeightVector_Func)
|
||||
NULL, /* get_mm_weightvector */
|
||||
(FT_Var_Load_Delta_Set_Idx_Map_Func)
|
||||
tt_var_load_delta_set_index_mapping,
|
||||
/* load_delta_set_idx_map */
|
||||
(FT_Var_Load_Item_Var_Store_Func)
|
||||
tt_var_load_item_variation_store,
|
||||
/* load_item_variation_store */
|
||||
(FT_Var_Get_Item_Delta_Func)
|
||||
tt_var_get_item_delta, /* get_item_delta */
|
||||
(FT_Var_Done_Item_Var_Store_Func)
|
||||
tt_var_done_item_variation_store,
|
||||
/* done_item_variation_store */
|
||||
(FT_Var_Done_Delta_Set_Idx_Map_Func)
|
||||
tt_var_done_delta_set_index_map,
|
||||
/* done_delta_set_index_map */
|
||||
(FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
|
||||
(FT_Done_Blend_Func) tt_done_blend /* done_blend */
|
||||
(FT_Get_MM_Func) NULL, /* get_mm */
|
||||
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
||||
(FT_Set_MM_Blend_Func) TT_Set_MM_Blend, /* set_mm_blend */
|
||||
(FT_Get_MM_Blend_Func) TT_Get_MM_Blend, /* get_mm_blend */
|
||||
(FT_Get_MM_Var_Func) TT_Get_MM_Var, /* get_mm_var */
|
||||
(FT_Set_Var_Design_Func) TT_Set_Var_Design, /* set_var_design */
|
||||
(FT_Get_Var_Design_Func) TT_Get_Var_Design, /* get_var_design */
|
||||
(FT_Set_Instance_Func) TT_Set_Named_Instance, /* set_instance */
|
||||
(FT_Set_MM_WeightVector_Func)NULL, /* set_mm_weightvector */
|
||||
(FT_Get_MM_WeightVector_Func)NULL, /* get_mm_weightvector */
|
||||
|
||||
(FT_Get_Var_Blend_Func) tt_get_var_blend, /* get_var_blend */
|
||||
(FT_Done_Blend_Func) tt_done_blend /* done_blend */
|
||||
)
|
||||
|
||||
FT_DEFINE_SERVICE_METRICSVARIATIONSREC(
|
||||
|
|
|
@ -801,7 +801,7 @@
|
|||
FT_UInt start_point,
|
||||
FT_UInt start_contour )
|
||||
{
|
||||
zone->n_points = (FT_UShort)load->outline.n_points + 4 -
|
||||
zone->n_points = (FT_UShort)load->outline.n_points -
|
||||
(FT_UShort)start_point;
|
||||
zone->n_contours = load->outline.n_contours -
|
||||
(FT_Short)start_contour;
|
||||
|
@ -970,6 +970,11 @@
|
|||
outline->points[n_points + 2] = loader->pp3;
|
||||
outline->points[n_points + 3] = loader->pp4;
|
||||
|
||||
outline->tags[n_points ] = 0;
|
||||
outline->tags[n_points + 1] = 0;
|
||||
outline->tags[n_points + 2] = 0;
|
||||
outline->tags[n_points + 3] = 0;
|
||||
|
||||
n_points += 4;
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
|
@ -980,9 +985,24 @@
|
|||
goto Exit;
|
||||
|
||||
/* Deltas apply to the unscaled data. */
|
||||
error = TT_Vary_Apply_Glyph_Deltas( loader,
|
||||
error = TT_Vary_Apply_Glyph_Deltas( loader->face,
|
||||
loader->glyph_index,
|
||||
outline,
|
||||
unrounded );
|
||||
unrounded,
|
||||
(FT_UInt)n_points );
|
||||
|
||||
/* recalculate linear horizontal and vertical advances */
|
||||
/* if we don't have HVAR and VVAR, respectively */
|
||||
|
||||
/* XXX: change all FreeType modules to store `linear' and `vadvance' */
|
||||
/* in 26.6 format before the `base' module scales them to 16.16 */
|
||||
if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
|
||||
loader->linear = FT_PIX_ROUND( unrounded[n_points - 3].x -
|
||||
unrounded[n_points - 4].x ) / 64;
|
||||
if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
|
||||
loader->vadvance = FT_PIX_ROUND( unrounded[n_points - 1].x -
|
||||
unrounded[n_points - 2].x ) / 64;
|
||||
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -994,7 +1014,7 @@
|
|||
tt_prepare_zone( &loader->zone, &gloader->current, 0, 0 );
|
||||
|
||||
FT_ARRAY_COPY( loader->zone.orus, loader->zone.cur,
|
||||
loader->zone.n_points );
|
||||
loader->zone.n_points + 4 );
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -1084,8 +1104,8 @@
|
|||
|
||||
for ( ; vec < limit; vec++, u++ )
|
||||
{
|
||||
vec->x = ADD_LONG( FT_MulFix( u->x, x_scale ), 32 ) >> 6;
|
||||
vec->y = ADD_LONG( FT_MulFix( u->y, y_scale ), 32 ) >> 6;
|
||||
vec->x = ( FT_MulFix( u->x, x_scale ) + 32 ) >> 6;
|
||||
vec->y = ( FT_MulFix( u->y, y_scale ) + 32 ) >> 6;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1136,7 +1156,11 @@
|
|||
}
|
||||
|
||||
if ( IS_HINTED( loader->load_flags ) )
|
||||
{
|
||||
loader->zone.n_points += 4;
|
||||
|
||||
error = TT_Hint_Glyph( loader, 0 );
|
||||
}
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||
Exit:
|
||||
|
@ -1204,8 +1228,8 @@
|
|||
p1 = gloader->base.outline.points + k;
|
||||
p2 = gloader->base.outline.points + l;
|
||||
|
||||
x = SUB_LONG( p1->x, p2->x );
|
||||
y = SUB_LONG( p1->y, p2->y );
|
||||
x = p1->x - p2->x;
|
||||
y = p1->y - p2->y;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1349,6 +1373,11 @@
|
|||
outline->points[outline->n_points + 2] = loader->pp3;
|
||||
outline->points[outline->n_points + 3] = loader->pp4;
|
||||
|
||||
outline->tags[outline->n_points ] = 0;
|
||||
outline->tags[outline->n_points + 1] = 0;
|
||||
outline->tags[outline->n_points + 2] = 0;
|
||||
outline->tags[outline->n_points + 3] = 0;
|
||||
|
||||
#ifdef TT_USE_BYTECODE_INTERPRETER
|
||||
|
||||
{
|
||||
|
@ -1407,9 +1436,11 @@
|
|||
|
||||
/* Some points are likely touched during execution of */
|
||||
/* instructions on components. So let's untouch them. */
|
||||
for ( i = 0; i < loader->zone.n_points - 4U; i++ )
|
||||
for ( i = 0; i < loader->zone.n_points; i++ )
|
||||
loader->zone.tags[i] &= ~FT_CURVE_TAG_TOUCH_BOTH;
|
||||
|
||||
loader->zone.n_points += 4;
|
||||
|
||||
return TT_Hint_Glyph( loader, 1 );
|
||||
}
|
||||
|
||||
|
@ -1730,29 +1761,57 @@
|
|||
/* a small outline structure with four elements for */
|
||||
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
|
||||
FT_Vector points[4];
|
||||
char tags[4] = { 1, 1, 1, 1 };
|
||||
short contours[4] = { 0, 1, 2, 3 };
|
||||
FT_Outline outline;
|
||||
|
||||
/* unrounded values */
|
||||
FT_Vector unrounded[4] = { {0, 0}, {0, 0}, {0, 0}, {0, 0} };
|
||||
|
||||
|
||||
points[0] = loader->pp1;
|
||||
points[1] = loader->pp2;
|
||||
points[2] = loader->pp3;
|
||||
points[3] = loader->pp4;
|
||||
points[0].x = loader->pp1.x;
|
||||
points[0].y = loader->pp1.y;
|
||||
points[1].x = loader->pp2.x;
|
||||
points[1].y = loader->pp2.y;
|
||||
|
||||
outline.n_points = 0;
|
||||
outline.n_contours = 0;
|
||||
points[2].x = loader->pp3.x;
|
||||
points[2].y = loader->pp3.y;
|
||||
points[3].x = loader->pp4.x;
|
||||
points[3].y = loader->pp4.y;
|
||||
|
||||
outline.n_points = 4;
|
||||
outline.n_contours = 4;
|
||||
outline.points = points;
|
||||
outline.tags = NULL;
|
||||
outline.contours = NULL;
|
||||
outline.tags = tags;
|
||||
outline.contours = contours;
|
||||
|
||||
/* this must be done before scaling */
|
||||
error = TT_Vary_Apply_Glyph_Deltas( loader,
|
||||
error = TT_Vary_Apply_Glyph_Deltas( loader->face,
|
||||
glyph_index,
|
||||
&outline,
|
||||
unrounded );
|
||||
unrounded,
|
||||
(FT_UInt)outline.n_points );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
loader->pp1.x = points[0].x;
|
||||
loader->pp1.y = points[0].y;
|
||||
loader->pp2.x = points[1].x;
|
||||
loader->pp2.y = points[1].y;
|
||||
|
||||
loader->pp3.x = points[2].x;
|
||||
loader->pp3.y = points[2].y;
|
||||
loader->pp4.x = points[3].x;
|
||||
loader->pp4.y = points[3].y;
|
||||
|
||||
/* recalculate linear horizontal and vertical advances */
|
||||
/* if we don't have HVAR and VVAR, respectively */
|
||||
if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
|
||||
loader->linear = FT_PIX_ROUND( unrounded[1].x -
|
||||
unrounded[0].x ) / 64;
|
||||
if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
|
||||
loader->vadvance = FT_PIX_ROUND( unrounded[3].x -
|
||||
unrounded[2].x ) / 64;
|
||||
}
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
||||
|
@ -1900,16 +1959,17 @@
|
|||
|
||||
/* construct an outline structure for */
|
||||
/* communication with `TT_Vary_Apply_Glyph_Deltas' */
|
||||
outline.n_contours = outline.n_points = limit;
|
||||
outline.n_points = (short)( gloader->current.num_subglyphs + 4 );
|
||||
outline.n_contours = outline.n_points;
|
||||
|
||||
outline.points = NULL;
|
||||
outline.tags = NULL;
|
||||
outline.contours = NULL;
|
||||
|
||||
if ( FT_NEW_ARRAY( points, limit + 4 ) ||
|
||||
FT_NEW_ARRAY( tags, limit + 4 ) ||
|
||||
FT_NEW_ARRAY( contours, limit + 4 ) ||
|
||||
FT_NEW_ARRAY( unrounded, limit + 4 ) )
|
||||
if ( FT_NEW_ARRAY( points, outline.n_points ) ||
|
||||
FT_NEW_ARRAY( tags, outline.n_points ) ||
|
||||
FT_NEW_ARRAY( contours, outline.n_points ) ||
|
||||
FT_NEW_ARRAY( unrounded, outline.n_points ) )
|
||||
goto Exit1;
|
||||
|
||||
subglyph = gloader->current.subglyphs;
|
||||
|
@ -1925,10 +1985,28 @@
|
|||
contours[i] = i;
|
||||
}
|
||||
|
||||
points[i++] = loader->pp1;
|
||||
points[i++] = loader->pp2;
|
||||
points[i++] = loader->pp3;
|
||||
points[i ] = loader->pp4;
|
||||
points[i].x = loader->pp1.x;
|
||||
points[i].y = loader->pp1.y;
|
||||
tags[i] = 1;
|
||||
contours[i] = i;
|
||||
|
||||
i++;
|
||||
points[i].x = loader->pp2.x;
|
||||
points[i].y = loader->pp2.y;
|
||||
tags[i] = 1;
|
||||
contours[i] = i;
|
||||
|
||||
i++;
|
||||
points[i].x = loader->pp3.x;
|
||||
points[i].y = loader->pp3.y;
|
||||
tags[i] = 1;
|
||||
contours[i] = i;
|
||||
|
||||
i++;
|
||||
points[i].x = loader->pp4.x;
|
||||
points[i].y = loader->pp4.y;
|
||||
tags[i] = 1;
|
||||
contours[i] = i;
|
||||
|
||||
outline.points = points;
|
||||
outline.tags = tags;
|
||||
|
@ -1936,9 +2014,12 @@
|
|||
|
||||
/* this call provides additional offsets */
|
||||
/* for each component's translation */
|
||||
if ( FT_SET_ERROR( TT_Vary_Apply_Glyph_Deltas( loader,
|
||||
&outline,
|
||||
unrounded ) ) )
|
||||
if ( FT_SET_ERROR( TT_Vary_Apply_Glyph_Deltas(
|
||||
face,
|
||||
glyph_index,
|
||||
&outline,
|
||||
unrounded,
|
||||
(FT_UInt)outline.n_points ) ) )
|
||||
goto Exit1;
|
||||
|
||||
subglyph = gloader->current.subglyphs;
|
||||
|
@ -1952,6 +2033,27 @@
|
|||
}
|
||||
}
|
||||
|
||||
loader->pp1.x = points[i + 0].x;
|
||||
loader->pp1.y = points[i + 0].y;
|
||||
loader->pp2.x = points[i + 1].x;
|
||||
loader->pp2.y = points[i + 1].y;
|
||||
|
||||
loader->pp3.x = points[i + 2].x;
|
||||
loader->pp3.y = points[i + 2].y;
|
||||
loader->pp4.x = points[i + 3].x;
|
||||
loader->pp4.y = points[i + 3].y;
|
||||
|
||||
/* recalculate linear horizontal and vertical advances */
|
||||
/* if we don't have HVAR and VVAR, respectively */
|
||||
if ( !( face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
|
||||
loader->linear =
|
||||
FT_PIX_ROUND( unrounded[outline.n_points - 3].x -
|
||||
unrounded[outline.n_points - 4].x ) / 64;
|
||||
if ( !( face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
|
||||
loader->vadvance =
|
||||
FT_PIX_ROUND( unrounded[outline.n_points - 1].x -
|
||||
unrounded[outline.n_points - 2].x ) / 64;
|
||||
|
||||
Exit1:
|
||||
FT_FREE( outline.points );
|
||||
FT_FREE( outline.tags );
|
||||
|
@ -2153,7 +2255,7 @@
|
|||
if ( loader->widthp )
|
||||
glyph->metrics.horiAdvance = loader->widthp[glyph_index] * 64;
|
||||
else
|
||||
glyph->metrics.horiAdvance = SUB_LONG( loader->pp2.x, loader->pp1.x );
|
||||
glyph->metrics.horiAdvance = SUB_LONG(loader->pp2.x, loader->pp1.x);
|
||||
|
||||
/* set glyph dimensions */
|
||||
glyph->metrics.width = SUB_LONG( bbox.xMax, bbox.xMin );
|
||||
|
@ -2795,12 +2897,8 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( FT_IS_SCALABLE( glyph->face ) ||
|
||||
FT_HAS_SBIX( glyph->face ) )
|
||||
if ( FT_IS_SCALABLE( glyph->face ) )
|
||||
{
|
||||
TT_Face face = (TT_Face)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 );
|
||||
|
@ -2808,35 +2906,6 @@
|
|||
glyph->linearHoriAdvance = loader.linear;
|
||||
glyph->linearVertAdvance = loader.vadvance;
|
||||
|
||||
/* Bitmaps from the 'sbix' table need special treatment: */
|
||||
/* if there is a glyph contour, the bitmap origin must be */
|
||||
/* shifted to be relative to the lower left corner of the */
|
||||
/* glyph bounding box, also taking the left-side bearing */
|
||||
/* (or top bearing) into account. */
|
||||
if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX &&
|
||||
loader.n_contours > 0 )
|
||||
{
|
||||
FT_Int bitmap_left;
|
||||
FT_Int bitmap_top;
|
||||
|
||||
|
||||
if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
|
||||
{
|
||||
/* This is a guess, since Apple's CoreText engine doesn't */
|
||||
/* really do vertical typesetting. */
|
||||
bitmap_left = loader.bbox.xMin;
|
||||
bitmap_top = loader.top_bearing;
|
||||
}
|
||||
else
|
||||
{
|
||||
bitmap_left = loader.left_bearing;
|
||||
bitmap_top = loader.bbox.yMin;
|
||||
}
|
||||
|
||||
glyph->bitmap_left += FT_MulFix( bitmap_left, x_scale ) >> 6;
|
||||
glyph->bitmap_top += FT_MulFix( bitmap_top, y_scale ) >> 6;
|
||||
}
|
||||
|
||||
/* sanity checks: if `xxxAdvance' in the sbit metric */
|
||||
/* structure isn't set, use `linearXXXAdvance' */
|
||||
if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
|
||||
|
@ -2903,9 +2972,6 @@
|
|||
&topBearing,
|
||||
&advanceY );
|
||||
|
||||
glyph->linearHoriAdvance = advanceX;
|
||||
glyph->linearVertAdvance = advanceY;
|
||||
|
||||
advanceX = (FT_UShort)FT_MulDiv( advanceX,
|
||||
glyph->face->size->metrics.x_ppem,
|
||||
glyph->face->units_per_EM );
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue