forked from minhngoc25a/freetype2
Compare commits
130 Commits
fix-sdf-sq
...
master
Author | SHA1 | Date |
---|---|---|
Dominik Röttsches | 275b116b40 | |
Dominik Röttsches | 44fd524ee4 | |
Dominik Röttsches | 603fef28a6 | |
Dominik Röttsches | d134b9e37b | |
Dominik Röttsches | 8ec531c26c | |
Dominik Röttsches | 9c4ad2a901 | |
Dominik Röttsches | 3414fef74f | |
Dominik Röttsches | 7c151abb69 | |
Dominik Röttsches | 8a9192f68e | |
Stephen Holdaway | d5d048bbfe | |
Dominik Röttsches | 31b14fd4dc | |
Chris Liddell | 1a242558be | |
Thomas Sondergaard | 55a97b0cb1 | |
Werner Lemberg | 31005d98a4 | |
Dominik Röttsches | bec4ef415e | |
Werner Lemberg | de27955c2a | |
Dominik Röttsches | 0607e0e959 | |
Dominik Röttsches | dece953516 | |
Dominik Röttsches | 15fef219d6 | |
Werner Lemberg | 2db58e061e | |
Dominik Röttsches | 117df36b4c | |
Alexei Podtelezhnikov | 5e48c88d57 | |
Alexei Podtelezhnikov | 9006ff7d10 | |
Werner Lemberg | 2848378be5 | |
Werner Lemberg | 40c6f97326 | |
Dominik Röttsches | 4b6f92e6b3 | |
Xavier Claessens | b861b24157 | |
Alexei Podtelezhnikov | 47103b2f19 | |
Alexei Podtelezhnikov | 705f416184 | |
Ben Wagner | f7daf9d293 | |
Alexei Podtelezhnikov | d9b8a69e9a | |
Alexei Podtelezhnikov | 9c706dcca7 | |
Ben Wagner | 9079521002 | |
Alexei Podtelezhnikov | d6fc8c6ba0 | |
Ben Wagner | 8bb7722a53 | |
Ben Wagner | 58395dd200 | |
Alexei Podtelezhnikov | 8b6bcc92c5 | |
Alexei Podtelezhnikov | e7482ff4c2 | |
Alexei Podtelezhnikov | 73631b9530 | |
Alexei Podtelezhnikov | 4fef1fcede | |
bruvzg | 9acefc4f51 | |
Ben Wagner | b11074cf6d | |
Ben Wagner | c26872ed59 | |
Alexei Podtelezhnikov | d685798123 | |
Alexei Podtelezhnikov | 8addad6065 | |
Alexei Podtelezhnikov | c26f0d0d7e | |
Behdad Esfahbod (بهداد اسفهبد) | b98dd169a1 | |
Dominik Röttsches | 7838c78f53 | |
Dominik Röttsches | 9aa99f2262 | |
Dominik Röttsches | a4c4566b6d | |
Dominik Röttsches | 5f19f49c81 | |
Werner Lemberg | e3ac7bb64a | |
Werner Lemberg | b4b7c3f607 | |
Werner Lemberg | c8a9c88975 | |
Werner Lemberg | 5d49473f85 | |
Werner Lemberg | e8ebfe988b | |
Anuj Verma | 7b3ebb9c12 | |
Werner Lemberg | 62bc04f4c5 | |
Brendan Shanks | 6fb7b7a09d | |
Alexei Podtelezhnikov | ed4d0710f1 | |
Alexei Podtelezhnikov | 581dd06405 | |
Xavier Claessens | d59c7ce1b9 | |
Werner Lemberg | 079a22da03 | |
Georg Brandl | 978eefee54 | |
Steve Lhomme | 3100c8120e | |
Ben Wagner | a1ca701023 | |
Werner Lemberg | aee6b94727 | |
Werner Lemberg | fc08295650 | |
Werner Lemberg | 1603378b91 | |
Eric Jing | 89d5cce58d | |
Werner Lemberg | 695d606ae5 | |
Ben Wagner | d247c56278 | |
Werner Lemberg | 385345037e | |
Werner Lemberg | 8a33164dad | |
Werner Lemberg | e50798b720 | |
Werner Lemberg | 87989a1435 | |
Werner Lemberg | 97cdbb24f7 | |
Werner Lemberg | 119e404b89 | |
Werner Lemberg | a8e4563c34 | |
Werner Lemberg | 1949a7ec3a | |
Werner Lemberg | ac4c1ebf7e | |
Werner Lemberg | 907715a6a2 | |
Werner Lemberg | 06727a5257 | |
Carlo Bramini | 127c1e8331 | |
Steve Lhomme | 0574692c6d | |
Werner Lemberg | fc15ebe0a6 | |
Ben Wagner | a960be9e5e | |
Werner Lemberg | d2c3bbcd8e | |
Werner Lemberg | 0c2bdb01a2 | |
Werner Lemberg | d014387ad4 | |
Ben Wagner | 7789f2bb79 | |
Werner Lemberg | 22a0cccb4d | |
Werner Lemberg | 53dfdcd819 | |
Werner Lemberg | 1e2eb65048 | |
Anuj Verma | 360e2507a3 | |
Anuj Verma | 2600ef637e | |
Anuj Verma | 5499d7bf81 | |
Ben Wagner | 335224beee | |
Ben Wagner | 034e5dbf92 | |
suzuki toshiya | bcdfa38692 | |
Werner Lemberg | 6c5522c6f8 | |
Werner Lemberg | ca46bc0cf2 | |
Werner Lemberg | 5b26e92a0f | |
Steve Lhomme | 20ec99be7e | |
Werner Lemberg | 01d4deb061 | |
Alexei Podtelezhnikov | 00ae29fcd2 | |
Werner Lemberg | 5a53e51b5c | |
Werner Lemberg | c67ecb8c3a | |
Werner Lemberg | 338b4e8846 | |
Alexei Podtelezhnikov | 1680885aa5 | |
Alexei Podtelezhnikov | 0447df71e7 | |
Alexei Podtelezhnikov | ed0e2e76d8 | |
Alexei Podtelezhnikov | 7c6b2f20b0 | |
Werner Lemberg | 24db55ecb8 | |
Alexei Podtelezhnikov | a173aead31 | |
Alexei Podtelezhnikov | dd8676b277 | |
Eric Jing | 56d182a74d | |
Alexei Podtelezhnikov | 8e39e42ee9 | |
Alexei Podtelezhnikov | c6dd509b99 | |
Alexei Podtelezhnikov | 946e1353ea | |
Werner Lemberg | 36ee3160a0 | |
Alexei Podtelezhnikov | 983d435865 | |
Alexei Podtelezhnikov | bee8886408 | |
Werner Lemberg | 7fd03a3e25 | |
Alexei Podtelezhnikov | da877c8693 | |
suzuki toshiya | 35740aa6a9 | |
Werner Lemberg | fa226478b1 | |
Alexei Podtelezhnikov | b34741c1cc | |
Ben Wagner | e34a860a07 | |
Anuj Verma | ab1c98ac18 |
|
@ -5,7 +5,7 @@ stages:
|
||||||
|
|
||||||
# FIXME: Use --werror once warnings are fixed.
|
# FIXME: Use --werror once warnings are fixed.
|
||||||
variables:
|
variables:
|
||||||
MESON_ARGS: --fatal-meson-warnings
|
MESON_ARGS: --fatal-meson-warnings --default-library=both
|
||||||
MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib
|
MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib
|
||||||
|
|
||||||
.build windows common:
|
.build windows common:
|
||||||
|
@ -47,8 +47,18 @@ variables:
|
||||||
- Import-Certificate -CertStoreLocation "Cert:\LocalMachine\Root" "C:\roots.sst"
|
- 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
|
# Make sure meson is up to date so we don't need to rebuild the image
|
||||||
# with each release.
|
# with each release.
|
||||||
- pip3 install meson==0.59.1
|
- pip3 install -U 'meson==0.59.*'
|
||||||
|
- pip3 install --upgrade certifi
|
||||||
- pip3 install -U ninja
|
- 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:
|
script:
|
||||||
# For some reason, options are separated by newlines instead of spaces,
|
# For some reason, options are separated by newlines instead of spaces,
|
||||||
# so we have to replace them first.
|
# so we have to replace them first.
|
||||||
|
@ -59,11 +69,10 @@ variables:
|
||||||
# script. Environment variables substitutions is done by PowerShell
|
# script. Environment variables substitutions is done by PowerShell
|
||||||
# before calling `cmd.exe`, that's why we use `$env:FOO` instead of
|
# before calling `cmd.exe`, that's why we use `$env:FOO` instead of
|
||||||
# `%FOO%`.
|
# `%FOO%`.
|
||||||
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
|
- 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 &&
|
meson setup build $env:MESON_ARGS_WINDOWS $env:MESON_ARGS_UWP &&
|
||||||
meson compile --verbose -C build &&
|
meson compile --verbose -C build
|
||||||
meson test -C build &&
|
$env:MESON_WINDOWS_TESTS"
|
||||||
meson test -C build --benchmark"
|
|
||||||
|
|
||||||
|
|
||||||
# Format of job names:
|
# Format of job names:
|
||||||
|
@ -76,12 +85,20 @@ windows meson vs2017 amd64:
|
||||||
extends: '.build windows meson'
|
extends: '.build windows meson'
|
||||||
variables:
|
variables:
|
||||||
ARCH: 'amd64'
|
ARCH: 'amd64'
|
||||||
|
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
|
||||||
|
|
||||||
windows meson vs2017 x86:
|
windows meson vs2017 x86:
|
||||||
extends: '.build windows meson'
|
extends: '.build windows meson'
|
||||||
variables:
|
variables:
|
||||||
ARCH: 'x86'
|
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.
|
# Linux Jobs.
|
||||||
#
|
#
|
||||||
|
@ -130,7 +147,8 @@ linux autotools libs clang:
|
||||||
linux meson:
|
linux meson:
|
||||||
extends: '.build linux common'
|
extends: '.build linux common'
|
||||||
script: |
|
script: |
|
||||||
meson setup build -Dbrotli=disabled \
|
meson setup build ${MESON_ARGS} \
|
||||||
|
-Dbrotli=disabled \
|
||||||
-Dbzip2=disabled \
|
-Dbzip2=disabled \
|
||||||
-Dharfbuzz=disabled \
|
-Dharfbuzz=disabled \
|
||||||
-Dpng=disabled \
|
-Dpng=disabled \
|
||||||
|
@ -142,7 +160,8 @@ linux meson:
|
||||||
linux meson libs:
|
linux meson libs:
|
||||||
extends: '.build linux common'
|
extends: '.build linux common'
|
||||||
script: |
|
script: |
|
||||||
meson setup build -Dbrotli=enabled \
|
meson setup build ${MESON_ARGS} \
|
||||||
|
-Dbrotli=enabled \
|
||||||
-Dbzip2=enabled \
|
-Dbzip2=enabled \
|
||||||
-Dharfbuzz=disabled \
|
-Dharfbuzz=disabled \
|
||||||
-Dpng=disabled \
|
-Dpng=disabled \
|
||||||
|
@ -205,7 +224,7 @@ macos meson:
|
||||||
- pip3 install -U meson
|
- pip3 install -U meson
|
||||||
- pip3 install --upgrade certifi
|
- pip3 install --upgrade certifi
|
||||||
- pip3 install -U ninja
|
- pip3 install -U ninja
|
||||||
|
|
||||||
- meson setup build
|
- meson setup build ${MESON_ARGS}
|
||||||
- meson compile --verbose -C build
|
- meson compile --verbose -C build
|
||||||
- sudo meson install -C build
|
- sudo meson install -C build
|
||||||
|
|
|
@ -106,10 +106,9 @@
|
||||||
# (this is compatible with the same CMake variables in zlib's CMake
|
# (this is compatible with the same CMake variables in zlib's CMake
|
||||||
# support).
|
# support).
|
||||||
|
|
||||||
# FreeType explicitly marks the API to be exported and relies on the compiler
|
# To minimize the number of cmake_policy() workarounds,
|
||||||
# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
|
# CMake >= 3 is requested.
|
||||||
# starting with 2.8.12.
|
cmake_minimum_required(VERSION 3.0)
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
|
||||||
|
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
|
||||||
# Allow symbol visibility settings also on static libraries. CMake < 3.3
|
# Allow symbol visibility settings also on static libraries. CMake < 3.3
|
||||||
|
@ -162,7 +161,7 @@ endif ()
|
||||||
project(freetype C)
|
project(freetype C)
|
||||||
|
|
||||||
set(VERSION_MAJOR "2")
|
set(VERSION_MAJOR "2")
|
||||||
set(VERSION_MINOR "11")
|
set(VERSION_MINOR "12")
|
||||||
set(VERSION_PATCH "1")
|
set(VERSION_PATCH "1")
|
||||||
|
|
||||||
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
|
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
|
||||||
|
@ -239,12 +238,14 @@ if (BUILD_FRAMEWORK)
|
||||||
message(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
|
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
|
||||||
endif ()
|
endif ()
|
||||||
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
|
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
|
||||||
set(BUILD_SHARED_LIBS ON)
|
set(BUILD_SHARED_LIBS ON)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Find dependencies
|
# Find dependencies
|
||||||
|
include(FindPkgConfig)
|
||||||
|
|
||||||
if (NOT FT_DISABLE_HARFBUZZ)
|
if (NOT FT_DISABLE_HARFBUZZ)
|
||||||
set(HARFBUZZ_MIN_VERSION "2.0.0")
|
set(HARFBUZZ_MIN_VERSION "2.0.0")
|
||||||
if (FT_REQUIRE_HARFBUZZ)
|
if (FT_REQUIRE_HARFBUZZ)
|
||||||
|
@ -271,11 +272,16 @@ if (NOT FT_DISABLE_ZLIB)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT FT_DISABLE_BZIP2)
|
if (NOT FT_DISABLE_BZIP2)
|
||||||
|
# Genuine BZip2 does not provide bzip2.pc, but some platforms have it.
|
||||||
|
# For better dependency in freetype2.pc, bzip2.pc is searched
|
||||||
|
# regardless of the availability of libbz2. If bzip2.pc is found,
|
||||||
|
# Requires.private is used instead of Libs.private.
|
||||||
if (FT_REQUIRE_BZIP2)
|
if (FT_REQUIRE_BZIP2)
|
||||||
find_package(BZip2 REQUIRED)
|
find_package(BZip2 REQUIRED)
|
||||||
else ()
|
else ()
|
||||||
find_package(BZip2)
|
find_package(BZip2)
|
||||||
endif ()
|
endif ()
|
||||||
|
pkg_check_modules(PC_BZIP2 bzip2)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT FT_DISABLE_BROTLI)
|
if (NOT FT_DISABLE_BROTLI)
|
||||||
|
@ -486,42 +492,55 @@ if (BUILD_FRAMEWORK)
|
||||||
)
|
)
|
||||||
set_target_properties(freetype PROPERTIES
|
set_target_properties(freetype PROPERTIES
|
||||||
FRAMEWORK TRUE
|
FRAMEWORK TRUE
|
||||||
MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
|
MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/builds/mac/freetype-Info.plist
|
||||||
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
PUBLIC_HEADER "${PUBLIC_HEADERS}"
|
||||||
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
|
||||||
)
|
)
|
||||||
endif ()
|
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(PKG_CONFIG_REQUIRED_PRIVATE "")
|
set(PKGCONFIG_REQUIRES "")
|
||||||
set(PKG_CONFIG_LIBS_PRIVATE "")
|
set(PKGCONFIG_REQUIRES_PRIVATE "")
|
||||||
|
set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
|
||||||
|
set(PKGCONFIG_LIBS_PRIVATE "")
|
||||||
|
|
||||||
if (ZLIB_FOUND)
|
if (ZLIB_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
|
||||||
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib")
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "zlib")
|
||||||
endif ()
|
endif ()
|
||||||
if (BZIP2_FOUND)
|
if (BZIP2_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
|
||||||
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
|
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
|
||||||
list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
|
if (PC_BZIP2_FOUND)
|
||||||
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "bzip2")
|
||||||
|
else ()
|
||||||
|
list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
if (PNG_FOUND)
|
if (PNG_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
|
||||||
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
|
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
|
||||||
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libpng")
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng")
|
||||||
endif ()
|
endif ()
|
||||||
if (HarfBuzz_FOUND)
|
if (HarfBuzz_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
|
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
|
||||||
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
|
||||||
endif ()
|
endif ()
|
||||||
if (BROTLIDEC_FOUND)
|
if (BROTLIDEC_FOUND)
|
||||||
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
|
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
|
||||||
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
|
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
|
||||||
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
|
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
|
||||||
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libbrotlidec")
|
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
@ -548,7 +567,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||||
# Generate the pkg-config file
|
# Generate the pkg-config file
|
||||||
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
|
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
|
||||||
|
|
||||||
string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
|
string(REPLACE ";" ", " PKGCONFIG_REQUIRES_PRIVATE "${PKGCONFIG_REQUIRES_PRIVATE}")
|
||||||
|
|
||||||
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
|
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
|
@ -560,10 +579,26 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
|
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
||||||
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
|
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
if (BUILD_SHARED_LIBS)
|
||||||
string(REPLACE "%LIBS_PRIVATE%" "${PKG_CONFIG_LIBS_PRIVATE}"
|
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}"
|
||||||
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
|
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 ()
|
||||||
|
|
||||||
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
|
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
|
||||||
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
|
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
|
||||||
|
@ -587,7 +622,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
|
||||||
COMPATIBILITY SameMajorVersion)
|
COMPATIBILITY SameMajorVersion)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS freetype
|
TARGETS freetype freetype-interface
|
||||||
EXPORT freetype-targets
|
EXPORT freetype-targets
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
|
12
README
12
README
|
@ -1,4 +1,4 @@
|
||||||
FreeType 2.11.1
|
FreeType 2.12.1
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Homepage: https://www.freetype.org
|
Homepage: https://www.freetype.org
|
||||||
|
@ -16,7 +16,9 @@ Read the files `docs/INSTALL*` for installation instructions; see the
|
||||||
file `docs/LICENSE.TXT` for the available licenses.
|
file `docs/LICENSE.TXT` for the available licenses.
|
||||||
|
|
||||||
For using FreeType's git repository instead of a distribution bundle,
|
For using FreeType's git repository instead of a distribution bundle,
|
||||||
please read file `README.git`.
|
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).
|
||||||
|
|
||||||
The FreeType 2 API reference is located in directory `docs/reference`;
|
The FreeType 2 API reference is located in directory `docs/reference`;
|
||||||
use the file `index.html` as the top entry point. [Please note that
|
use the file `index.html` as the top entry point. [Please note that
|
||||||
|
@ -30,9 +32,9 @@ sites. Go to
|
||||||
|
|
||||||
and download one of the following files.
|
and download one of the following files.
|
||||||
|
|
||||||
freetype-doc-2.11.1.tar.xz
|
freetype-doc-2.12.1.tar.xz
|
||||||
freetype-doc-2.11.1.tar.gz
|
freetype-doc-2.12.1.tar.gz
|
||||||
ftdoc2111.zip
|
ftdoc2121.zip
|
||||||
|
|
||||||
To view the documentation online, go to
|
To view the documentation online, go to
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ copy_submodule_files ()
|
||||||
cp $DLG_SRC_DIR/* src/dlg
|
cp $DLG_SRC_DIR/* src/dlg
|
||||||
}
|
}
|
||||||
|
|
||||||
if test -d ".git"; then
|
if test -e ".git"; then
|
||||||
DLG_INC_DIR=subprojects/dlg/include/dlg
|
DLG_INC_DIR=subprojects/dlg/include/dlg
|
||||||
DLG_SRC_DIR=subprojects/dlg/src/dlg
|
DLG_SRC_DIR=subprojects/dlg/src/dlg
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
|
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>FreeType</string>
|
<string>freetype</string>
|
||||||
|
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>FreeType ${PROJECT_VERSION}</string>
|
<string>FreeType ${PROJECT_VERSION}</string>
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
|
|
||||||
#define FT_DEPRECATED_ATTRIBUTE
|
#define FT_DEPRECATED_ATTRIBUTE
|
||||||
|
|
||||||
#include FT_MAC_H
|
#include <freetype/ftmac.h>
|
||||||
|
|
||||||
/* undefine blocking-macros in ftmac.h */
|
/* undefine blocking-macros in ftmac.h */
|
||||||
#undef FT_GetFile_From_Mac_Name
|
#undef FT_GetFile_From_Mac_Name
|
||||||
|
|
|
@ -304,13 +304,12 @@ do-dist: distclean refdoc
|
||||||
cp $(CONFIG_GUESS) builds/unix
|
cp $(CONFIG_GUESS) builds/unix
|
||||||
cp $(CONFIG_SUB) builds/unix
|
cp $(CONFIG_SUB) builds/unix
|
||||||
|
|
||||||
@# Generate `ChangeLog' file with commits since previous release.
|
@# Generate `ChangeLog' file with commits since release 2.11.0
|
||||||
|
@# (when we stopped creating this file manually).
|
||||||
$(CHANGELOG_SCRIPT) \
|
$(CHANGELOG_SCRIPT) \
|
||||||
--format='%B%n' \
|
--format='%B%n' \
|
||||||
--no-cluster \
|
--no-cluster \
|
||||||
-- `git describe --tags \
|
-- VER-2-11-0..$(version_tag) \
|
||||||
--abbrev=0 \
|
|
||||||
$(version_tag)^`..$(version_tag) \
|
|
||||||
> ChangeLog
|
> ChangeLog
|
||||||
|
|
||||||
@# Remove intermediate files created by the `refdoc' target.
|
@# Remove intermediate files created by the `refdoc' target.
|
||||||
|
@ -318,6 +317,6 @@ do-dist: distclean refdoc
|
||||||
rm -f docs/mkdocs.yml
|
rm -f docs/mkdocs.yml
|
||||||
|
|
||||||
@# Remove more stuff related to git.
|
@# Remove more stuff related to git.
|
||||||
rm -rf subprojects
|
rm -rf subprojects/dlg
|
||||||
|
|
||||||
# EOF
|
# EOF
|
||||||
|
|
|
@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.h.in])
|
||||||
|
|
||||||
# Don't forget to update `docs/VERSIONS.TXT'!
|
# Don't forget to update `docs/VERSIONS.TXT'!
|
||||||
|
|
||||||
version_info='24:1:18'
|
version_info='24:3:18'
|
||||||
AC_SUBST([version_info])
|
AC_SUBST([version_info])
|
||||||
ft_version=`echo $version_info | tr : .`
|
ft_version=`echo $version_info | tr : .`
|
||||||
AC_SUBST([ft_version])
|
AC_SUBST([ft_version])
|
||||||
|
@ -530,16 +530,28 @@ AC_SEARCH_LIBS([clock_gettime],
|
||||||
[test "$ac_cv_search_clock_gettime" = "none required" \
|
[test "$ac_cv_search_clock_gettime" = "none required" \
|
||||||
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
||||||
|
|
||||||
# 'librsvg' is needed to demonstrate SVG support.
|
|
||||||
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0],
|
|
||||||
[have_librsvg="yes (pkg-config)"], [have_librsvg=no])
|
|
||||||
|
|
||||||
FT_DEMO_CFLAGS=""
|
FT_DEMO_CFLAGS=""
|
||||||
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
|
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
|
||||||
|
|
||||||
if test "$have_librsvg" != no; then
|
# 'librsvg' is needed to demonstrate SVG support.
|
||||||
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
|
AC_ARG_WITH([librsvg],
|
||||||
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
|
[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])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_SUBST([FT_DEMO_CFLAGS])
|
AC_SUBST([FT_DEMO_CFLAGS])
|
||||||
|
@ -985,32 +997,32 @@ fi
|
||||||
|
|
||||||
|
|
||||||
# entries in Requires.private are separated by commas
|
# entries in Requires.private are separated by commas
|
||||||
REQUIRES_PRIVATE="$zlib_reqpriv, \
|
PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
|
||||||
$bzip2_reqpriv, \
|
$bzip2_reqpriv, \
|
||||||
$libpng_reqpriv, \
|
$libpng_reqpriv, \
|
||||||
$harfbuzz_reqpriv, \
|
$harfbuzz_reqpriv, \
|
||||||
$brotli_reqpriv"
|
$brotli_reqpriv"
|
||||||
# beautify
|
# beautify
|
||||||
REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
|
PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
|
||||||
| sed -e 's/^ *//' \
|
| sed -e 's/^ *//' \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/, */,/g' \
|
-e 's/, */,/g' \
|
||||||
-e 's/,,*/,/g' \
|
-e 's/,,*/,/g' \
|
||||||
-e 's/^,*//' \
|
-e 's/^,*//' \
|
||||||
-e 's/,*$//' \
|
-e 's/,*$//' \
|
||||||
-e 's/,/, /g'`
|
-e 's/,/, /g'`
|
||||||
|
|
||||||
LIBS_PRIVATE="$zlib_libspriv \
|
PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
|
||||||
$bzip2_libspriv \
|
$bzip2_libspriv \
|
||||||
$libpng_libspriv \
|
$libpng_libspriv \
|
||||||
$harfbuzz_libspriv \
|
$harfbuzz_libspriv \
|
||||||
$brotli_libspriv \
|
$brotli_libspriv \
|
||||||
$ft2_extra_libs"
|
$ft2_extra_libs"
|
||||||
# beautify
|
# beautify
|
||||||
LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
|
PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
|
||||||
| sed -e 's/^ *//' \
|
| sed -e 's/^ *//' \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/ */ /g'`
|
-e 's/ */ /g'`
|
||||||
|
|
||||||
LIBSSTATIC_CONFIG="-lfreetype \
|
LIBSSTATIC_CONFIG="-lfreetype \
|
||||||
$zlib_libsstaticconf \
|
$zlib_libsstaticconf \
|
||||||
|
@ -1028,10 +1040,28 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
|
||||||
-e 's/ *$//' \
|
-e 's/ *$//' \
|
||||||
-e 's/ */ /g'`
|
-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([ftmac_c])
|
||||||
AC_SUBST([REQUIRES_PRIVATE])
|
AC_SUBST([PKGCONFIG_REQUIRES])
|
||||||
AC_SUBST([LIBS_PRIVATE])
|
AC_SUBST([PKGCONFIG_LIBS])
|
||||||
|
AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
|
||||||
|
AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
|
||||||
AC_SUBST([LIBSSTATIC_CONFIG])
|
AC_SUBST([LIBSSTATIC_CONFIG])
|
||||||
|
|
||||||
AC_SUBST([hardcode_libdir_flag_spec])
|
AC_SUBST([hardcode_libdir_flag_spec])
|
||||||
|
|
|
@ -7,8 +7,8 @@ Name: FreeType 2
|
||||||
URL: https://freetype.org
|
URL: https://freetype.org
|
||||||
Description: A free, high-quality, and portable font engine.
|
Description: A free, high-quality, and portable font engine.
|
||||||
Version: %ft_version%
|
Version: %ft_version%
|
||||||
Requires:
|
Requires: %PKGCONFIG_REQUIRES%
|
||||||
Requires.private: %REQUIRES_PRIVATE%
|
Requires.private: %PKGCONFIG_REQUIRES_PRIVATE%
|
||||||
Libs: -L${libdir} -lfreetype
|
Libs: %PKGCONFIG_LIBS%
|
||||||
Libs.private: %LIBS_PRIVATE%
|
Libs.private: %PKGCONFIG_LIBS_PRIVATE%
|
||||||
Cflags: -I${includedir}/freetype2
|
Cflags: -I${includedir}/freetype2
|
||||||
|
|
|
@ -68,12 +68,14 @@ version_info := @version_info@
|
||||||
|
|
||||||
# Variables needed for `freetype-config' and `freetype.pc'.
|
# Variables needed for `freetype-config' and `freetype.pc'.
|
||||||
#
|
#
|
||||||
PKG_CONFIG := @PKG_CONFIG@
|
PKG_CONFIG := @PKG_CONFIG@
|
||||||
REQUIRES_PRIVATE := @REQUIRES_PRIVATE@
|
PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@
|
||||||
LIBS_PRIVATE := @LIBS_PRIVATE@
|
PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@
|
||||||
LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
|
PKGCONFIG_LIBS := @PKGCONFIG_LIBS@
|
||||||
build_libtool_libs := @build_libtool_libs@
|
PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@
|
||||||
ft_version := @ft_version@
|
LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
|
||||||
|
build_libtool_libs := @build_libtool_libs@
|
||||||
|
ft_version := @ft_version@
|
||||||
|
|
||||||
# The directory where all library files are placed.
|
# The directory where all library files are placed.
|
||||||
#
|
#
|
||||||
|
@ -137,15 +139,17 @@ prefix_x := $(subst $(space),\\$(space),$(prefix))
|
||||||
|
|
||||||
$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
|
$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
|
||||||
rm -f $@ $@.tmp
|
rm -f $@ $@.tmp
|
||||||
sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \
|
sed -e 's|%PKGCONFIG_REQUIRES%|$(PKGCONFIG_REQUIRES)|' \
|
||||||
-e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \
|
-e 's|%PKGCONFIG_REQUIRES_PRIVATE%|$(PKGCONFIG_REQUIRES_PRIVATE)|' \
|
||||||
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
|
-e 's|%PKGCONFIG_LIBS%|$(PKGCONFIG_LIBS)|' \
|
||||||
-e 's|%exec_prefix%|$(exec_prefix_x)|' \
|
-e 's|%PKGCONFIG_LIBS_PRIVATE%|$(PKGCONFIG_LIBS_PRIVATE)|' \
|
||||||
-e 's|%ft_version%|$(ft_version)|' \
|
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
|
||||||
-e 's|%includedir%|$(includedir_x)|' \
|
-e 's|%exec_prefix%|$(exec_prefix_x)|' \
|
||||||
-e 's|%libdir%|$(libdir_x)|' \
|
-e 's|%ft_version%|$(ft_version)|' \
|
||||||
-e 's|%prefix%|$(prefix_x)|' \
|
-e 's|%includedir%|$(includedir_x)|' \
|
||||||
$< \
|
-e 's|%libdir%|$(libdir_x)|' \
|
||||||
|
-e 's|%prefix%|$(prefix_x)|' \
|
||||||
|
$< \
|
||||||
> $@.tmp
|
> $@.tmp
|
||||||
chmod a-w $@.tmp
|
chmod a-w $@.tmp
|
||||||
mv $@.tmp $@
|
mv $@.tmp $@
|
||||||
|
|
|
@ -21,7 +21,7 @@ the following targets:
|
||||||
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -21,7 +21,7 @@ the following targets:
|
||||||
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -196,19 +196,77 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32_WCE
|
/* non-desktop Universal Windows Platform */
|
||||||
|
#if defined( WINAPI_FAMILY ) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
|
||||||
|
|
||||||
|
#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 )
|
||||||
|
|
||||||
FT_LOCAL_DEF( HANDLE )
|
FT_LOCAL_DEF( HANDLE )
|
||||||
CreateFileA( LPCSTR lpFileName,
|
CreateFileA( LPCSTR lpFileName,
|
||||||
DWORD dwDesiredAccess,
|
DWORD dwDesiredAccess,
|
||||||
DWORD dwShareMode,
|
DWORD dwShareMode,
|
||||||
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||||
DWORD dwCreationDisposition,
|
DWORD dwCreationDisposition,
|
||||||
DWORD dwFlagsAndAttributes,
|
DWORD dwFlagsAndAttributes,
|
||||||
HANDLE hTemplateFile )
|
HANDLE hTemplateFile )
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
LPWSTR lpFileNameW;
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined( _WIN32_WCE )
|
||||||
|
|
||||||
|
/* malloc.h provides implementation of alloca()/_alloca() */
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
|
FT_LOCAL_DEF( HANDLE )
|
||||||
|
CreateFileA( LPCSTR lpFileName,
|
||||||
|
DWORD dwDesiredAccess,
|
||||||
|
DWORD dwShareMode,
|
||||||
|
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
|
||||||
|
DWORD dwCreationDisposition,
|
||||||
|
DWORD dwFlagsAndAttributes,
|
||||||
|
HANDLE hTemplateFile )
|
||||||
|
{
|
||||||
|
int len;
|
||||||
|
LPWSTR lpFileNameW;
|
||||||
|
|
||||||
|
|
||||||
/* allocate memory space for converted path name */
|
/* allocate memory space for converted path name */
|
||||||
|
@ -235,12 +293,13 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined( _WIN32_WCE ) || defined ( _WIN32_WINDOWS ) || \
|
#if defined( _WIN32_WCE ) || defined ( _WIN32_WINDOWS ) || \
|
||||||
!defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400
|
!defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400
|
||||||
|
|
||||||
FT_LOCAL_DEF( BOOL )
|
FT_LOCAL_DEF( BOOL )
|
||||||
GetFileSizeEx( HANDLE hFile,
|
GetFileSizeEx( HANDLE hFile,
|
||||||
PLARGE_INTEGER lpFileSize )
|
PLARGE_INTEGER lpFileSize )
|
||||||
{
|
{
|
||||||
lpFileSize->u.LowPart = GetFileSize( hFile,
|
lpFileSize->u.LowPart = GetFileSize( hFile,
|
||||||
(DWORD *)&lpFileSize->u.HighPart );
|
(DWORD *)&lpFileSize->u.HighPart );
|
||||||
|
|
|
@ -485,6 +485,7 @@
|
||||||
<ClCompile Include="..\..\..\src\sfnt\sfnt.c" />
|
<ClCompile Include="..\..\..\src\sfnt\sfnt.c" />
|
||||||
<ClCompile Include="..\..\..\src\smooth\smooth.c" />
|
<ClCompile Include="..\..\..\src\smooth\smooth.c" />
|
||||||
<ClCompile Include="..\..\..\src\sdf\sdf.c" />
|
<ClCompile Include="..\..\..\src\sdf\sdf.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\svg\svg.c" />
|
||||||
<ClCompile Include="..\..\..\src\truetype\truetype.c" />
|
<ClCompile Include="..\..\..\src\truetype\truetype.c" />
|
||||||
<ClCompile Include="..\..\..\src\type1\type1.c" />
|
<ClCompile Include="..\..\..\src\type1\type1.c" />
|
||||||
<ClCompile Include="..\..\..\src\type42\type42.c" />
|
<ClCompile Include="..\..\..\src\type42\type42.c" />
|
||||||
|
|
|
@ -68,6 +68,9 @@
|
||||||
<ClCompile Include="..\..\..\src\smooth\smooth.c">
|
<ClCompile Include="..\..\..\src\smooth\smooth.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\..\src\svg\svg.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\..\src\truetype\truetype.c">
|
<ClCompile Include="..\..\..\src\truetype\truetype.c">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -143,4 +146,4 @@
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<p>This directory contains solution and project files for
|
<p>This directory contains solution and project files for
|
||||||
Visual C++ 2010 or newer, named <tt>freetype.sln</tt>,
|
Visual C++ 2010 or newer, named <tt>freetype.sln</tt>,
|
||||||
and <tt>freetype.vcxproj</tt>. It compiles the following libraries
|
and <tt>freetype.vcxproj</tt>. It compiles the following libraries
|
||||||
from the FreeType 2.11.1 sources:</p>
|
from the FreeType 2.12.1 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
||||||
|
|
|
@ -442,6 +442,10 @@
|
||||||
RelativePath="..\..\..\src\smooth\smooth.c"
|
RelativePath="..\..\..\src\smooth\smooth.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\src\svg\svg.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<Filter
|
<Filter
|
||||||
Name="FT_MODULES"
|
Name="FT_MODULES"
|
||||||
>
|
>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<p>This directory contains project files <tt>freetype.dsp</tt> for
|
<p>This directory contains project files <tt>freetype.dsp</tt> for
|
||||||
Visual C++ 6.0, and <tt>freetype.vcproj</tt> for Visual C++ 2002
|
Visual C++ 6.0, and <tt>freetype.vcproj</tt> for Visual C++ 2002
|
||||||
through 2008, which you might need to upgrade automatically.
|
through 2008, which you might need to upgrade automatically.
|
||||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
||||||
|
|
|
@ -21,7 +21,7 @@ the following targets:
|
||||||
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
<li>PPC/SP WM6 (Windows Mobile 6)</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
It compiles the following libraries from the FreeType 2.11.1 sources:</p>
|
It compiles the following libraries from the FreeType 2.12.1 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<pre>
|
<pre>
|
||||||
|
|
82
docs/CHANGES
82
docs/CHANGES
|
@ -1,3 +1,49 @@
|
||||||
|
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
|
CHANGES BETWEEN 2.11.1 and 2.12.0
|
||||||
|
|
||||||
I. IMPORTANT CHANGES
|
I. IMPORTANT CHANGES
|
||||||
|
@ -10,7 +56,41 @@ CHANGES BETWEEN 2.11.1 and 2.12.0
|
||||||
programs have been set up to use 'librsvg' as the rendering
|
programs have been set up to use 'librsvg' as the rendering
|
||||||
library.
|
library.
|
||||||
|
|
||||||
This work was Moazin Kathri's GSoC 2019 project.
|
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.
|
||||||
|
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
|
@ -60,6 +60,8 @@ found on _most_ systems, but not all of them:
|
||||||
|
|
||||||
release libtool so
|
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.1 24.1.18 6.18.1
|
||||||
2.11.0 24.0.18 6.18.0
|
2.11.0 24.0.18 6.18.0
|
||||||
2.10.4 23.4.17 6.17.4
|
2.10.4 23.4.17 6.17.4
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH FREETYPE-CONFIG 1 "December 2021" "FreeType 2.11.1"
|
.TH FREETYPE-CONFIG 1 "May 2022" "FreeType 2.12.1"
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 5.3 KiB |
|
@ -2411,9 +2411,9 @@
|
||||||
units per em (e.g. Inter). This patch fixes it.
|
units per em (e.g. Inter). This patch fixes it.
|
||||||
|
|
||||||
The return value of af_loader_compute_darkening was also changed to
|
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
|
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]
|
* src/autofit/afloader.[ch]
|
||||||
(af_loader_compute_darkening): Return FT_Fixed.
|
(af_loader_compute_darkening): Return FT_Fixed.
|
||||||
|
|
|
@ -707,7 +707,7 @@
|
||||||
[base] Fix integer overflow.
|
[base] Fix integer overflow.
|
||||||
|
|
||||||
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
|
* 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>
|
2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -77,13 +77,14 @@ How to prepare a new release
|
||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
VERSION=2.10.4
|
VERSION=2.12.0
|
||||||
SAVANNAH_USER=wl
|
SAVANNAH_USER=wl
|
||||||
SOURCEFORGE_USER=wlemb
|
SOURCEFORGE_USER=wlemb
|
||||||
|
GPG_KEY_ID=BE6C3AAC63AD8E3F
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
GPG='/usr/bin/gpg --batch --no-tty'
|
GPG="/usr/bin/gpg --batch --no-tty --local-user $GPG_KEY_ID"
|
||||||
|
|
||||||
version=`echo $VERSION | sed "s/\\.//g"`
|
version=`echo $VERSION | sed "s/\\.//g"`
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,8 @@ FT_BEGIN_HEADER
|
||||||
* FT_FACE_FLAG_EXTERNAL_STREAM
|
* FT_FACE_FLAG_EXTERNAL_STREAM
|
||||||
* FT_FACE_FLAG_HINTER
|
* FT_FACE_FLAG_HINTER
|
||||||
* FT_FACE_FLAG_SVG
|
* FT_FACE_FLAG_SVG
|
||||||
|
* FT_FACE_FLAG_SBIX
|
||||||
|
* FT_FACE_FLAG_SBIX_OVERLAY
|
||||||
*
|
*
|
||||||
* FT_HAS_HORIZONTAL
|
* FT_HAS_HORIZONTAL
|
||||||
* FT_HAS_VERTICAL
|
* FT_HAS_VERTICAL
|
||||||
|
@ -163,6 +165,8 @@ FT_BEGIN_HEADER
|
||||||
* FT_HAS_COLOR
|
* FT_HAS_COLOR
|
||||||
* FT_HAS_MULTIPLE_MASTERS
|
* FT_HAS_MULTIPLE_MASTERS
|
||||||
* FT_HAS_SVG
|
* FT_HAS_SVG
|
||||||
|
* FT_HAS_SBIX
|
||||||
|
* FT_HAS_SBIX_OVERLAY
|
||||||
*
|
*
|
||||||
* FT_IS_SFNT
|
* FT_IS_SFNT
|
||||||
* FT_IS_SCALABLE
|
* FT_IS_SCALABLE
|
||||||
|
@ -227,6 +231,7 @@ FT_BEGIN_HEADER
|
||||||
* FT_LOAD_NO_SCALE
|
* FT_LOAD_NO_SCALE
|
||||||
* FT_LOAD_NO_HINTING
|
* FT_LOAD_NO_HINTING
|
||||||
* FT_LOAD_NO_BITMAP
|
* FT_LOAD_NO_BITMAP
|
||||||
|
* FT_LOAD_SBITS_ONLY
|
||||||
* FT_LOAD_NO_AUTOHINT
|
* FT_LOAD_NO_AUTOHINT
|
||||||
* FT_LOAD_COLOR
|
* FT_LOAD_COLOR
|
||||||
*
|
*
|
||||||
|
@ -1235,6 +1240,16 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* FT_FACE_FLAG_SVG ::
|
* FT_FACE_FLAG_SVG ::
|
||||||
* [Since 2.12] The face has an 'SVG~' OpenType table.
|
* [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_SCALABLE ( 1L << 0 )
|
||||||
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
|
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
|
||||||
|
@ -1253,6 +1268,8 @@ FT_BEGIN_HEADER
|
||||||
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
|
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
|
||||||
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
|
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
|
||||||
#define FT_FACE_FLAG_SVG ( 1L << 16 )
|
#define FT_FACE_FLAG_SVG ( 1L << 16 )
|
||||||
|
#define FT_FACE_FLAG_SBIX ( 1L << 17 )
|
||||||
|
#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -1509,6 +1526,108 @@ FT_BEGIN_HEADER
|
||||||
( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) )
|
( !!( (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:
|
* @enum:
|
||||||
|
@ -1773,13 +1892,13 @@ FT_BEGIN_HEADER
|
||||||
* The advance width of the unhinted glyph. Its value is expressed in
|
* The advance width of the unhinted glyph. Its value is expressed in
|
||||||
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
|
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
|
||||||
* loading the glyph. This field can be important to perform correct
|
* loading the glyph. This field can be important to perform correct
|
||||||
* WYSIWYG layout. Only relevant for outline glyphs.
|
* WYSIWYG layout. Only relevant for scalable glyphs.
|
||||||
*
|
*
|
||||||
* linearVertAdvance ::
|
* linearVertAdvance ::
|
||||||
* The advance height of the unhinted glyph. Its value is expressed in
|
* The advance height of the unhinted glyph. Its value is expressed in
|
||||||
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
|
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
|
||||||
* loading the glyph. This field can be important to perform correct
|
* loading the glyph. This field can be important to perform correct
|
||||||
* WYSIWYG layout. Only relevant for outline glyphs.
|
* WYSIWYG layout. Only relevant for scalable glyphs.
|
||||||
*
|
*
|
||||||
* advance ::
|
* advance ::
|
||||||
* This shorthand is, depending on @FT_LOAD_IGNORE_TRANSFORM, the
|
* This shorthand is, depending on @FT_LOAD_IGNORE_TRANSFORM, the
|
||||||
|
@ -2976,6 +3095,15 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @FT_LOAD_NO_SCALE always sets this flag.
|
* @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 ::
|
* FT_LOAD_VERTICAL_LAYOUT ::
|
||||||
* Load the glyph for vertical text layout. In particular, the
|
* Load the glyph for vertical text layout. In particular, the
|
||||||
* `advance` value in the @FT_GlyphSlotRec structure is set to the
|
* `advance` value in the @FT_GlyphSlotRec structure is set to the
|
||||||
|
@ -3054,11 +3182,12 @@ FT_BEGIN_HEADER
|
||||||
* the OpenType specification), make @FT_Render_Glyph provide a default
|
* the OpenType specification), make @FT_Render_Glyph provide a default
|
||||||
* blending of the color glyph layers associated with the glyph index,
|
* blending of the color glyph layers associated with the glyph index,
|
||||||
* using the same bitmap format as embedded color bitmap images. This
|
* using the same bitmap format as embedded color bitmap images. This
|
||||||
* is mainly for convenience and works for 'COLR' v0 tables only. For
|
* is mainly for convenience and works only for glyphs in 'COLR' v0
|
||||||
* full control of color layers use @FT_Get_Color_Glyph_Layer and
|
* tables (or glyphs in 'COLR' v1 tables that exclusively use v0
|
||||||
* FreeType's color functions like @FT_Palette_Select instead of
|
* features). For full control of color layers use
|
||||||
* setting @FT_LOAD_COLOR for rendering so that the client application
|
* @FT_Get_Color_Glyph_Layer and FreeType's color functions like
|
||||||
* can handle blending by itself.
|
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
|
||||||
|
* so that the client application can handle blending by itself.
|
||||||
*
|
*
|
||||||
* FT_LOAD_COMPUTE_METRICS ::
|
* FT_LOAD_COMPUTE_METRICS ::
|
||||||
* [Since 2.6.1] Compute glyph metrics from the glyph data, without the
|
* [Since 2.6.1] Compute glyph metrics from the glyph data, without the
|
||||||
|
@ -3119,6 +3248,7 @@ FT_BEGIN_HEADER
|
||||||
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
|
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
|
||||||
#define FT_LOAD_MONOCHROME ( 1L << 12 )
|
#define FT_LOAD_MONOCHROME ( 1L << 12 )
|
||||||
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
|
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
|
||||||
|
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
|
||||||
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
|
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
|
||||||
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
|
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
|
||||||
#define FT_LOAD_COLOR ( 1L << 20 )
|
#define FT_LOAD_COLOR ( 1L << 20 )
|
||||||
|
@ -3129,7 +3259,6 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
/* used internally only by certain font drivers */
|
/* used internally only by certain font drivers */
|
||||||
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
|
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
|
||||||
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
|
|
||||||
#define FT_LOAD_SVG_ONLY ( 1L << 23 )
|
#define FT_LOAD_SVG_ONLY ( 1L << 23 )
|
||||||
|
|
||||||
|
|
||||||
|
@ -3408,6 +3537,44 @@ FT_BEGIN_HEADER
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* FreeType has two rasterizers for generating SDF, namely:
|
||||||
|
*
|
||||||
|
* 1. `sdf` for generating SDF directly from glyph's outline, and
|
||||||
|
*
|
||||||
|
* 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`.
|
||||||
|
*
|
||||||
|
* There are some issues with stability and possible failures of 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.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* 3. Generating SDF for really small glyphs may result in undesirable
|
||||||
|
* output; the pixel grid (which stores distance information) becomes
|
||||||
|
* too coarse.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* Points (1) and (2) can be avoided by using the `bsdf` rasterizer,
|
||||||
|
* which is more stable than the `sdf` rasterizer in general.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
typedef enum FT_Render_Mode_
|
typedef enum FT_Render_Mode_
|
||||||
{
|
{
|
||||||
|
@ -4774,7 +4941,7 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define FREETYPE_MAJOR 2
|
#define FREETYPE_MAJOR 2
|
||||||
#define FREETYPE_MINOR 11
|
#define FREETYPE_MINOR 12
|
||||||
#define FREETYPE_PATCH 1
|
#define FREETYPE_PATCH 1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -521,21 +521,26 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* This iterator object is needed for @FT_Get_Colorline_Stops. It keeps
|
* This iterator object is needed for @FT_Get_Colorline_Stops. It keeps
|
||||||
* state while iterating over the stops of an @FT_ColorLine,
|
* state while iterating over the stops of an @FT_ColorLine, representing
|
||||||
* representing the `ColorLine` struct of the v1 extensions to 'COLR',
|
* the `ColorLine` struct of the v1 extensions to 'COLR', see
|
||||||
* see 'https://github.com/googlefonts/colr-gradients-spec'.
|
* 'https://github.com/googlefonts/colr-gradients-spec'. Do not manually
|
||||||
|
* modify fields of this iterator.
|
||||||
*
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
* num_color_stops ::
|
* num_color_stops ::
|
||||||
* The number of color stops for the requested glyph index. Set by
|
* The number of color stops for the requested glyph index. Set by
|
||||||
* @FT_Get_Colorline_Stops.
|
* @FT_Get_Paint.
|
||||||
*
|
*
|
||||||
* current_color_stop ::
|
* current_color_stop ::
|
||||||
* The current color stop. Set by @FT_Get_Colorline_Stops.
|
* The current color stop. Set by @FT_Get_Colorline_Stops.
|
||||||
*
|
*
|
||||||
* p ::
|
* p ::
|
||||||
* An opaque pointer into 'COLR' table data. The caller must set this
|
* An opaque pointer into 'COLR' table data. Set by @FT_Get_Paint.
|
||||||
* to `NULL` before the first call of @FT_Get_Colorline_Stops.
|
* 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.
|
||||||
*
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.11 -- **currently experimental only!** There might be changes
|
* 2.11 -- **currently experimental only!** There might be changes
|
||||||
|
@ -549,6 +554,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
|
|
||||||
|
FT_Bool read_variable;
|
||||||
|
|
||||||
} FT_ColorStopIterator;
|
} FT_ColorStopIterator;
|
||||||
|
|
||||||
|
|
||||||
|
@ -592,7 +599,8 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
* stop_offset ::
|
* stop_offset ::
|
||||||
* The stop offset between 0 and 1 along the gradient.
|
* The stop offset along the gradient, expressed as a 16.16 fixed-point
|
||||||
|
* coordinate.
|
||||||
*
|
*
|
||||||
* color ::
|
* color ::
|
||||||
* The color information for this stop, see @FT_ColorIndex.
|
* The color information for this stop, see @FT_ColorIndex.
|
||||||
|
@ -604,7 +612,7 @@ FT_BEGIN_HEADER
|
||||||
*/
|
*/
|
||||||
typedef struct FT_ColorStop_
|
typedef struct FT_ColorStop_
|
||||||
{
|
{
|
||||||
FT_F2Dot14 stop_offset;
|
FT_Fixed stop_offset;
|
||||||
FT_ColorIndex color;
|
FT_ColorIndex color;
|
||||||
|
|
||||||
} FT_ColorStop;
|
} FT_ColorStop;
|
||||||
|
|
|
@ -214,9 +214,9 @@ FT_BEGIN_HEADER
|
||||||
* itself, it is possible to control its behaviour with @FT_Property_Set
|
* itself, it is possible to control its behaviour with @FT_Property_Set
|
||||||
* and @FT_Property_Get.
|
* and @FT_Property_Get.
|
||||||
*
|
*
|
||||||
* The TrueType driver's module name is 'truetype'; a single property
|
* The TrueType driver's module name is 'truetype'; two properties are
|
||||||
* @interpreter-version is available, as documented in the @properties
|
* available, @interpreter-version and @TEMPORARY-enable-variable-colrv1, as
|
||||||
* section.
|
* documented in the @properties section.
|
||||||
*
|
*
|
||||||
* To help understand the differences between interpreter versions, we
|
* To help understand the differences between interpreter versions, we
|
||||||
* introduce a list of definitions, kindly provided by Greg Hitchcock.
|
* introduce a list of definitions, kindly provided by Greg Hitchcock.
|
||||||
|
@ -820,6 +820,48 @@ FT_BEGIN_HEADER
|
||||||
* 2.5
|
* 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
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
|
|
|
@ -584,9 +584,9 @@ FT_BEGIN_HEADER
|
||||||
* The glyph image is translated with the `origin` vector before
|
* The glyph image is translated with the `origin` vector before
|
||||||
* rendering.
|
* rendering.
|
||||||
*
|
*
|
||||||
* The first parameter is a pointer to an @FT_Glyph handle, that will be
|
* The first parameter is a pointer to an @FT_Glyph handle that will be
|
||||||
* _replaced_ by this function (with newly allocated data). Typically,
|
* _replaced_ by this function (with newly allocated data). Typically,
|
||||||
* you would use (omitting error handling):
|
* you would do something like the following (omitting error handling).
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* FT_Glyph glyph;
|
* FT_Glyph glyph;
|
||||||
|
@ -603,7 +603,7 @@ FT_BEGIN_HEADER
|
||||||
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
|
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
|
||||||
* {
|
* {
|
||||||
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
|
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
|
||||||
* 0, 1 );
|
* 0, 1 );
|
||||||
* if ( error ) // `glyph' unchanged
|
* if ( error ) // `glyph' unchanged
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
|
@ -618,7 +618,7 @@ FT_BEGIN_HEADER
|
||||||
* FT_Done_Glyph( glyph );
|
* FT_Done_Glyph( glyph );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Here is another example, again without error handling:
|
* Here is another example, again without error handling.
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* FT_Glyph glyphs[MAX_GLYPHS]
|
* FT_Glyph glyphs[MAX_GLYPHS]
|
||||||
|
|
|
@ -401,11 +401,11 @@ FT_BEGIN_HEADER
|
||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* FT_OUTLINE_OVERLAP ::
|
* FT_OUTLINE_OVERLAP ::
|
||||||
* This flag indicates that this outline contains overlapping contrours
|
* [Since 2.10.3] This flag indicates that this outline contains
|
||||||
* and the anti-aliased renderer should perform oversampling to
|
* overlapping contours and the anti-aliased renderer should perform
|
||||||
* mitigate possible artifacts. This flag should _not_ be set for
|
* oversampling to mitigate possible artifacts. This flag should _not_
|
||||||
* well designed glyphs without overlaps because it quadruples the
|
* be set for well designed glyphs without overlaps because it quadruples
|
||||||
* rendering time.
|
* the rendering time.
|
||||||
*
|
*
|
||||||
* FT_OUTLINE_HIGH_PRECISION ::
|
* FT_OUTLINE_HIGH_PRECISION ::
|
||||||
* This flag indicates that the scan-line converter should try to
|
* This flag indicates that the scan-line converter should try to
|
||||||
|
|
|
@ -47,6 +47,9 @@ FT_BEGIN_HEADER
|
||||||
* MM fonts, others will work with all three types. They are similar
|
* MM fonts, others will work with all three types. They are similar
|
||||||
* enough that a consistent interface makes sense.
|
* enough that a consistent interface makes sense.
|
||||||
*
|
*
|
||||||
|
* For Adobe MM fonts, macro @FT_IS_SFNT returns false. For GX and
|
||||||
|
* OpenType variation fonts, it returns true.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -395,6 +398,10 @@ FT_BEGIN_HEADER
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @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
|
* [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`.
|
* function with `num_coords` set to zero and `coords` set to `NULL`.
|
||||||
* [Since 2.9] 'Default values' means the currently selected named
|
* [Since 2.9] 'Default values' means the currently selected named
|
||||||
|
@ -437,6 +444,11 @@ FT_BEGIN_HEADER
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* 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:
|
* @since:
|
||||||
* 2.7.1
|
* 2.7.1
|
||||||
*/
|
*/
|
||||||
|
@ -468,9 +480,9 @@ FT_BEGIN_HEADER
|
||||||
* the number of axes, use default values for the remaining axes.
|
* the number of axes, use default values for the remaining axes.
|
||||||
*
|
*
|
||||||
* coords ::
|
* coords ::
|
||||||
* The design coordinates array (each element must be between 0 and 1.0
|
* The design coordinates array. Each element is a 16.16 fractional
|
||||||
* for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and
|
* value and must be between 0 and 1.0 for Adobe MM fonts, and between
|
||||||
* OpenType variation fonts).
|
* -1.0 and 1.0 for TrueType GX and OpenType variation fonts.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
|
@ -515,7 +527,7 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* coords ::
|
* coords ::
|
||||||
* The normalized blend coordinates array.
|
* The normalized blend coordinates array (as 16.16 fractional values).
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
|
|
|
@ -109,11 +109,13 @@ FT_BEGIN_HEADER
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* A contour that contains a single point only is represented by a 'move
|
* Degenerate contours, segments, and Bezier arcs may be reported. In
|
||||||
* to' operation followed by 'line to' to the same point. In most cases,
|
* most cases, it is best to filter these out before using the outline
|
||||||
* it is best to filter this out before using the outline for stroking
|
* for stroking or other path modification purposes (which may cause
|
||||||
* purposes (otherwise it would result in a visible dot when round caps
|
* degenerate segments to become non-degenrate and visible, like when
|
||||||
* are used).
|
* stroke caps are used or the path is otherwise outset). Some glyph
|
||||||
|
* outlines may contain deliberate degenerate single points for mark
|
||||||
|
* attachement.
|
||||||
*
|
*
|
||||||
* Similarly, the function returns success for an empty outline also
|
* Similarly, the function returns success for an empty outline also
|
||||||
* (doing nothing, this is, not calling any emitter); if necessary, you
|
* (doing nothing, this is, not calling any emitter); if necessary, you
|
||||||
|
|
|
@ -112,6 +112,21 @@ FT_BEGIN_HEADER
|
||||||
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
|
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:
|
* @enum:
|
||||||
|
|
|
@ -293,7 +293,7 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* miter_limit ::
|
* miter_limit ::
|
||||||
* The maximum reciprocal sine of half-angle at the miter join,
|
* 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:
|
* @note:
|
||||||
* The `radius` is expressed in the same units as the outline
|
* The `radius` is expressed in the same units as the outline
|
||||||
|
|
|
@ -229,7 +229,8 @@ FT_BEGIN_HEADER
|
||||||
* A handle to the source stream.
|
* A handle to the source stream.
|
||||||
*
|
*
|
||||||
* offset ::
|
* offset ::
|
||||||
* The offset of read in stream (always from start).
|
* The offset from the start of the stream to seek to if this is a seek
|
||||||
|
* operation (see note).
|
||||||
*
|
*
|
||||||
* buffer ::
|
* buffer ::
|
||||||
* The address of the read buffer.
|
* The address of the read buffer.
|
||||||
|
@ -241,8 +242,13 @@ FT_BEGIN_HEADER
|
||||||
* The number of bytes effectively read by the stream.
|
* The number of bytes effectively read by the stream.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* This function might be called to perform a seek or skip operation with
|
* This function performs a seek *or* a read operation depending on the
|
||||||
* a `count` of~0. A non-zero return value then indicates an error.
|
* 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.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef unsigned long
|
typedef unsigned long
|
||||||
|
|
|
@ -315,7 +315,7 @@ FT_BEGIN_HEADER
|
||||||
/* The normal stack then points to these values instead of the DICT */
|
/* The normal stack then points to these values instead of the DICT */
|
||||||
/* because all other operators in Private DICT clear the stack. */
|
/* because all other operators in Private DICT clear the stack. */
|
||||||
/* `blend_stack' could be cleared at each operator other than blend. */
|
/* `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_stack; /* base of stack allocation */
|
||||||
FT_Byte* blend_top; /* first empty slot */
|
FT_Byte* blend_top; /* first empty slot */
|
||||||
|
|
|
@ -278,6 +278,40 @@ FT_BEGIN_HEADER
|
||||||
FT_Long c );
|
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
|
* 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
|
* idea is that both `a' and `b' are scaled by factors of 10 so that the
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* 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 ) \
|
#define FT_NEXT_BYTE( buffer ) \
|
||||||
( (unsigned char)*buffer++ )
|
( (unsigned char)*buffer++ )
|
||||||
|
|
||||||
#define FT_NEXT_SHORT( buffer ) \
|
#define FT_NEXT_SHORT( buffer ) \
|
||||||
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_USHORT( buffer ) \
|
#define FT_NEXT_USHORT( buffer ) \
|
||||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_OFF3( buffer ) \
|
#define FT_NEXT_OFF3( buffer ) \
|
||||||
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_UOFF3( buffer ) \
|
#define FT_NEXT_UOFF3( buffer ) \
|
||||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_LONG( buffer ) \
|
#define FT_NEXT_LONG( buffer ) \
|
||||||
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_LONG( buffer - 4 ) )
|
||||||
|
|
||||||
#define FT_NEXT_ULONG( buffer ) \
|
#define FT_NEXT_ULONG( buffer ) \
|
||||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) )
|
||||||
|
|
||||||
|
|
||||||
#define FT_NEXT_SHORT_LE( buffer ) \
|
#define FT_NEXT_SHORT_LE( buffer ) \
|
||||||
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_USHORT_LE( buffer ) \
|
#define FT_NEXT_USHORT_LE( buffer ) \
|
||||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_OFF3_LE( buffer ) \
|
#define FT_NEXT_OFF3_LE( buffer ) \
|
||||||
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_UOFF3_LE( buffer ) \
|
#define FT_NEXT_UOFF3_LE( buffer ) \
|
||||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_LONG_LE( buffer ) \
|
#define FT_NEXT_LONG_LE( buffer ) \
|
||||||
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) )
|
||||||
|
|
||||||
#define FT_NEXT_ULONG_LE( buffer ) \
|
#define FT_NEXT_ULONG_LE( buffer ) \
|
||||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
|
( 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_CHAR() FT_GET_MACRO( FT_Stream_GetByte, FT_Char )
|
||||||
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetByte, FT_Byte )
|
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetByte, FT_Byte )
|
||||||
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
|
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Int16 )
|
||||||
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
|
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UInt16 )
|
||||||
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
|
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_UInt32 )
|
||||||
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
|
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Int32 )
|
||||||
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
|
||||||
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
|
||||||
|
|
||||||
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
|
#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_UShort )
|
#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_Long )
|
#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_ULong )
|
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_UInt32 )
|
||||||
#endif
|
#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_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_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Char, var )
|
||||||
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, 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_UShort, 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_ULong, 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_Long, 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_ULong, var )
|
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_UInt32, var )
|
||||||
|
|
||||||
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, 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_UShort, 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_Long, 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_ULong, var )
|
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_UInt32, var )
|
||||||
|
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||||
|
@ -459,23 +459,23 @@ FT_BEGIN_HEADER
|
||||||
FT_Stream_GetByte( FT_Stream stream );
|
FT_Stream_GetByte( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_GetUShort( FT_Stream stream );
|
FT_Stream_GetUShort( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_GetUOffset( FT_Stream stream );
|
FT_Stream_GetUOffset( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_GetULong( FT_Stream stream );
|
FT_Stream_GetULong( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_GetUShortLE( FT_Stream stream );
|
FT_Stream_GetUShortLE( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_GetULongLE( FT_Stream stream );
|
FT_Stream_GetULongLE( FT_Stream stream );
|
||||||
|
|
||||||
|
|
||||||
|
@ -485,7 +485,7 @@ FT_BEGIN_HEADER
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 16-bit big-endian unsigned integer from a stream */
|
/* read a 16-bit big-endian unsigned integer from a stream */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_ReadUShort( FT_Stream stream,
|
FT_Stream_ReadUShort( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
|
@ -495,17 +495,17 @@ FT_BEGIN_HEADER
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 32-bit big-endian integer from a stream */
|
/* read a 32-bit big-endian integer from a stream */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_ReadULong( FT_Stream stream,
|
FT_Stream_ReadULong( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 16-bit little-endian unsigned integer from a stream */
|
/* read a 16-bit little-endian unsigned integer from a stream */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_ReadUShortLE( FT_Stream stream,
|
FT_Stream_ReadUShortLE( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 32-bit little-endian unsigned integer from a stream */
|
/* read a 32-bit little-endian unsigned integer from a stream */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_ReadULongLE( FT_Stream stream,
|
FT_Stream_ReadULongLE( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* The FreeType Multiple Masters and GX var services (specification).
|
* The FreeType Multiple Masters and GX var services (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2022 by
|
* Copyright (C) 2003-2022 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
* modified, and distributed under the terms of the FreeType project
|
* modified, and distributed under the terms of the FreeType project
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
#define SVMM_H_
|
#define SVMM_H_
|
||||||
|
|
||||||
#include <freetype/internal/ftserv.h>
|
#include <freetype/internal/ftserv.h>
|
||||||
|
#include <freetype/internal/ftmmtypes.h>
|
||||||
|
|
||||||
|
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
@ -96,53 +97,94 @@ FT_BEGIN_HEADER
|
||||||
FT_UInt* len,
|
FT_UInt* len,
|
||||||
FT_Fixed* weight_vector );
|
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_DEFINE_SERVICE( MultiMasters )
|
||||||
{
|
{
|
||||||
FT_Get_MM_Func get_mm;
|
FT_Get_MM_Func get_mm;
|
||||||
FT_Set_MM_Design_Func set_mm_design;
|
FT_Set_MM_Design_Func set_mm_design;
|
||||||
FT_Set_MM_Blend_Func set_mm_blend;
|
FT_Set_MM_Blend_Func set_mm_blend;
|
||||||
FT_Get_MM_Blend_Func get_mm_blend;
|
FT_Get_MM_Blend_Func get_mm_blend;
|
||||||
FT_Get_MM_Var_Func get_mm_var;
|
FT_Get_MM_Var_Func get_mm_var;
|
||||||
FT_Set_Var_Design_Func set_var_design;
|
FT_Set_Var_Design_Func set_var_design;
|
||||||
FT_Get_Var_Design_Func get_var_design;
|
FT_Get_Var_Design_Func get_var_design;
|
||||||
FT_Set_Instance_Func set_instance;
|
FT_Set_Instance_Func set_instance;
|
||||||
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
||||||
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
||||||
|
|
||||||
/* for internal use; only needed for code sharing between modules */
|
/* for internal use; only needed for code sharing between modules */
|
||||||
FT_Get_Var_Blend_Func get_var_blend;
|
FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
|
||||||
FT_Done_Blend_Func done_blend;
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
||||||
get_mm_, \
|
get_mm_, \
|
||||||
set_mm_design_, \
|
set_mm_design_, \
|
||||||
set_mm_blend_, \
|
set_mm_blend_, \
|
||||||
get_mm_blend_, \
|
get_mm_blend_, \
|
||||||
get_mm_var_, \
|
get_mm_var_, \
|
||||||
set_var_design_, \
|
set_var_design_, \
|
||||||
get_var_design_, \
|
get_var_design_, \
|
||||||
set_instance_, \
|
set_instance_, \
|
||||||
set_weightvector_, \
|
set_weightvector_, \
|
||||||
get_weightvector_, \
|
get_weightvector_, \
|
||||||
get_var_blend_, \
|
load_delta_set_idx_map_, \
|
||||||
done_blend_ ) \
|
load_item_var_store_, \
|
||||||
static const FT_Service_MultiMastersRec class_ = \
|
get_item_delta_, \
|
||||||
{ \
|
done_item_var_store_, \
|
||||||
get_mm_, \
|
done_delta_set_idx_map_, \
|
||||||
set_mm_design_, \
|
get_var_blend_, \
|
||||||
set_mm_blend_, \
|
done_blend_ ) \
|
||||||
get_mm_blend_, \
|
static const FT_Service_MultiMastersRec class_ = \
|
||||||
get_mm_var_, \
|
{ \
|
||||||
set_var_design_, \
|
get_mm_, \
|
||||||
get_var_design_, \
|
set_mm_design_, \
|
||||||
set_instance_, \
|
set_mm_blend_, \
|
||||||
set_weightvector_, \
|
get_mm_blend_, \
|
||||||
get_weightvector_, \
|
get_mm_var_, \
|
||||||
get_var_blend_, \
|
set_var_design_, \
|
||||||
done_blend_ \
|
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_ \
|
||||||
};
|
};
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
|
@ -453,22 +453,22 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Has_PS_Glyph_Names
|
* FT_Has_PS_Glyph_Names
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Return true if a given face provides reliable PostScript glyph names.
|
* Return true if a given face provides reliable PostScript glyph names.
|
||||||
* This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
|
* This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
|
||||||
* certain fonts (mostly TrueType) contain incorrect glyph name tables.
|
* certain fonts (mostly TrueType) contain incorrect glyph name tables.
|
||||||
*
|
*
|
||||||
* When this function returns true, the caller is sure that the glyph
|
* When this function returns true, the caller is sure that the glyph
|
||||||
* names returned by @FT_Get_Glyph_Name are reliable.
|
* names returned by @FT_Get_Glyph_Name are reliable.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* face handle
|
* face handle
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* Boolean. True if glyph names are reliable.
|
* Boolean. True if glyph names are reliable.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Int )
|
FT_EXPORT( FT_Int )
|
||||||
|
@ -478,30 +478,40 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Get_PS_Font_Info
|
* FT_Get_PS_Font_Info
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Retrieve the @PS_FontInfoRec structure corresponding to a given
|
* Retrieve the @PS_FontInfoRec structure corresponding to a given
|
||||||
* PostScript font.
|
* PostScript font.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* PostScript face handle.
|
* PostScript face handle.
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* afont_info ::
|
* afont_info ::
|
||||||
* Output font info structure pointer.
|
* A pointer to a @PS_FontInfoRec object.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* String pointers within the @PS_FontInfoRec structure are owned by the
|
* String pointers within the @PS_FontInfoRec structure are owned by the
|
||||||
* face and don't need to be freed by the caller. Missing entries in
|
* face and don't need to be freed by the caller. Missing entries in the
|
||||||
* the font's FontInfo dictionary are represented by `NULL` pointers.
|
* font's FontInfo dictionary are represented by `NULL` pointers.
|
||||||
*
|
*
|
||||||
* If the font's format is not PostScript-based, this function will
|
* The following font formats support this feature: 'Type~1', 'Type~42',
|
||||||
* return the `FT_Err_Invalid_Argument` error code.
|
* 'CFF', 'CID~Type~1'. For other font formats this function returns the
|
||||||
|
* `FT_Err_Invalid_Argument` error code.
|
||||||
|
*
|
||||||
|
* @example:
|
||||||
|
* ```
|
||||||
|
* PS_FontInfoRec font_info;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* error = FT_Get_PS_Font_Info( face, &font_info );
|
||||||
|
* ...
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
|
@ -512,29 +522,39 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Get_PS_Font_Private
|
* FT_Get_PS_Font_Private
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Retrieve the @PS_PrivateRec structure corresponding to a given
|
* Retrieve the @PS_PrivateRec structure corresponding to a given
|
||||||
* PostScript font.
|
* PostScript font.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* PostScript face handle.
|
* PostScript face handle.
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* afont_private ::
|
* afont_private ::
|
||||||
* Output private dictionary structure pointer.
|
* A pointer to a @PS_PrivateRec object.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The string pointers within the @PS_PrivateRec structure are owned by
|
* The string pointers within the @PS_PrivateRec structure are owned by
|
||||||
* the face and don't need to be freed by the caller.
|
* the face and don't need to be freed by the caller.
|
||||||
*
|
*
|
||||||
* If the font's format is not PostScript-based, this function returns
|
* Only the 'Type~1' font format supports this feature. For other font
|
||||||
* the `FT_Err_Invalid_Argument` error code.
|
* formats this function returns the `FT_Err_Invalid_Argument` error
|
||||||
|
* code.
|
||||||
|
*
|
||||||
|
* @example:
|
||||||
|
* ```
|
||||||
|
* PS_PrivateRec font_private;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* error = FT_Get_PS_Font_Private( face, &font_private );
|
||||||
|
* ...
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
|
@ -693,67 +713,67 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Get_PS_Font_Value
|
* FT_Get_PS_Font_Value
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Retrieve the value for the supplied key from a PostScript font.
|
* Retrieve the value for the supplied key from a PostScript font.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* PostScript face handle.
|
* PostScript face handle.
|
||||||
*
|
*
|
||||||
* key ::
|
* key ::
|
||||||
* An enumeration value representing the dictionary key to retrieve.
|
* An enumeration value representing the dictionary key to retrieve.
|
||||||
*
|
*
|
||||||
* idx ::
|
* idx ::
|
||||||
* For array values, this specifies the index to be returned.
|
* For array values, this specifies the index to be returned.
|
||||||
*
|
*
|
||||||
* value ::
|
* value ::
|
||||||
* A pointer to memory into which to write the value.
|
* A pointer to memory into which to write the value.
|
||||||
*
|
*
|
||||||
* valen_len ::
|
* valen_len ::
|
||||||
* The size, in bytes, of the memory supplied for the value.
|
* The size, in bytes, of the memory supplied for the value.
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* value ::
|
* value ::
|
||||||
* The value matching the above key, if it exists.
|
* The value matching the above key, if it exists.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* The amount of memory (in bytes) required to hold the requested value
|
* The amount of memory (in bytes) required to hold the requested value
|
||||||
* (if it exists, -1 otherwise).
|
* (if it exists, -1 otherwise).
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The values returned are not pointers into the internal structures of
|
* The values returned are not pointers into the internal structures of
|
||||||
* the face, but are 'fresh' copies, so that the memory containing them
|
* the face, but are 'fresh' copies, so that the memory containing them
|
||||||
* belongs to the calling application. This also enforces the
|
* belongs to the calling application. This also enforces the
|
||||||
* 'read-only' nature of these values, i.e., this function cannot be
|
* 'read-only' nature of these values, i.e., this function cannot be
|
||||||
* used to manipulate the face.
|
* used to manipulate the face.
|
||||||
*
|
*
|
||||||
* `value` is a void pointer because the values returned can be of
|
* `value` is a void pointer because the values returned can be of
|
||||||
* various types.
|
* various types.
|
||||||
*
|
*
|
||||||
* If either `value` is `NULL` or `value_len` is too small, just the
|
* If either `value` is `NULL` or `value_len` is too small, just the
|
||||||
* required memory size for the requested entry is returned.
|
* required memory size for the requested entry is returned.
|
||||||
*
|
*
|
||||||
* The `idx` parameter is used, not only to retrieve elements of, for
|
* The `idx` parameter is used, not only to retrieve elements of, for
|
||||||
* example, the FontMatrix or FontBBox, but also to retrieve name keys
|
* example, the FontMatrix or FontBBox, but also to retrieve name keys
|
||||||
* from the CharStrings dictionary, and the charstrings themselves. It
|
* from the CharStrings dictionary, and the charstrings themselves. It
|
||||||
* is ignored for atomic values.
|
* is ignored for atomic values.
|
||||||
*
|
*
|
||||||
* `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
|
* `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
|
||||||
* get the value as in the font stream, you need to divide by 65536000.0
|
* get the value as in the font stream, you need to divide by 65536000.0
|
||||||
* (to remove the FT_Fixed scale, and the x1000 scale).
|
* (to remove the FT_Fixed scale, and the x1000 scale).
|
||||||
*
|
*
|
||||||
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
|
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
|
||||||
* be retrieved. So, for example, PostScript procedures such as NP, ND,
|
* be retrieved. So, for example, PostScript procedures such as NP, ND,
|
||||||
* and RD are not available. Arbitrary keys are, obviously, not be
|
* and RD are not available. Arbitrary keys are, obviously, not be
|
||||||
* available either.
|
* available either.
|
||||||
*
|
*
|
||||||
* If the font's format is not PostScript-based, this function returns
|
* If the font's format is not PostScript-based, this function returns
|
||||||
* the `FT_Err_Invalid_Argument` error code.
|
* the `FT_Err_Invalid_Argument` error code.
|
||||||
*
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.4.8
|
* 2.4.8
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Long )
|
FT_EXPORT( FT_Long )
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
project('freetype2', 'c',
|
project('freetype2', 'c',
|
||||||
meson_version: '>= 0.55.0',
|
meson_version: '>= 0.55.0',
|
||||||
default_options: ['default_library=both'],
|
|
||||||
version: run_command('builds/meson/extract_freetype_version.py',
|
version: run_command('builds/meson/extract_freetype_version.py',
|
||||||
'include/freetype/freetype.h',
|
'include/freetype/freetype.h',
|
||||||
check: true).stdout().strip(),
|
check: true).stdout().strip(),
|
||||||
|
@ -336,7 +335,8 @@ endif
|
||||||
# Harfbuzz support
|
# Harfbuzz support
|
||||||
harfbuzz_dep = dependency('harfbuzz',
|
harfbuzz_dep = dependency('harfbuzz',
|
||||||
version: '>= 2.0.0',
|
version: '>= 2.0.0',
|
||||||
required: get_option('harfbuzz'))
|
required: get_option('harfbuzz'),
|
||||||
|
default_options: ['freetype=disabled'])
|
||||||
|
|
||||||
if harfbuzz_dep.found()
|
if harfbuzz_dep.found()
|
||||||
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_HARFBUZZ']
|
ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_HARFBUZZ']
|
||||||
|
|
|
@ -1085,4 +1085,71 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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 */
|
/* END */
|
||||||
|
|
|
@ -217,7 +217,7 @@
|
||||||
|
|
||||||
error = FT_GlyphLoader_CreateExtra( loader );
|
error = FT_GlyphLoader_CreateExtra( loader );
|
||||||
if ( error )
|
if ( error )
|
||||||
return error;
|
goto Exit;
|
||||||
|
|
||||||
/* check points & tags */
|
/* check points & tags */
|
||||||
new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points +
|
new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points +
|
||||||
|
@ -229,7 +229,10 @@
|
||||||
new_max = FT_PAD_CEIL( new_max, 8 );
|
new_max = FT_PAD_CEIL( new_max, 8 );
|
||||||
|
|
||||||
if ( new_max > FT_OUTLINE_POINTS_MAX )
|
if ( new_max > FT_OUTLINE_POINTS_MAX )
|
||||||
return FT_THROW( Array_Too_Large );
|
{
|
||||||
|
error = FT_THROW( Array_Too_Large );
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
|
if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
|
||||||
FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
|
FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
|
||||||
|
@ -254,7 +257,7 @@
|
||||||
|
|
||||||
error = FT_GlyphLoader_CreateExtra( loader );
|
error = FT_GlyphLoader_CreateExtra( loader );
|
||||||
if ( error )
|
if ( error )
|
||||||
return error;
|
goto Exit;
|
||||||
|
|
||||||
/* check contours */
|
/* check contours */
|
||||||
old_max = loader->max_contours;
|
old_max = loader->max_contours;
|
||||||
|
@ -265,7 +268,10 @@
|
||||||
new_max = FT_PAD_CEIL( new_max, 4 );
|
new_max = FT_PAD_CEIL( new_max, 4 );
|
||||||
|
|
||||||
if ( new_max > FT_OUTLINE_CONTOURS_MAX )
|
if ( new_max > FT_OUTLINE_CONTOURS_MAX )
|
||||||
return FT_THROW( Array_Too_Large );
|
{
|
||||||
|
error = FT_THROW( Array_Too_Large );
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
|
if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
|
@ -469,7 +469,7 @@
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_Memory memory = svg_glyph->library->memory;
|
FT_Memory memory = svg_glyph->library->memory;
|
||||||
|
|
||||||
FT_SVG_Document document;
|
FT_SVG_Document document = NULL;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_NEW( document ) )
|
if ( FT_NEW( document ) )
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
/* Don't want warnings about our own use of deprecated functions. */
|
/* Don't want warnings about our own use of deprecated functions. */
|
||||||
#define FT_DEPRECATED_ATTRIBUTE
|
#define FT_DEPRECATED_ATTRIBUTE
|
||||||
|
|
||||||
#include FT_MAC_H
|
#include <freetype/ftmac.h>
|
||||||
|
|
||||||
#ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */
|
#ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */
|
||||||
#define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault
|
#define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault
|
||||||
|
@ -314,7 +314,7 @@
|
||||||
NULL, NULL, NULL ) )
|
NULL, NULL, NULL ) )
|
||||||
return ( OSType ) 0;
|
return ( OSType ) 0;
|
||||||
|
|
||||||
return ((FInfo *)(info.finderInfo))->fdType;
|
return ( (FInfo *)( info.finderInfo ) )->fdType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@
|
||||||
|
|
||||||
if ( ps_name_len != 0 )
|
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;
|
ps_name[ps_name_len] = 0;
|
||||||
}
|
}
|
||||||
if ( style->indexes[face_index] > 1 &&
|
if ( style->indexes[face_index] > 1 &&
|
||||||
|
|
|
@ -334,7 +334,7 @@
|
||||||
/* if SVG table exists, allocate the space in `slot->other` */
|
/* if SVG table exists, allocate the space in `slot->other` */
|
||||||
if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
|
if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
|
||||||
{
|
{
|
||||||
FT_SVG_Document document;
|
FT_SVG_Document document = NULL;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_NEW( document ) )
|
if ( FT_NEW( document ) )
|
||||||
|
@ -605,7 +605,7 @@
|
||||||
|
|
||||||
|
|
||||||
FT_FREE( doc->svg_document );
|
FT_FREE( doc->svg_document );
|
||||||
slot->internal->load_flags &= ~FT_GLYPH_OWN_GZIP_SVG;
|
slot->internal->flags &= ~FT_GLYPH_OWN_GZIP_SVG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1674,7 +1674,6 @@
|
||||||
FT_FREE( stream->base );
|
FT_FREE( stream->base );
|
||||||
|
|
||||||
stream->size = 0;
|
stream->size = 0;
|
||||||
stream->base = NULL;
|
|
||||||
stream->close = NULL;
|
stream->close = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2216,7 +2215,8 @@
|
||||||
if ( FT_QALLOC( sfnt_data, rlen ) )
|
if ( FT_QALLOC( sfnt_data, rlen ) )
|
||||||
return error;
|
return error;
|
||||||
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, (FT_ULong)rlen );
|
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, (FT_ULong)rlen );
|
||||||
if ( error ) {
|
if ( error )
|
||||||
|
{
|
||||||
FT_FREE( sfnt_data );
|
FT_FREE( sfnt_data );
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -2528,6 +2528,16 @@
|
||||||
#endif
|
#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
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
FT_TRACE3(( "FT_Open_Face: " ));
|
FT_TRACE3(( "FT_Open_Face: " ));
|
||||||
if ( face_index < 0 )
|
if ( face_index < 0 )
|
||||||
|
@ -3400,6 +3410,9 @@
|
||||||
if ( !face )
|
if ( !face )
|
||||||
return FT_THROW( Invalid_Face_Handle );
|
return FT_THROW( Invalid_Face_Handle );
|
||||||
|
|
||||||
|
if ( !face->size )
|
||||||
|
return FT_THROW( Invalid_Size_Handle );
|
||||||
|
|
||||||
if ( !req || req->width < 0 || req->height < 0 ||
|
if ( !req || req->width < 0 || req->height < 0 ||
|
||||||
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
|
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
|
||||||
return FT_THROW( Invalid_Argument );
|
return FT_THROW( Invalid_Argument );
|
||||||
|
|
|
@ -402,17 +402,17 @@
|
||||||
FT_Long *result_offset );
|
FT_Long *result_offset );
|
||||||
|
|
||||||
|
|
||||||
CONST_FT_RFORK_RULE_ARRAY_BEGIN(ft_raccess_guess_table,
|
CONST_FT_RFORK_RULE_ARRAY_BEGIN( ft_raccess_guess_table,
|
||||||
ft_raccess_guess_rec)
|
ft_raccess_guess_rec )
|
||||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_double, apple_double)
|
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( apple_single, apple_single )
|
||||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_ufs_export, darwin_ufs_export)
|
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_newvfs, darwin_newvfs )
|
||||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_hfsplus, darwin_hfsplus)
|
CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_hfsplus, darwin_hfsplus )
|
||||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(vfat, vfat)
|
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_cap, linux_cap )
|
||||||
CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_double, linux_double)
|
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_ENTRY( linux_netatalk, linux_netatalk )
|
||||||
CONST_FT_RFORK_RULE_ARRAY_END
|
CONST_FT_RFORK_RULE_ARRAY_END
|
||||||
|
|
||||||
|
|
||||||
|
@ -868,9 +868,7 @@
|
||||||
const char* tmp;
|
const char* tmp;
|
||||||
const char* slash;
|
const char* slash;
|
||||||
size_t new_length;
|
size_t new_length;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error;
|
||||||
|
|
||||||
FT_UNUSED( error );
|
|
||||||
|
|
||||||
|
|
||||||
new_length = ft_strlen( original_name ) + ft_strlen( insertion );
|
new_length = ft_strlen( original_name ) + ft_strlen( insertion );
|
||||||
|
|
|
@ -363,11 +363,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_UShort )
|
FT_BASE_DEF( FT_UInt16 )
|
||||||
FT_Stream_GetUShort( FT_Stream stream )
|
FT_Stream_GetUShort( FT_Stream stream )
|
||||||
{
|
{
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_UShort result;
|
FT_UInt16 result;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream && stream->cursor );
|
FT_ASSERT( stream && stream->cursor );
|
||||||
|
@ -382,11 +382,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_UShort )
|
FT_BASE_DEF( FT_UInt16 )
|
||||||
FT_Stream_GetUShortLE( FT_Stream stream )
|
FT_Stream_GetUShortLE( FT_Stream stream )
|
||||||
{
|
{
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_UShort result;
|
FT_UInt16 result;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream && stream->cursor );
|
FT_ASSERT( stream && stream->cursor );
|
||||||
|
@ -401,11 +401,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_ULong )
|
FT_BASE_DEF( FT_UInt32 )
|
||||||
FT_Stream_GetUOffset( FT_Stream stream )
|
FT_Stream_GetUOffset( FT_Stream stream )
|
||||||
{
|
{
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_ULong result;
|
FT_UInt32 result;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream && stream->cursor );
|
FT_ASSERT( stream && stream->cursor );
|
||||||
|
@ -419,11 +419,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_ULong )
|
FT_BASE_DEF( FT_UInt32 )
|
||||||
FT_Stream_GetULong( FT_Stream stream )
|
FT_Stream_GetULong( FT_Stream stream )
|
||||||
{
|
{
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_ULong result;
|
FT_UInt32 result;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream && stream->cursor );
|
FT_ASSERT( stream && stream->cursor );
|
||||||
|
@ -437,11 +437,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_ULong )
|
FT_BASE_DEF( FT_UInt32 )
|
||||||
FT_Stream_GetULongLE( FT_Stream stream )
|
FT_Stream_GetULongLE( FT_Stream stream )
|
||||||
{
|
{
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_ULong result;
|
FT_UInt32 result;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream && stream->cursor );
|
FT_ASSERT( stream && stream->cursor );
|
||||||
|
@ -493,13 +493,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_UShort )
|
FT_BASE_DEF( FT_UInt16 )
|
||||||
FT_Stream_ReadUShort( FT_Stream stream,
|
FT_Stream_ReadUShort( FT_Stream stream,
|
||||||
FT_Error* error )
|
FT_Error* error )
|
||||||
{
|
{
|
||||||
FT_Byte reads[2];
|
FT_Byte reads[2];
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_UShort result = 0;
|
FT_UInt16 result = 0;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream );
|
FT_ASSERT( stream );
|
||||||
|
@ -538,13 +538,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_UShort )
|
FT_BASE_DEF( FT_UInt16 )
|
||||||
FT_Stream_ReadUShortLE( FT_Stream stream,
|
FT_Stream_ReadUShortLE( FT_Stream stream,
|
||||||
FT_Error* error )
|
FT_Error* error )
|
||||||
{
|
{
|
||||||
FT_Byte reads[2];
|
FT_Byte reads[2];
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_UShort result = 0;
|
FT_UInt16 result = 0;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream );
|
FT_ASSERT( stream );
|
||||||
|
@ -628,13 +628,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_ULong )
|
FT_BASE_DEF( FT_UInt32 )
|
||||||
FT_Stream_ReadULong( FT_Stream stream,
|
FT_Stream_ReadULong( FT_Stream stream,
|
||||||
FT_Error* error )
|
FT_Error* error )
|
||||||
{
|
{
|
||||||
FT_Byte reads[4];
|
FT_Byte reads[4];
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_ULong result = 0;
|
FT_UInt32 result = 0;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream );
|
FT_ASSERT( stream );
|
||||||
|
@ -673,13 +673,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_BASE_DEF( FT_ULong )
|
FT_BASE_DEF( FT_UInt32 )
|
||||||
FT_Stream_ReadULongLE( FT_Stream stream,
|
FT_Stream_ReadULongLE( FT_Stream stream,
|
||||||
FT_Error* error )
|
FT_Error* error )
|
||||||
{
|
{
|
||||||
FT_Byte reads[4];
|
FT_Byte reads[4];
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_ULong result = 0;
|
FT_UInt32 result = 0;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( stream );
|
FT_ASSERT( stream );
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
|
|
||||||
#include<windows.h>
|
#include<windows.h>
|
||||||
|
|
||||||
#define FT_VERSION 2,11,1,0
|
#define FT_VERSION 2,12,1,0
|
||||||
#define FT_VERSION_STR "2.11.1"
|
#define FT_VERSION_STR "2.12.1"
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION FT_VERSION
|
FILEVERSION FT_VERSION
|
||||||
|
@ -45,7 +45,7 @@ BEGIN
|
||||||
VALUE "FileVersion", FT_VERSION_STR
|
VALUE "FileVersion", FT_VERSION_STR
|
||||||
VALUE "ProductName", "FreeType"
|
VALUE "ProductName", "FreeType"
|
||||||
VALUE "ProductVersion", FT_VERSION_STR
|
VALUE "ProductVersion", FT_VERSION_STR
|
||||||
VALUE "LegalCopyright", "\251 2000-2021 The FreeType Project www.freetype.org. All rights reserved."
|
VALUE "LegalCopyright", "\251 2000-2022 The FreeType Project www.freetype.org. All rights reserved."
|
||||||
VALUE "InternalName", "freetype"
|
VALUE "InternalName", "freetype"
|
||||||
VALUE "OriginalFilename", FT_FILENAME
|
VALUE "OriginalFilename", FT_FILENAME
|
||||||
END
|
END
|
||||||
|
|
|
@ -13,7 +13,7 @@ This code implements a BDF driver for the FreeType library, following the
|
||||||
Adobe Specification V 2.2. The specification of the BDF font format is
|
Adobe Specification V 2.2. The specification of the BDF font format is
|
||||||
available from Adobe's web site:
|
available from Adobe's web site:
|
||||||
|
|
||||||
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
|
https://adobe-type-tools.github.io/font-tech-notes/pdfs/5005.BDF_Spec.pdf
|
||||||
|
|
||||||
Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
|
Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
|
||||||
They do not define vertical metrics, because the X Consortium BDF
|
They do not define vertical metrics, because the X Consortium BDF
|
||||||
|
@ -23,6 +23,10 @@ specification has removed them.
|
||||||
Encodings
|
Encodings
|
||||||
*********
|
*********
|
||||||
|
|
||||||
|
[This section is out of date, retained for historical reasons. BDF
|
||||||
|
properties can be retrieved with `FT_Get_BDF_Property`, character set ID
|
||||||
|
values with `FT_Get_BDF_Charset_ID`.]
|
||||||
|
|
||||||
The variety of encodings that accompanies bdf fonts appears to encompass the
|
The variety of encodings that accompanies bdf fonts appears to encompass the
|
||||||
small set defined in freetype.h. On the other hand, two properties that
|
small set defined in freetype.h. On the other hand, two properties that
|
||||||
specify encoding and registry are usually defined in bdf fonts.
|
specify encoding and registry are usually defined in bdf fonts.
|
||||||
|
|
|
@ -57,8 +57,9 @@
|
||||||
/* it is better to use FreeType memory routines instead of raw
|
/* it is better to use FreeType memory routines instead of raw
|
||||||
'malloc/free' */
|
'malloc/free' */
|
||||||
|
|
||||||
typedef void *(* alloc_func)(void*, int, int);
|
typedef void* (*alloc_func)( void*, int, int );
|
||||||
typedef void (* free_func)(void*, void*);
|
typedef void (*free_func) ( void*, void* );
|
||||||
|
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
ft_bzip2_alloc( FT_Memory memory,
|
ft_bzip2_alloc( FT_Memory memory,
|
||||||
|
|
|
@ -210,7 +210,7 @@ FT_BEGIN_HEADER
|
||||||
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
||||||
FT_BEGIN_STMNT \
|
FT_BEGIN_STMNT \
|
||||||
FTC_Node *_bucket, *_pnode, _node; \
|
FTC_Node *_bucket, *_pnode, _node; \
|
||||||
FTC_Cache _cache = FTC_CACHE(cache); \
|
FTC_Cache _cache = FTC_CACHE( cache ); \
|
||||||
FT_Offset _hash = (FT_Offset)(hash); \
|
FT_Offset _hash = (FT_Offset)(hash); \
|
||||||
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
|
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
|
||||||
FT_Bool _list_changed = FALSE; \
|
FT_Bool _list_changed = FALSE; \
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
FTC_CMapQuery query = (FTC_CMapQuery)ftcquery;
|
FTC_CMapQuery query = (FTC_CMapQuery)ftcquery;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
FT_Memory memory = cache->memory;
|
FT_Memory memory = cache->memory;
|
||||||
FTC_CMapNode node;
|
FTC_CMapNode node = NULL;
|
||||||
FT_UInt nn;
|
FT_UInt nn;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -140,8 +140,8 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
} FTC_FamilyRec, *FTC_Family;
|
} FTC_FamilyRec, *FTC_Family;
|
||||||
|
|
||||||
#define FTC_FAMILY(x) ( (FTC_Family)(x) )
|
#define FTC_FAMILY( x ) ( (FTC_Family)(x) )
|
||||||
#define FTC_FAMILY_P(x) ( (FTC_Family*)(x) )
|
#define FTC_FAMILY_P( x ) ( (FTC_Family*)(x) )
|
||||||
|
|
||||||
|
|
||||||
typedef struct FTC_GNodeRec_
|
typedef struct FTC_GNodeRec_
|
||||||
|
@ -245,7 +245,7 @@ FT_BEGIN_HEADER
|
||||||
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
|
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
|
||||||
|
|
||||||
#define FTC_CACHE_GCACHE_CLASS( 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 ) \
|
#define FTC_CACHE_FAMILY_CLASS( x ) \
|
||||||
( (FTC_MruListClass)FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
( (FTC_MruListClass)FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
{
|
{
|
||||||
FT_Memory memory = cache->memory;
|
FT_Memory memory = cache->memory;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
FTC_INode inode;
|
FTC_INode inode = NULL;
|
||||||
|
|
||||||
|
|
||||||
if ( !FT_QNEW( inode ) )
|
if ( !FT_QNEW( inode ) )
|
||||||
|
@ -74,6 +74,7 @@
|
||||||
|
|
||||||
/* initialize its inner fields */
|
/* initialize its inner fields */
|
||||||
FTC_GNode_Init( gnode, gindex, family );
|
FTC_GNode_Init( gnode, gindex, family );
|
||||||
|
inode->glyph = NULL;
|
||||||
|
|
||||||
/* we will now load the glyph image */
|
/* we will now load the glyph image */
|
||||||
error = clazz->family_load_glyph( family, gindex, cache,
|
error = clazz->family_load_glyph( family, gindex, cache,
|
||||||
|
|
|
@ -51,8 +51,8 @@ FT_BEGIN_HEADER
|
||||||
} FTC_INodeRec, *FTC_INode;
|
} FTC_INodeRec, *FTC_INode;
|
||||||
|
|
||||||
#define FTC_INODE( x ) ( (FTC_INode)( x ) )
|
#define FTC_INODE( x ) ( (FTC_INode)( x ) )
|
||||||
#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
|
#define FTC_INODE_GINDEX( x ) FTC_GNODE( x )->gindex
|
||||||
#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
|
#define FTC_INODE_FAMILY( x ) FTC_GNODE( x )->family
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
||||||
|
@ -72,7 +72,7 @@ FT_BEGIN_HEADER
|
||||||
#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
|
#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
|
||||||
|
|
||||||
#define FTC_CACHE_IFAMILY_CLASS( 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 */
|
/* can be used as a @FTC_Node_FreeFunc */
|
||||||
|
|
|
@ -262,7 +262,9 @@
|
||||||
if ( list->clazz.node_done )
|
if ( list->clazz.node_done )
|
||||||
list->clazz.node_done( node, list->data );
|
list->clazz.node_done( node, list->data );
|
||||||
}
|
}
|
||||||
else if ( FT_QALLOC( node, list->clazz.node_size ) )
|
|
||||||
|
/* zero new node in case of node_init failure */
|
||||||
|
else if ( FT_ALLOC( node, list->clazz.node_size ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
error = list->clazz.node_init( node, key, list->data );
|
error = list->clazz.node_init( node, key, list->data );
|
||||||
|
|
|
@ -171,7 +171,7 @@
|
||||||
sbit->xadvance = (FT_Char)xadvance;
|
sbit->xadvance = (FT_Char)xadvance;
|
||||||
sbit->yadvance = (FT_Char)yadvance;
|
sbit->yadvance = (FT_Char)yadvance;
|
||||||
sbit->format = (FT_Byte)bitmap->pixel_mode;
|
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 )
|
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
|
||||||
{
|
{
|
||||||
|
@ -248,7 +248,9 @@
|
||||||
snode->count = count;
|
snode->count = count;
|
||||||
for ( node_count = 0; node_count < count; node_count++ )
|
for ( node_count = 0; node_count < count; node_count++ )
|
||||||
{
|
{
|
||||||
snode->sbits[node_count].width = 255;
|
snode->sbits[node_count].width = 255;
|
||||||
|
snode->sbits[node_count].height = 0;
|
||||||
|
snode->sbits[node_count].buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = ftc_snode_load( snode,
|
error = ftc_snode_load( snode,
|
||||||
|
|
|
@ -61,7 +61,7 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
typedef const FTC_SFamilyClassRec* FTC_SFamilyClass;
|
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 ) \
|
#define FTC_CACHE_SFAMILY_CLASS( x ) \
|
||||||
FTC_SFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
FTC_SFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
|
|
||||||
if ( char_code < 255 )
|
if ( char_code < 255 )
|
||||||
{
|
{
|
||||||
FT_UInt code = (FT_UInt)(char_code + 1);
|
FT_UInt code = (FT_UInt)( char_code + 1 );
|
||||||
|
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* OpenType font driver implementation (body).
|
* OpenType font driver implementation (body).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2022 by
|
* Copyright (C) 1996-2022 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
* modified, and distributed under the terms of the FreeType project
|
* modified, and distributed under the terms of the FreeType project
|
||||||
|
@ -936,22 +936,103 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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(
|
FT_DEFINE_SERVICE_MULTIMASTERSREC(
|
||||||
cff_service_multi_masters,
|
cff_service_multi_masters,
|
||||||
|
|
||||||
(FT_Get_MM_Func) NULL, /* get_mm */
|
(FT_Get_MM_Func) NULL, /* get_mm */
|
||||||
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
||||||
(FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
|
(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_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
|
||||||
(FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
|
(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_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */
|
||||||
(FT_Get_Var_Design_Func) cff_get_var_design, /* get_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_Instance_Func) cff_set_instance, /* set_instance */
|
||||||
(FT_Set_MM_WeightVector_Func)cff_set_mm_weightvector, /* set_mm_weightvector */
|
(FT_Set_MM_WeightVector_Func)
|
||||||
(FT_Get_MM_WeightVector_Func)cff_get_mm_weightvector, /* get_mm_weightvector */
|
cff_set_mm_weightvector,
|
||||||
|
/* set_mm_weightvector */
|
||||||
(FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
|
(FT_Get_MM_WeightVector_Func)
|
||||||
(FT_Done_Blend_Func) cff_done_blend /* done_blend */
|
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 */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,14 @@
|
||||||
|
|
||||||
#include "cfferrs.h"
|
#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
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
|
@ -67,7 +75,7 @@
|
||||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
#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,
|
return cff_index_access_element( &cff->charstrings_index, glyph_index,
|
||||||
|
@ -103,7 +111,7 @@
|
||||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
#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 );
|
cff_index_forget_element( &cff->charstrings_index, pointer );
|
||||||
|
@ -255,8 +263,8 @@
|
||||||
|
|
||||||
|
|
||||||
if ( size->strike_index != 0xFFFFFFFFUL &&
|
if ( size->strike_index != 0xFFFFFFFFUL &&
|
||||||
sfnt->load_eblc &&
|
( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
|
||||||
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
|
IS_DEFAULT_INSTANCE( size->root.face ) )
|
||||||
{
|
{
|
||||||
TT_SBit_MetricsRec metrics;
|
TT_SBit_MetricsRec metrics;
|
||||||
|
|
||||||
|
@ -362,8 +370,8 @@
|
||||||
SFNT_Service sfnt;
|
SFNT_Service sfnt;
|
||||||
|
|
||||||
|
|
||||||
if ( size->root.metrics.x_ppem < 1 ||
|
if ( size && (size->root.metrics.x_ppem < 1 ||
|
||||||
size->root.metrics.y_ppem < 1 )
|
size->root.metrics.y_ppem < 1 ) )
|
||||||
{
|
{
|
||||||
error = FT_THROW( Invalid_Size_Handle );
|
error = FT_THROW( Invalid_Size_Handle );
|
||||||
return error;
|
return error;
|
||||||
|
@ -396,6 +404,9 @@
|
||||||
&dummy,
|
&dummy,
|
||||||
&advanceY );
|
&advanceY );
|
||||||
|
|
||||||
|
glyph->root.linearHoriAdvance = advanceX;
|
||||||
|
glyph->root.linearVertAdvance = advanceY;
|
||||||
|
|
||||||
advanceX =
|
advanceX =
|
||||||
(FT_UShort)FT_MulDiv( advanceX,
|
(FT_UShort)FT_MulDiv( advanceX,
|
||||||
glyph->root.face->size->metrics.x_ppem,
|
glyph->root.face->size->metrics.x_ppem,
|
||||||
|
|
|
@ -1288,7 +1288,7 @@
|
||||||
/* Blended values are written to a different buffer, */
|
/* Blended values are written to a different buffer, */
|
||||||
/* using reserved operator 255. */
|
/* 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 )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
cff_blend_doBlend( CFF_SubFont subFont,
|
cff_blend_doBlend( CFF_SubFont subFont,
|
||||||
CFF_Parser parser,
|
CFF_Parser parser,
|
||||||
|
@ -1364,7 +1364,7 @@
|
||||||
FT_UInt32 sum;
|
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;
|
sum = cff_parse_num( parser, &parser->stack[i + base] ) * 0x10000;
|
||||||
|
|
||||||
for ( j = 1; j < blend->lenBV; j++ )
|
for ( j = 1; j < blend->lenBV; j++ )
|
||||||
|
@ -1373,7 +1373,7 @@
|
||||||
/* point parser stack to new value on blend_stack */
|
/* point parser stack to new value on blend_stack */
|
||||||
parser->stack[i + base] = subFont->blend_top;
|
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 */
|
/* will not conflict with actual DICTs because 255 is a reserved */
|
||||||
/* opcode in both CFF and CFF2 DICTs. See `cff_parse_num' for */
|
/* opcode in both CFF and CFF2 DICTs. See `cff_parse_num' for */
|
||||||
/* decode of this, which rounds to an integer. */
|
/* decode of this, which rounds to an integer. */
|
||||||
|
|
|
@ -411,9 +411,7 @@
|
||||||
FT_String* result;
|
FT_String* result;
|
||||||
|
|
||||||
|
|
||||||
(void)FT_STRDUP( result, source );
|
FT_MEM_STRDUP( result, source );
|
||||||
|
|
||||||
FT_UNUSED( error );
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,7 +530,7 @@
|
||||||
|
|
||||||
else if ( **d == 255 )
|
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. */
|
/* Since these are trusted values, a limit check is not needed. */
|
||||||
|
|
||||||
/* After the 255, 4 bytes give the number. */
|
/* After the 255, 4 bytes give the number. */
|
||||||
|
|
|
@ -1033,7 +1033,7 @@
|
||||||
GXV_NAME_ENTER( "StateArray" );
|
GXV_NAME_ENTER( "StateArray" );
|
||||||
|
|
||||||
GXV_TRACE(( "parse %d bytes by stateSize=%d maxClassID=%d\n",
|
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:
|
* 2 states are predefined and must be described in StateArray:
|
||||||
|
@ -1418,7 +1418,7 @@
|
||||||
GXV_NAME_ENTER( "XStateArray" );
|
GXV_NAME_ENTER( "XStateArray" );
|
||||||
|
|
||||||
GXV_TRACE(( "parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\n",
|
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:
|
* 2 states are predefined and must be described:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Name: zlib
|
Name: zlib
|
||||||
Short Name: zlib
|
Short Name: zlib
|
||||||
URL: http://zlib.net/
|
URL: http://zlib.net/
|
||||||
Version: 1.2.11
|
Version: 1.2.12
|
||||||
License: see `zlib.h`
|
License: see `zlib.h`
|
||||||
|
|
||||||
Description:
|
Description:
|
||||||
|
|
1296
src/gzip/crc32.c
1296
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,6 +790,9 @@
|
||||||
if ( err == Z_DATA_ERROR )
|
if ( err == Z_DATA_ERROR )
|
||||||
return FT_THROW( Invalid_Table );
|
return FT_THROW( Invalid_Table );
|
||||||
|
|
||||||
|
if ( err == Z_NEED_DICT )
|
||||||
|
return FT_THROW( Invalid_Table );
|
||||||
|
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* gzguts.h -- zlib internal header definitions for gz* operations
|
/* gzguts.h -- zlib internal header definitions for gz* operations
|
||||||
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler
|
* Copyright (C) 2004-2019 Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
#if defined(_WIN32)
|
||||||
# define WIDECHAR
|
# define WIDECHAR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -190,6 +190,7 @@ typedef struct {
|
||||||
/* just for writing */
|
/* just for writing */
|
||||||
int level; /* compression level */
|
int level; /* compression level */
|
||||||
int strategy; /* compression strategy */
|
int strategy; /* compression strategy */
|
||||||
|
int reset; /* true if a reset is pending after a Z_FINISH */
|
||||||
/* seek request */
|
/* seek request */
|
||||||
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
||||||
int seek; /* true if seek request pending */
|
int seek; /* true if seek request pending */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* infback.c -- inflate using a call-back interface
|
/* infback.c -- inflate using a call-back interface
|
||||||
* Copyright (C) 1995-2016 Mark Adler
|
* Copyright (C) 1995-2022 Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -477,6 +477,7 @@ int ZEXPORT inflateBack(
|
||||||
}
|
}
|
||||||
Tracev((stderr, "inflate: codes ok\n"));
|
Tracev((stderr, "inflate: codes ok\n"));
|
||||||
state->mode = LEN;
|
state->mode = LEN;
|
||||||
|
/* fallthrough */
|
||||||
|
|
||||||
case LEN:
|
case LEN:
|
||||||
/* use inflate_fast() if we have enough input and output */
|
/* 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 */
|
code const FAR *dcode; /* local strm->distcode */
|
||||||
unsigned lmask; /* mask for first level of length codes */
|
unsigned lmask; /* mask for first level of length codes */
|
||||||
unsigned dmask; /* mask for first level of distance codes */
|
unsigned dmask; /* mask for first level of distance codes */
|
||||||
code here; /* retrieved table entry */
|
code const *here; /* retrieved table entry */
|
||||||
unsigned op; /* code bits, operation, extra bits, or */
|
unsigned op; /* code bits, operation, extra bits, or */
|
||||||
/* window position, window bytes to copy */
|
/* window position, window bytes to copy */
|
||||||
unsigned len; /* match length, unused bytes */
|
unsigned len; /* match length, unused bytes */
|
||||||
|
@ -107,20 +107,20 @@ void ZLIB_INTERNAL inflate_fast(
|
||||||
hold += (unsigned long)(*in++) << bits;
|
hold += (unsigned long)(*in++) << bits;
|
||||||
bits += 8;
|
bits += 8;
|
||||||
}
|
}
|
||||||
here = lcode[hold & lmask];
|
here = lcode + (hold & lmask);
|
||||||
dolen:
|
dolen:
|
||||||
op = (unsigned)(here.bits);
|
op = (unsigned)(here->bits);
|
||||||
hold >>= op;
|
hold >>= op;
|
||||||
bits -= op;
|
bits -= op;
|
||||||
op = (unsigned)(here.op);
|
op = (unsigned)(here->op);
|
||||||
if (op == 0) { /* literal */
|
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 '%c'\n" :
|
||||||
"inflate: literal 0x%02x\n", here.val));
|
"inflate: literal 0x%02x\n", here->val));
|
||||||
*out++ = (unsigned char)(here.val);
|
*out++ = (unsigned char)(here->val);
|
||||||
}
|
}
|
||||||
else if (op & 16) { /* length base */
|
else if (op & 16) { /* length base */
|
||||||
len = (unsigned)(here.val);
|
len = (unsigned)(here->val);
|
||||||
op &= 15; /* number of extra bits */
|
op &= 15; /* number of extra bits */
|
||||||
if (op) {
|
if (op) {
|
||||||
if (bits < op) {
|
if (bits < op) {
|
||||||
|
@ -138,14 +138,14 @@ void ZLIB_INTERNAL inflate_fast(
|
||||||
hold += (unsigned long)(*in++) << bits;
|
hold += (unsigned long)(*in++) << bits;
|
||||||
bits += 8;
|
bits += 8;
|
||||||
}
|
}
|
||||||
here = dcode[hold & dmask];
|
here = dcode + (hold & dmask);
|
||||||
dodist:
|
dodist:
|
||||||
op = (unsigned)(here.bits);
|
op = (unsigned)(here->bits);
|
||||||
hold >>= op;
|
hold >>= op;
|
||||||
bits -= op;
|
bits -= op;
|
||||||
op = (unsigned)(here.op);
|
op = (unsigned)(here->op);
|
||||||
if (op & 16) { /* distance base */
|
if (op & 16) { /* distance base */
|
||||||
dist = (unsigned)(here.val);
|
dist = (unsigned)(here->val);
|
||||||
op &= 15; /* number of extra bits */
|
op &= 15; /* number of extra bits */
|
||||||
if (bits < op) {
|
if (bits < op) {
|
||||||
hold += (unsigned long)(*in++) << bits;
|
hold += (unsigned long)(*in++) << bits;
|
||||||
|
@ -264,7 +264,7 @@ void ZLIB_INTERNAL inflate_fast(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((op & 64) == 0) { /* 2nd level distance code */
|
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;
|
goto dodist;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -274,7 +274,7 @@ void ZLIB_INTERNAL inflate_fast(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ((op & 64) == 0) { /* 2nd level length code */
|
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;
|
goto dolen;
|
||||||
}
|
}
|
||||||
else if (op & 32) { /* end-of-block */
|
else if (op & 32) { /* end-of-block */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* inflate.c -- zlib decompression
|
/* inflate.c -- zlib decompression
|
||||||
* Copyright (C) 1995-2016 Mark Adler
|
* Copyright (C) 1995-2022 Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -132,6 +132,7 @@ int ZEXPORT inflateResetKeep(
|
||||||
state->mode = HEAD;
|
state->mode = HEAD;
|
||||||
state->last = 0;
|
state->last = 0;
|
||||||
state->havedict = 0;
|
state->havedict = 0;
|
||||||
|
state->flags = -1;
|
||||||
state->dmax = 32768U;
|
state->dmax = 32768U;
|
||||||
state->head = Z_NULL;
|
state->head = Z_NULL;
|
||||||
state->hold = 0;
|
state->hold = 0;
|
||||||
|
@ -269,7 +270,7 @@ int ZEXPORT inflatePrime(
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* Z_FREETYPE */
|
#endif /* !Z_FREETYPE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return state with length and distance decoding tables and index sizes set to
|
Return state with length and distance decoding tables and index sizes set to
|
||||||
|
@ -453,10 +454,10 @@ local int updatewindow(
|
||||||
|
|
||||||
/* check function to use adler32() for zlib or crc32() for gzip */
|
/* check function to use adler32() for zlib or crc32() for gzip */
|
||||||
#ifdef GUNZIP
|
#ifdef GUNZIP
|
||||||
# define UPDATE(check, buf, len) \
|
# define UPDATE_CHECK(check, buf, len) \
|
||||||
(state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
|
(state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
|
||||||
#else
|
#else
|
||||||
# define UPDATE(check, buf, len) adler32(check, buf, len)
|
# define UPDATE_CHECK(check, buf, len) adler32(check, buf, len)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* check macros for header crc */
|
/* check macros for header crc */
|
||||||
|
@ -676,7 +677,6 @@ int ZEXPORT inflate(
|
||||||
state->mode = FLAGS;
|
state->mode = FLAGS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->flags = 0; /* expect zlib header */
|
|
||||||
if (state->head != Z_NULL)
|
if (state->head != Z_NULL)
|
||||||
state->head->done = -1;
|
state->head->done = -1;
|
||||||
if (!(state->wrap & 1) || /* check if zlib header allowed */
|
if (!(state->wrap & 1) || /* check if zlib header allowed */
|
||||||
|
@ -703,6 +703,7 @@ int ZEXPORT inflate(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->dmax = 1U << len;
|
state->dmax = 1U << len;
|
||||||
|
state->flags = 0; /* indicate zlib header */
|
||||||
Tracev((stderr, "inflate: zlib header ok\n"));
|
Tracev((stderr, "inflate: zlib header ok\n"));
|
||||||
strm->adler = state->check = adler32(0L, Z_NULL, 0);
|
strm->adler = state->check = adler32(0L, Z_NULL, 0);
|
||||||
state->mode = hold & 0x200 ? DICTID : TYPE;
|
state->mode = hold & 0x200 ? DICTID : TYPE;
|
||||||
|
@ -728,6 +729,7 @@ int ZEXPORT inflate(
|
||||||
CRC2(state->check, hold);
|
CRC2(state->check, hold);
|
||||||
INITBITS();
|
INITBITS();
|
||||||
state->mode = TIME;
|
state->mode = TIME;
|
||||||
|
/* fallthrough */
|
||||||
case TIME:
|
case TIME:
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if (state->head != Z_NULL)
|
if (state->head != Z_NULL)
|
||||||
|
@ -736,6 +738,7 @@ int ZEXPORT inflate(
|
||||||
CRC4(state->check, hold);
|
CRC4(state->check, hold);
|
||||||
INITBITS();
|
INITBITS();
|
||||||
state->mode = OS;
|
state->mode = OS;
|
||||||
|
/* fallthrough */
|
||||||
case OS:
|
case OS:
|
||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
if (state->head != Z_NULL) {
|
if (state->head != Z_NULL) {
|
||||||
|
@ -746,6 +749,7 @@ int ZEXPORT inflate(
|
||||||
CRC2(state->check, hold);
|
CRC2(state->check, hold);
|
||||||
INITBITS();
|
INITBITS();
|
||||||
state->mode = EXLEN;
|
state->mode = EXLEN;
|
||||||
|
/* fallthrough */
|
||||||
case EXLEN:
|
case EXLEN:
|
||||||
if (state->flags & 0x0400) {
|
if (state->flags & 0x0400) {
|
||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
|
@ -759,6 +763,7 @@ int ZEXPORT inflate(
|
||||||
else if (state->head != Z_NULL)
|
else if (state->head != Z_NULL)
|
||||||
state->head->extra = Z_NULL;
|
state->head->extra = Z_NULL;
|
||||||
state->mode = EXTRA;
|
state->mode = EXTRA;
|
||||||
|
/* fallthrough */
|
||||||
case EXTRA:
|
case EXTRA:
|
||||||
if (state->flags & 0x0400) {
|
if (state->flags & 0x0400) {
|
||||||
copy = state->length;
|
copy = state->length;
|
||||||
|
@ -781,6 +786,7 @@ int ZEXPORT inflate(
|
||||||
}
|
}
|
||||||
state->length = 0;
|
state->length = 0;
|
||||||
state->mode = NAME;
|
state->mode = NAME;
|
||||||
|
/* fallthrough */
|
||||||
case NAME:
|
case NAME:
|
||||||
if (state->flags & 0x0800) {
|
if (state->flags & 0x0800) {
|
||||||
if (have == 0) goto inf_leave;
|
if (have == 0) goto inf_leave;
|
||||||
|
@ -802,6 +808,7 @@ int ZEXPORT inflate(
|
||||||
state->head->name = Z_NULL;
|
state->head->name = Z_NULL;
|
||||||
state->length = 0;
|
state->length = 0;
|
||||||
state->mode = COMMENT;
|
state->mode = COMMENT;
|
||||||
|
/* fallthrough */
|
||||||
case COMMENT:
|
case COMMENT:
|
||||||
if (state->flags & 0x1000) {
|
if (state->flags & 0x1000) {
|
||||||
if (have == 0) goto inf_leave;
|
if (have == 0) goto inf_leave;
|
||||||
|
@ -822,6 +829,7 @@ int ZEXPORT inflate(
|
||||||
else if (state->head != Z_NULL)
|
else if (state->head != Z_NULL)
|
||||||
state->head->comment = Z_NULL;
|
state->head->comment = Z_NULL;
|
||||||
state->mode = HCRC;
|
state->mode = HCRC;
|
||||||
|
/* fallthrough */
|
||||||
case HCRC:
|
case HCRC:
|
||||||
if (state->flags & 0x0200) {
|
if (state->flags & 0x0200) {
|
||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
|
@ -845,6 +853,7 @@ int ZEXPORT inflate(
|
||||||
strm->adler = state->check = ZSWAP32(hold);
|
strm->adler = state->check = ZSWAP32(hold);
|
||||||
INITBITS();
|
INITBITS();
|
||||||
state->mode = DICT;
|
state->mode = DICT;
|
||||||
|
/* fallthrough */
|
||||||
case DICT:
|
case DICT:
|
||||||
if (state->havedict == 0) {
|
if (state->havedict == 0) {
|
||||||
RESTORE();
|
RESTORE();
|
||||||
|
@ -852,8 +861,10 @@ int ZEXPORT inflate(
|
||||||
}
|
}
|
||||||
strm->adler = state->check = adler32(0L, Z_NULL, 0);
|
strm->adler = state->check = adler32(0L, Z_NULL, 0);
|
||||||
state->mode = TYPE;
|
state->mode = TYPE;
|
||||||
|
/* fallthrough */
|
||||||
case TYPE:
|
case TYPE:
|
||||||
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
|
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
|
||||||
|
/* fallthrough */
|
||||||
case TYPEDO:
|
case TYPEDO:
|
||||||
if (state->last) {
|
if (state->last) {
|
||||||
BYTEBITS();
|
BYTEBITS();
|
||||||
|
@ -904,8 +915,10 @@ int ZEXPORT inflate(
|
||||||
INITBITS();
|
INITBITS();
|
||||||
state->mode = COPY_;
|
state->mode = COPY_;
|
||||||
if (flush == Z_TREES) goto inf_leave;
|
if (flush == Z_TREES) goto inf_leave;
|
||||||
|
/* fallthrough */
|
||||||
case COPY_:
|
case COPY_:
|
||||||
state->mode = COPY;
|
state->mode = COPY;
|
||||||
|
/* fallthrough */
|
||||||
case COPY:
|
case COPY:
|
||||||
copy = state->length;
|
copy = state->length;
|
||||||
if (copy) {
|
if (copy) {
|
||||||
|
@ -941,6 +954,7 @@ int ZEXPORT inflate(
|
||||||
Tracev((stderr, "inflate: table sizes ok\n"));
|
Tracev((stderr, "inflate: table sizes ok\n"));
|
||||||
state->have = 0;
|
state->have = 0;
|
||||||
state->mode = LENLENS;
|
state->mode = LENLENS;
|
||||||
|
/* fallthrough */
|
||||||
case LENLENS:
|
case LENLENS:
|
||||||
while (state->have < state->ncode) {
|
while (state->have < state->ncode) {
|
||||||
NEEDBITS(3);
|
NEEDBITS(3);
|
||||||
|
@ -962,6 +976,7 @@ int ZEXPORT inflate(
|
||||||
Tracev((stderr, "inflate: code lengths ok\n"));
|
Tracev((stderr, "inflate: code lengths ok\n"));
|
||||||
state->have = 0;
|
state->have = 0;
|
||||||
state->mode = CODELENS;
|
state->mode = CODELENS;
|
||||||
|
/* fallthrough */
|
||||||
case CODELENS:
|
case CODELENS:
|
||||||
while (state->have < state->nlen + state->ndist) {
|
while (state->have < state->nlen + state->ndist) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -1045,8 +1060,10 @@ int ZEXPORT inflate(
|
||||||
Tracev((stderr, "inflate: codes ok\n"));
|
Tracev((stderr, "inflate: codes ok\n"));
|
||||||
state->mode = LEN_;
|
state->mode = LEN_;
|
||||||
if (flush == Z_TREES) goto inf_leave;
|
if (flush == Z_TREES) goto inf_leave;
|
||||||
|
/* fallthrough */
|
||||||
case LEN_:
|
case LEN_:
|
||||||
state->mode = LEN;
|
state->mode = LEN;
|
||||||
|
/* fallthrough */
|
||||||
case LEN:
|
case LEN:
|
||||||
if (have >= 6 && left >= 258) {
|
if (have >= 6 && left >= 258) {
|
||||||
RESTORE();
|
RESTORE();
|
||||||
|
@ -1096,6 +1113,7 @@ int ZEXPORT inflate(
|
||||||
}
|
}
|
||||||
state->extra = (unsigned)(here.op) & 15;
|
state->extra = (unsigned)(here.op) & 15;
|
||||||
state->mode = LENEXT;
|
state->mode = LENEXT;
|
||||||
|
/* fallthrough */
|
||||||
case LENEXT:
|
case LENEXT:
|
||||||
if (state->extra) {
|
if (state->extra) {
|
||||||
NEEDBITS(state->extra);
|
NEEDBITS(state->extra);
|
||||||
|
@ -1106,6 +1124,7 @@ int ZEXPORT inflate(
|
||||||
Tracevv((stderr, "inflate: length %u\n", state->length));
|
Tracevv((stderr, "inflate: length %u\n", state->length));
|
||||||
state->was = state->length;
|
state->was = state->length;
|
||||||
state->mode = DIST;
|
state->mode = DIST;
|
||||||
|
/* fallthrough */
|
||||||
case DIST:
|
case DIST:
|
||||||
for (;;) {
|
for (;;) {
|
||||||
here = state->distcode[BITS(state->distbits)];
|
here = state->distcode[BITS(state->distbits)];
|
||||||
|
@ -1133,6 +1152,7 @@ int ZEXPORT inflate(
|
||||||
state->offset = (unsigned)here.val;
|
state->offset = (unsigned)here.val;
|
||||||
state->extra = (unsigned)(here.op) & 15;
|
state->extra = (unsigned)(here.op) & 15;
|
||||||
state->mode = DISTEXT;
|
state->mode = DISTEXT;
|
||||||
|
/* fallthrough */
|
||||||
case DISTEXT:
|
case DISTEXT:
|
||||||
if (state->extra) {
|
if (state->extra) {
|
||||||
NEEDBITS(state->extra);
|
NEEDBITS(state->extra);
|
||||||
|
@ -1149,6 +1169,7 @@ int ZEXPORT inflate(
|
||||||
#endif
|
#endif
|
||||||
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
||||||
state->mode = MATCH;
|
state->mode = MATCH;
|
||||||
|
/* fallthrough */
|
||||||
case MATCH:
|
case MATCH:
|
||||||
if (left == 0) goto inf_leave;
|
if (left == 0) goto inf_leave;
|
||||||
copy = out - left;
|
copy = out - left;
|
||||||
|
@ -1208,7 +1229,7 @@ int ZEXPORT inflate(
|
||||||
state->total += out;
|
state->total += out;
|
||||||
if ((state->wrap & 4) && out)
|
if ((state->wrap & 4) && out)
|
||||||
strm->adler = state->check =
|
strm->adler = state->check =
|
||||||
UPDATE(state->check, put - out, out);
|
UPDATE_CHECK(state->check, put - out, out);
|
||||||
out = left;
|
out = left;
|
||||||
if ((state->wrap & 4) && (
|
if ((state->wrap & 4) && (
|
||||||
#ifdef GUNZIP
|
#ifdef GUNZIP
|
||||||
|
@ -1224,10 +1245,11 @@ int ZEXPORT inflate(
|
||||||
}
|
}
|
||||||
#ifdef GUNZIP
|
#ifdef GUNZIP
|
||||||
state->mode = LENGTH;
|
state->mode = LENGTH;
|
||||||
|
/* fallthrough */
|
||||||
case LENGTH:
|
case LENGTH:
|
||||||
if (state->wrap && state->flags) {
|
if (state->wrap && state->flags) {
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if (hold != (state->total & 0xffffffffUL)) {
|
if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
|
||||||
strm->msg = (char *)"incorrect length check";
|
strm->msg = (char *)"incorrect length check";
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1237,6 +1259,7 @@ int ZEXPORT inflate(
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
state->mode = DONE;
|
state->mode = DONE;
|
||||||
|
/* fallthrough */
|
||||||
case DONE:
|
case DONE:
|
||||||
ret = Z_STREAM_END;
|
ret = Z_STREAM_END;
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
|
@ -1246,6 +1269,7 @@ int ZEXPORT inflate(
|
||||||
case MEM:
|
case MEM:
|
||||||
return Z_MEM_ERROR;
|
return Z_MEM_ERROR;
|
||||||
case SYNC:
|
case SYNC:
|
||||||
|
/* fallthrough */
|
||||||
default:
|
default:
|
||||||
return Z_STREAM_ERROR;
|
return Z_STREAM_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1271,7 +1295,7 @@ int ZEXPORT inflate(
|
||||||
state->total += out;
|
state->total += out;
|
||||||
if ((state->wrap & 4) && out)
|
if ((state->wrap & 4) && out)
|
||||||
strm->adler = state->check =
|
strm->adler = state->check =
|
||||||
UPDATE(state->check, strm->next_out - out, out);
|
UPDATE_CHECK(state->check, strm->next_out - out, out);
|
||||||
strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
|
strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
|
||||||
(state->mode == TYPE ? 128 : 0) +
|
(state->mode == TYPE ? 128 : 0) +
|
||||||
(state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
|
(state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
|
||||||
|
@ -1409,6 +1433,7 @@ int ZEXPORT inflateSync(
|
||||||
z_streamp strm)
|
z_streamp strm)
|
||||||
{
|
{
|
||||||
unsigned len; /* number of bytes to look at or looked at */
|
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 long in, out; /* temporary to save total_in and total_out */
|
||||||
unsigned char buf[4]; /* to restore bit buffer to byte string */
|
unsigned char buf[4]; /* to restore bit buffer to byte string */
|
||||||
struct inflate_state FAR *state;
|
struct inflate_state FAR *state;
|
||||||
|
@ -1441,9 +1466,15 @@ int ZEXPORT inflateSync(
|
||||||
|
|
||||||
/* return no joy or set up to restart inflate() on a new block */
|
/* return no joy or set up to restart inflate() on a new block */
|
||||||
if (state->have != 4) return Z_DATA_ERROR;
|
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;
|
in = strm->total_in; out = strm->total_out;
|
||||||
inflateReset(strm);
|
inflateReset(strm);
|
||||||
strm->total_in = in; strm->total_out = out;
|
strm->total_in = in; strm->total_out = out;
|
||||||
|
state->flags = flags;
|
||||||
state->mode = TYPE;
|
state->mode = TYPE;
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
@ -1468,7 +1499,7 @@ int ZEXPORT inflateSyncPoint(
|
||||||
return state->mode == STORED && state->bits == 0;
|
return state->mode == STORED && state->bits == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !Z_FREETYPE
|
#ifndef Z_FREETYPE
|
||||||
|
|
||||||
int ZEXPORT inflateCopy(
|
int ZEXPORT inflateCopy(
|
||||||
z_streamp dest,
|
z_streamp dest,
|
||||||
|
@ -1545,7 +1576,7 @@ int ZEXPORT inflateValidate(
|
||||||
|
|
||||||
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
|
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
|
||||||
state = (struct inflate_state FAR *)strm->state;
|
state = (struct inflate_state FAR *)strm->state;
|
||||||
if (check)
|
if (check && state->wrap)
|
||||||
state->wrap |= 4;
|
state->wrap |= 4;
|
||||||
else
|
else
|
||||||
state->wrap &= ~4;
|
state->wrap &= ~4;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* inflate.h -- internal inflate state definition
|
/* inflate.h -- internal inflate state definition
|
||||||
* Copyright (C) 1995-2016 Mark Adler
|
* Copyright (C) 1995-2019 Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -89,7 +89,8 @@ struct inflate_state {
|
||||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip,
|
int wrap; /* bit 0 true for zlib, bit 1 true for gzip,
|
||||||
bit 2 true to validate check value */
|
bit 2 true to validate check value */
|
||||||
int havedict; /* true if dictionary provided */
|
int havedict; /* true if dictionary provided */
|
||||||
int flags; /* gzip header method and flags (0 if zlib) */
|
int flags; /* gzip header method and flags, 0 if zlib, or
|
||||||
|
-1 if raw or no header yet */
|
||||||
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
|
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
|
||||||
unsigned long check; /* protected copy of check value */
|
unsigned long check; /* protected copy of check value */
|
||||||
unsigned long total; /* protected copy of output count */
|
unsigned long total; /* protected copy of output count */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* inftrees.c -- generate Huffman trees for efficient decoding
|
/* inftrees.c -- generate Huffman trees for efficient decoding
|
||||||
* Copyright (C) 1995-2017 Mark Adler
|
* Copyright (C) 1995-2022 Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
#define MAXBITS 15
|
#define MAXBITS 15
|
||||||
|
|
||||||
const char inflate_copyright[] =
|
const char inflate_copyright[] =
|
||||||
" inflate 1.2.11 Copyright 1995-2017 Mark Adler ";
|
" inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
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
|
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};
|
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 */
|
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,
|
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, 77, 202};
|
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
|
||||||
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
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,
|
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,
|
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||||
|
|
|
@ -6,8 +6,6 @@ are compiled as part of `src/gzip/ftgzip.c`.
|
||||||
* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
|
* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
|
||||||
is set.
|
is set.
|
||||||
|
|
||||||
* src/gzip/crc32.c (DO1, DO8): Undefine. Already defined in `adler32.c`.
|
|
||||||
|
|
||||||
* src/gzip/gzguts.h (COPY): Rename to...
|
* src/gzip/gzguts.h (COPY): Rename to...
|
||||||
(COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
|
(COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
|
||||||
which have the same name in `zlib.h`.
|
which have the same name in `zlib.h`.
|
||||||
|
@ -25,10 +23,10 @@ Omit unused function declarations when `Z_FREETYPE` is defined.
|
||||||
* src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
|
* src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
|
||||||
prevent compiler errors.
|
prevent compiler errors.
|
||||||
|
|
||||||
diff --git b/src/gzip/adler32.c a/src/gzip/adler32.c
|
diff --git a/src/gzip/adler32.c b/src/gzip/adler32.c
|
||||||
index be5e8a247..aa032e1dd 100644
|
index be5e8a247..aa032e1dd 100644
|
||||||
--- b/src/gzip/adler32.c
|
--- a/src/gzip/adler32.c
|
||||||
+++ a/src/gzip/adler32.c
|
+++ b/src/gzip/adler32.c
|
||||||
@@ -7,7 +7,9 @@
|
@@ -7,7 +7,9 @@
|
||||||
|
|
||||||
#include "zutil.h"
|
#include "zutil.h"
|
||||||
|
@ -54,23 +52,10 @@ index be5e8a247..aa032e1dd 100644
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+#endif /* !Z_FREETYPE */
|
+#endif /* !Z_FREETYPE */
|
||||||
diff --git b/src/gzip/crc32.c a/src/gzip/crc32.c
|
diff --git a/src/gzip/gzguts.h b/src/gzip/gzguts.h
|
||||||
index 3e3eb1794..ffced1ea7 100644
|
index 57faf3716..4f09a52a7 100644
|
||||||
--- b/src/gzip/crc32.c
|
--- a/src/gzip/gzguts.h
|
||||||
+++ a/src/gzip/crc32.c
|
+++ b/src/gzip/gzguts.h
|
||||||
@@ -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 @@
|
@@ -163,7 +163,7 @@
|
||||||
|
|
||||||
/* values for gz_state how */
|
/* values for gz_state how */
|
||||||
|
@ -80,10 +65,10 @@ index 990a4d251..c81f8f392 100644
|
||||||
#define GZIP 2 /* decompress a gzip stream */
|
#define GZIP 2 /* decompress a gzip stream */
|
||||||
|
|
||||||
/* internal gzip file state data structure */
|
/* internal gzip file state data structure */
|
||||||
diff --git b/src/gzip/inflate.c a/src/gzip/inflate.c
|
diff --git a/src/gzip/inflate.c b/src/gzip/inflate.c
|
||||||
index 3f7ea647b..7387e6f57 100644
|
index 4375557b4..5bf5b815e 100644
|
||||||
--- b/src/gzip/inflate.c
|
--- a/src/gzip/inflate.c
|
||||||
+++ a/src/gzip/inflate.c
|
+++ b/src/gzip/inflate.c
|
||||||
@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
|
@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
|
||||||
#ifdef BUILDFIXED
|
#ifdef BUILDFIXED
|
||||||
void makefixed OF((void));
|
void makefixed OF((void));
|
||||||
|
@ -95,7 +80,7 @@ index 3f7ea647b..7387e6f57 100644
|
||||||
|
|
||||||
local int inflateStateCheck(
|
local int inflateStateCheck(
|
||||||
z_streamp strm)
|
z_streamp strm)
|
||||||
@@ -244,6 +246,8 @@ int ZEXPORT inflateInit_(
|
@@ -245,6 +247,8 @@ int ZEXPORT inflateInit_(
|
||||||
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
|
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,16 +89,16 @@ index 3f7ea647b..7387e6f57 100644
|
||||||
int ZEXPORT inflatePrime(
|
int ZEXPORT inflatePrime(
|
||||||
z_streamp strm,
|
z_streamp strm,
|
||||||
int bits,
|
int bits,
|
||||||
@@ -265,6 +269,8 @@ int ZEXPORT inflatePrime(
|
@@ -266,6 +270,8 @@ int ZEXPORT inflatePrime(
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
+#endif /* Z_FREETYPE */
|
+#endif /* !Z_FREETYPE */
|
||||||
+
|
+
|
||||||
/*
|
/*
|
||||||
Return state with length and distance decoding tables and index sizes set to
|
Return state with length and distance decoding tables and index sizes set to
|
||||||
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
fixed code decoding. Normally this returns fixed tables from inffixed.h.
|
||||||
@@ -1288,6 +1294,8 @@ int ZEXPORT inflateEnd(
|
@@ -1312,6 +1318,8 @@ int ZEXPORT inflateEnd(
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +107,7 @@ index 3f7ea647b..7387e6f57 100644
|
||||||
int ZEXPORT inflateGetDictionary(
|
int ZEXPORT inflateGetDictionary(
|
||||||
z_streamp strm,
|
z_streamp strm,
|
||||||
Bytef *dictionary,
|
Bytef *dictionary,
|
||||||
@@ -1440,6 +1448,8 @@ int ZEXPORT inflateSync(
|
@@ -1471,6 +1479,8 @@ int ZEXPORT inflateSync(
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,16 +116,16 @@ index 3f7ea647b..7387e6f57 100644
|
||||||
/*
|
/*
|
||||||
Returns true if inflate is currently at the end of a block generated by
|
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
|
Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
|
||||||
@@ -1458,6 +1468,8 @@ int ZEXPORT inflateSyncPoint(
|
@@ -1489,6 +1499,8 @@ int ZEXPORT inflateSyncPoint(
|
||||||
return state->mode == STORED && state->bits == 0;
|
return state->mode == STORED && state->bits == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
+#if !Z_FREETYPE
|
+#ifndef Z_FREETYPE
|
||||||
+
|
+
|
||||||
int ZEXPORT inflateCopy(
|
int ZEXPORT inflateCopy(
|
||||||
z_streamp dest,
|
z_streamp dest,
|
||||||
z_streamp source)
|
z_streamp source)
|
||||||
@@ -1505,6 +1517,8 @@ int ZEXPORT inflateCopy(
|
@@ -1536,6 +1548,8 @@ int ZEXPORT inflateCopy(
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +134,7 @@ index 3f7ea647b..7387e6f57 100644
|
||||||
int ZEXPORT inflateUndermine(
|
int ZEXPORT inflateUndermine(
|
||||||
z_streamp strm,
|
z_streamp strm,
|
||||||
int subvert)
|
int subvert)
|
||||||
@@ -1538,6 +1552,8 @@ int ZEXPORT inflateValidate(
|
@@ -1569,6 +1583,8 @@ int ZEXPORT inflateValidate(
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,16 +143,16 @@ index 3f7ea647b..7387e6f57 100644
|
||||||
long ZEXPORT inflateMark(
|
long ZEXPORT inflateMark(
|
||||||
z_streamp strm)
|
z_streamp strm)
|
||||||
{
|
{
|
||||||
@@ -1559,3 +1575,5 @@ unsigned long ZEXPORT inflateCodesUsed(
|
@@ -1590,3 +1606,5 @@ unsigned long ZEXPORT inflateCodesUsed(
|
||||||
state = (struct inflate_state FAR *)strm->state;
|
state = (struct inflate_state FAR *)strm->state;
|
||||||
return (unsigned long)(state->next - state->codes);
|
return (unsigned long)(state->next - state->codes);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+#endif /* !Z_FREETYPE */
|
+#endif /* !Z_FREETYPE */
|
||||||
diff --git b/src/gzip/inflate.h a/src/gzip/inflate.h
|
diff --git a/src/gzip/inflate.h b/src/gzip/inflate.h
|
||||||
index a46cce6b6..92ea758e2 100644
|
index f127b6b1f..c6f5a52e1 100644
|
||||||
--- b/src/gzip/inflate.h
|
--- a/src/gzip/inflate.h
|
||||||
+++ a/src/gzip/inflate.h
|
+++ b/src/gzip/inflate.h
|
||||||
@@ -3,6 +3,9 @@
|
@@ -3,6 +3,9 @@
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
@ -178,16 +163,16 @@ index a46cce6b6..92ea758e2 100644
|
||||||
/* WARNING: this file should *not* be used by applications. It is
|
/* WARNING: this file should *not* be used by applications. It is
|
||||||
part of the implementation of the compression library and is
|
part of the implementation of the compression library and is
|
||||||
subject to change. Applications should only use zlib.h.
|
subject to change. Applications should only use zlib.h.
|
||||||
@@ -123,3 +126,5 @@ struct inflate_state {
|
@@ -124,3 +127,5 @@ struct inflate_state {
|
||||||
int back; /* bits back of last unprocessed length/lit */
|
int back; /* bits back of last unprocessed length/lit */
|
||||||
unsigned was; /* initial length of match */
|
unsigned was; /* initial length of match */
|
||||||
};
|
};
|
||||||
+
|
+
|
||||||
+#endif /* INFLATE_H */
|
+#endif /* INFLATE_H */
|
||||||
diff --git b/src/gzip/inftrees.h a/src/gzip/inftrees.h
|
diff --git a/src/gzip/inftrees.h b/src/gzip/inftrees.h
|
||||||
index baa53a0b1..c94eb78b5 100644
|
index baa53a0b1..c94eb78b5 100644
|
||||||
--- b/src/gzip/inftrees.h
|
--- a/src/gzip/inftrees.h
|
||||||
+++ a/src/gzip/inftrees.h
|
+++ b/src/gzip/inftrees.h
|
||||||
@@ -3,6 +3,9 @@
|
@@ -3,6 +3,9 @@
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
@ -204,10 +189,10 @@ index baa53a0b1..c94eb78b5 100644
|
||||||
unsigned FAR *bits, unsigned short FAR *work));
|
unsigned FAR *bits, unsigned short FAR *work));
|
||||||
+
|
+
|
||||||
+#endif /* INFTREES_H_ */
|
+#endif /* INFTREES_H_ */
|
||||||
diff --git b/src/gzip/zlib.h a/src/gzip/zlib.h
|
diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
|
||||||
index f09cdaf1e..1807c0645 100644
|
index 4a98e38bf..d760140c2 100644
|
||||||
--- b/src/gzip/zlib.h
|
--- a/src/gzip/zlib.h
|
||||||
+++ a/src/gzip/zlib.h
|
+++ b/src/gzip/zlib.h
|
||||||
@@ -31,7 +31,7 @@
|
@@ -31,7 +31,7 @@
|
||||||
#ifndef ZLIB_H
|
#ifndef ZLIB_H
|
||||||
#define ZLIB_H
|
#define ZLIB_H
|
||||||
|
@ -251,7 +236,7 @@ index f09cdaf1e..1807c0645 100644
|
||||||
/*
|
/*
|
||||||
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int level,
|
int level,
|
||||||
@@ -954,6 +958,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
@@ -956,6 +960,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
|
||||||
destination.
|
destination.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -260,7 +245,7 @@ index f09cdaf1e..1807c0645 100644
|
||||||
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
|
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
|
||||||
/*
|
/*
|
||||||
This function is equivalent to inflateEnd followed by inflateInit,
|
This function is equivalent to inflateEnd followed by inflateInit,
|
||||||
@@ -978,6 +984,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
|
@@ -980,6 +986,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
|
||||||
the windowBits parameter is invalid.
|
the windowBits parameter is invalid.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -269,7 +254,7 @@ index f09cdaf1e..1807c0645 100644
|
||||||
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
|
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
|
||||||
int bits,
|
int bits,
|
||||||
int value));
|
int value));
|
||||||
@@ -1067,6 +1075,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
|
@@ -1069,6 +1077,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
|
||||||
stream state was inconsistent.
|
stream state was inconsistent.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -278,7 +263,7 @@ index f09cdaf1e..1807c0645 100644
|
||||||
/*
|
/*
|
||||||
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
|
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
|
||||||
unsigned char FAR *window));
|
unsigned char FAR *window));
|
||||||
@@ -1093,6 +1103,8 @@ typedef unsigned (*in_func) OF((void FAR *,
|
@@ -1095,6 +1105,8 @@ typedef unsigned (*in_func) OF((void FAR *,
|
||||||
z_const unsigned char FAR * FAR *));
|
z_const unsigned char FAR * FAR *));
|
||||||
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
|
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
|
||||||
|
|
||||||
|
@ -287,7 +272,7 @@ index f09cdaf1e..1807c0645 100644
|
||||||
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
|
||||||
in_func in, void FAR *in_desc,
|
in_func in, void FAR *in_desc,
|
||||||
out_func out, void FAR *out_desc));
|
out_func out, void FAR *out_desc));
|
||||||
@@ -1212,6 +1224,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
@@ -1214,6 +1226,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
|
||||||
27-31: 0 (reserved)
|
27-31: 0 (reserved)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -296,16 +281,16 @@ index f09cdaf1e..1807c0645 100644
|
||||||
#ifndef Z_SOLO
|
#ifndef Z_SOLO
|
||||||
|
|
||||||
/* utility functions */
|
/* utility functions */
|
||||||
@@ -1739,6 +1753,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
@@ -1742,6 +1756,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
if (crc != original_crc) error();
|
if (crc != original_crc) error();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
+#ifndef Z_FREETYPE
|
+#ifndef Z_FREETYPE
|
||||||
+
|
+
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
@@ -1805,6 +1821,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
@@ -1822,6 +1838,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
|
||||||
ZLIB_VERSION, (int)sizeof(z_stream))
|
ZLIB_VERSION, (int)sizeof(z_stream))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -325,13 +310,14 @@ index f09cdaf1e..1807c0645 100644
|
||||||
#ifndef Z_SOLO
|
#ifndef Z_SOLO
|
||||||
|
|
||||||
/* gzgetc() macro and its supporting function and exposed data structure. Note
|
/* gzgetc() macro and its supporting function and exposed data structure. Note
|
||||||
@@ -1879,12 +1908,15 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
@@ -1901,13 +1930,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
|
||||||
+#ifndef Z_FREETYPE
|
+#ifndef Z_FREETYPE
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
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 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
@ -341,7 +327,7 @@ index f09cdaf1e..1807c0645 100644
|
||||||
ZEXTERN const char * ZEXPORT zError OF((int));
|
ZEXTERN const char * ZEXPORT zError OF((int));
|
||||||
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
|
||||||
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
|
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
|
||||||
@@ -1904,6 +1936,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
@@ -1927,6 +1959,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
|
||||||
va_list va));
|
va_list va));
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -349,21 +335,11 @@ index f09cdaf1e..1807c0645 100644
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
diff --git b/src/gzip/zutil.h a/src/gzip/zutil.h
|
diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
|
||||||
index b079ea6a8..2d734a835 100644
|
index d9a20ae1b..14f0f1a85 100644
|
||||||
--- b/src/gzip/zutil.h
|
--- a/src/gzip/zutil.h
|
||||||
+++ a/src/gzip/zutil.h
|
+++ b/src/gzip/zutil.h
|
||||||
@@ -30,7 +30,9 @@
|
@@ -188,6 +188,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||||
#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
|
#pragma warn -8066
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -372,7 +348,7 @@ index b079ea6a8..2d734a835 100644
|
||||||
/* provide prototypes for these when building zlib without LFS */
|
/* provide prototypes for these when building zlib without LFS */
|
||||||
#if !defined(_WIN32) && \
|
#if !defined(_WIN32) && \
|
||||||
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||||
@@ -192,6 +196,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
@@ -195,6 +197,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));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -381,7 +357,7 @@ index b079ea6a8..2d734a835 100644
|
||||||
/* common defaults */
|
/* common defaults */
|
||||||
|
|
||||||
#ifndef OS_CODE
|
#ifndef OS_CODE
|
||||||
@@ -223,9 +229,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
@@ -226,9 +230,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||||
# define zmemcmp _fmemcmp
|
# define zmemcmp _fmemcmp
|
||||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
||||||
# else
|
# 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
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.11, January 15th, 2017
|
version 1.2.12, March 11th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -37,11 +37,11 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.11"
|
#define ZLIB_VERSION "1.2.12"
|
||||||
#define ZLIB_VERNUM 0x12b0
|
#define ZLIB_VERNUM 0x12c0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 11
|
#define ZLIB_VER_REVISION 12
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -547,8 +547,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
|
||||||
int strategy));
|
int strategy));
|
||||||
|
|
||||||
This is another version of deflateInit with more compression options. The
|
This is another version of deflateInit with more compression options. The
|
||||||
fields next_in, zalloc, zfree and opaque must be initialized before by the
|
fields zalloc, zfree and opaque must be initialized before by the caller.
|
||||||
caller.
|
|
||||||
|
|
||||||
The method parameter is the compression method. It must be Z_DEFLATED in
|
The method parameter is the compression method. It must be Z_DEFLATED in
|
||||||
this version of the library.
|
this version of the library.
|
||||||
|
@ -716,11 +715,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
|
||||||
used to switch between compression and straight copy of the input data, or
|
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.
|
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
|
If the compression approach (which is a function of the level) or the
|
||||||
strategy is changed, and if any input has been consumed in a previous
|
strategy is changed, and if there have been any deflate() calls since the
|
||||||
deflate() call, then the input available so far is compressed with the old
|
state was initialized or reset, then the input available so far is
|
||||||
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
|
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
|
||||||
for the compression levels 0, 1..3, and 4..9 respectively. The new level
|
There are three approaches for the compression levels 0, 1..3, and 4..9
|
||||||
and strategy will take effect at the next call of deflate().
|
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
|
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
|
not have enough output space to complete, then the parameter change will not
|
||||||
|
@ -869,9 +869,11 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
|
||||||
detection, or add 16 to decode only the gzip format (the zlib format will
|
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
|
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
|
CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
|
||||||
below), inflate() will not automatically decode concatenated gzip streams.
|
below), inflate() will *not* automatically decode concatenated gzip members.
|
||||||
inflate() will return Z_STREAM_END at the end of the gzip stream. The state
|
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 stream.
|
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).
|
||||||
|
|
||||||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
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
|
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
|
||||||
|
@ -1316,14 +1318,14 @@ typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
|
||||||
/*
|
/*
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
|
Open the gzip (.gz) file at path for reading and decompressing, or
|
||||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
|
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
|
||||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
|
but can also include a compression level ("wb9") or a strategy: 'f' for
|
||||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
|
filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
|
||||||
for fixed code compression as in "wb9F". (See the description of
|
'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
|
||||||
deflateInit2 for more information about the strategy parameter.) 'T' will
|
as in "wb9F". (See the description of deflateInit2 for more information
|
||||||
request transparent writing or appending with no compression and not using
|
about the strategy parameter.) 'T' will request transparent writing or
|
||||||
the gzip format.
|
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
|
"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
|
be written be appended to the file. "+" will result in an error, since
|
||||||
|
@ -1353,9 +1355,9 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
|
||||||
|
|
||||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
/*
|
/*
|
||||||
gzdopen associates a gzFile with the file descriptor fd. File descriptors
|
Associate a gzFile with the file descriptor fd. File descriptors are
|
||||||
are obtained from calls like open, dup, creat, pipe or fileno (if the file
|
obtained from calls like open, dup, creat, pipe or fileno (if the file has
|
||||||
has been previously opened with fopen). The mode parameter is as in gzopen.
|
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
|
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
|
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
|
||||||
|
@ -1376,13 +1378,13 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
/*
|
/*
|
||||||
Set the internal buffer size used by this library's functions. The
|
Set the internal buffer size used by this library's functions for file to
|
||||||
default buffer size is 8192 bytes. This function must be called after
|
size. The default buffer size is 8192 bytes. This function must be called
|
||||||
gzopen() or gzdopen(), and before any other calls that read or write the
|
after gzopen() or gzdopen(), and before any other calls that read or write
|
||||||
file. The buffer memory allocation is always deferred to the first read or
|
the file. The buffer memory allocation is always deferred to the first read
|
||||||
write. Three times that size in buffer space is allocated. A larger buffer
|
or write. Three times that size in buffer space is allocated. A larger
|
||||||
size of, for example, 64K or 128K bytes will noticeably increase the speed
|
buffer size of, for example, 64K or 128K bytes will noticeably increase the
|
||||||
of decompression (reading).
|
speed of decompression (reading).
|
||||||
|
|
||||||
The new buffer size also affects the maximum length for gzprintf().
|
The new buffer size also affects the maximum length for gzprintf().
|
||||||
|
|
||||||
|
@ -1392,9 +1394,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
/*
|
/*
|
||||||
Dynamically update the compression level or strategy. See the description
|
Dynamically update the compression level and strategy for file. See the
|
||||||
of deflateInit2 for the meaning of these parameters. Previously provided
|
description of deflateInit2 for the meaning of these parameters. Previously
|
||||||
data is flushed before the parameter change.
|
provided data is flushed before applying the parameter changes.
|
||||||
|
|
||||||
gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
|
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,
|
opened for writing, Z_ERRNO if there is an error writing the flushed data,
|
||||||
|
@ -1403,7 +1405,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
|
||||||
/*
|
/*
|
||||||
Reads the given number of uncompressed bytes from the compressed file. If
|
Read and decompress up to len uncompressed bytes from file into buf. If
|
||||||
the input file is not in gzip format, gzread copies the given number of
|
the input file is not in gzip format, gzread copies the given number of
|
||||||
bytes into the buffer directly from the file.
|
bytes into the buffer directly from the file.
|
||||||
|
|
||||||
|
@ -1434,11 +1436,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,
|
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
||||||
gzFile file));
|
gzFile file));
|
||||||
/*
|
/*
|
||||||
Read up to nitems items of size size from file to buf, otherwise operating
|
Read and decompress up to nitems items of size size from file into buf,
|
||||||
as gzread() does. This duplicates the interface of stdio's fread(), with
|
otherwise operating as gzread() does. This duplicates the interface of
|
||||||
size_t request and return types. If the library defines size_t, then
|
stdio's fread(), with size_t request and return types. If the library
|
||||||
z_size_t is identical to size_t. If not, then z_size_t is an unsigned
|
defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
|
||||||
integer type that can contain a pointer.
|
is an unsigned integer type that can contain a pointer.
|
||||||
|
|
||||||
gzfread() returns the number of full items read of size size, or zero if
|
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
|
the end of the file was reached and a full item could not be read, or if
|
||||||
|
@ -1457,18 +1459,16 @@ 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.
|
file, reseting and retrying on end-of-file, when size is not 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
|
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
|
||||||
voidpc buf, unsigned len));
|
|
||||||
/*
|
/*
|
||||||
Writes the given number of uncompressed bytes into the compressed file.
|
Compress and write the len uncompressed bytes at buf to file. gzwrite
|
||||||
gzwrite returns the number of uncompressed bytes written or 0 in case of
|
returns the number of uncompressed bytes written or 0 in case of error.
|
||||||
error.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
|
||||||
z_size_t nitems, gzFile file));
|
z_size_t nitems, gzFile file));
|
||||||
/*
|
/*
|
||||||
gzfwrite() writes nitems items of size size from buf to file, duplicating
|
Compress and write 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 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,
|
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.
|
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, ...));
|
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
|
||||||
/*
|
/*
|
||||||
Converts, formats, and writes the arguments to the compressed file under
|
Convert, format, compress, and write the arguments (...) to file under
|
||||||
control of the format string, as in fprintf. gzprintf returns the number of
|
control of the string format, as in fprintf. gzprintf returns the number of
|
||||||
uncompressed bytes actually written, or a negative zlib error code in case
|
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
|
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
|
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
|
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
|
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
|
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.
|
because the secure snprintf() or vsnprintf() functions were not available.
|
||||||
This can be determined using zlibCompileFlags().
|
This can be determined using zlibCompileFlags().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
/*
|
/*
|
||||||
Writes the given null-terminated string to the compressed file, excluding
|
Compress and write the given null-terminated string s to file, excluding
|
||||||
the terminating null character.
|
the terminating null character.
|
||||||
|
|
||||||
gzputs returns the number of characters written, or -1 in case of error.
|
gzputs returns the number of characters written, or -1 in case of error.
|
||||||
|
@ -1504,11 +1504,12 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
|
||||||
|
|
||||||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
/*
|
/*
|
||||||
Reads bytes from the compressed file until len-1 characters are read, or a
|
Read and decompress bytes from file into buf, until len-1 characters are
|
||||||
newline character is read and transferred to buf, or an end-of-file
|
read, or until a newline character is read and transferred to buf, or an
|
||||||
condition is encountered. If any characters are read or if len == 1, the
|
end-of-file condition is encountered. If any characters are read or if len
|
||||||
string is terminated with a null character. If no characters are read due
|
is one, the string is terminated with a null character. If no characters
|
||||||
to an end-of-file or len < 1, then the buffer is left untouched.
|
are read due to an end-of-file or len is less than one, then the buffer is
|
||||||
|
left untouched.
|
||||||
|
|
||||||
gzgets returns buf which is a null-terminated string, or it returns NULL
|
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
|
for end-of-file or in case of error. If there was an error, the contents at
|
||||||
|
@ -1517,13 +1518,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
|
||||||
/*
|
/*
|
||||||
Writes c, converted to an unsigned char, into the compressed file. gzputc
|
Compress and write c, converted to an unsigned char, into file. gzputc
|
||||||
returns the value that was written, or -1 in case of error.
|
returns the value that was written, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Reads one byte from the compressed file. gzgetc returns this byte or -1
|
Read and decompress one byte from file. gzgetc returns this byte or -1
|
||||||
in case of end of file or error. This is implemented as a macro for speed.
|
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.
|
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
|
it does not check to see if file is NULL, nor whether the structure file
|
||||||
|
@ -1532,8 +1533,8 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
/*
|
/*
|
||||||
Push one character back onto the stream to be read as the first character
|
Push c back onto the stream for file to be read as the first character on
|
||||||
on the next read. At least one character of push-back is allowed.
|
the next read. At least one character of push-back is always allowed.
|
||||||
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
|
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
|
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
|
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
|
||||||
|
@ -1544,9 +1545,9 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output into the compressed file. The parameter flush
|
Flush all pending output to file. The parameter flush is as in the
|
||||||
is as in the deflate() function. The return value is the zlib error number
|
deflate() function. The return value is the zlib error number (see function
|
||||||
(see function gzerror below). gzflush is only permitted when writing.
|
gzerror below). gzflush is only permitted when writing.
|
||||||
|
|
||||||
If the flush parameter is Z_FINISH, the remaining data is written and the
|
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
|
gzip stream is completed in the output. If gzwrite() is called again, a new
|
||||||
|
@ -1561,8 +1562,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
|
||||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
z_off_t offset, int whence));
|
z_off_t offset, int whence));
|
||||||
|
|
||||||
Sets the starting position for the next gzread or gzwrite on the given
|
Set the starting position to offset relative to whence for the next gzread
|
||||||
compressed file. The offset represents a number of bytes in the
|
or gzwrite on file. The offset represents a number of bytes in the
|
||||||
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
uncompressed data stream. The whence parameter is defined as in lseek(2);
|
||||||
the value SEEK_END is not supported.
|
the value SEEK_END is not supported.
|
||||||
|
|
||||||
|
@ -1579,18 +1580,18 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Rewinds the given file. This function is supported only for reading.
|
Rewind 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));
|
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
|
|
||||||
Returns the starting position for the next gzread or gzwrite on the given
|
Return the starting position for the next gzread or gzwrite on file.
|
||||||
compressed file. This position represents a number of bytes in the
|
This position represents a number of bytes in the uncompressed data stream,
|
||||||
uncompressed data stream, and is zero when starting, even if appending or
|
and is zero when starting, even if appending or reading a gzip stream from
|
||||||
reading a gzip stream from the middle of a file using gzdopen().
|
the middle of a file using gzdopen().
|
||||||
|
|
||||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
|
||||||
*/
|
*/
|
||||||
|
@ -1598,22 +1599,22 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
|
||||||
|
|
||||||
Returns the current offset in the file being read or written. This offset
|
Return the current compressed (actual) read or write offset of file. This
|
||||||
includes the count of bytes that precede the gzip stream, for example when
|
offset includes the count of bytes that precede the gzip stream, for example
|
||||||
appending or when using gzdopen() for reading. When reading, the offset
|
when appending or when using gzdopen() for reading. When reading, the
|
||||||
does not include as yet unused buffered input. This information can be used
|
offset does not include as yet unused buffered input. This information can
|
||||||
for a progress indicator. On error, gzoffset() returns -1.
|
be used for a progress indicator. On error, gzoffset() returns -1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if the end-of-file indicator has been set while reading,
|
Return true (1) if the end-of-file indicator for file has been set while
|
||||||
false (0) otherwise. Note that the end-of-file indicator is set only if the
|
reading, false (0) otherwise. Note that the end-of-file indicator is set
|
||||||
read tried to go past the end of the input, but came up short. Therefore,
|
only if the read tried to go past the end of the input, but came up short.
|
||||||
just like feof(), gzeof() may return false even if there is no more data to
|
Therefore, just like feof(), gzeof() may return false even if there is no
|
||||||
read, in the event that the last read request was for the exact number of
|
more data to read, in the event that the last read request was for the exact
|
||||||
bytes remaining in the input file. This will happen if the input file size
|
number of bytes remaining in the input file. This will happen if the input
|
||||||
is an exact multiple of the buffer size.
|
file size is an exact multiple of the buffer size.
|
||||||
|
|
||||||
If gzeof() returns true, then the read functions will return no more data,
|
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
|
unless the end-of-file indicator is reset by gzclearerr() and the input file
|
||||||
|
@ -1622,7 +1623,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Returns true (1) if file is being copied directly while reading, or false
|
Return true (1) if file is being copied directly while reading, or false
|
||||||
(0) if file is a gzip stream being decompressed.
|
(0) if file is a gzip stream being decompressed.
|
||||||
|
|
||||||
If the input file is empty, gzdirect() will return true, since the input
|
If the input file is empty, gzdirect() will return true, since the input
|
||||||
|
@ -1643,8 +1644,8 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Flushes all pending output if necessary, closes the compressed file and
|
Flush all pending output for file, if necessary, close file and
|
||||||
deallocates the (de)compression state. Note that once file is closed, you
|
deallocate the (de)compression state. Note that once file is closed, you
|
||||||
cannot call gzerror with file, since its structures have been deallocated.
|
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
|
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.
|
must not be called more than once on the same allocation.
|
||||||
|
@ -1668,10 +1669,10 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
|
||||||
|
|
||||||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
/*
|
/*
|
||||||
Returns the error message for the last error which occurred on the given
|
Return the error message for the last error which occurred on file.
|
||||||
compressed file. errnum is set to zlib error number. If an error occurred
|
errnum is set to zlib error number. If an error occurred in the file system
|
||||||
in the file system and not in the compression library, errnum is set to
|
and not in the compression library, errnum is set to Z_ERRNO and the
|
||||||
Z_ERRNO and the application may consult errno to get the exact error code.
|
application may consult errno to get the exact error code.
|
||||||
|
|
||||||
The application must not modify the returned string. Future calls to
|
The application must not modify the returned string. Future calls to
|
||||||
this function may invalidate the previously returned string. If file is
|
this function may invalidate the previously returned string. If file is
|
||||||
|
@ -1684,7 +1685,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
|
||||||
|
|
||||||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
/*
|
/*
|
||||||
Clears the error and end-of-file flags for file. This is analogous to the
|
Clear 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
|
clearerr() function in stdio. This is useful for continuing to read a gzip
|
||||||
file that is being written concurrently.
|
file that is being written concurrently.
|
||||||
*/
|
*/
|
||||||
|
@ -1702,8 +1703,9 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
|
||||||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
|
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
|
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
|
||||||
return the updated checksum. If buf is Z_NULL, this function returns the
|
return the updated checksum. An Adler-32 value is in the range of a 32-bit
|
||||||
required initial value for the checksum.
|
unsigned integer. 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
|
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
|
||||||
much faster.
|
much faster.
|
||||||
|
@ -1736,12 +1738,13 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
|
||||||
negative, the result has no meaning or utility.
|
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
|
Update a running CRC-32 with the bytes buf[0..len-1] and return the
|
||||||
updated CRC-32. If buf is Z_NULL, this function returns the required
|
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
|
||||||
initial value for the crc. Pre- and post-conditioning (one's complement) is
|
If buf is Z_NULL, this function returns the required initial value for the
|
||||||
performed within this function so it shouldn't be done by the application.
|
crc. Pre- and post-conditioning (one's complement) is performed within this
|
||||||
|
function so it shouldn't be done by the application.
|
||||||
|
|
||||||
Usage example:
|
Usage example:
|
||||||
|
|
||||||
|
@ -1755,7 +1758,7 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
|
||||||
|
|
||||||
#ifndef Z_FREETYPE
|
#ifndef Z_FREETYPE
|
||||||
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf,
|
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
|
||||||
z_size_t len));
|
z_size_t len));
|
||||||
/*
|
/*
|
||||||
Same as crc32(), but with a size_t length.
|
Same as crc32(), but with a size_t length.
|
||||||
|
@ -1771,6 +1774,20 @@ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
|
||||||
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 :) */
|
/* various hacks, don't look :) */
|
||||||
|
|
||||||
|
@ -1871,6 +1888,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
|
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_combine64 OF((uLong, uLong, z_off64_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
|
||||||
|
@ -1881,6 +1899,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define z_gzoffset z_gzoffset64
|
# define z_gzoffset z_gzoffset64
|
||||||
# define z_adler32_combine z_adler32_combine64
|
# define z_adler32_combine z_adler32_combine64
|
||||||
# define z_crc32_combine z_crc32_combine64
|
# define z_crc32_combine z_crc32_combine64
|
||||||
|
# define z_crc32_combine_gen z_crc32_combine_gen64
|
||||||
# else
|
# else
|
||||||
# define gzopen gzopen64
|
# define gzopen gzopen64
|
||||||
# define gzseek gzseek64
|
# define gzseek gzseek64
|
||||||
|
@ -1888,6 +1907,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
# define gzoffset gzoffset64
|
# define gzoffset gzoffset64
|
||||||
# define adler32_combine adler32_combine64
|
# define adler32_combine adler32_combine64
|
||||||
# define crc32_combine crc32_combine64
|
# define crc32_combine crc32_combine64
|
||||||
|
# define crc32_combine_gen crc32_combine_gen64
|
||||||
# endif
|
# endif
|
||||||
# ifndef Z_LARGE64
|
# ifndef Z_LARGE64
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
||||||
|
@ -1896,6 +1916,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
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_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
|
||||||
|
@ -1904,6 +1925,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
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 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Z_SOLO */
|
#else /* Z_SOLO */
|
||||||
|
@ -1911,6 +1933,7 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
|
||||||
#ifndef Z_FREETYPE
|
#ifndef Z_FREETYPE
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
|
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 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !Z_SOLO */
|
#endif /* !Z_SOLO */
|
||||||
|
@ -1925,7 +1948,7 @@ ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
|
||||||
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
|
||||||
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
|
||||||
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
|
||||||
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
|
#if defined(_WIN32) && !defined(Z_SOLO)
|
||||||
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
|
||||||
const char *mode));
|
const char *mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -136,8 +136,8 @@ const char * ZEXPORT zError(
|
||||||
return ERR_MSG(err);
|
return ERR_MSG(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32_WCE)
|
#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
|
||||||
/* The Microsoft C Run-Time Library for Windows CE doesn't have
|
/* The older Microsoft C Run-Time Library for Windows CE doesn't have
|
||||||
* errno. We define it as a global variable to simplify porting.
|
* errno. We define it as a global variable to simplify porting.
|
||||||
* Its value is always 0 and should not be used.
|
* Its value is always 0 and should not be used.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* zutil.h -- internal interface and configuration of the compression library
|
/* zutil.h -- internal interface and configuration of the compression library
|
||||||
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
|
* Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -29,12 +29,6 @@
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Z_SOLO
|
|
||||||
# ifndef Z_FREETYPE
|
|
||||||
typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef local
|
#ifndef local
|
||||||
# define local static
|
# define local static
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,6 +42,17 @@ typedef unsigned short ush;
|
||||||
typedef ush FAR ushf;
|
typedef ush FAR ushf;
|
||||||
typedef unsigned long ulg;
|
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 */
|
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||||
/* (size given to avoid silly warnings with Visual C++) */
|
/* (size given to avoid silly warnings with Visual C++) */
|
||||||
|
|
||||||
|
@ -172,10 +177,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
|
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
|
||||||
# if defined(_WIN32_WCE)
|
# if defined(_WIN32_WCE)
|
||||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||||
# ifndef _PTRDIFF_T_DEFINED
|
|
||||||
typedef int ptrdiff_t;
|
|
||||||
# define _PTRDIFF_T_DEFINED
|
|
||||||
# endif
|
|
||||||
# else
|
# else
|
||||||
# define fdopen(fd,type) _fdopen(fd,type)
|
# define fdopen(fd,type) _fdopen(fd,type)
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -344,7 +344,7 @@
|
||||||
{
|
{
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
FT_Memory memory;
|
FT_Memory memory;
|
||||||
FT_LZWFile zip;
|
FT_LZWFile zip = NULL;
|
||||||
|
|
||||||
|
|
||||||
if ( !stream || !source )
|
if ( !stream || !source )
|
||||||
|
|
|
@ -143,7 +143,7 @@
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( FT_QRENEW_ARRAY( state->stack, old_size, new_size ) )
|
if ( FT_QREALLOC( state->stack, old_size, new_size ) )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* if relocating to heap */
|
/* if relocating to heap */
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
|
|
||||||
pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 );
|
pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 );
|
||||||
if ( pfrface->height < pfrface->ascender - pfrface->descender )
|
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 )
|
if ( phy_font->num_strikes > 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -248,7 +248,7 @@
|
||||||
else
|
else
|
||||||
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
|
#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 );
|
bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar );
|
||||||
|
|
|
@ -535,11 +535,11 @@
|
||||||
|
|
||||||
if ( r & 1 )
|
if ( r & 1 )
|
||||||
{
|
{
|
||||||
*buffer = (FT_Byte)(*buffer + c);
|
*buffer = (FT_Byte)( *buffer + c );
|
||||||
buffer++;
|
buffer++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*buffer = (FT_Byte)(c << 4);
|
*buffer = (FT_Byte)( c << 4 );
|
||||||
|
|
||||||
r++;
|
r++;
|
||||||
}
|
}
|
||||||
|
@ -572,8 +572,8 @@
|
||||||
if ( p >= limit )
|
if ( p >= limit )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( n > (FT_UInt)(limit - p) )
|
if ( n > (FT_UInt)( limit - p ) )
|
||||||
n = (FT_UInt)(limit - p);
|
n = (FT_UInt)( limit - p );
|
||||||
|
|
||||||
for ( r = 0; r < n; r++ )
|
for ( r = 0; r < n; r++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
*
|
*
|
||||||
* psfixed.h
|
* 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.
|
* Copyright 2007-2013 Adobe Systems Incorporated.
|
||||||
*
|
*
|
||||||
|
@ -43,10 +43,10 @@
|
||||||
FT_BEGIN_HEADER
|
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
|
#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 )
|
#define CF2_FIXED_MAX ( (CF2_Fixed)0x7FFFFFFFL )
|
||||||
|
|
|
@ -72,7 +72,7 @@ FT_BEGIN_HEADER
|
||||||
} CF2_PathOp;
|
} CF2_PathOp;
|
||||||
|
|
||||||
|
|
||||||
/* a matrix of fixed point values */
|
/* a matrix of fixed-point values */
|
||||||
typedef struct CF2_Matrix_
|
typedef struct CF2_Matrix_
|
||||||
{
|
{
|
||||||
CF2_F16Dot16 a;
|
CF2_F16Dot16 a;
|
||||||
|
|
|
@ -1900,7 +1900,8 @@
|
||||||
/* WeightVector */
|
/* WeightVector */
|
||||||
{
|
{
|
||||||
FT_UInt idx;
|
FT_UInt idx;
|
||||||
PS_Blend blend = decoder->blend;
|
PS_Blend blend = decoder->blend;
|
||||||
|
FT_UInt len_buildchar = decoder->len_buildchar;
|
||||||
|
|
||||||
|
|
||||||
if ( arg_cnt != 1 || !blend )
|
if ( arg_cnt != 1 || !blend )
|
||||||
|
@ -1908,14 +1909,15 @@
|
||||||
|
|
||||||
idx = (FT_UInt)cf2_stack_popInt( opStack );
|
idx = (FT_UInt)cf2_stack_popInt( opStack );
|
||||||
|
|
||||||
if ( idx + blend->num_designs >
|
if ( len_buildchar < blend->num_designs ||
|
||||||
decoder->len_buildchar )
|
len_buildchar - blend->num_designs < idx )
|
||||||
goto Unexpected_OtherSubr;
|
goto Unexpected_OtherSubr;
|
||||||
|
|
||||||
ft_memcpy( &decoder->buildchar[idx],
|
if ( decoder->buildchar && blend->weight_vector )
|
||||||
blend->weight_vector,
|
ft_memcpy( &decoder->buildchar[idx],
|
||||||
blend->num_designs *
|
blend->weight_vector,
|
||||||
sizeof ( blend->weight_vector[0] ) );
|
blend->num_designs *
|
||||||
|
sizeof ( blend->weight_vector[0] ) );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -99,45 +99,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
shift_elements( PS_Table table,
|
|
||||||
FT_Byte* old_base )
|
|
||||||
{
|
|
||||||
FT_PtrDist delta = table->block - old_base;
|
|
||||||
FT_Byte** offset = table->elements;
|
|
||||||
FT_Byte** limit = offset + table->max_elems;
|
|
||||||
|
|
||||||
|
|
||||||
for ( ; offset < limit; offset++ )
|
|
||||||
{
|
|
||||||
if ( offset[0] )
|
|
||||||
offset[0] += delta;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
reallocate_t1_table( PS_Table table,
|
ps_table_realloc( PS_Table table,
|
||||||
FT_Offset new_size )
|
FT_Offset new_size )
|
||||||
{
|
{
|
||||||
FT_Memory memory = table->memory;
|
FT_Memory memory = table->memory;
|
||||||
FT_Byte* old_base = table->block;
|
FT_Byte* old_base = table->block;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
/* allocate new base block */
|
/* (re)allocate the base block */
|
||||||
if ( FT_ALLOC( table->block, new_size ) )
|
if ( FT_REALLOC( table->block, table->capacity, new_size ) )
|
||||||
{
|
|
||||||
table->block = old_base;
|
|
||||||
return error;
|
return error;
|
||||||
}
|
|
||||||
|
|
||||||
/* copy elements and shift offsets */
|
/* rebase offsets if necessary */
|
||||||
if ( old_base )
|
if ( old_base && table->block != old_base )
|
||||||
{
|
{
|
||||||
FT_MEM_COPY( table->block, old_base, table->capacity );
|
FT_Byte** offset = table->elements;
|
||||||
shift_elements( table, old_base );
|
FT_Byte** limit = offset + table->max_elems;
|
||||||
FT_FREE( old_base );
|
|
||||||
|
|
||||||
|
for ( ; offset < limit; offset++ )
|
||||||
|
{
|
||||||
|
if ( *offset )
|
||||||
|
*offset = table->block + ( *offset - old_base );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table->capacity = new_size;
|
table->capacity = new_size;
|
||||||
|
@ -204,7 +190,7 @@
|
||||||
new_size = FT_PAD_CEIL( new_size, 1024 );
|
new_size = FT_PAD_CEIL( new_size, 1024 );
|
||||||
}
|
}
|
||||||
|
|
||||||
error = reallocate_t1_table( table, new_size );
|
error = ps_table_realloc( table, new_size );
|
||||||
if ( error )
|
if ( error )
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -234,32 +220,12 @@
|
||||||
* @InOut:
|
* @InOut:
|
||||||
* table ::
|
* table ::
|
||||||
* The target table.
|
* The target table.
|
||||||
*
|
|
||||||
* @Note:
|
|
||||||
* This function does NOT release the heap's memory block. It is up
|
|
||||||
* to the caller to clean it, or reference it in its own structures.
|
|
||||||
*/
|
*/
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
ps_table_done( PS_Table table )
|
ps_table_done( PS_Table table )
|
||||||
{
|
{
|
||||||
FT_Memory memory = table->memory;
|
/* no problem if shrinking fails */
|
||||||
FT_Error error;
|
ps_table_realloc( table, table->cursor );
|
||||||
FT_Byte* old_base = table->block;
|
|
||||||
|
|
||||||
|
|
||||||
/* should never fail, because rec.cursor <= rec.size */
|
|
||||||
if ( !old_base )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( FT_QALLOC( table->block, table->cursor ) )
|
|
||||||
return;
|
|
||||||
FT_MEM_COPY( table->block, old_base, table->cursor );
|
|
||||||
shift_elements( table, old_base );
|
|
||||||
|
|
||||||
table->capacity = table->cursor;
|
|
||||||
FT_FREE( old_base );
|
|
||||||
|
|
||||||
FT_UNUSED( error );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -552,7 +518,7 @@
|
||||||
|
|
||||||
if ( *cur == '<' ) /* <...> */
|
if ( *cur == '<' ) /* <...> */
|
||||||
{
|
{
|
||||||
if ( cur + 1 < limit && *(cur + 1) == '<' ) /* << */
|
if ( cur + 1 < limit && *( cur + 1 ) == '<' ) /* << */
|
||||||
{
|
{
|
||||||
cur++;
|
cur++;
|
||||||
cur++;
|
cur++;
|
||||||
|
@ -1098,7 +1064,6 @@
|
||||||
{
|
{
|
||||||
FT_Byte* q = (FT_Byte*)objects[idx] + field->offset;
|
FT_Byte* q = (FT_Byte*)objects[idx] + field->offset;
|
||||||
FT_Long val;
|
FT_Long val;
|
||||||
FT_String* string = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
skip_spaces( &cur, limit );
|
skip_spaces( &cur, limit );
|
||||||
|
@ -1148,8 +1113,9 @@
|
||||||
case T1_FIELD_TYPE_STRING:
|
case T1_FIELD_TYPE_STRING:
|
||||||
case T1_FIELD_TYPE_KEY:
|
case T1_FIELD_TYPE_KEY:
|
||||||
{
|
{
|
||||||
FT_Memory memory = parser->memory;
|
FT_Memory memory = parser->memory;
|
||||||
FT_UInt len = (FT_UInt)( limit - cur );
|
FT_UInt len = (FT_UInt)( limit - cur );
|
||||||
|
FT_String* string = NULL;
|
||||||
|
|
||||||
|
|
||||||
if ( cur >= limit )
|
if ( cur >= limit )
|
||||||
|
@ -1190,7 +1156,6 @@
|
||||||
FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n",
|
FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n",
|
||||||
field->ident ));
|
field->ident ));
|
||||||
FT_FREE( *(FT_String**)q );
|
FT_FREE( *(FT_String**)q );
|
||||||
*(FT_String**)q = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( FT_QALLOC( string, len + 1 ) )
|
if ( FT_QALLOC( string, len + 1 ) )
|
||||||
|
|
|
@ -49,8 +49,8 @@ FT_BEGIN_HEADER
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
CF2_Fixed r; /* 16.16 fixed point */
|
CF2_Fixed r; /* 16.16 fixed-point */
|
||||||
CF2_Frac f; /* 2.30 fixed point (for font matrix) */
|
CF2_Frac f; /* 2.30 fixed-point (for font matrix) */
|
||||||
CF2_Int i;
|
CF2_Int i;
|
||||||
} u;
|
} u;
|
||||||
|
|
||||||
|
|
|
@ -1548,8 +1548,9 @@
|
||||||
/* the accepted shift for strong points in fractional pixels */
|
/* the accepted shift for strong points in fractional pixels */
|
||||||
#define PSH_STRONG_THRESHOLD 32
|
#define PSH_STRONG_THRESHOLD 32
|
||||||
|
|
||||||
/* the maximum shift value in font units */
|
/* the maximum shift value in font units tuned to distinguish */
|
||||||
#define PSH_STRONG_THRESHOLD_MAXIMUM 30
|
/* between stems and serifs in URW+ font collection */
|
||||||
|
#define PSH_STRONG_THRESHOLD_MAXIMUM 12
|
||||||
|
|
||||||
|
|
||||||
/* find strong points in a glyph */
|
/* find strong points in a glyph */
|
||||||
|
|
|
@ -646,7 +646,7 @@
|
||||||
T1_Private* priv,
|
T1_Private* priv,
|
||||||
PSH_Globals *aglobals )
|
PSH_Globals *aglobals )
|
||||||
{
|
{
|
||||||
PSH_Globals globals;
|
PSH_Globals globals = NULL;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -63,16 +63,14 @@
|
||||||
{
|
{
|
||||||
FT_UInt old_max = table->max_hints;
|
FT_UInt old_max = table->max_hints;
|
||||||
FT_UInt new_max = count;
|
FT_UInt new_max = count;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
if ( new_max > old_max )
|
/* try to grow the table */
|
||||||
{
|
new_max = FT_PAD_CEIL( new_max, 8 );
|
||||||
/* try to grow the table */
|
if ( !FT_QRENEW_ARRAY( table->hints, old_max, new_max ) )
|
||||||
new_max = FT_PAD_CEIL( new_max, 8 );
|
table->max_hints = new_max;
|
||||||
if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) )
|
|
||||||
table->max_hints = new_max;
|
|
||||||
}
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,17 +88,14 @@
|
||||||
count = table->num_hints;
|
count = table->num_hints;
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
if ( count >= table->max_hints )
|
if ( count > table->max_hints )
|
||||||
{
|
{
|
||||||
error = ps_hint_table_ensure( table, count, memory );
|
error = ps_hint_table_ensure( table, count, memory );
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
hint = table->hints + count - 1;
|
hint = table->hints + count - 1; /* initialized upstream */
|
||||||
hint->pos = 0;
|
|
||||||
hint->len = 0;
|
|
||||||
hint->flags = 0;
|
|
||||||
|
|
||||||
table->num_hints = count;
|
table->num_hints = count;
|
||||||
|
|
||||||
|
@ -136,14 +131,15 @@
|
||||||
FT_UInt count,
|
FT_UInt count,
|
||||||
FT_Memory memory )
|
FT_Memory memory )
|
||||||
{
|
{
|
||||||
FT_UInt old_max = ( mask->max_bits + 7 ) >> 3;
|
FT_UInt old_max = mask->max_bits >> 3;
|
||||||
FT_UInt new_max = ( count + 7 ) >> 3;
|
FT_UInt new_max = ( count + 7 ) >> 3;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
|
|
||||||
if ( new_max > old_max )
|
if ( new_max > old_max )
|
||||||
{
|
{
|
||||||
new_max = FT_PAD_CEIL( new_max, 8 );
|
new_max = FT_PAD_CEIL( new_max, 8 );
|
||||||
|
/* added bytes are zeroed here */
|
||||||
if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) )
|
if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) )
|
||||||
mask->max_bits = new_max * 8;
|
mask->max_bits = new_max * 8;
|
||||||
}
|
}
|
||||||
|
@ -154,31 +150,15 @@
|
||||||
/* test a bit value in a given mask */
|
/* test a bit value in a given mask */
|
||||||
static FT_Int
|
static FT_Int
|
||||||
ps_mask_test_bit( PS_Mask mask,
|
ps_mask_test_bit( PS_Mask mask,
|
||||||
FT_Int idx )
|
FT_UInt idx )
|
||||||
{
|
{
|
||||||
if ( (FT_UInt)idx >= mask->num_bits )
|
if ( idx >= mask->num_bits )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) );
|
return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* clear a given bit */
|
|
||||||
static void
|
|
||||||
ps_mask_clear_bit( PS_Mask mask,
|
|
||||||
FT_UInt idx )
|
|
||||||
{
|
|
||||||
FT_Byte* p;
|
|
||||||
|
|
||||||
|
|
||||||
if ( idx >= mask->num_bits )
|
|
||||||
return;
|
|
||||||
|
|
||||||
p = mask->bytes + ( idx >> 3 );
|
|
||||||
p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* set a given bit, possibly grow the mask */
|
/* set a given bit, possibly grow the mask */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
ps_mask_set_bit( PS_Mask mask,
|
ps_mask_set_bit( PS_Mask mask,
|
||||||
|
@ -269,6 +249,10 @@
|
||||||
mask = table->masks + count - 1;
|
mask = table->masks + count - 1;
|
||||||
mask->num_bits = 0;
|
mask->num_bits = 0;
|
||||||
mask->end_point = 0;
|
mask->end_point = 0;
|
||||||
|
/* reused mask must be cleared */
|
||||||
|
if ( mask->max_bits )
|
||||||
|
FT_MEM_ZERO( mask->bytes, mask->max_bits >> 3 );
|
||||||
|
|
||||||
table->num_masks = count;
|
table->num_masks = count;
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
@ -426,7 +410,7 @@
|
||||||
PS_Mask mask2 = table->masks + index2;
|
PS_Mask mask2 = table->masks + index2;
|
||||||
FT_UInt count1 = mask1->num_bits;
|
FT_UInt count1 = mask1->num_bits;
|
||||||
FT_UInt count2 = mask2->num_bits;
|
FT_UInt count2 = mask2->num_bits;
|
||||||
FT_Int delta;
|
FT_UInt delta;
|
||||||
|
|
||||||
|
|
||||||
if ( count2 > 0 )
|
if ( count2 > 0 )
|
||||||
|
@ -437,15 +421,14 @@
|
||||||
|
|
||||||
|
|
||||||
/* if "count2" is greater than "count1", we need to grow the */
|
/* if "count2" is greater than "count1", we need to grow the */
|
||||||
/* first bitset, and clear the highest bits */
|
/* first bitset */
|
||||||
if ( count2 > count1 )
|
if ( count2 > count1 )
|
||||||
{
|
{
|
||||||
error = ps_mask_ensure( mask1, count2, memory );
|
error = ps_mask_ensure( mask1, count2, memory );
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
for ( pos = count1; pos < count2; pos++ )
|
mask1->num_bits = count2;
|
||||||
ps_mask_clear_bit( mask1, pos );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* merge (unite) the bitsets */
|
/* merge (unite) the bitsets */
|
||||||
|
@ -467,7 +450,7 @@
|
||||||
mask2->end_point = 0;
|
mask2->end_point = 0;
|
||||||
|
|
||||||
/* number of masks to move */
|
/* number of masks to move */
|
||||||
delta = (FT_Int)( table->num_masks - 1 - index2 );
|
delta = table->num_masks - 1 - index2;
|
||||||
if ( delta > 0 )
|
if ( delta > 0 )
|
||||||
{
|
{
|
||||||
/* move to end of table for reuse */
|
/* move to end of table for reuse */
|
||||||
|
@ -476,7 +459,7 @@
|
||||||
|
|
||||||
ft_memmove( mask2,
|
ft_memmove( mask2,
|
||||||
mask2 + 1,
|
mask2 + 1,
|
||||||
(FT_UInt)delta * sizeof ( PS_MaskRec ) );
|
delta * sizeof ( PS_MaskRec ) );
|
||||||
|
|
||||||
mask2[delta] = dummy;
|
mask2[delta] = dummy;
|
||||||
}
|
}
|
||||||
|
@ -647,7 +630,7 @@
|
||||||
FT_Int pos,
|
FT_Int pos,
|
||||||
FT_Int len,
|
FT_Int len,
|
||||||
FT_Memory memory,
|
FT_Memory memory,
|
||||||
FT_Int *aindex )
|
FT_UInt *aindex )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_UInt flags = 0;
|
FT_UInt flags = 0;
|
||||||
|
@ -665,9 +648,6 @@
|
||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( aindex )
|
|
||||||
*aindex = -1;
|
|
||||||
|
|
||||||
/* now, lookup stem in the current hints table */
|
/* now, lookup stem in the current hints table */
|
||||||
{
|
{
|
||||||
PS_Mask mask;
|
PS_Mask mask;
|
||||||
|
@ -704,7 +684,7 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
if ( aindex )
|
if ( aindex )
|
||||||
*aindex = (FT_Int)idx;
|
*aindex = idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
@ -715,9 +695,9 @@
|
||||||
/* add a "hstem3/vstem3" counter to our dimension table */
|
/* add a "hstem3/vstem3" counter to our dimension table */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
ps_dimension_add_counter( PS_Dimension dim,
|
ps_dimension_add_counter( PS_Dimension dim,
|
||||||
FT_Int hint1,
|
FT_UInt hint1,
|
||||||
FT_Int hint2,
|
FT_UInt hint2,
|
||||||
FT_Int hint3,
|
FT_UInt hint3,
|
||||||
FT_Memory memory )
|
FT_Memory memory )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
@ -744,26 +724,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now, set the bits for our hints in the counter mask */
|
/* now, set the bits for our hints in the counter mask */
|
||||||
if ( hint1 >= 0 )
|
error = ps_mask_set_bit( counter, hint1, memory );
|
||||||
{
|
if ( error )
|
||||||
error = ps_mask_set_bit( counter, (FT_UInt)hint1, memory );
|
goto Exit;
|
||||||
if ( error )
|
|
||||||
goto Exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( hint2 >= 0 )
|
error = ps_mask_set_bit( counter, hint2, memory );
|
||||||
{
|
if ( error )
|
||||||
error = ps_mask_set_bit( counter, (FT_UInt)hint2, memory );
|
goto Exit;
|
||||||
if ( error )
|
|
||||||
goto Exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( hint3 >= 0 )
|
error = ps_mask_set_bit( counter, hint3, memory );
|
||||||
{
|
if ( error )
|
||||||
error = ps_mask_set_bit( counter, (FT_UInt)hint3, memory );
|
goto Exit;
|
||||||
if ( error )
|
|
||||||
goto Exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
return error;
|
return error;
|
||||||
|
@ -892,7 +863,7 @@
|
||||||
PS_Dimension dim;
|
PS_Dimension dim;
|
||||||
FT_Memory memory = hints->memory;
|
FT_Memory memory = hints->memory;
|
||||||
FT_Int count;
|
FT_Int count;
|
||||||
FT_Int idx[3];
|
FT_UInt idx[3];
|
||||||
|
|
||||||
|
|
||||||
/* limit "dimension" to 0..1 */
|
/* limit "dimension" to 0..1 */
|
||||||
|
|
|
@ -2269,7 +2269,7 @@
|
||||||
/* This is due to the fact that, in the vast majority of cases, */
|
/* This is due to the fact that, in the vast majority of cases, */
|
||||||
/* the span length in bytes is relatively small. */
|
/* the span length in bytes is relatively small. */
|
||||||
while ( --c2 > 0 )
|
while ( --c2 > 0 )
|
||||||
*(++target) = 0xFF;
|
*( ++target ) = 0xFF;
|
||||||
|
|
||||||
target[1] |= f2;
|
target[1] |= f2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1096,7 +1096,7 @@
|
||||||
FT_Int i, j;
|
FT_Int i, j;
|
||||||
|
|
||||||
FT_SDFFormat* t_buffer;
|
FT_SDFFormat* t_buffer;
|
||||||
FT_16D16 spread;
|
FT_16D16 sp_sq, spread;
|
||||||
|
|
||||||
|
|
||||||
if ( !worker || !target )
|
if ( !worker || !target )
|
||||||
|
@ -1116,11 +1116,13 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_SQUARED_DISTANCES
|
|
||||||
spread = FT_INT_16D16( worker->params.spread *
|
|
||||||
worker->params.spread );
|
|
||||||
#else
|
|
||||||
spread = FT_INT_16D16( worker->params.spread );
|
spread = FT_INT_16D16( worker->params.spread );
|
||||||
|
|
||||||
|
#if USE_SQUARED_DISTANCES
|
||||||
|
sp_sq = FT_INT_16D16( worker->params.spread *
|
||||||
|
worker->params.spread );
|
||||||
|
#else
|
||||||
|
sp_sq = FT_INT_16D16( worker->params.spread );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for ( j = 0; j < r; j++ )
|
for ( j = 0; j < r; j++ )
|
||||||
|
@ -1136,8 +1138,8 @@
|
||||||
index = j * w + i;
|
index = j * w + i;
|
||||||
dist = worker->distance_map[index].dist;
|
dist = worker->distance_map[index].dist;
|
||||||
|
|
||||||
if ( dist < 0 || dist > spread )
|
if ( dist < 0 || dist > sp_sq )
|
||||||
dist = spread;
|
dist = sp_sq;
|
||||||
|
|
||||||
#if USE_SQUARED_DISTANCES
|
#if USE_SQUARED_DISTANCES
|
||||||
dist = square_root( dist );
|
dist = square_root( dist );
|
||||||
|
|
|
@ -738,6 +738,18 @@
|
||||||
|
|
||||||
contour = shape->contours;
|
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 ( ( contour->last_pos.x == control_1->x &&
|
||||||
|
contour->last_pos.y == control_1->y ) ||
|
||||||
|
( control_1->x == to->x &&
|
||||||
|
control_1->y == to->y ) )
|
||||||
|
{
|
||||||
|
sdf_line_to( to, user );
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
FT_CALL( sdf_edge_new( memory, &edge ) );
|
FT_CALL( sdf_edge_new( memory, &edge ) );
|
||||||
|
|
||||||
edge->edge_type = SDF_EDGE_CONIC;
|
edge->edge_type = SDF_EDGE_CONIC;
|
||||||
|
@ -764,9 +776,9 @@
|
||||||
const FT_26D6_Vec* to,
|
const FT_26D6_Vec* to,
|
||||||
void* user )
|
void* user )
|
||||||
{
|
{
|
||||||
SDF_Shape* shape = ( SDF_Shape* )user;
|
SDF_Shape* shape = ( SDF_Shape* )user;
|
||||||
SDF_Edge* edge = NULL;
|
SDF_Edge* edge = NULL;
|
||||||
SDF_Contour* contour = NULL;
|
SDF_Contour* contour = NULL;
|
||||||
|
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_Memory memory = shape->memory;
|
FT_Memory memory = shape->memory;
|
||||||
|
@ -1065,7 +1077,7 @@
|
||||||
static FT_Error
|
static FT_Error
|
||||||
split_sdf_conic( FT_Memory memory,
|
split_sdf_conic( FT_Memory memory,
|
||||||
FT_26D6_Vec* control_points,
|
FT_26D6_Vec* control_points,
|
||||||
FT_Int max_splits,
|
FT_UInt max_splits,
|
||||||
SDF_Edge** out )
|
SDF_Edge** out )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
@ -1134,26 +1146,41 @@
|
||||||
static FT_Error
|
static FT_Error
|
||||||
split_sdf_cubic( FT_Memory memory,
|
split_sdf_cubic( FT_Memory memory,
|
||||||
FT_26D6_Vec* control_points,
|
FT_26D6_Vec* control_points,
|
||||||
FT_Int max_splits,
|
FT_UInt max_splits,
|
||||||
SDF_Edge** out )
|
SDF_Edge** out )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_26D6_Vec cpos[7];
|
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 );
|
error = FT_THROW( Invalid_Argument );
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* split the conic */
|
/* split the cubic */
|
||||||
cpos[0] = control_points[0];
|
cpos[0] = control_points[0];
|
||||||
cpos[1] = control_points[1];
|
cpos[1] = control_points[1];
|
||||||
cpos[2] = control_points[2];
|
cpos[2] = control_points[2];
|
||||||
cpos[3] = control_points[3];
|
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 ( 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( 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 )
|
||||||
|
{
|
||||||
|
split_cubic( cpos );
|
||||||
|
goto Append;
|
||||||
|
}
|
||||||
|
|
||||||
split_cubic( cpos );
|
split_cubic( cpos );
|
||||||
|
|
||||||
/* If max number of splits is done */
|
/* If max number of splits is done */
|
||||||
|
@ -1250,13 +1277,32 @@
|
||||||
/* Subdivide the curve and add it to the list. */
|
/* Subdivide the curve and add it to the list. */
|
||||||
{
|
{
|
||||||
FT_26D6_Vec ctrls[3];
|
FT_26D6_Vec ctrls[3];
|
||||||
|
FT_26D6 dx, dy;
|
||||||
|
FT_UInt num_splits;
|
||||||
|
|
||||||
|
|
||||||
ctrls[0] = edge->start_pos;
|
ctrls[0] = edge->start_pos;
|
||||||
ctrls[1] = edge->control_a;
|
ctrls[1] = edge->control_a;
|
||||||
ctrls[2] = edge->end_pos;
|
ctrls[2] = edge->end_pos;
|
||||||
|
|
||||||
error = split_sdf_conic( memory, ctrls, 32, &new_edges );
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
error = split_sdf_conic( memory, ctrls, num_splits, &new_edges );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1893,7 +1939,7 @@
|
||||||
/* now factor is 16.16 */
|
/* now factor is 16.16 */
|
||||||
factor = FT_DivFix( factor, sq_line_length );
|
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 ) )
|
if ( factor > FT_INT_16D16( 1 ) )
|
||||||
factor = FT_INT_16D16( 1 );
|
factor = FT_INT_16D16( 1 );
|
||||||
if ( factor < 0 )
|
if ( factor < 0 )
|
||||||
|
@ -2968,7 +3014,7 @@
|
||||||
diff = current_dist.distance - min_dist.distance;
|
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 );
|
min_dist = resolve_corner( min_dist, current_dist );
|
||||||
else if ( diff < 0 )
|
else if ( diff < 0 )
|
||||||
min_dist = current_dist;
|
min_dist = current_dist;
|
||||||
|
@ -3118,7 +3164,7 @@
|
||||||
if ( min_dist.distance > sp_sq )
|
if ( min_dist.distance > sp_sq )
|
||||||
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 )
|
if ( USE_SQUARED_DISTANCES )
|
||||||
min_dist.distance = square_root( min_dist.distance );
|
min_dist.distance = square_root( min_dist.distance );
|
||||||
|
|
||||||
|
@ -3242,7 +3288,7 @@
|
||||||
buffer = (FT_SDFFormat*)bitmap->buffer;
|
buffer = (FT_SDFFormat*)bitmap->buffer;
|
||||||
|
|
||||||
if ( USE_SQUARED_DISTANCES )
|
if ( USE_SQUARED_DISTANCES )
|
||||||
sp_sq = fixed_spread * fixed_spread;
|
sp_sq = FT_INT_16D16( (FT_Int)( spread * spread ) );
|
||||||
else
|
else
|
||||||
sp_sq = fixed_spread;
|
sp_sq = fixed_spread;
|
||||||
|
|
||||||
|
@ -3286,6 +3332,7 @@
|
||||||
FT_26D6_Vec grid_point = zero_vector;
|
FT_26D6_Vec grid_point = zero_vector;
|
||||||
SDF_Signed_Distance dist = max_sdf;
|
SDF_Signed_Distance dist = max_sdf;
|
||||||
FT_UInt index = 0;
|
FT_UInt index = 0;
|
||||||
|
FT_16D16 diff = 0;
|
||||||
|
|
||||||
|
|
||||||
if ( x < 0 || x >= width )
|
if ( x < 0 || x >= width )
|
||||||
|
@ -3313,7 +3360,7 @@
|
||||||
if ( dist.distance > sp_sq )
|
if ( dist.distance > sp_sq )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* square_root the values and fit in a 6.10 fixed-point */
|
/* take the square root of the distance if required */
|
||||||
if ( USE_SQUARED_DISTANCES )
|
if ( USE_SQUARED_DISTANCES )
|
||||||
dist.distance = square_root( dist.distance );
|
dist.distance = square_root( dist.distance );
|
||||||
|
|
||||||
|
@ -3325,11 +3372,15 @@
|
||||||
/* check whether the pixel is set or not */
|
/* check whether the pixel is set or not */
|
||||||
if ( dists[index].sign == 0 )
|
if ( dists[index].sign == 0 )
|
||||||
dists[index] = dist;
|
dists[index] = dist;
|
||||||
else if ( dists[index].distance > dist.distance )
|
else
|
||||||
dists[index] = dist;
|
{
|
||||||
else if ( FT_ABS( dists[index].distance - dist.distance )
|
diff = FT_ABS( dists[index].distance - dist.distance );
|
||||||
< CORNER_CHECK_EPSILON )
|
|
||||||
dists[index] = resolve_corner( dists[index], dist );
|
if ( diff <= CORNER_CHECK_EPSILON )
|
||||||
|
dists[index] = resolve_corner( dists[index], dist );
|
||||||
|
else if ( dists[index].distance > dist.distance )
|
||||||
|
dists[index] = dist;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
*
|
*
|
||||||
* https://github.com/chmike/fpsqrt
|
* 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 )
|
FT_LOCAL_DEF( FT_16D16 )
|
||||||
square_root( FT_16D16 val )
|
square_root( FT_16D16 val )
|
||||||
|
@ -72,8 +72,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert 16.16 fixed point values to the desired output format.
|
* Convert 16.16 fixed-point values to the desired output format.
|
||||||
* In this case we reduce 16.16 fixed point values to normalized
|
* In this case we reduce 16.16 fixed-point values to normalized
|
||||||
* 8-bit values.
|
* 8-bit values.
|
||||||
*
|
*
|
||||||
* The `max_value` in the parameter is the maximum value in the
|
* The `max_value` in the parameter is the maximum value in the
|
||||||
|
|
|
@ -48,6 +48,8 @@ FT_BEGIN_HEADER
|
||||||
#define MIN_SPREAD 2
|
#define MIN_SPREAD 2
|
||||||
/* maximum spread supported by the renderer */
|
/* maximum spread supported by the renderer */
|
||||||
#define MAX_SPREAD 32
|
#define MAX_SPREAD 32
|
||||||
|
/* pixel size in 26.6 */
|
||||||
|
#define ONE_PIXEL ( 1 << 6 )
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue