sync with OpenBSD -current
This commit is contained in:
parent
acb2a22980
commit
455fea1627
229 changed files with 25075 additions and 13981 deletions
8
3RDPARTY
8
3RDPARTY
|
@ -1,21 +1,21 @@
|
||||||
|
|
||||||
# $OpenBSD: 3RDPARTY,v 1.429 2024/07/19 19:00:02 matthieu Exp $
|
# $OpenBSD: 3RDPARTY,v 1.432 2024/08/04 18:22:48 matthieu Exp $
|
||||||
#
|
#
|
||||||
Package: Freetype
|
Package: Freetype
|
||||||
Version: 2.13.0
|
Version: 2.13.2
|
||||||
Current Vers: 2.13.2
|
Current Vers: 2.13.2
|
||||||
Maintainer: Freetype.org
|
Maintainer: Freetype.org
|
||||||
Archive Site: http://download.savannah.gnu.org/releases/freetype/
|
Archive Site: http://download.savannah.gnu.org/releases/freetype/
|
||||||
|
|
||||||
Package: xterm
|
Package: xterm
|
||||||
Version: 378
|
Version: 393
|
||||||
Current Vers: 393
|
Current Vers: 393
|
||||||
Maintainer: Thomas E. Dickey
|
Maintainer: Thomas E. Dickey
|
||||||
Archive Site: http://invisible-island.net/xterm/xterm.html
|
Archive Site: http://invisible-island.net/xterm/xterm.html
|
||||||
|
|
||||||
Package: Mesa
|
Package: Mesa
|
||||||
Version 23.3.6
|
Version 23.3.6
|
||||||
Current Vers: 24.1.4
|
Current Vers: 24.1.5
|
||||||
Maintainer: Brian Paul
|
Maintainer: Brian Paul
|
||||||
Archive Site: https://archive.mesa3d.org/
|
Archive Site: https://archive.mesa3d.org/
|
||||||
|
|
||||||
|
|
10
MODULES
10
MODULES
|
@ -1,4 +1,4 @@
|
||||||
# $OpenBSD: MODULES,v 1.525 2024/07/19 15:12:09 matthieu Exp $
|
# $OpenBSD: MODULES,v 1.527 2024/08/04 18:22:48 matthieu Exp $
|
||||||
#
|
#
|
||||||
# X.Org maintained modules
|
# X.Org maintained modules
|
||||||
#
|
#
|
||||||
|
@ -22,7 +22,7 @@ app/setxkbmap 1.3.4
|
||||||
app/smproxy 1.0.7
|
app/smproxy 1.0.7
|
||||||
app/twm 1.0.12
|
app/twm 1.0.12
|
||||||
app/viewres 1.0.7
|
app/viewres 1.0.7
|
||||||
app/x11perf 1.6.2
|
app/x11perf 1.7.0 needs-update
|
||||||
app/xauth 1.1.3
|
app/xauth 1.1.3
|
||||||
app/xbacklight 1.2.3
|
app/xbacklight 1.2.3
|
||||||
app/xbiff 1.0.5
|
app/xbiff 1.0.5
|
||||||
|
@ -149,7 +149,7 @@ font/xfree86-type1 1.0.5
|
||||||
|
|
||||||
lib/libICE 1.1.1
|
lib/libICE 1.1.1
|
||||||
lib/libSM 1.2.4
|
lib/libSM 1.2.4
|
||||||
lib/libX11 1.8.9
|
lib/libX11 1.8.10
|
||||||
lib/libXScrnSaver 1.2.4
|
lib/libXScrnSaver 1.2.4
|
||||||
lib/libXau 1.0.11
|
lib/libXau 1.0.11
|
||||||
lib/libXaw 1.0.16
|
lib/libXaw 1.0.16
|
||||||
|
@ -159,7 +159,7 @@ lib/libXdamage 1.1.6
|
||||||
lib/libXdmcp 1.1.5
|
lib/libXdmcp 1.1.5
|
||||||
lib/libXext 1.3.6
|
lib/libXext 1.3.6
|
||||||
lib/libXfixes 6.0.1
|
lib/libXfixes 6.0.1
|
||||||
lib/libXfont2 2.0.6
|
lib/libXfont2 2.0.7 needs-update
|
||||||
lib/libXft 2.3.8
|
lib/libXft 2.3.8
|
||||||
lib/libXi 1.8.1
|
lib/libXi 1.8.1
|
||||||
lib/libXinerama 1.1.5
|
lib/libXinerama 1.1.5
|
||||||
|
@ -170,7 +170,7 @@ lib/libXrandr 1.5.4
|
||||||
lib/libXrender 0.9.11
|
lib/libXrender 0.9.11
|
||||||
lib/libXres 1.2.2
|
lib/libXres 1.2.2
|
||||||
lib/libXt 1.3.0
|
lib/libXt 1.3.0
|
||||||
lib/libXtst 1.2.4
|
lib/libXtst 1.2.5
|
||||||
lib/libXv 1.0.12
|
lib/libXv 1.0.12
|
||||||
lib/libXvMC 1.0.14
|
lib/libXvMC 1.0.14
|
||||||
lib/libXxf86dga 1.1.6
|
lib/libXxf86dga 1.1.6
|
||||||
|
|
|
@ -218,7 +218,7 @@
|
||||||
./usr/X11R6/lib/libX11-xcb.so.2.0
|
./usr/X11R6/lib/libX11-xcb.so.2.0
|
||||||
./usr/X11R6/lib/libX11.a
|
./usr/X11R6/lib/libX11.a
|
||||||
./usr/X11R6/lib/libX11.la
|
./usr/X11R6/lib/libX11.la
|
||||||
./usr/X11R6/lib/libX11.so.18.1
|
./usr/X11R6/lib/libX11.so.18.2
|
||||||
./usr/X11R6/lib/libXRes.a
|
./usr/X11R6/lib/libXRes.a
|
||||||
./usr/X11R6/lib/libXRes.la
|
./usr/X11R6/lib/libXRes.la
|
||||||
./usr/X11R6/lib/libXRes.so.5.1
|
./usr/X11R6/lib/libXRes.so.5.1
|
||||||
|
@ -309,7 +309,7 @@
|
||||||
./usr/X11R6/lib/libfontenc.la
|
./usr/X11R6/lib/libfontenc.la
|
||||||
./usr/X11R6/lib/libfontenc.so.4.0
|
./usr/X11R6/lib/libfontenc.so.4.0
|
||||||
./usr/X11R6/lib/libfreetype.a
|
./usr/X11R6/lib/libfreetype.a
|
||||||
./usr/X11R6/lib/libfreetype.so.30.3
|
./usr/X11R6/lib/libfreetype.so.30.4
|
||||||
./usr/X11R6/lib/libpciaccess.a
|
./usr/X11R6/lib/libpciaccess.a
|
||||||
./usr/X11R6/lib/libpciaccess.so.2.1
|
./usr/X11R6/lib/libpciaccess.so.2.1
|
||||||
./usr/X11R6/lib/libpixman-1.a
|
./usr/X11R6/lib/libpixman-1.a
|
||||||
|
|
|
@ -164,7 +164,7 @@ project(freetype C)
|
||||||
|
|
||||||
set(VERSION_MAJOR "2")
|
set(VERSION_MAJOR "2")
|
||||||
set(VERSION_MINOR "13")
|
set(VERSION_MINOR "13")
|
||||||
set(VERSION_PATCH "0")
|
set(VERSION_PATCH "2")
|
||||||
|
|
||||||
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
|
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
|
||||||
set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'")
|
set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'")
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,11 @@
|
||||||
# $OpenBSD: Makefile,v 1.58 2023/05/21 09:25:29 matthieu Exp $
|
# $OpenBSD: Makefile,v 1.59 2024/08/04 17:17:23 matthieu Exp $
|
||||||
|
|
||||||
.include <bsd.own.mk>
|
.include <bsd.own.mk>
|
||||||
|
|
||||||
FREETYPESRC= ${.CURDIR}/src
|
FREETYPESRC= ${.CURDIR}/src
|
||||||
|
|
||||||
# Get it from builds/unix/configure.ac
|
# Get it from builds/unix/configure.ac
|
||||||
FT_VERSION_INFO= 25.0.19
|
FT_VERSION_INFO= 26.1.20
|
||||||
|
|
||||||
INSTALL_PROGRAM = ${INSTALL} ${INSTALL_COPY} -m 755 -o $(BINOWN) -g $(BINGRP)
|
INSTALL_PROGRAM = ${INSTALL} ${INSTALL_COPY} -m 755 -o $(BINOWN) -g $(BINGRP)
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ SRCS= ftbase.c ftbbox.c ftbdf.c ftbitmap.c ftdebug.c ftcache.c \
|
||||||
raster.c sdf.c sfnt.c smooth.c svg.c truetype.c type1.c type1cid.c \
|
raster.c sdf.c sfnt.c smooth.c svg.c truetype.c type1.c type1cid.c \
|
||||||
type42.c winfnt.c
|
type42.c winfnt.c
|
||||||
|
|
||||||
CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}/builds/unix -I${.CURDIR}/src/lzw -DFT2_BUILD_LIBRARY -DFT_CONFIG_CONFIG_H='<ftconfig.h>'
|
CPPFLAGS+= -I${.CURDIR}/include -I${.CURDIR}/builds/unix -I${.CURDIR}/src/lzw -DFT2_BUILD_LIBRARY=1 -DFT_CONFIG_CONFIG_H='<ftconfig.h>'
|
||||||
|
|
||||||
.if ${COMPILER_VERSION} != "gcc3"
|
.if ${COMPILER_VERSION} != "gcc3"
|
||||||
CFLAGS+= -fvisibility=hidden -std=gnu99 -Wall -Wdeclaration-after-statement -Werror=implicit-function-declaration -Werror=undef -Wextra -Winit-self -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wno-attributes -Wno-long-long -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wpacked -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wstrict-prototypes -Wwrite-strings
|
CFLAGS+= -fvisibility=hidden -std=gnu99 -Wall -Wdeclaration-after-statement -Werror=implicit-function-declaration -Werror=undef -Wextra -Winit-self -Winline -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wnested-externs -Wno-attributes -Wno-long-long -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wpacked -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-aliasing=2 -Wstrict-prototypes -Wwrite-strings
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FreeType 2.13.0
|
FreeType 2.13.2
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Homepage: https://www.freetype.org
|
Homepage: https://www.freetype.org
|
||||||
|
@ -32,9 +32,9 @@ sites. Go to
|
||||||
|
|
||||||
and download one of the following files.
|
and download one of the following files.
|
||||||
|
|
||||||
freetype-doc-2.13.0.tar.xz
|
freetype-doc-2.13.2.tar.xz
|
||||||
freetype-doc-2.13.0.tar.gz
|
freetype-doc-2.13.2.tar.gz
|
||||||
ftdoc2130.zip
|
ftdoc2132.zip
|
||||||
|
|
||||||
To view the documentation online, go to
|
To view the documentation online, go to
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
FT_Get_Color_Glyph_Layer;
|
FT_Get_Color_Glyph_Layer;
|
||||||
FT_Get_Color_Glyph_Paint;
|
FT_Get_Color_Glyph_Paint;
|
||||||
FT_Get_Colorline_Stops;
|
FT_Get_Colorline_Stops;
|
||||||
|
FT_Get_Default_Named_Instance;
|
||||||
FT_Get_FSType_Flags;
|
FT_Get_FSType_Flags;
|
||||||
FT_Get_First_Char;
|
FT_Get_First_Char;
|
||||||
FT_Get_Font_Format;
|
FT_Get_Font_Format;
|
||||||
|
@ -104,6 +105,7 @@
|
||||||
FT_Get_Var_Design_Coordinates;
|
FT_Get_Var_Design_Coordinates;
|
||||||
FT_Get_WinFNT_Header;
|
FT_Get_WinFNT_Header;
|
||||||
FT_Get_X11_Font_Format;
|
FT_Get_X11_Font_Format;
|
||||||
|
FT_GlyphSlot_AdjustWeight;
|
||||||
FT_GlyphSlot_Embolden;
|
FT_GlyphSlot_Embolden;
|
||||||
FT_GlyphSlot_Oblique;
|
FT_GlyphSlot_Oblique;
|
||||||
FT_GlyphSlot_Own_Bitmap;
|
FT_GlyphSlot_Own_Bitmap;
|
||||||
|
@ -220,6 +222,8 @@
|
||||||
FT_Vector_Unit;
|
FT_Vector_Unit;
|
||||||
TT_New_Context;
|
TT_New_Context;
|
||||||
TT_RunIns;
|
TT_RunIns;
|
||||||
|
_init;
|
||||||
|
_fini;
|
||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
};
|
};
|
||||||
|
|
|
@ -299,7 +299,7 @@ refdoc:
|
||||||
$(PUBLIC_DIR)/config/*.h \
|
$(PUBLIC_DIR)/config/*.h \
|
||||||
$(PUBLIC_DIR)/cache/*.h
|
$(PUBLIC_DIR)/cache/*.h
|
||||||
@echo Building static site...
|
@echo Building static site...
|
||||||
cd $(DOC_DIR) && mkdocs build
|
cd $(DOC_DIR) && $(PYTHON) -m mkdocs build
|
||||||
@echo Done.
|
@echo Done.
|
||||||
|
|
||||||
# Variables for running `refdoc' with Python's `virtualenv'. The
|
# Variables for running `refdoc' with Python's `virtualenv'. The
|
||||||
|
|
|
@ -200,14 +200,6 @@ environment by Metrowerks. GCC for MPW and Symantec
|
||||||
behaviours are not tested at all. Building ftdemos
|
behaviours are not tested at all. Building ftdemos
|
||||||
for classic MacOS and working test is required.
|
for classic MacOS and working test is required.
|
||||||
|
|
||||||
4-3. Porting Jam onto MPW
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
FreeType uses Jam (and FT-Jam) for unified cross-
|
|
||||||
platform building tool. At present, Jam is not ported
|
|
||||||
to MPW. To update classic MacOS support easily,
|
|
||||||
building by Jam is expected on MPW.
|
|
||||||
|
|
||||||
|
|
||||||
APPENDIX I
|
APPENDIX I
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -97,8 +97,12 @@ def generate_ftmodule(lists):
|
||||||
|
|
||||||
for module in lists["AUX_MODULES"]:
|
for module in lists["AUX_MODULES"]:
|
||||||
if module in ("psaux", "psnames", "otvalid", "gxvalid"):
|
if module in ("psaux", "psnames", "otvalid", "gxvalid"):
|
||||||
|
name = {
|
||||||
|
"gxvalid": "gxv",
|
||||||
|
"otvalid": "otv",
|
||||||
|
}.get(module, module)
|
||||||
result += (
|
result += (
|
||||||
"FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module
|
"FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % name
|
||||||
)
|
)
|
||||||
|
|
||||||
result += "/* EOF */\n"
|
result += "/* EOF */\n"
|
||||||
|
|
|
@ -198,27 +198,22 @@ modules:
|
||||||
include $(TOP_DIR)/builds/modules.mk
|
include $(TOP_DIR)/builds/modules.mk
|
||||||
|
|
||||||
|
|
||||||
# get FreeType version string, using a
|
# get FreeType version string using built-in string functions
|
||||||
# poor man's `sed' emulation with make's built-in string functions
|
|
||||||
#
|
#
|
||||||
|
hash := \#
|
||||||
|
|
||||||
work := $(strip $(shell $(CAT) \
|
work := $(strip $(shell $(CAT) \
|
||||||
$(subst /,$(SEP),$(TOP_DIR)/include/freetype/freetype.h)))
|
$(subst /,$(SEP),$(TOP_DIR)/include/freetype/freetype.h)))
|
||||||
work := $(subst |,x,$(work))
|
|
||||||
work := $(subst $(space),|,$(work))
|
|
||||||
work := $(subst \#define|FREETYPE_MAJOR|,$(space),$(work))
|
|
||||||
work := $(word 2,$(work))
|
|
||||||
major := $(subst |,$(space),$(work))
|
|
||||||
major := $(firstword $(major))
|
|
||||||
|
|
||||||
work := $(subst \#define|FREETYPE_MINOR|,$(space),$(work))
|
work := $(subst $(hash)define$(space)FREETYPE_MAJOR$(space),MAjOR=,$(work))
|
||||||
work := $(word 2,$(work))
|
work := $(subst $(hash)define$(space)FREETYPE_MINOR$(space),MInOR=,$(work))
|
||||||
minor := $(subst |,$(space),$(work))
|
work := $(subst $(hash)define$(space)FREETYPE_PATCH$(space),PAtCH=,$(work))
|
||||||
minor := $(firstword $(minor))
|
|
||||||
|
|
||||||
work := $(subst \#define|FREETYPE_PATCH|,$(space),$(work))
|
major := $(subst MAjOR=,,$(filter MAjOR=%,$(work)))
|
||||||
work := $(word 2,$(work))
|
minor := $(subst MInOR=,,$(filter MInOR=%,$(work)))
|
||||||
patch := $(subst |,$(space),$(work))
|
patch := $(subst PAtCH=,,$(filter PAtCH=%,$(work)))
|
||||||
patch := $(firstword $(patch))
|
|
||||||
|
work :=
|
||||||
|
|
||||||
# ifneq ($(findstring x0x,x$(patch)x),)
|
# ifneq ($(findstring x0x,x$(patch)x),)
|
||||||
# version := $(major).$(minor)
|
# version := $(major).$(minor)
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
# indicate that you have read the license and understand and accept it
|
# indicate that you have read the license and understand and accept it
|
||||||
# fully.
|
# fully.
|
||||||
|
|
||||||
AC_INIT([FreeType], [2.13], [freetype@nongnu.org], [freetype])
|
AC_INIT([FreeType], [2.13.2], [freetype@nongnu.org], [freetype])
|
||||||
AC_CONFIG_SRCDIR([ftconfig.h.in])
|
AC_CONFIG_SRCDIR([ftconfig.h.in])
|
||||||
|
|
||||||
|
|
||||||
# Don't forget to update `docs/VERSIONS.TXT'!
|
# Don't forget to update `docs/VERSIONS.TXT'!
|
||||||
|
|
||||||
version_info='25:0:19'
|
version_info='26:1:20'
|
||||||
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])
|
||||||
|
@ -966,14 +966,14 @@ esac
|
||||||
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
|
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
|
||||||
|
|
||||||
# Check for Python and docwriter
|
# Check for Python and docwriter
|
||||||
|
PYTHON_MIN_VERSION=3.5
|
||||||
have_py3=no
|
have_py3=no
|
||||||
have_docwriter=no
|
have_docwriter=no
|
||||||
PIP=pip
|
PIP=pip
|
||||||
|
|
||||||
AC_CHECK_PROGS([PYTHON], [python3 python], [missing])
|
AC_CHECK_PROGS([PYTHON], [python3 python], [missing])
|
||||||
if test "x$PYTHON" != "xmissing"; then
|
if test "x$PYTHON" != "xmissing"; then
|
||||||
AX_PROG_PYTHON_VERSION([3.5], [have_py3=yes], [])
|
AX_PROG_PYTHON_VERSION([$PYTHON_MIN_VERSION], [have_py3=yes], [])
|
||||||
|
|
||||||
if test "x$have_py3" = "xyes"; then
|
if test "x$have_py3" = "xyes"; then
|
||||||
PIP="$PYTHON -m $PIP"
|
PIP="$PYTHON -m $PIP"
|
||||||
|
@ -1162,7 +1162,7 @@ if test $have_docwriter = no; then
|
||||||
`make refdoc' will fail since pip package `docwriter' is not installed.
|
`make refdoc' will fail since pip package `docwriter' is not installed.
|
||||||
To install, run `$PIP install docwriter', or to use a Python
|
To install, run `$PIP install docwriter', or to use a Python
|
||||||
virtual environment, run `make refdoc-venv' (requires pip package
|
virtual environment, run `make refdoc-venv' (requires pip package
|
||||||
`virtualenv'). These operations require Python >= 3.5.
|
`virtualenv'). These operations require Python >= $PYTHON_MIN_VERSION.
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -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='25:0:19'
|
version_info='26:1:20'
|
||||||
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])
|
||||||
|
@ -966,14 +966,14 @@ esac
|
||||||
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
|
AX_PTHREAD([have_pthread=yes], [have_pthread=no])
|
||||||
|
|
||||||
# Check for Python and docwriter
|
# Check for Python and docwriter
|
||||||
|
PYTHON_MIN_VERSION=3.5
|
||||||
have_py3=no
|
have_py3=no
|
||||||
have_docwriter=no
|
have_docwriter=no
|
||||||
PIP=pip
|
PIP=pip
|
||||||
|
|
||||||
AC_CHECK_PROGS([PYTHON], [python3 python], [missing])
|
AC_CHECK_PROGS([PYTHON], [python3 python], [missing])
|
||||||
if test "x$PYTHON" != "xmissing"; then
|
if test "x$PYTHON" != "xmissing"; then
|
||||||
AX_PROG_PYTHON_VERSION([3.5], [have_py3=yes], [])
|
AX_PROG_PYTHON_VERSION([$PYTHON_MIN_VERSION], [have_py3=yes], [])
|
||||||
|
|
||||||
if test "x$have_py3" = "xyes"; then
|
if test "x$have_py3" = "xyes"; then
|
||||||
PIP="$PYTHON -m $PIP"
|
PIP="$PYTHON -m $PIP"
|
||||||
|
@ -1162,7 +1162,7 @@ if test $have_docwriter = no; then
|
||||||
`make refdoc' will fail since pip package `docwriter' is not installed.
|
`make refdoc' will fail since pip package `docwriter' is not installed.
|
||||||
To install, run `$PIP install docwriter', or to use a Python
|
To install, run `$PIP install docwriter', or to use a Python
|
||||||
virtual environment, run `make refdoc-venv' (requires pip package
|
virtual environment, run `make refdoc-venv' (requires pip package
|
||||||
`virtualenv'). These operations require Python >= 3.5.
|
`virtualenv'). These operations require Python >= $PYTHON_MIN_VERSION.
|
||||||
])
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
2
lib/freetype/builds/vms/apinames_vms.bash
Normal file
2
lib/freetype/builds/vms/apinames_vms.bash
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
src/tools/apinames -wV include/freetype/*.h > freetype_vms0.opt
|
||||||
|
mv freetype_vms0.opt freetype_vms.opt
|
|
@ -1,28 +0,0 @@
|
||||||
!
|
|
||||||
! This is a simple driver file with information used by make.com to
|
|
||||||
! check if external libraries (like t1lib and freetype) are available on
|
|
||||||
! the system.
|
|
||||||
!
|
|
||||||
! Layout of the file:
|
|
||||||
!
|
|
||||||
! - Lines starting with ! are treated as comments
|
|
||||||
! - Elements in a data line are separated by # signs
|
|
||||||
! - The elements need to be listed in the following order
|
|
||||||
! 1.) Name of the Library
|
|
||||||
! 2.) Location where the object library can be found
|
|
||||||
! 3.) Location where the include files for the library can be found
|
|
||||||
! 4.) Include file used to verify library location
|
|
||||||
! 5.) CPP define to pass to the build to indicate availability of
|
|
||||||
! the library
|
|
||||||
!
|
|
||||||
! Example: The following lines show how definitions
|
|
||||||
! might look like. They are site specific and the locations of the
|
|
||||||
! library and include files need almost certainly to be changed.
|
|
||||||
!
|
|
||||||
! Location: All of the libaries can be found at the following addresses
|
|
||||||
!
|
|
||||||
! ZLIB: http://www.decus.de:8080/www/vms/sw/zlib.htmlx
|
|
||||||
!
|
|
||||||
BZ2LIB # sys$library:libbz2.olb # decc$user_include: # bzlib.h # FT_CONFIG_OPTION_SYSTEM_ZLIB
|
|
||||||
PNGLIB # sys$library:libpng.olb # sys$library: # png.h # FT_CONFIG_OPTION_SYSTEM_ZLIB
|
|
||||||
ZLIB # sys$library:libz.olb # sys$library: # zlib.h # FT_CONFIG_OPTION_SYSTEM_ZLIB
|
|
|
@ -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.13.0 sources:</p>
|
It compiles the following libraries from the FreeType 2.13.2 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.13.0 sources:</p>
|
It compiles the following libraries from the FreeType 2.13.2 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
||||||
|
@ -195,7 +195,7 @@
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
||||||
|
@ -248,7 +248,7 @@
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
||||||
|
@ -274,7 +274,7 @@
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||||
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Disabled</InlineFunctionExpansion>
|
||||||
|
@ -328,7 +328,7 @@
|
||||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
@ -356,7 +356,7 @@
|
||||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -409,7 +409,7 @@
|
||||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
@ -435,7 +435,7 @@
|
||||||
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
<DisableLanguageExtensions>true</DisableLanguageExtensions>
|
||||||
<WarningLevel>Level4</WarningLevel>
|
<WarningLevel>Level4</WarningLevel>
|
||||||
<CompileAs>Default</CompileAs>
|
<CompileAs>Default</CompileAs>
|
||||||
<DisableSpecificWarnings>4001</DisableSpecificWarnings>
|
<DisableSpecificWarnings>4001;4267</DisableSpecificWarnings>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|
|
@ -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.13.0 sources:</p>
|
from the FreeType 2.13.2 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
|
||||||
|
|
|
@ -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.13.0 sources:</p>
|
It compiles the following libraries from the FreeType 2.13.2 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.13.0 sources:</p>
|
It compiles the following libraries from the FreeType 2.13.2 sources:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -661,36 +661,12 @@ FT_BEGIN_HEADER
|
||||||
* not) instructions in a certain way so that all TrueType fonts look like
|
* not) instructions in a certain way so that all TrueType fonts look like
|
||||||
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
|
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
|
||||||
* technical overview on what this means. See `ttinterp.h` for more
|
* technical overview on what this means. See `ttinterp.h` for more
|
||||||
* details on the LEAN option.
|
* details on this option.
|
||||||
*
|
*
|
||||||
* There are three possible values.
|
* The new default mode focuses on applying a minimal set of rules to all
|
||||||
*
|
* fonts indiscriminately so that modern and web fonts render well while
|
||||||
* Value 1:
|
* legacy fonts render okay. The corresponding interpreter version is v40.
|
||||||
* This value is associated with the 'Infinality' moniker, contributed by
|
* The so-called Infinality mode (v38) is no longer available in FreeType.
|
||||||
* an individual nicknamed Infinality with the goal of making TrueType
|
|
||||||
* fonts render better than on Windows. A high amount of configurability
|
|
||||||
* and flexibility, down to rules for single glyphs in fonts, but also
|
|
||||||
* very slow. Its experimental and slow nature and the original
|
|
||||||
* developer losing interest meant that this option was never enabled in
|
|
||||||
* default builds.
|
|
||||||
*
|
|
||||||
* The corresponding interpreter version is v38.
|
|
||||||
*
|
|
||||||
* Value 2:
|
|
||||||
* The new default mode for the TrueType driver. The Infinality code
|
|
||||||
* base was stripped to the bare minimum and all configurability removed
|
|
||||||
* in the name of speed and simplicity. The configurability was mainly
|
|
||||||
* aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'.
|
|
||||||
* Legacy fonts are fonts that modify vertical stems to achieve clean
|
|
||||||
* black-and-white bitmaps. The new mode focuses on applying a minimal
|
|
||||||
* set of rules to all fonts indiscriminately so that modern and web
|
|
||||||
* fonts render well while legacy fonts render okay.
|
|
||||||
*
|
|
||||||
* The corresponding interpreter version is v40.
|
|
||||||
*
|
|
||||||
* Value 3:
|
|
||||||
* Compile both, making both v38 and v40 available (the latter is the
|
|
||||||
* default).
|
|
||||||
*
|
*
|
||||||
* By undefining these, you get rendering behavior like on Windows without
|
* By undefining these, you get rendering behavior like on Windows without
|
||||||
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
|
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
|
||||||
|
@ -705,9 +681,7 @@ FT_BEGIN_HEADER
|
||||||
* [1]
|
* [1]
|
||||||
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
|
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
|
||||||
*/
|
*/
|
||||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
|
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2 */
|
|
||||||
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 )
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -977,21 +951,14 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next three macros are defined if native TrueType hinting is
|
* The next two macros are defined if native TrueType hinting is
|
||||||
* requested by the definitions above. Don't change this.
|
* requested by the definitions above. Don't change this.
|
||||||
*/
|
*/
|
||||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||||
#define TT_USE_BYTECODE_INTERPRETER
|
#define TT_USE_BYTECODE_INTERPRETER
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
|
|
||||||
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
|
|
||||||
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,57 @@
|
||||||
|
CHANGES BETWEEN 2.13.1 and 2.13.2 (2023-Aug-25)
|
||||||
|
|
||||||
|
I. MISCELLANEOUS
|
||||||
|
|
||||||
|
- Better support for CFF2 variation fonts.
|
||||||
|
|
||||||
|
- TrueType interpreter version 38 (also known as 'Infinality') has
|
||||||
|
been removed.
|
||||||
|
|
||||||
|
- Improved OpenVMS support.
|
||||||
|
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
|
||||||
|
CHANGES BETWEEN 2.13.0 and 2.13.1 (2023-Jun-24)
|
||||||
|
|
||||||
|
I. MISCELLANEOUS
|
||||||
|
|
||||||
|
- New function `FT_Get_Default_Named_Instance` to get the index of
|
||||||
|
the default named instance of an OpenType Variation Font.
|
||||||
|
|
||||||
|
- A new load flag `FT_LOAD_NO_SVG` to make FreeType ignore glyphs in
|
||||||
|
an 'SVG ' table.
|
||||||
|
|
||||||
|
- New function `FT_GlyphSlot_AdjustWeight` to adjust the glyph
|
||||||
|
weight either horizontally or vertically. This is part of the
|
||||||
|
`ftsynth.h` header file, which is still considered to be in alpha
|
||||||
|
stage.
|
||||||
|
|
||||||
|
- TrueType interpreter version 38 (also known as 'Infinality') has
|
||||||
|
been deactivated; the value of `TT_INTERPRETER_VERSION_38` is now
|
||||||
|
the same as `TT_INTERPRETER_VERSION_40`.
|
||||||
|
|
||||||
|
- Updated OpenVMS support.
|
||||||
|
|
||||||
|
- The base API documentation has been modularized for easier
|
||||||
|
handling.
|
||||||
|
|
||||||
|
- Switching named instances on and off in Variation Fonts was buggy
|
||||||
|
if the design coordinates didn't change.
|
||||||
|
|
||||||
|
- `ftbench` has a new command-line option `-a` to apply design
|
||||||
|
coordinates.
|
||||||
|
|
||||||
|
- `ftview` can now flip SVG rendering on and off using the 'Z' key.
|
||||||
|
|
||||||
|
- In `ftmulti` it is now possible to toggle the fill rule and
|
||||||
|
overlap flag used for rendering glyphs using the 'F3' and 'F4'
|
||||||
|
keys, respectively. Toggling the anti-aliased mode has been
|
||||||
|
changed to the 'TAB' key.
|
||||||
|
|
||||||
|
|
||||||
|
======================================================================
|
||||||
|
|
||||||
CHANGES BETWEEN 2.12.1 and 2.13.0 (2023-Feb-09)
|
CHANGES BETWEEN 2.12.1 and 2.13.0 (2023-Feb-09)
|
||||||
|
|
||||||
I. IMPORTANT CHANGES
|
I. IMPORTANT CHANGES
|
||||||
|
@ -12,7 +66,7 @@ CHANGES BETWEEN 2.12.1 and 2.13.0 (2023-Feb-09)
|
||||||
https://learn.microsoft.com/en-us/typography/opentype/spec/colr
|
https://learn.microsoft.com/en-us/typography/opentype/spec/colr
|
||||||
|
|
||||||
|
|
||||||
III. MISCELLANEOUS
|
II. MISCELLANEOUS
|
||||||
|
|
||||||
- For OpenType Variable Fonts, `avar` table format 2.0 is now
|
- For OpenType Variable Fonts, `avar` table format 2.0 is now
|
||||||
supported. The code was contributed by Behdad Esfahbod.
|
supported. The code was contributed by Behdad Esfahbod.
|
||||||
|
@ -75,6 +129,10 @@ CHANGES BETWEEN 2.12.1 and 2.13.0 (2023-Feb-09)
|
||||||
af_debug_hints_
|
af_debug_hints_
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- The internal zlib library was updated to version 1.2.13. Note,
|
||||||
|
however, that FreeType is *not* affected by CVE-2022-37434 since
|
||||||
|
it doesn't use the `inflateGetHeader` function.
|
||||||
|
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
@ -2420,7 +2478,7 @@ CHANGES BETWEEN 2.3.8 and 2.3.7
|
||||||
is provided for x86 and ARM. See FT_CONFIG_OPTION_INLINE_MULFIX
|
is provided for x86 and ARM. See FT_CONFIG_OPTION_INLINE_MULFIX
|
||||||
and FT_CONFIG_OPTION_NO_ASSEMBLER (in ftoption.h) for more.
|
and FT_CONFIG_OPTION_NO_ASSEMBLER (in ftoption.h) for more.
|
||||||
|
|
||||||
- The handling of `tricky' fonts (this is, fonts which don't work
|
- The handling of `tricky' fonts (that is, fonts which don't work
|
||||||
with the autohinter, needing the font format's hinting engine)
|
with the autohinter, needing the font format's hinting engine)
|
||||||
has been generalized and changed slightly:
|
has been generalized and changed slightly:
|
||||||
|
|
||||||
|
@ -2877,7 +2935,7 @@ CHANGES BETWEEN 2.2 and 2.1.10
|
||||||
|
|
||||||
II. IMPORTANT CHANGES
|
II. IMPORTANT CHANGES
|
||||||
|
|
||||||
- Version 2.2 no longer exposes its internals, this is, the header
|
- Version 2.2 no longer exposes its internals, that is, the header
|
||||||
files located in the `include/freetype/internal' directory of
|
files located in the `include/freetype/internal' directory of
|
||||||
the source package are not copied anymore by the `make install'
|
the source package are not copied anymore by the `make install'
|
||||||
command. Consequently, a number of rogue clients which directly
|
command. Consequently, a number of rogue clients which directly
|
||||||
|
|
|
@ -270,12 +270,12 @@ to access them.
|
||||||
`FT2_DEBUG' environment variable. Use this function to override
|
`FT2_DEBUG' environment variable. Use this function to override
|
||||||
the value with `level'. Use value `NULL' to disable tracing.
|
the value with `level'. Use value `NULL' to disable tracing.
|
||||||
|
|
||||||
FT_Trace_Set_Default_Level():
|
FT_Trace_Set_Default_Level( void )
|
||||||
|
|
||||||
Reset the tracing levels to the default value, i.e., the value of
|
Reset the tracing levels to the default value, i.e., the value of
|
||||||
the `FT2_DEBUG' environment variable or no tracing if not set.
|
the `FT2_DEBUG' environment variable or no tracing if not set.
|
||||||
|
|
||||||
FT_Set_Log_Handler( ft_custom_log_handler handler ):
|
FT_Set_Log_Handler( ft_custom_log_handler handler )
|
||||||
|
|
||||||
Use `handler' as a custom handler for formatting tracing and error
|
Use `handler' as a custom handler for formatting tracing and error
|
||||||
messages. The `ft_custom_log_handler' typedef has the following
|
messages. The `ft_custom_log_handler' typedef has the following
|
||||||
|
@ -290,7 +290,7 @@ to access them.
|
||||||
first argument of `FT_TRACE' or `FT_ERROR', and `args' holds the
|
first argument of `FT_TRACE' or `FT_ERROR', and `args' holds the
|
||||||
remaining arguments.
|
remaining arguments.
|
||||||
|
|
||||||
FT_Set_Default_Log_Handler():
|
FT_Set_Default_Log_Handler( void )
|
||||||
|
|
||||||
Reset the log handler to the default version.
|
Reset the log handler to the default version.
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
How to build the FreeType 2 library on VMS
|
How to build the FreeType library on VMS
|
||||||
-----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
It is actually very straightforward to install the FreeType 2 library.
|
It is actually very straightforward to install the FreeType library.
|
||||||
Just execute vms_make.com from the toplevel directory to build the
|
Just execute `vms_make.com from` the toplevel directory to build the
|
||||||
library. This procedure currently accepts the following options:
|
library. This procedure currently accepts the following options:
|
||||||
|
|
||||||
DEBUG
|
* `DEBUG`
|
||||||
Build the library with debug information and without optimization.
|
Build the library with debug information and without optimization.
|
||||||
|
|
||||||
lopts=<value>
|
* `lopts=<value>`
|
||||||
Options to pass to the link command e.g. lopts=/traceback
|
Options to pass to the link command, e.g., `lopts=/traceback`.
|
||||||
|
|
||||||
ccopt=<value>
|
* `ccopt=<value>`
|
||||||
Options to pass to the C compiler e.g. ccopt=/float=ieee
|
Options to pass to the C compiler, e.g., `ccopt=/float=ieee`.
|
||||||
|
|
||||||
In case you did download the demos, place them in a separate directory
|
In case you did download the demos, place them in a separate directory
|
||||||
sharing the same top level as the directory of FreeType 2 and follow
|
sharing the same top level as the directory of FreeType and follow the
|
||||||
the same instructions as above for the demos from there. The build
|
same instructions as above for the demos from there. The build
|
||||||
process relies on this to figure out the location of the FreeType 2
|
process relies on this to figure out the location of the FreeType
|
||||||
include files.
|
include files.
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,23 +28,30 @@ The library is available in the directory
|
||||||
|
|
||||||
[.LIB]
|
[.LIB]
|
||||||
|
|
||||||
To compile applications using FreeType 2 you have to define the
|
To compile applications using FreeType you have to define the logical
|
||||||
logical FREETYPE pointing to the directory
|
`FREETYPE` pointing to the directory
|
||||||
|
|
||||||
[.INCLUDE.FREETYPE]
|
[.INCLUDE.FREETYPE]
|
||||||
|
|
||||||
i.e., if the directory in which this INSTALL.VMS file is located is
|
i.e., if the directory in which this `INSTALL.VMS` file is located is
|
||||||
$disk:[freetype] then define the logical with
|
`$disk:[freetype.docs]`, then define the logical with
|
||||||
|
|
||||||
define freetype $disk:[freetype.include.freetype]
|
define freetype $disk:[freetype.include.freetype]
|
||||||
|
|
||||||
This version has been tested with Compaq C V6.2-006 on OpenVMS Alpha
|
See http://nchrem.tnw.tudelft.nl/openvms/software2.html#Freetype for
|
||||||
V7.2-1.
|
the packages FreeType depends on.
|
||||||
|
|
||||||
|
The latest versions were tested using
|
||||||
|
- VSI C V7.4-002 and DECWindows V1.7-F on OpenVMS Alpha V8.4-2L1
|
||||||
|
- VSI C V7.4-001 and DECWindows V1.7-E on OpenVMS IA64 V8.4-2L3
|
||||||
|
|
||||||
|
|
||||||
Any problems can be reported to
|
Any problems can be reported to
|
||||||
|
|
||||||
|
Jouk Jansen <joukj@hrem.nano.tudelft.nl> or
|
||||||
|
|
||||||
|
Orginal version of the build procedures was created by
|
||||||
|
|
||||||
Jouk Jansen <joukj@hrem.stm.tudelft.nl> or
|
|
||||||
Martin P.J. Zinser <zinser@zinser.no-ip.info>
|
Martin P.J. Zinser <zinser@zinser.no-ip.info>
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
|
@ -18,8 +18,6 @@ There are two ways to generate the documentation:
|
||||||
- This may or may not require internet access every time depending on
|
- This may or may not require internet access every time depending on
|
||||||
pip and system caching.
|
pip and system caching.
|
||||||
|
|
||||||
This also works with Jam: Just type `jam refdoc' in the main directory.
|
|
||||||
|
|
||||||
Some troubleshooting tips:
|
Some troubleshooting tips:
|
||||||
|
|
||||||
* Regularly run `pip install --upgrade docwriter' to check for updates which
|
* Regularly run `pip install --upgrade docwriter' to check for updates which
|
||||||
|
|
|
@ -60,6 +60,8 @@ found on _most_ systems, but not all of them:
|
||||||
|
|
||||||
release libtool so
|
release libtool so
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
2.13.2 26.1.20 6.20.1
|
||||||
|
2.13.1 26.0.20 6.20.0
|
||||||
2.13.0 25.0.19 6.19.0
|
2.13.0 25.0.19 6.19.0
|
||||||
2.12.1 24.3.18 6.18.3
|
2.12.1 24.3.18 6.18.3
|
||||||
2.12.0 24.2.18 6.18.2
|
2.12.0 24.2.18 6.18.2
|
||||||
|
|
|
@ -57,7 +57,7 @@ Notes
|
||||||
(`*') in the table below.
|
(`*') in the table below.
|
||||||
|
|
||||||
FreeType can be configured to support Mac files (on older Mac OS
|
FreeType can be configured to support Mac files (on older Mac OS
|
||||||
versions, a `file' is stored as a data and a resource fork, this is,
|
versions, a `file' is stored as a data and a resource fork, that is,
|
||||||
within two separate data chunks). If a file can't be opened as a
|
within two separate data chunks). If a file can't be opened as a
|
||||||
font, FreeType then checks whether it is a resource fork, trying to
|
font, FreeType then checks whether it is a resource fork, trying to
|
||||||
extract the contained font data from either a `POST' or `sfnt'
|
extract the contained font data from either a `POST' or `sfnt'
|
||||||
|
@ -77,8 +77,8 @@ which isn't supported yet please send a mail too.
|
||||||
--- BDF --- --- bdf 5005.BDF_Spec.pdf, X11
|
--- BDF --- --- bdf 5005.BDF_Spec.pdf, X11
|
||||||
|
|
||||||
|
|
||||||
SFNT PS TYPE_1 --- type1 Type 1 GX Font Format
|
SFNT PS TYPE_1 --- type1 Type 1 GX Font Format [7]
|
||||||
(for the Mac) [3]
|
(for the Mac; not supported)
|
||||||
SFNT PS TYPE_1 CID cid 5180.sfnt.pdf (for the Mac) [3]
|
SFNT PS TYPE_1 CID cid 5180.sfnt.pdf (for the Mac) [3]
|
||||||
SFNT PS CFF --- cff OT spec, 5176.CFF.pdf
|
SFNT PS CFF --- cff OT spec, 5176.CFF.pdf
|
||||||
(`OTTO' format)
|
(`OTTO' format)
|
||||||
|
@ -198,6 +198,12 @@ which isn't supported yet please send a mail too.
|
||||||
[6] Supported font formats are TrueType and OpenType fonts as
|
[6] Supported font formats are TrueType and OpenType fonts as
|
||||||
defined in the OpenType specification 1.6 and newer.
|
defined in the OpenType specification 1.6 and newer.
|
||||||
|
|
||||||
|
[7] `The Type 1 GX Font Format' (dated 1995-09-27) was distributed in
|
||||||
|
Apple Developer CD-ROM in those days. The content of `TYP1' table
|
||||||
|
is a PostScript Type 1 font without the eexec encryption. Current
|
||||||
|
versions of FreeType don't not support this format, but FontForge
|
||||||
|
can load it.
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (C) 2004-2023 by
|
Copyright (C) 2004-2023 by
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH FREETYPE-CONFIG 1 "February 2023" "FreeType 2.13.0"
|
.TH FREETYPE-CONFIG 1 "August 2023" "FreeType 2.13.2"
|
||||||
.
|
.
|
||||||
.
|
.
|
||||||
.SH NAME
|
.SH NAME
|
||||||
|
|
|
@ -15,33 +15,53 @@ How to prepare a new release
|
||||||
|
|
||||||
. docs/VERSIONS.TXT: Document changed `version_info`.
|
. docs/VERSIONS.TXT: Document changed `version_info`.
|
||||||
|
|
||||||
. Clone the git archive to another directory with
|
. Update the 'dlg' submodule with
|
||||||
|
|
||||||
git clone -l -s . ../freetype.test
|
git submodule foreach git pull origin master
|
||||||
|
|
||||||
or something like this and run
|
. Copy the submodule code with
|
||||||
|
|
||||||
make distclean; make devel; make
|
make copy_submodule
|
||||||
make distclean; make devel; make multi
|
|
||||||
make distclean; make devel CC=g++; make CC=g++
|
and run
|
||||||
make distclean; make devel CC=g++; make multi CC=g++
|
|
||||||
|
make distclean && make devel && make
|
||||||
|
make distclean && make devel && make multi
|
||||||
|
make distclean && make devel CC=g++ && make CC=g++ ANSIFLAGS=""
|
||||||
|
make distclean && make devel CC=g++ && make multi CC=g++ ANSIFLAGS=""
|
||||||
|
|
||||||
sh autogen.sh
|
sh autogen.sh
|
||||||
make distclean; ./configure CC=g++; make
|
make distclean && ./configure CC=g++ && make ANSIFLAGS=""
|
||||||
|
|
||||||
in the cloned repository to test compilation with both gcc and g++.
|
to test compilation with both gcc and g++ (you might also add the `-j`
|
||||||
|
flag to `make` for parallel compilation).
|
||||||
|
|
||||||
Note that it is normally not necessary to test standard C
|
Note that it is normally not necessary to test standard C
|
||||||
compilation with the `configure`, `meson`, and `cmake` build tools
|
compilation with the `configure`, `meson`, and `cmake` build tools
|
||||||
since this is done by the CI process of 'gitlab.freetype.org' for
|
since this is done by the CI process of 'gitlab.freedesktop.org' for
|
||||||
every commit.
|
every commit.
|
||||||
|
|
||||||
. Test C++ compilation for 'freetype-demos' too (using `git clone` as
|
. Test C++ compilation for 'freetype-demos' too; this needs a compiled
|
||||||
above).
|
FreeType library as described in the `README` file.
|
||||||
|
|
||||||
|
make distclean && make
|
||||||
|
make distclean && make CC=g++ ANSIFLAGS=""
|
||||||
|
|
||||||
. Run `src/tools/chktrcmp.py` and check that there are no undefined
|
. Run `src/tools/chktrcmp.py` and check that there are no undefined
|
||||||
`trace_XXXX` macros.
|
`trace_XXXX` macros.
|
||||||
|
|
||||||
|
. Update meson subproject files (for both the 'freetype' and
|
||||||
|
'freetype-demos' git repositories) with
|
||||||
|
|
||||||
|
meson subprojects update
|
||||||
|
|
||||||
|
. Test meson compilation (for both the 'freetype' and 'freetype-demos'
|
||||||
|
git repositories) with
|
||||||
|
|
||||||
|
meson setup builddir && meson compile -C builddir
|
||||||
|
|
||||||
|
. Commit everything.
|
||||||
|
|
||||||
. After pushing the new release, tag the git repositories ('freetype',
|
. After pushing the new release, tag the git repositories ('freetype',
|
||||||
'freetype-demos') with
|
'freetype-demos') with
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,13 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// This macro is used when an assertion fails. It gets the source expression
|
||||||
|
// and can return an alternative (that must stay alive).
|
||||||
|
// Mainly useful to execute something on failed assertion.
|
||||||
|
#ifndef DLG_FAILED_ASSERTION_TEXT
|
||||||
|
#define DLG_FAILED_ASSERTION_TEXT(x) x
|
||||||
|
#endif
|
||||||
|
|
||||||
// - utility -
|
// - utility -
|
||||||
// two methods needed since cplusplus does not support compound literals
|
// two methods needed since cplusplus does not support compound literals
|
||||||
// and c does not support uniform initialization/initializer lists
|
// and c does not support uniform initialization/initializer lists
|
||||||
|
@ -131,83 +138,12 @@ struct dlg_origin {
|
||||||
// Type of the output handler, see dlg_set_handler.
|
// Type of the output handler, see dlg_set_handler.
|
||||||
typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string, void* data);
|
typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string, void* data);
|
||||||
|
|
||||||
#ifdef DLG_DISABLE
|
#ifndef DLG_DISABLE
|
||||||
// Tagged/Untagged logging with variable level
|
// Tagged/Untagged logging with variable level
|
||||||
// Tags must always be in the format `("tag1", "tag2")` (including brackets)
|
// Tags must always be in the format `("tag1", "tag2")` (including brackets)
|
||||||
#define dlg_log(level, ...)
|
// Example usages:
|
||||||
#define dlg_logt(level, tags, ...)
|
// dlg_log(dlg_level_warning, "test 1")
|
||||||
|
// dlg_logt(("tag1, "tag2"), dlg_level_debug, "test %d", 2)
|
||||||
// Dynamic level assert macros in various versions for additional arguments
|
|
||||||
#define dlg_assertl(level, expr) // assert without tags/message
|
|
||||||
#define dlg_assertlt(level, tags, expr) // assert with tags
|
|
||||||
#define dlg_assertlm(level, expr, ...) // assert with message
|
|
||||||
#define dlg_assertltm(level, tags, expr, ...) // assert with tags & message
|
|
||||||
|
|
||||||
// Sets the handler that is responsible for formatting and outputting log calls.
|
|
||||||
// This function is not thread safe and the handler is set globally.
|
|
||||||
// The handler itself must not change dlg tags or call a dlg macro (if it
|
|
||||||
// does so, the provided string or tags array in 'origin' might get invalid).
|
|
||||||
// The handler can also be used for various other things such as dealing
|
|
||||||
// with failed assertions or filtering calls based on the passed tags.
|
|
||||||
// The default handler is dlg_default_output (see its doc for more info).
|
|
||||||
// If using c++ make sure the registered handler cannot throw e.g. by
|
|
||||||
// wrapping everything into a try-catch blog.
|
|
||||||
inline void dlg_set_handler(dlg_handler handler, void* data) {
|
|
||||||
(void) handler;
|
|
||||||
(void) data;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the currently active dlg handler and sets `data` to
|
|
||||||
// its user data pointer. `data` must not be NULL.
|
|
||||||
// Useful to create handler chains.
|
|
||||||
// This function is not threadsafe, i.e. retrieving the handler while
|
|
||||||
// changing it from another thread is unsafe.
|
|
||||||
// See `dlg_set_handler`.
|
|
||||||
inline dlg_handler dlg_get_handler(void** data) {
|
|
||||||
*data = NULL;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The default output handler.
|
|
||||||
// Only use this to reset the output handler, prefer to use
|
|
||||||
// dlg_generic_output (from output.h) which this function simply calls.
|
|
||||||
// It also flushes the stream used and correctly outputs even from multiple threads.
|
|
||||||
inline void dlg_default_output(const struct dlg_origin* o, const char* str, void* data) {
|
|
||||||
(void) o;
|
|
||||||
(void) str;
|
|
||||||
(void) data;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adds the given tag associated with the given function to the thread specific list.
|
|
||||||
// If func is not NULL the tag will only applied to calls from the same function.
|
|
||||||
// Remove the tag again calling dlg_remove_tag (with exactly the same pointers!).
|
|
||||||
// Does not check if the tag is already present.
|
|
||||||
inline void dlg_add_tag(const char* tag, const char* func) {
|
|
||||||
(void) tag;
|
|
||||||
(void) func;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Removes a tag added with dlg_add_tag (has no effect for tags no present).
|
|
||||||
// The pointers must be exactly the same pointers that were supplied to dlg_add_tag,
|
|
||||||
// this function will not check using strcmp. When the same tag/func combination
|
|
||||||
// is added multiple times, this function remove exactly one candidate, it is
|
|
||||||
// undefined which. Returns whether a tag was found (and removed).
|
|
||||||
inline bool dlg_remove_tag(const char* tag, const char* func) {
|
|
||||||
(void) tag;
|
|
||||||
(void) func;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns the thread-specific buffer and its size for dlg.
|
|
||||||
// The buffer should only be used by formatting functions.
|
|
||||||
// The buffer can be reallocated and the size changed, just make sure
|
|
||||||
// to update both values correctly.
|
|
||||||
inline char** dlg_thread_buffer(size_t** size) {
|
|
||||||
(void) size;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // DLG_DISABLE
|
|
||||||
#define dlg_log(level, ...) if(level >= DLG_LOG_LEVEL) \
|
#define dlg_log(level, ...) if(level >= DLG_LOG_LEVEL) \
|
||||||
dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \
|
dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \
|
||||||
DLG_FMT_FUNC(__VA_ARGS__), NULL)
|
DLG_FMT_FUNC(__VA_ARGS__), NULL)
|
||||||
|
@ -215,23 +151,31 @@ typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string,
|
||||||
dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, \
|
dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, \
|
||||||
DLG_FMT_FUNC(__VA_ARGS__), NULL)
|
DLG_FMT_FUNC(__VA_ARGS__), NULL)
|
||||||
|
|
||||||
|
// Dynamic level assert macros in various versions for additional arguments
|
||||||
|
// Example usages:
|
||||||
|
// dlg_assertl(dlg_level_warning, data != nullptr);
|
||||||
|
// dlg_assertlt(("tag1, "tag2"), dlg_level_trace, data != nullptr);
|
||||||
|
// dlg_asserttlm(("tag1), dlg_level_warning, data != nullptr, "Data must not be null");
|
||||||
|
// dlg_assertlm(dlg_level_error, data != nullptr, "Data must not be null");
|
||||||
#define dlg_assertl(level, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
#define dlg_assertl(level, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
||||||
dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, NULL, #expr)
|
dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, NULL, \
|
||||||
|
DLG_FAILED_ASSERTION_TEXT(#expr))
|
||||||
#define dlg_assertlt(level, tags, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
#define dlg_assertlt(level, tags, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
||||||
dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, NULL, #expr)
|
dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, NULL, \
|
||||||
|
DLG_FAILED_ASSERTION_TEXT(#expr))
|
||||||
#define dlg_assertlm(level, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
#define dlg_assertlm(level, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
||||||
dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \
|
dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \
|
||||||
DLG_FMT_FUNC(__VA_ARGS__), #expr)
|
DLG_FMT_FUNC(__VA_ARGS__), DLG_FAILED_ASSERTION_TEXT(#expr))
|
||||||
#define dlg_assertltm(level, tags, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
#define dlg_assertltm(level, tags, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
|
||||||
dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, \
|
dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, \
|
||||||
__func__, DLG_FMT_FUNC(__VA_ARGS__), #expr)
|
__func__, DLG_FMT_FUNC(__VA_ARGS__), DLG_FAILED_ASSERTION_TEXT(#expr))
|
||||||
|
|
||||||
DLG_API void dlg_set_handler(dlg_handler handler, void* data);
|
#define dlg__assert_or(level, tags, expr, code, msg) if(!(expr)) {\
|
||||||
DLG_API dlg_handler dlg_get_handler(void** data);
|
if(level >= DLG_ASSERT_LEVEL) \
|
||||||
DLG_API void dlg_default_output(const struct dlg_origin*, const char* string, void*);
|
dlg__do_log(level, tags, DLG_FILE, __LINE__, __func__, msg, \
|
||||||
DLG_API void dlg_add_tag(const char* tag, const char* func);
|
DLG_FAILED_ASSERTION_TEXT(#expr)); \
|
||||||
DLG_API bool dlg_remove_tag(const char* tag, const char* func);
|
code; \
|
||||||
DLG_API char** dlg_thread_buffer(size_t** size);
|
} (void) NULL
|
||||||
|
|
||||||
// - Private interface: not part of the abi/api but needed in macros -
|
// - Private interface: not part of the abi/api but needed in macros -
|
||||||
// Formats the given format string and arguments as printf would, uses the thread buffer.
|
// Formats the given format string and arguments as printf would, uses the thread buffer.
|
||||||
|
@ -239,8 +183,66 @@ typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string,
|
||||||
DLG_API void dlg__do_log(enum dlg_level lvl, const char* const*, const char*, int,
|
DLG_API void dlg__do_log(enum dlg_level lvl, const char* const*, const char*, int,
|
||||||
const char*, const char*, const char*);
|
const char*, const char*, const char*);
|
||||||
DLG_API const char* dlg__strip_root_path(const char* file, const char* base);
|
DLG_API const char* dlg__strip_root_path(const char* file, const char* base);
|
||||||
|
|
||||||
|
#else // DLG_DISABLE
|
||||||
|
|
||||||
|
#define dlg_log(level, ...)
|
||||||
|
#define dlg_logt(level, tags, ...)
|
||||||
|
|
||||||
|
#define dlg_assertl(level, expr) // assert without tags/message
|
||||||
|
#define dlg_assertlt(level, tags, expr) // assert with tags
|
||||||
|
#define dlg_assertlm(level, expr, ...) // assert with message
|
||||||
|
#define dlg_assertltm(level, tags, expr, ...) // assert with tags & message
|
||||||
|
|
||||||
|
#define dlg__assert_or(level, tags, expr, code, msg) if(!(expr)) { code; } (void) NULL
|
||||||
#endif // DLG_DISABLE
|
#endif // DLG_DISABLE
|
||||||
|
|
||||||
|
// The API below is independent from DLG_DISABLE
|
||||||
|
|
||||||
|
// Sets the handler that is responsible for formatting and outputting log calls.
|
||||||
|
// This function is not thread safe and the handler is set globally.
|
||||||
|
// The handler itself must not change dlg tags or call a dlg macro (if it
|
||||||
|
// does so, the provided string or tags array in 'origin' might get invalid).
|
||||||
|
// The handler can also be used for various other things such as dealing
|
||||||
|
// with failed assertions or filtering calls based on the passed tags.
|
||||||
|
// The default handler is dlg_default_output (see its doc for more info).
|
||||||
|
// If using c++ make sure the registered handler cannot throw e.g. by
|
||||||
|
// wrapping everything into a try-catch blog.
|
||||||
|
DLG_API void dlg_set_handler(dlg_handler handler, void* data);
|
||||||
|
|
||||||
|
// The default output handler.
|
||||||
|
// Only use this to reset the output handler, prefer to use
|
||||||
|
// dlg_generic_output (from output.h) which this function simply calls.
|
||||||
|
// It also flushes the stream used and correctly outputs even from multiple threads.
|
||||||
|
DLG_API void dlg_default_output(const struct dlg_origin*, const char* string, void*);
|
||||||
|
|
||||||
|
// Returns the currently active dlg handler and sets `data` to
|
||||||
|
// its user data pointer. `data` must not be NULL.
|
||||||
|
// Useful to create handler chains.
|
||||||
|
// This function is not threadsafe, i.e. retrieving the handler while
|
||||||
|
// changing it from another thread is unsafe.
|
||||||
|
// See `dlg_set_handler`.
|
||||||
|
DLG_API dlg_handler dlg_get_handler(void** data);
|
||||||
|
|
||||||
|
// Adds the given tag associated with the given function to the thread specific list.
|
||||||
|
// If func is not NULL the tag will only applied to calls from the same function.
|
||||||
|
// Remove the tag again calling dlg_remove_tag (with exactly the same pointers!).
|
||||||
|
// Does not check if the tag is already present.
|
||||||
|
DLG_API void dlg_add_tag(const char* tag, const char* func);
|
||||||
|
|
||||||
|
// Removes a tag added with dlg_add_tag (has no effect for tags no present).
|
||||||
|
// The pointers must be exactly the same pointers that were supplied to dlg_add_tag,
|
||||||
|
// this function will not check using strcmp. When the same tag/func combination
|
||||||
|
// is added multiple times, this function remove exactly one candidate, it is
|
||||||
|
// undefined which. Returns whether a tag was found (and removed).
|
||||||
|
DLG_API bool dlg_remove_tag(const char* tag, const char* func);
|
||||||
|
|
||||||
|
// Returns the thread-specific buffer and its size for dlg.
|
||||||
|
// The buffer should only be used by formatting functions.
|
||||||
|
// The buffer can be reallocated and the size changed, just make sure
|
||||||
|
// to update both values correctly.
|
||||||
|
DLG_API char** dlg_thread_buffer(size_t** size);
|
||||||
|
|
||||||
// Untagged leveled logging
|
// Untagged leveled logging
|
||||||
#define dlg_trace(...) dlg_log(dlg_level_trace, __VA_ARGS__)
|
#define dlg_trace(...) dlg_log(dlg_level_trace, __VA_ARGS__)
|
||||||
#define dlg_debug(...) dlg_log(dlg_level_debug, __VA_ARGS__)
|
#define dlg_debug(...) dlg_log(dlg_level_debug, __VA_ARGS__)
|
||||||
|
@ -263,6 +265,24 @@ typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string,
|
||||||
#define dlg_assertm(expr, ...) dlg_assertlm(DLG_DEFAULT_ASSERT, expr, __VA_ARGS__)
|
#define dlg_assertm(expr, ...) dlg_assertlm(DLG_DEFAULT_ASSERT, expr, __VA_ARGS__)
|
||||||
#define dlg_asserttm(tags, expr, ...) dlg_assertltm(DLG_DEFAULT_ASSERT, tags, expr, __VA_ARGS__)
|
#define dlg_asserttm(tags, expr, ...) dlg_assertltm(DLG_DEFAULT_ASSERT, tags, expr, __VA_ARGS__)
|
||||||
|
|
||||||
|
// If (expr) does not evaluate to true, always executes 'code' (no matter what
|
||||||
|
// DLG_ASSERT_LEVEL is or if dlg is disabled or not).
|
||||||
|
// When dlg is enabled and the level is greater or equal to DLG_ASSERT_LEVEL,
|
||||||
|
// logs the failed assertion.
|
||||||
|
// Example usages:
|
||||||
|
// dlg_assertl_or(dlg_level_warn, data != nullptr, return);
|
||||||
|
// dlg_assertlm_or(dlg_level_fatal, data != nullptr, return, "Data must not be null");
|
||||||
|
// dlg_assert_or(data != nullptr, logError(); return false);
|
||||||
|
#define dlg_assertltm_or(level, tags, expr, code, ...) dlg__assert_or(level, \
|
||||||
|
DLG_CREATE_TAGS tags, expr, code, DLG_FMT_FUNC(__VA_ARGS__))
|
||||||
|
#define dlg_assertlm_or(level, expr, code, ...) dlg__assert_or(level, \
|
||||||
|
DLG_CREATE_TAGS(NULL), expr, code, DLG_FMT_FUNC(__VA_ARGS__))
|
||||||
|
#define dlg_assertl_or(level, expr, code) dlg__assert_or(level, \
|
||||||
|
DLG_CREATE_TAGS(NULL), expr, code, NULL)
|
||||||
|
|
||||||
|
#define dlg_assert_or(expr, code) dlg_assertl_or(DLG_DEFAULT_ASSERT, expr, code)
|
||||||
|
#define dlg_assertm_or(expr, code, ...) dlg_assertlm_or(DLG_DEFAULT_ASSERT, expr, code, __VA_ARGS__)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -661,36 +661,12 @@ FT_BEGIN_HEADER
|
||||||
* not) instructions in a certain way so that all TrueType fonts look like
|
* not) instructions in a certain way so that all TrueType fonts look like
|
||||||
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
|
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
|
||||||
* technical overview on what this means. See `ttinterp.h` for more
|
* technical overview on what this means. See `ttinterp.h` for more
|
||||||
* details on the LEAN option.
|
* details on this option.
|
||||||
*
|
*
|
||||||
* There are three possible values.
|
* The new default mode focuses on applying a minimal set of rules to all
|
||||||
*
|
* fonts indiscriminately so that modern and web fonts render well while
|
||||||
* Value 1:
|
* legacy fonts render okay. The corresponding interpreter version is v40.
|
||||||
* This value is associated with the 'Infinality' moniker, contributed by
|
* The so-called Infinality mode (v38) is no longer available in FreeType.
|
||||||
* an individual nicknamed Infinality with the goal of making TrueType
|
|
||||||
* fonts render better than on Windows. A high amount of configurability
|
|
||||||
* and flexibility, down to rules for single glyphs in fonts, but also
|
|
||||||
* very slow. Its experimental and slow nature and the original
|
|
||||||
* developer losing interest meant that this option was never enabled in
|
|
||||||
* default builds.
|
|
||||||
*
|
|
||||||
* The corresponding interpreter version is v38.
|
|
||||||
*
|
|
||||||
* Value 2:
|
|
||||||
* The new default mode for the TrueType driver. The Infinality code
|
|
||||||
* base was stripped to the bare minimum and all configurability removed
|
|
||||||
* in the name of speed and simplicity. The configurability was mainly
|
|
||||||
* aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'.
|
|
||||||
* Legacy fonts are fonts that modify vertical stems to achieve clean
|
|
||||||
* black-and-white bitmaps. The new mode focuses on applying a minimal
|
|
||||||
* set of rules to all fonts indiscriminately so that modern and web
|
|
||||||
* fonts render well while legacy fonts render okay.
|
|
||||||
*
|
|
||||||
* The corresponding interpreter version is v40.
|
|
||||||
*
|
|
||||||
* Value 3:
|
|
||||||
* Compile both, making both v38 and v40 available (the latter is the
|
|
||||||
* default).
|
|
||||||
*
|
*
|
||||||
* By undefining these, you get rendering behavior like on Windows without
|
* By undefining these, you get rendering behavior like on Windows without
|
||||||
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
|
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
|
||||||
|
@ -705,9 +681,7 @@ FT_BEGIN_HEADER
|
||||||
* [1]
|
* [1]
|
||||||
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
|
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
|
||||||
*/
|
*/
|
||||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
|
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||||
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
|
|
||||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -977,21 +951,14 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next three macros are defined if native TrueType hinting is
|
* The next two macros are defined if native TrueType hinting is
|
||||||
* requested by the definitions above. Don't change this.
|
* requested by the definitions above. Don't change this.
|
||||||
*/
|
*/
|
||||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||||
#define TT_USE_BYTECODE_INTERPRETER
|
#define TT_USE_BYTECODE_INTERPRETER
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
|
|
||||||
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
|
|
||||||
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
#define ft_fread fread
|
#define ft_fread fread
|
||||||
#define ft_fseek fseek
|
#define ft_fseek fseek
|
||||||
#define ft_ftell ftell
|
#define ft_ftell ftell
|
||||||
#define ft_sprintf sprintf
|
#define ft_snprintf snprintf
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
|
@ -102,61 +102,25 @@ FT_BEGIN_HEADER
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
/*************************************************************************/
|
|
||||||
/* */
|
|
||||||
/* B A S I C T Y P E S */
|
|
||||||
/* */
|
|
||||||
/*************************************************************************/
|
|
||||||
/*************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @section:
|
* @section:
|
||||||
* base_interface
|
* font_testing_macros
|
||||||
*
|
*
|
||||||
* @title:
|
* @title:
|
||||||
* Base Interface
|
* Font Testing Macros
|
||||||
*
|
*
|
||||||
* @abstract:
|
* @abstract:
|
||||||
* The FreeType~2 base font interface.
|
* Macros to test various properties of fonts.
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* This section describes the most important public high-level API
|
* Macros to test the most important font properties.
|
||||||
* functions of FreeType~2.
|
*
|
||||||
|
* It is recommended to use these high-level macros instead of directly
|
||||||
|
* testing the corresponding flags, which are scattered over various
|
||||||
|
* structures.
|
||||||
*
|
*
|
||||||
* @order:
|
* @order:
|
||||||
* FT_Library
|
|
||||||
* FT_Face
|
|
||||||
* FT_Size
|
|
||||||
* FT_GlyphSlot
|
|
||||||
* FT_CharMap
|
|
||||||
* FT_Encoding
|
|
||||||
* FT_ENC_TAG
|
|
||||||
*
|
|
||||||
* FT_FaceRec
|
|
||||||
*
|
|
||||||
* FT_FACE_FLAG_SCALABLE
|
|
||||||
* FT_FACE_FLAG_FIXED_SIZES
|
|
||||||
* FT_FACE_FLAG_FIXED_WIDTH
|
|
||||||
* FT_FACE_FLAG_HORIZONTAL
|
|
||||||
* FT_FACE_FLAG_VERTICAL
|
|
||||||
* FT_FACE_FLAG_COLOR
|
|
||||||
* FT_FACE_FLAG_SFNT
|
|
||||||
* FT_FACE_FLAG_CID_KEYED
|
|
||||||
* FT_FACE_FLAG_TRICKY
|
|
||||||
* FT_FACE_FLAG_KERNING
|
|
||||||
* FT_FACE_FLAG_MULTIPLE_MASTERS
|
|
||||||
* FT_FACE_FLAG_VARIATION
|
|
||||||
* FT_FACE_FLAG_GLYPH_NAMES
|
|
||||||
* FT_FACE_FLAG_EXTERNAL_STREAM
|
|
||||||
* FT_FACE_FLAG_HINTER
|
|
||||||
* FT_FACE_FLAG_SVG
|
|
||||||
* FT_FACE_FLAG_SBIX
|
|
||||||
* FT_FACE_FLAG_SBIX_OVERLAY
|
|
||||||
*
|
|
||||||
* FT_HAS_HORIZONTAL
|
* FT_HAS_HORIZONTAL
|
||||||
* FT_HAS_VERTICAL
|
* FT_HAS_VERTICAL
|
||||||
* FT_HAS_KERNING
|
* FT_HAS_KERNING
|
||||||
|
@ -176,21 +140,59 @@ FT_BEGIN_HEADER
|
||||||
* FT_IS_NAMED_INSTANCE
|
* FT_IS_NAMED_INSTANCE
|
||||||
* FT_IS_VARIATION
|
* FT_IS_VARIATION
|
||||||
*
|
*
|
||||||
* FT_STYLE_FLAG_BOLD
|
*/
|
||||||
* FT_STYLE_FLAG_ITALIC
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* FT_SizeRec
|
* @section:
|
||||||
* FT_Size_Metrics
|
* library_setup
|
||||||
*
|
*
|
||||||
* FT_GlyphSlotRec
|
* @title:
|
||||||
* FT_Glyph_Metrics
|
* Library Setup
|
||||||
* FT_SubGlyph
|
|
||||||
*
|
*
|
||||||
* FT_Bitmap_Size
|
* @abstract:
|
||||||
|
* Functions to start and end the usage of the FreeType library.
|
||||||
*
|
*
|
||||||
|
* @description:
|
||||||
|
* Functions to start and end the usage of the FreeType library.
|
||||||
|
*
|
||||||
|
* Note that @FT_Library_Version and @FREETYPE_XXX are of limited use
|
||||||
|
* because even a new release of FreeType with only documentation
|
||||||
|
* changes increases the version number.
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
|
* FT_Library
|
||||||
* FT_Init_FreeType
|
* FT_Init_FreeType
|
||||||
* FT_Done_FreeType
|
* FT_Done_FreeType
|
||||||
*
|
*
|
||||||
|
* FT_Library_Version
|
||||||
|
* FREETYPE_XXX
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* face_creation
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Face Creation
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* Functions to manage fonts.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* The functions and structures collected in this section operate on
|
||||||
|
* fonts globally.
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
|
* FT_Face
|
||||||
|
* FT_FaceRec
|
||||||
|
* FT_FACE_FLAG_XXX
|
||||||
|
* FT_STYLE_FLAG_XXX
|
||||||
|
*
|
||||||
* FT_New_Face
|
* FT_New_Face
|
||||||
* FT_Done_Face
|
* FT_Done_Face
|
||||||
* FT_Reference_Face
|
* FT_Reference_Face
|
||||||
|
@ -198,10 +200,36 @@ FT_BEGIN_HEADER
|
||||||
* FT_Face_Properties
|
* FT_Face_Properties
|
||||||
* FT_Open_Face
|
* FT_Open_Face
|
||||||
* FT_Open_Args
|
* FT_Open_Args
|
||||||
|
* FT_OPEN_XXX
|
||||||
* FT_Parameter
|
* FT_Parameter
|
||||||
* FT_Attach_File
|
* FT_Attach_File
|
||||||
* FT_Attach_Stream
|
* FT_Attach_Stream
|
||||||
*
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* sizing_and_scaling
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Sizing and Scaling
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* Functions to manage font sizes.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* The functions and structures collected in this section are related to
|
||||||
|
* selecting and manipulating the size of a font globally.
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
|
* FT_Size
|
||||||
|
* FT_SizeRec
|
||||||
|
* FT_Size_Metrics
|
||||||
|
*
|
||||||
|
* FT_Bitmap_Size
|
||||||
|
*
|
||||||
* FT_Set_Char_Size
|
* FT_Set_Char_Size
|
||||||
* FT_Set_Pixel_Sizes
|
* FT_Set_Pixel_Sizes
|
||||||
* FT_Request_Size
|
* FT_Request_Size
|
||||||
|
@ -209,44 +237,37 @@ FT_BEGIN_HEADER
|
||||||
* FT_Size_Request_Type
|
* FT_Size_Request_Type
|
||||||
* FT_Size_RequestRec
|
* FT_Size_RequestRec
|
||||||
* FT_Size_Request
|
* FT_Size_Request
|
||||||
|
*
|
||||||
* FT_Set_Transform
|
* FT_Set_Transform
|
||||||
* FT_Get_Transform
|
* FT_Get_Transform
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Glyph Retrieval
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* Functions to manage glyphs.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* The functions and structures collected in this section operate on
|
||||||
|
* single glyphs, of which @FT_Load_Glyph is most important.
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
|
* FT_GlyphSlot
|
||||||
|
* FT_GlyphSlotRec
|
||||||
|
* FT_Glyph_Metrics
|
||||||
|
*
|
||||||
* FT_Load_Glyph
|
* FT_Load_Glyph
|
||||||
* FT_Get_Char_Index
|
* FT_LOAD_XXX
|
||||||
* FT_Get_First_Char
|
|
||||||
* FT_Get_Next_Char
|
|
||||||
* FT_Load_Char
|
|
||||||
*
|
|
||||||
* FT_OPEN_MEMORY
|
|
||||||
* FT_OPEN_STREAM
|
|
||||||
* FT_OPEN_PATHNAME
|
|
||||||
* FT_OPEN_DRIVER
|
|
||||||
* FT_OPEN_PARAMS
|
|
||||||
*
|
|
||||||
* FT_LOAD_DEFAULT
|
|
||||||
* FT_LOAD_RENDER
|
|
||||||
* FT_LOAD_MONOCHROME
|
|
||||||
* FT_LOAD_LINEAR_DESIGN
|
|
||||||
* FT_LOAD_NO_SCALE
|
|
||||||
* FT_LOAD_NO_HINTING
|
|
||||||
* FT_LOAD_NO_BITMAP
|
|
||||||
* FT_LOAD_SBITS_ONLY
|
|
||||||
* FT_LOAD_NO_AUTOHINT
|
|
||||||
* FT_LOAD_COLOR
|
|
||||||
*
|
|
||||||
* FT_LOAD_VERTICAL_LAYOUT
|
|
||||||
* FT_LOAD_IGNORE_TRANSFORM
|
|
||||||
* FT_LOAD_FORCE_AUTOHINT
|
|
||||||
* FT_LOAD_NO_RECURSE
|
|
||||||
* FT_LOAD_PEDANTIC
|
|
||||||
*
|
|
||||||
* FT_LOAD_TARGET_NORMAL
|
|
||||||
* FT_LOAD_TARGET_LIGHT
|
|
||||||
* FT_LOAD_TARGET_MONO
|
|
||||||
* FT_LOAD_TARGET_LCD
|
|
||||||
* FT_LOAD_TARGET_LCD_V
|
|
||||||
*
|
|
||||||
* FT_LOAD_TARGET_MODE
|
* FT_LOAD_TARGET_MODE
|
||||||
|
* FT_LOAD_TARGET_XXX
|
||||||
*
|
*
|
||||||
* FT_Render_Glyph
|
* FT_Render_Glyph
|
||||||
* FT_Render_Mode
|
* FT_Render_Mode
|
||||||
|
@ -254,34 +275,121 @@ FT_BEGIN_HEADER
|
||||||
* FT_Kerning_Mode
|
* FT_Kerning_Mode
|
||||||
* FT_Get_Track_Kerning
|
* FT_Get_Track_Kerning
|
||||||
*
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* character_mapping
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Character Mapping
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* Functions to manage character-to-glyph maps.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* This section holds functions and structures that are related to
|
||||||
|
* mapping character input codes to glyph indices.
|
||||||
|
*
|
||||||
|
* Note that for many scripts the simplistic approach used by FreeType
|
||||||
|
* of mapping a single character to a single glyph is not valid or
|
||||||
|
* possible! In general, a higher-level library like HarfBuzz or ICU
|
||||||
|
* should be used for handling text strings.
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
|
* FT_CharMap
|
||||||
* FT_CharMapRec
|
* FT_CharMapRec
|
||||||
|
* FT_Encoding
|
||||||
|
* FT_ENC_TAG
|
||||||
|
*
|
||||||
* FT_Select_Charmap
|
* FT_Select_Charmap
|
||||||
* FT_Set_Charmap
|
* FT_Set_Charmap
|
||||||
* FT_Get_Charmap_Index
|
* FT_Get_Charmap_Index
|
||||||
*
|
*
|
||||||
|
* FT_Get_Char_Index
|
||||||
|
* FT_Get_First_Char
|
||||||
|
* FT_Get_Next_Char
|
||||||
|
* FT_Load_Char
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* information_retrieval
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Information Retrieval
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* Functions to retrieve font and glyph information.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Functions to retrieve font and glyph information. Only some very
|
||||||
|
* basic data is covered; see also the chapter on the format-specific
|
||||||
|
* API for more.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
* FT_Get_Name_Index
|
* FT_Get_Name_Index
|
||||||
* FT_Get_Glyph_Name
|
* FT_Get_Glyph_Name
|
||||||
* FT_Get_Postscript_Name
|
* FT_Get_Postscript_Name
|
||||||
* FT_Get_FSType_Flags
|
* FT_Get_FSType_Flags
|
||||||
|
* FT_FSTYPE_XXX
|
||||||
* FT_Get_SubGlyph_Info
|
* FT_Get_SubGlyph_Info
|
||||||
|
* FT_SUBGLYPH_FLAG_XXX
|
||||||
*
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Other API Data
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* Other structures, enumerations, and macros.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Other structures, enumerations, and macros. Deprecated functions are
|
||||||
|
* also listed here.
|
||||||
|
*
|
||||||
|
* @order:
|
||||||
* FT_Face_Internal
|
* FT_Face_Internal
|
||||||
* FT_Size_Internal
|
* FT_Size_Internal
|
||||||
* FT_Slot_Internal
|
* FT_Slot_Internal
|
||||||
*
|
*
|
||||||
* FT_FACE_FLAG_XXX
|
* FT_SubGlyph
|
||||||
* FT_STYLE_FLAG_XXX
|
|
||||||
* FT_OPEN_XXX
|
|
||||||
* FT_LOAD_XXX
|
|
||||||
* FT_LOAD_TARGET_XXX
|
|
||||||
* FT_SUBGLYPH_FLAG_XXX
|
|
||||||
* FT_FSTYPE_XXX
|
|
||||||
*
|
*
|
||||||
* FT_HAS_FAST_GLYPHS
|
* FT_HAS_FAST_GLYPHS
|
||||||
|
* FT_Face_CheckTrueTypePatents
|
||||||
|
* FT_Face_SetUnpatentedHinting
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* B A S I C T Y P E S */
|
||||||
|
/* */
|
||||||
|
/*************************************************************************/
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
|
@ -349,6 +457,13 @@ FT_BEGIN_HEADER
|
||||||
} FT_Glyph_Metrics;
|
} FT_Glyph_Metrics;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* sizing_and_scaling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
|
@ -409,6 +524,13 @@ FT_BEGIN_HEADER
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* library_setup
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @type:
|
* @type:
|
||||||
|
@ -483,7 +605,7 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @section:
|
* @section:
|
||||||
* base_interface
|
* face_creation
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -519,6 +641,13 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_FaceRec_* FT_Face;
|
typedef struct FT_FaceRec_* FT_Face;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* sizing_and_scaling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @type:
|
* @type:
|
||||||
|
@ -551,6 +680,13 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_SizeRec_* FT_Size;
|
typedef struct FT_SizeRec_* FT_Size;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @type:
|
* @type:
|
||||||
|
@ -570,6 +706,13 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
|
typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* character_mapping
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @type:
|
* @type:
|
||||||
|
@ -877,6 +1020,13 @@ FT_BEGIN_HEADER
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @type:
|
* @type:
|
||||||
|
@ -892,6 +1042,13 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_Face_InternalRec_* FT_Face_Internal;
|
typedef struct FT_Face_InternalRec_* FT_Face_Internal;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* face_creation
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
|
@ -918,7 +1075,7 @@ FT_BEGIN_HEADER
|
||||||
* If we have the third named instance of face~4, say, `face_index` is
|
* If we have the third named instance of face~4, say, `face_index` is
|
||||||
* set to 0x00030004.
|
* set to 0x00030004.
|
||||||
*
|
*
|
||||||
* Bit 31 is always zero (this is, `face_index` is always a positive
|
* Bit 31 is always zero (that is, `face_index` is always a positive
|
||||||
* value).
|
* value).
|
||||||
*
|
*
|
||||||
* [Since 2.9] Changing the design coordinates with
|
* [Since 2.9] Changing the design coordinates with
|
||||||
|
@ -936,7 +1093,7 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* [Since 2.6.1] Bits 16-30 hold the number of named instances
|
* [Since 2.6.1] Bits 16-30 hold the number of named instances
|
||||||
* available for the current face if we have a GX or OpenType variation
|
* available for the current face if we have a GX or OpenType variation
|
||||||
* (sub)font. Bit 31 is always zero (this is, `style_flags` is always
|
* (sub)font. Bit 31 is always zero (that is, `style_flags` is always
|
||||||
* a positive value). Note that a variation font has always at least
|
* a positive value). Note that a variation font has always at least
|
||||||
* one named instance, namely the default instance.
|
* one named instance, namely the default instance.
|
||||||
*
|
*
|
||||||
|
@ -1002,7 +1159,7 @@ FT_BEGIN_HEADER
|
||||||
* Note that the bounding box might be off by (at least) one pixel for
|
* Note that the bounding box might be off by (at least) one pixel for
|
||||||
* hinted fonts. See @FT_Size_Metrics for further discussion.
|
* hinted fonts. See @FT_Size_Metrics for further discussion.
|
||||||
*
|
*
|
||||||
* Note that the bounding box does not vary in OpenType variable fonts
|
* Note that the bounding box does not vary in OpenType variation fonts
|
||||||
* and should only be used in relation to the default instance.
|
* and should only be used in relation to the default instance.
|
||||||
*
|
*
|
||||||
* units_per_EM ::
|
* units_per_EM ::
|
||||||
|
@ -1090,9 +1247,9 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
FT_Generic generic;
|
FT_Generic generic;
|
||||||
|
|
||||||
/*# The following member variables (down to `underline_thickness`) */
|
/* The following member variables (down to `underline_thickness`) */
|
||||||
/*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
|
/* are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
|
||||||
/*# for bitmap fonts. */
|
/* for bitmap fonts. */
|
||||||
FT_BBox bbox;
|
FT_BBox bbox;
|
||||||
|
|
||||||
FT_UShort units_per_EM;
|
FT_UShort units_per_EM;
|
||||||
|
@ -1110,7 +1267,7 @@ FT_BEGIN_HEADER
|
||||||
FT_Size size;
|
FT_Size size;
|
||||||
FT_CharMap charmap;
|
FT_CharMap charmap;
|
||||||
|
|
||||||
/*@private begin */
|
/* private fields, internal to FreeType */
|
||||||
|
|
||||||
FT_Driver driver;
|
FT_Driver driver;
|
||||||
FT_Memory memory;
|
FT_Memory memory;
|
||||||
|
@ -1123,8 +1280,6 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
FT_Face_Internal internal;
|
FT_Face_Internal internal;
|
||||||
|
|
||||||
/*@private end */
|
|
||||||
|
|
||||||
} FT_FaceRec;
|
} FT_FaceRec;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1207,13 +1362,13 @@ FT_BEGIN_HEADER
|
||||||
* successfully; in all other cases you get an
|
* successfully; in all other cases you get an
|
||||||
* `FT_Err_Invalid_Argument` error.
|
* `FT_Err_Invalid_Argument` error.
|
||||||
*
|
*
|
||||||
* Note that CID-keyed fonts that are in an SFNT wrapper (this is, all
|
* Note that CID-keyed fonts that are in an SFNT wrapper (that is, all
|
||||||
* OpenType/CFF fonts) don't have this flag set since the glyphs are
|
* OpenType/CFF fonts) don't have this flag set since the glyphs are
|
||||||
* accessed in the normal way (using contiguous indices); the
|
* accessed in the normal way (using contiguous indices); the
|
||||||
* 'CID-ness' isn't visible to the application.
|
* 'CID-ness' isn't visible to the application.
|
||||||
*
|
*
|
||||||
* FT_FACE_FLAG_TRICKY ::
|
* FT_FACE_FLAG_TRICKY ::
|
||||||
* The face is 'tricky', this is, it always needs the font format's
|
* The face is 'tricky', that is, it always needs the font format's
|
||||||
* native hinting engine to get a reasonable result. A typical example
|
* native hinting engine to get a reasonable result. A typical example
|
||||||
* is the old Chinese font `mingli.ttf` (but not `mingliu.ttc`) that
|
* is the old Chinese font `mingli.ttf` (but not `mingliu.ttc`) that
|
||||||
* uses TrueType bytecode instructions to move and scale all of its
|
* uses TrueType bytecode instructions to move and scale all of its
|
||||||
|
@ -1235,8 +1390,8 @@ FT_BEGIN_HEADER
|
||||||
* FT_FACE_FLAG_VARIATION ::
|
* FT_FACE_FLAG_VARIATION ::
|
||||||
* [Since 2.9] Set if the current face (or named instance) has been
|
* [Since 2.9] Set if the current face (or named instance) has been
|
||||||
* altered with @FT_Set_MM_Design_Coordinates,
|
* altered with @FT_Set_MM_Design_Coordinates,
|
||||||
* @FT_Set_Var_Design_Coordinates, or @FT_Set_Var_Blend_Coordinates.
|
* @FT_Set_Var_Design_Coordinates, @FT_Set_Var_Blend_Coordinates, or
|
||||||
* This flag is unset by a call to @FT_Set_Named_Instance.
|
* @FT_Set_MM_WeightVector to select a non-default instance.
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
|
@ -1272,6 +1427,13 @@ FT_BEGIN_HEADER
|
||||||
#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
|
#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* font_testing_macros
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @macro:
|
* @macro:
|
||||||
|
@ -1381,6 +1543,13 @@ FT_BEGIN_HEADER
|
||||||
( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) )
|
( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) )
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @macro:
|
* @macro:
|
||||||
|
@ -1393,6 +1562,13 @@ FT_BEGIN_HEADER
|
||||||
#define FT_HAS_FAST_GLYPHS( face ) 0
|
#define FT_HAS_FAST_GLYPHS( face ) 0
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* font_testing_macros
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @macro:
|
* @macro:
|
||||||
|
@ -1451,8 +1627,8 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* A macro that returns true whenever a face object has been altered by
|
* A macro that returns true whenever a face object has been altered by
|
||||||
* @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, or
|
* @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates,
|
||||||
* @FT_Set_Var_Blend_Coordinates.
|
* @FT_Set_Var_Blend_Coordinates, or @FT_Set_MM_WeightVector.
|
||||||
*
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.9
|
* 2.9
|
||||||
|
@ -1628,6 +1804,13 @@ FT_BEGIN_HEADER
|
||||||
( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) )
|
( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) )
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* face_creation
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @enum:
|
* @enum:
|
||||||
|
@ -1654,6 +1837,13 @@ FT_BEGIN_HEADER
|
||||||
#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
|
#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @type:
|
* @type:
|
||||||
|
@ -1666,6 +1856,13 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_Size_InternalRec_* FT_Size_Internal;
|
typedef struct FT_Size_InternalRec_* FT_Size_Internal;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* sizing_and_scaling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
|
@ -1817,6 +2014,13 @@ FT_BEGIN_HEADER
|
||||||
} FT_SizeRec;
|
} FT_SizeRec;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
|
@ -1848,6 +2052,13 @@ FT_BEGIN_HEADER
|
||||||
typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
|
typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
|
@ -2092,6 +2303,13 @@ FT_BEGIN_HEADER
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* library_setup
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -2149,6 +2367,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Done_FreeType( FT_Library library );
|
FT_Done_FreeType( FT_Library library );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* face_creation
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @enum:
|
* @enum:
|
||||||
|
@ -2451,7 +2676,7 @@ FT_BEGIN_HEADER
|
||||||
* Each new face object created with this function also owns a default
|
* Each new face object created with this function also owns a default
|
||||||
* @FT_Size object, accessible as `face->size`.
|
* @FT_Size object, accessible as `face->size`.
|
||||||
*
|
*
|
||||||
* One @FT_Library instance can have multiple face objects, this is,
|
* One @FT_Library instance can have multiple face objects, that is,
|
||||||
* @FT_Open_Face and its siblings can be called multiple times using the
|
* @FT_Open_Face and its siblings can be called multiple times using the
|
||||||
* same `library` argument.
|
* same `library` argument.
|
||||||
*
|
*
|
||||||
|
@ -2650,6 +2875,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Done_Face( FT_Face face );
|
FT_Done_Face( FT_Face face );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* sizing_and_scaling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -2679,7 +2911,7 @@ FT_BEGIN_HEADER
|
||||||
* silently uses outlines if there is no bitmap for a given glyph index.
|
* silently uses outlines if there is no bitmap for a given glyph index.
|
||||||
*
|
*
|
||||||
* For GX and OpenType variation fonts, a bitmap strike makes sense only
|
* For GX and OpenType variation fonts, a bitmap strike makes sense only
|
||||||
* if the default instance is active (this is, no glyph variation takes
|
* if the default instance is active (that is, no glyph variation takes
|
||||||
* place); otherwise, FreeType simply ignores bitmap strikes. The same
|
* place); otherwise, FreeType simply ignores bitmap strikes. The same
|
||||||
* is true for all named instances that are different from the default
|
* is true for all named instances that are different from the default
|
||||||
* instance.
|
* instance.
|
||||||
|
@ -2942,6 +3174,13 @@ FT_BEGIN_HEADER
|
||||||
FT_UInt pixel_height );
|
FT_UInt pixel_height );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -2976,7 +3215,7 @@ FT_BEGIN_HEADER
|
||||||
* glyph may be transformed. See @FT_Set_Transform for the details.
|
* glyph may be transformed. See @FT_Set_Transform for the details.
|
||||||
*
|
*
|
||||||
* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument` is returned
|
* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument` is returned
|
||||||
* for invalid CID values (this is, for CID values that don't have a
|
* for invalid CID values (that is, for CID values that don't have a
|
||||||
* corresponding glyph in the font). See the discussion of the
|
* corresponding glyph in the font). See the discussion of the
|
||||||
* @FT_FACE_FLAG_CID_KEYED flag for more details.
|
* @FT_FACE_FLAG_CID_KEYED flag for more details.
|
||||||
*
|
*
|
||||||
|
@ -2990,6 +3229,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Int32 load_flags );
|
FT_Int32 load_flags );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* character_mapping
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -3033,6 +3279,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Int32 load_flags );
|
FT_Int32 load_flags );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @enum:
|
* @enum:
|
||||||
|
@ -3172,10 +3425,11 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* [Since 2.12] If the glyph index maps to an entry in the face's
|
* [Since 2.12] If the glyph index maps to an entry in the face's
|
||||||
* 'SVG~' table, load the associated SVG document from this table and
|
* 'SVG~' table, load the associated SVG document from this table and
|
||||||
* set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG.
|
* set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG
|
||||||
* Note that FreeType itself can't render SVG documents; however, the
|
* ([since 2.13.1] provided @FT_LOAD_NO_SVG is not set). Note that
|
||||||
* library provides hooks to seamlessly integrate an external renderer.
|
* FreeType itself can't render SVG documents; however, the library
|
||||||
* See sections @ot_svg_driver and @svg_fonts for more.
|
* provides hooks to seamlessly integrate an external renderer. See
|
||||||
|
* sections @ot_svg_driver and @svg_fonts for more.
|
||||||
*
|
*
|
||||||
* [Since 2.10, experimental] If the glyph index maps to an entry in
|
* [Since 2.10, experimental] If the glyph index maps to an entry in
|
||||||
* the face's 'COLR' table with a 'CPAL' palette table (as defined in
|
* the face's 'COLR' table with a 'CPAL' palette table (as defined in
|
||||||
|
@ -3189,6 +3443,9 @@ FT_BEGIN_HEADER
|
||||||
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
|
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
|
||||||
* so that the client application can handle blending by itself.
|
* so that the client application can handle blending by itself.
|
||||||
*
|
*
|
||||||
|
* FT_LOAD_NO_SVG ::
|
||||||
|
* [Since 2.13.1] Ignore SVG glyph data when loading.
|
||||||
|
*
|
||||||
* 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
|
||||||
* use of bundled metrics tables (for example, the 'hdmx' table in
|
* use of bundled metrics tables (for example, the 'hdmx' table in
|
||||||
|
@ -3254,6 +3511,7 @@ FT_BEGIN_HEADER
|
||||||
#define FT_LOAD_COLOR ( 1L << 20 )
|
#define FT_LOAD_COLOR ( 1L << 20 )
|
||||||
#define FT_LOAD_COMPUTE_METRICS ( 1L << 21 )
|
#define FT_LOAD_COMPUTE_METRICS ( 1L << 21 )
|
||||||
#define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 )
|
#define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 )
|
||||||
|
#define FT_LOAD_NO_SVG ( 1L << 24 )
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
|
@ -3372,6 +3630,13 @@ FT_BEGIN_HEADER
|
||||||
FT_STATIC_CAST( FT_Render_Mode, ( (x) >> 16 ) & 15 )
|
FT_STATIC_CAST( FT_Render_Mode, ( (x) >> 16 ) & 15 )
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* sizing_and_scaling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -3447,6 +3712,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Vector* delta );
|
FT_Vector* delta );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* glyph_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @enum:
|
* @enum:
|
||||||
|
@ -3841,6 +4113,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Fixed* akerning );
|
FT_Fixed* akerning );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* character_mapping
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -4057,6 +4336,13 @@ FT_BEGIN_HEADER
|
||||||
FT_UInt *agindex );
|
FT_UInt *agindex );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* face_creation
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -4155,6 +4441,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Parameter* properties );
|
FT_Parameter* properties );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* information_retrieval
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
@ -4266,9 +4559,10 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* [Since 2.9] Special PostScript names for named instances are only
|
* [Since 2.9] Special PostScript names for named instances are only
|
||||||
* returned if the named instance is set with @FT_Set_Named_Instance (and
|
* returned if the named instance is set with @FT_Set_Named_Instance (and
|
||||||
* the font has corresponding entries in its 'fvar' table). If
|
* the font has corresponding entries in its 'fvar' table or is the
|
||||||
* @FT_IS_VARIATION returns true, the algorithmically derived PostScript
|
* default named instance). If @FT_IS_VARIATION returns true, the
|
||||||
* name is provided, not looking up special entries for named instances.
|
* algorithmically derived PostScript name is provided, not looking up
|
||||||
|
* special entries for named instances.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( const char* )
|
FT_EXPORT( const char* )
|
||||||
FT_Get_Postscript_Name( FT_Face face );
|
FT_Get_Postscript_Name( FT_Face face );
|
||||||
|
@ -4900,32 +5194,10 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @section:
|
* @section:
|
||||||
* version
|
* library_setup
|
||||||
*
|
|
||||||
* @title:
|
|
||||||
* FreeType Version
|
|
||||||
*
|
|
||||||
* @abstract:
|
|
||||||
* Functions and macros related to FreeType versions.
|
|
||||||
*
|
|
||||||
* @description:
|
|
||||||
* Note that those functions and macros are of limited use because even a
|
|
||||||
* new release of FreeType with only documentation changes increases the
|
|
||||||
* version number.
|
|
||||||
*
|
|
||||||
* @order:
|
|
||||||
* FT_Library_Version
|
|
||||||
*
|
|
||||||
* FREETYPE_MAJOR
|
|
||||||
* FREETYPE_MINOR
|
|
||||||
* FREETYPE_PATCH
|
|
||||||
*
|
|
||||||
* FT_Face_CheckTrueTypePatents
|
|
||||||
* FT_Face_SetUnpatentedHinting
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @enum:
|
* @enum:
|
||||||
|
@ -4950,7 +5222,7 @@ FT_BEGIN_HEADER
|
||||||
*/
|
*/
|
||||||
#define FREETYPE_MAJOR 2
|
#define FREETYPE_MAJOR 2
|
||||||
#define FREETYPE_MINOR 13
|
#define FREETYPE_MINOR 13
|
||||||
#define FREETYPE_PATCH 0
|
#define FREETYPE_PATCH 2
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -4992,6 +5264,13 @@ FT_BEGIN_HEADER
|
||||||
FT_Int *apatch );
|
FT_Int *apatch );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
|
|
|
@ -43,61 +43,61 @@ FT_BEGIN_HEADER
|
||||||
* objects, as well as caching information like character maps and glyph
|
* objects, as well as caching information like character maps and glyph
|
||||||
* images while limiting their maximum memory usage.
|
* images while limiting their maximum memory usage.
|
||||||
*
|
*
|
||||||
* Note that all types and functions begin with the `FTC_` prefix.
|
* Note that all types and functions begin with the `FTC_` prefix rather
|
||||||
|
* than the usual `FT_` prefix in the rest of FreeType.
|
||||||
*
|
*
|
||||||
* The cache is highly portable and thus doesn't know anything about the
|
* The cache is highly portable and, thus, doesn't know anything about
|
||||||
* fonts installed on your system, or how to access them. This implies
|
* the fonts installed on your system, or how to access them. Therefore,
|
||||||
* the following scheme:
|
* it requires the following.
|
||||||
*
|
*
|
||||||
* First, available or installed font faces are uniquely identified by
|
* * @FTC_FaceID, an arbitrary non-zero value that uniquely identifies
|
||||||
* @FTC_FaceID values, provided to the cache by the client. Note that
|
* available or installed font faces, has to be provided to the
|
||||||
* the cache only stores and compares these values, and doesn't try to
|
* cache by the client. Note that the cache only stores and compares
|
||||||
* interpret them in any way.
|
* these values and doesn't try to interpret them in any way, but they
|
||||||
|
* have to be persistent on the client side.
|
||||||
*
|
*
|
||||||
* Second, the cache calls, only when needed, a client-provided function
|
* * @FTC_Face_Requester, a method to convert an @FTC_FaceID into a new
|
||||||
* to convert an @FTC_FaceID into a new @FT_Face object. The latter is
|
* @FT_Face object when necessary, has to be provided to the cache by
|
||||||
* then completely managed by the cache, including its termination
|
* the client. The @FT_Face object is completely managed by the cache,
|
||||||
* through @FT_Done_Face. To monitor termination of face objects, the
|
* including its termination through @FT_Done_Face. To monitor
|
||||||
* finalizer callback in the `generic` field of the @FT_Face object can
|
* termination of face objects, the finalizer callback in the `generic`
|
||||||
* be used, which might also be used to store the @FTC_FaceID of the
|
* field of the @FT_Face object can be used, which might also be used
|
||||||
* face.
|
* to store the @FTC_FaceID of the face.
|
||||||
*
|
*
|
||||||
* Clients are free to map face IDs to anything else. The most simple
|
* Clients are free to map face IDs to anything useful. The most simple
|
||||||
* usage is to associate them to a (pathname,face_index) pair that is
|
* usage is, for example, to associate them to a `{pathname,face_index}`
|
||||||
* used to call @FT_New_Face. However, more complex schemes are also
|
* pair that is then used by @FTC_Face_Requester to call @FT_New_Face.
|
||||||
* possible.
|
* However, more complex schemes are also possible.
|
||||||
*
|
*
|
||||||
* Note that for the cache to work correctly, the face ID values must be
|
* Note that for the cache to work correctly, the face ID values must be
|
||||||
* **persistent**, which means that the contents they point to should not
|
* **persistent**, which means that the contents they point to should not
|
||||||
* change at runtime, or that their value should not become invalid.
|
* change at runtime, or that their value should not become invalid.
|
||||||
*
|
|
||||||
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
|
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
|
||||||
* you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
|
* you should call @FTC_Manager_RemoveFaceID as soon as possible to let
|
||||||
* the cache get rid of any references to the old @FTC_FaceID it may keep
|
* the cache get rid of any references to the old @FTC_FaceID it may keep
|
||||||
* internally. Failure to do so will lead to incorrect behaviour or even
|
* internally. Failure to do so will lead to incorrect behaviour or even
|
||||||
* crashes.
|
* crashes in @FTC_Face_Requester.
|
||||||
*
|
*
|
||||||
* To use the cache, start with calling @FTC_Manager_New to create a new
|
* To use the cache, start with calling @FTC_Manager_New to create a new
|
||||||
* @FTC_Manager object, which models a single cache instance. You can
|
* @FTC_Manager object, which models a single cache instance. You can
|
||||||
* then look up @FT_Face and @FT_Size objects with
|
* then look up @FT_Face and @FT_Size objects with
|
||||||
* @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
|
* @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively, and
|
||||||
|
* use them in any FreeType work stream. You can also cache other
|
||||||
|
* FreeType objects as follows.
|
||||||
*
|
*
|
||||||
* If you want to use the charmap caching, call @FTC_CMapCache_New, then
|
* * If you want to use the charmap caching, call @FTC_CMapCache_New,
|
||||||
* later use @FTC_CMapCache_Lookup to perform the equivalent of
|
* then later use @FTC_CMapCache_Lookup to perform the equivalent of
|
||||||
* @FT_Get_Char_Index, only much faster.
|
* @FT_Get_Char_Index, only much faster.
|
||||||
*
|
*
|
||||||
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache_New,
|
* * If you want to use the @FT_Glyph caching, call @FTC_ImageCache_New,
|
||||||
* then later use @FTC_ImageCache_Lookup to retrieve the corresponding
|
* then later use @FTC_ImageCache_Lookup to retrieve the corresponding
|
||||||
* @FT_Glyph objects from the cache.
|
* @FT_Glyph objects from the cache.
|
||||||
*
|
*
|
||||||
* If you need lots of small bitmaps, it is much more memory efficient to
|
* * If you need lots of small bitmaps, it is much more memory-efficient
|
||||||
* call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
|
* to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
|
||||||
* returns @FTC_SBitRec structures, which are used to store small bitmaps
|
* returns @FTC_SBitRec structures, which are used to store small
|
||||||
* directly. (A small bitmap is one whose metrics and dimensions all fit
|
* bitmaps directly. (A small bitmap is one whose metrics and
|
||||||
* into 8-bit integers).
|
* dimensions all fit into 8-bit integers).
|
||||||
*
|
|
||||||
* We hope to also provide a kerning cache in the near future.
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
* @order:
|
* @order:
|
||||||
* FTC_Manager
|
* FTC_Manager
|
||||||
|
|
|
@ -31,9 +31,28 @@
|
||||||
* Core API
|
* Core API
|
||||||
*
|
*
|
||||||
* @sections:
|
* @sections:
|
||||||
* version
|
|
||||||
* basic_types
|
* basic_types
|
||||||
* base_interface
|
* library_setup
|
||||||
|
* face_creation
|
||||||
|
* font_testing_macros
|
||||||
|
* sizing_and_scaling
|
||||||
|
* glyph_retrieval
|
||||||
|
* character_mapping
|
||||||
|
* information_retrieval
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @chapter:
|
||||||
|
* extended_api
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Extended API
|
||||||
|
*
|
||||||
|
* @sections:
|
||||||
* glyph_variants
|
* glyph_variants
|
||||||
* color_management
|
* color_management
|
||||||
* layer_management
|
* layer_management
|
||||||
|
|
|
@ -134,7 +134,7 @@ FT_BEGIN_HEADER
|
||||||
* each being rounded to the nearest pixel edge, taking care of overshoot
|
* each being rounded to the nearest pixel edge, taking care of overshoot
|
||||||
* suppression at small sizes, stem darkening, and scaling.
|
* suppression at small sizes, stem darkening, and scaling.
|
||||||
*
|
*
|
||||||
* Hstems (this is, hint values defined in the font to help align
|
* Hstems (that is, hint values defined in the font to help align
|
||||||
* horizontal features) that fall within a blue zone are said to be
|
* horizontal features) that fall within a blue zone are said to be
|
||||||
* 'captured' and are aligned to that zone. Uncaptured stems are moved
|
* 'captured' and are aligned to that zone. Uncaptured stems are moved
|
||||||
* in one of four ways, top edge up or down, bottom edge up or down.
|
* in one of four ways, top edge up or down, bottom edge up or down.
|
||||||
|
@ -446,7 +446,7 @@ FT_BEGIN_HEADER
|
||||||
* at smaller sizes.
|
* at smaller sizes.
|
||||||
*
|
*
|
||||||
* For the auto-hinter, stem-darkening is experimental currently and thus
|
* For the auto-hinter, stem-darkening is experimental currently and thus
|
||||||
* switched off by default (this is, `no-stem-darkening` is set to TRUE
|
* switched off by default (that is, `no-stem-darkening` is set to TRUE
|
||||||
* by default). Total consistency with the CFF driver is not achieved
|
* by default). Total consistency with the CFF driver is not achieved
|
||||||
* right now because the emboldening method differs and glyphs must be
|
* right now because the emboldening method differs and glyphs must be
|
||||||
* scaled down on the Y-axis to keep outline points inside their
|
* scaled down on the Y-axis to keep outline points inside their
|
||||||
|
@ -651,11 +651,8 @@ FT_BEGIN_HEADER
|
||||||
* Windows~98; only grayscale and B/W rasterizing is supported.
|
* Windows~98; only grayscale and B/W rasterizing is supported.
|
||||||
*
|
*
|
||||||
* TT_INTERPRETER_VERSION_38 ::
|
* TT_INTERPRETER_VERSION_38 ::
|
||||||
* Version~38 corresponds to MS rasterizer v.1.9; it is roughly
|
* Version~38 is the same Version~40. The original 'Infinality' code is
|
||||||
* equivalent to the hinting provided by DirectWrite ClearType (as can
|
* no longer available.
|
||||||
* be found, for example, in the Internet Explorer~9 running on
|
|
||||||
* Windows~7). It is used in FreeType to select the 'Infinality'
|
|
||||||
* subpixel hinting code. The code may be removed in a future version.
|
|
||||||
*
|
*
|
||||||
* TT_INTERPRETER_VERSION_40 ::
|
* TT_INTERPRETER_VERSION_40 ::
|
||||||
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
|
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Note: A 'raster' is simply a scan-line converter, used to render
|
* Note: A 'raster' is simply a scan-line converter, used to render
|
||||||
* FT_Outlines into FT_Bitmaps.
|
* `FT_Outline`s into `FT_Bitmap`s.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -256,6 +256,12 @@ FT_BEGIN_HEADER
|
||||||
* palette ::
|
* palette ::
|
||||||
* A typeless pointer to the bitmap palette; this field is intended for
|
* A typeless pointer to the bitmap palette; this field is intended for
|
||||||
* paletted pixel modes. Not used currently.
|
* paletted pixel modes. Not used currently.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* `width` and `rows` refer to the *physical* size of the bitmap, not the
|
||||||
|
* *logical* one. For example, if @FT_Pixel_Mode is set to
|
||||||
|
* `FT_PIXEL_MODE_LCD`, the logical width is a just a third of the
|
||||||
|
* physical one.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_Bitmap_
|
typedef struct FT_Bitmap_
|
||||||
{
|
{
|
||||||
|
@ -856,7 +862,7 @@ FT_BEGIN_HEADER
|
||||||
* @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
|
* @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
|
||||||
*
|
*
|
||||||
* The anti-aliased rasterizer produces coverage values from 0 to 255,
|
* The anti-aliased rasterizer produces coverage values from 0 to 255,
|
||||||
* this is, from completely transparent to completely opaque.
|
* that is, from completely transparent to completely opaque.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_Span_
|
typedef struct FT_Span_
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,7 +62,7 @@ FT_BEGIN_HEADER
|
||||||
* component.
|
* component.
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* FT_Trace_Set_Level( "any:7 memory:0 );
|
* FT_Trace_Set_Level( "any:7 memory:0" );
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
|
|
|
@ -153,7 +153,7 @@ FT_BEGIN_HEADER
|
||||||
* @note:
|
* @note:
|
||||||
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
|
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
|
||||||
* for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
|
* for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
|
||||||
* values are integers.
|
* values are whole numbers (i.e., the fractional part is zero).
|
||||||
*/
|
*/
|
||||||
typedef struct FT_Var_Axis_
|
typedef struct FT_Var_Axis_
|
||||||
{
|
{
|
||||||
|
@ -399,8 +399,8 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The design coordinates are 16.16 fractional values for TrueType GX and
|
* The design coordinates are 16.16 fractional values for TrueType GX and
|
||||||
* OpenType variation fonts. For Adobe MM fonts, the values are
|
* OpenType variation fonts. For Adobe MM fonts, the values are supposed
|
||||||
* integers.
|
* to be whole numbers (i.e., the fractional part is zero).
|
||||||
*
|
*
|
||||||
* [Since 2.8.1] To reset all axes to the default values, call the
|
* [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`.
|
||||||
|
@ -446,8 +446,8 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The design coordinates are 16.16 fractional values for TrueType GX and
|
* The design coordinates are 16.16 fractional values for TrueType GX and
|
||||||
* OpenType variation fonts. For Adobe MM fonts, the values are
|
* OpenType variation fonts. For Adobe MM fonts, the values are whole
|
||||||
* integers.
|
* numbers (i.e., the fractional part is zero).
|
||||||
*
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.7.1
|
* 2.7.1
|
||||||
|
@ -602,10 +602,12 @@ FT_BEGIN_HEADER
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* Adobe Multiple Master fonts limit the number of designs, and thus the
|
* Adobe Multiple Master fonts limit the number of designs, and thus the
|
||||||
* length of the weight vector to~16.
|
* length of the weight vector to 16~elements.
|
||||||
*
|
*
|
||||||
* If `len` is zero and `weightvector` is `NULL`, the weight vector array
|
* If `len` is larger than zero, this function sets the
|
||||||
* is reset to the default values.
|
* @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e.,
|
||||||
|
* @FT_IS_VARIATION will return true). If `len` is zero, this bit flag
|
||||||
|
* is unset and the weight vector array is reset to the default values.
|
||||||
*
|
*
|
||||||
* The Adobe documentation also states that the values in the
|
* The Adobe documentation also states that the values in the
|
||||||
* WeightVector array must total 1.0 +/-~0.001. In practice this does
|
* WeightVector array must total 1.0 +/-~0.001. In practice this does
|
||||||
|
@ -753,6 +755,45 @@ FT_BEGIN_HEADER
|
||||||
FT_Set_Named_Instance( FT_Face face,
|
FT_Set_Named_Instance( FT_Face face,
|
||||||
FT_UInt instance_index );
|
FT_UInt instance_index );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @function:
|
||||||
|
* FT_Get_Default_Named_Instance
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Retrieve the index of the default named instance, to be used with
|
||||||
|
* @FT_Set_Named_Instance.
|
||||||
|
*
|
||||||
|
* The default instance of a variation font is that instance for which
|
||||||
|
* the nth axis coordinate is equal to `axis[n].def` (as specified in the
|
||||||
|
* @FT_MM_Var structure), with~n covering all axes.
|
||||||
|
*
|
||||||
|
* FreeType synthesizes a named instance for the default instance if the
|
||||||
|
* font does not contain such an entry.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* A handle to the source face.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* instance_index ::
|
||||||
|
* The index of the default named instance.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* FreeType error code. 0~means success.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* For Adobe MM fonts (which don't have named instances) this function
|
||||||
|
* always returns zero for `instance_index`.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.13.1
|
||||||
|
*/
|
||||||
|
FT_EXPORT( FT_Error )
|
||||||
|
FT_Get_Default_Named_Instance( FT_Face face,
|
||||||
|
FT_UInt *instance_index );
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ FT_BEGIN_HEADER
|
||||||
* attachement.
|
* 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, that is, not calling any emitter); if necessary, you
|
||||||
* should filter this out, too.
|
* should filter this out, too.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
|
|
|
@ -158,7 +158,7 @@ FT_BEGIN_HEADER
|
||||||
FT_Renderer_GetCBoxFunc get_glyph_cbox;
|
FT_Renderer_GetCBoxFunc get_glyph_cbox;
|
||||||
FT_Renderer_SetModeFunc set_mode;
|
FT_Renderer_SetModeFunc set_mode;
|
||||||
|
|
||||||
FT_Raster_Funcs* raster_class;
|
const FT_Raster_Funcs* raster_class;
|
||||||
|
|
||||||
} FT_Renderer_Class;
|
} FT_Renderer_Class;
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,18 @@ FT_BEGIN_HEADER
|
||||||
FT_EXPORT( void )
|
FT_EXPORT( void )
|
||||||
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
||||||
|
|
||||||
|
/* Precisely adjust the glyph weight either horizontally or vertically. */
|
||||||
|
/* The `xdelta` and `ydelta` values are fractions of the face Em size */
|
||||||
|
/* (in fixed-point format). Considering that a regular face would have */
|
||||||
|
/* stem widths on the order of 0.1 Em, a delta of 0.05 (0x0CCC) should */
|
||||||
|
/* be very noticeable. To increase or decrease the weight, use positive */
|
||||||
|
/* or negative values, respectively. */
|
||||||
|
FT_EXPORT( void )
|
||||||
|
FT_GlyphSlot_AdjustWeight( FT_GlyphSlot slot,
|
||||||
|
FT_Fixed xdelta,
|
||||||
|
FT_Fixed ydelta );
|
||||||
|
|
||||||
|
|
||||||
/* Slant an outline glyph to the right by about 12 degrees. */
|
/* Slant an outline glyph to the right by about 12 degrees. */
|
||||||
FT_EXPORT( void )
|
FT_EXPORT( void )
|
||||||
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
|
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
|
||||||
|
|
|
@ -229,8 +229,7 @@ FT_BEGIN_HEADER
|
||||||
* A handle to the source stream.
|
* A handle to the source stream.
|
||||||
*
|
*
|
||||||
* offset ::
|
* offset ::
|
||||||
* The offset from the start of the stream to seek to if this is a seek
|
* The offset from the start of the stream to seek to.
|
||||||
* operation (see note).
|
|
||||||
*
|
*
|
||||||
* buffer ::
|
* buffer ::
|
||||||
* The address of the read buffer.
|
* The address of the read buffer.
|
||||||
|
@ -239,16 +238,9 @@ FT_BEGIN_HEADER
|
||||||
* The number of bytes to read from the stream.
|
* The number of bytes to read from the stream.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* The number of bytes effectively read by the stream.
|
* If count >~0, return the number of bytes effectively read by the
|
||||||
*
|
* stream (after seeking to `offset`). If count ==~0, return the status
|
||||||
* @note:
|
* of the seek operation (non-zero indicates an error).
|
||||||
* This function performs a seek *or* a read operation depending on the
|
|
||||||
* argument values. If `count` is zero, the operation is a seek to
|
|
||||||
* `offset` bytes. If `count` is >~0, the operation is a read of `count`
|
|
||||||
* bytes from the current position in the stream, and the `offset` value
|
|
||||||
* should be ignored.
|
|
||||||
*
|
|
||||||
* For seek operations, a non-zero return value indicates an error.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef unsigned long
|
typedef unsigned long
|
||||||
|
|
|
@ -42,7 +42,10 @@ FT_BEGIN_HEADER
|
||||||
( defined( __cplusplus ) && __cplusplus > 201402L )
|
( defined( __cplusplus ) && __cplusplus > 201402L )
|
||||||
# define FALL_THROUGH [[__fallthrough__]]
|
# define FALL_THROUGH [[__fallthrough__]]
|
||||||
# elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \
|
# elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \
|
||||||
( defined( __clang__ ) && __clang_major__ >= 10 )
|
( defined( __clang__ ) && \
|
||||||
|
( defined( __apple_build_version__ ) \
|
||||||
|
? __apple_build_version__ >= 12000000 \
|
||||||
|
: __clang_major__ >= 10 ) )
|
||||||
# define FALL_THROUGH __attribute__(( __fallthrough__ ))
|
# define FALL_THROUGH __attribute__(( __fallthrough__ ))
|
||||||
# else
|
# else
|
||||||
# define FALL_THROUGH ( (void)0 )
|
# define FALL_THROUGH ( (void)0 )
|
||||||
|
|
|
@ -332,9 +332,9 @@ FT_BEGIN_HEADER
|
||||||
* Based on geometric considerations we use the following inequality to
|
* Based on geometric considerations we use the following inequality to
|
||||||
* identify a degenerate matrix.
|
* identify a degenerate matrix.
|
||||||
*
|
*
|
||||||
* 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
|
* 32 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
|
||||||
*
|
*
|
||||||
* Value 50 is heuristic.
|
* Value 32 is heuristic.
|
||||||
*/
|
*/
|
||||||
FT_BASE( FT_Bool )
|
FT_BASE( FT_Bool )
|
||||||
FT_Matrix_Check( const FT_Matrix* matrix );
|
FT_Matrix_Check( const FT_Matrix* matrix );
|
||||||
|
|
|
@ -157,6 +157,7 @@ FT_BEGIN_HEADER
|
||||||
* A handle to a function used to select a new fixed size. It is used
|
* A handle to a function used to select a new fixed size. It is used
|
||||||
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
|
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
|
||||||
* scaling done in the base layer suffices.
|
* scaling done in the base layer suffices.
|
||||||
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* Most function pointers, with the exception of `load_glyph`, can be set
|
* Most function pointers, with the exception of `load_glyph`, can be set
|
||||||
* to 0 to indicate a default behaviour.
|
* to 0 to indicate a default behaviour.
|
||||||
|
|
|
@ -28,13 +28,19 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
typedef struct GX_ItemVarDataRec_
|
typedef struct GX_ItemVarDataRec_
|
||||||
{
|
{
|
||||||
FT_UInt itemCount; /* number of delta sets per item */
|
FT_UInt itemCount; /* Number of delta sets per item. */
|
||||||
FT_UInt regionIdxCount; /* number of region indices */
|
FT_UInt regionIdxCount; /* Number of region indices. */
|
||||||
FT_UInt* regionIndices; /* array of `regionCount' indices; */
|
FT_UInt* regionIndices; /* Array of `regionCount` indices; */
|
||||||
/* these index `varRegionList' */
|
/* these index `varRegionList`. */
|
||||||
FT_ItemVarDelta* deltaSet; /* array of `itemCount' deltas */
|
FT_Byte* deltaSet; /* Array of `itemCount` deltas; */
|
||||||
/* use `innerIndex' for this array */
|
/* use `innerIndex` for this array. */
|
||||||
|
FT_UShort wordDeltaCount; /* Number of the first 32-bit ints */
|
||||||
|
/* or 16-bit ints of `deltaSet` */
|
||||||
|
/* depending on `longWords`. */
|
||||||
|
FT_Bool longWords; /* If true, `deltaSet` is a 32-bit */
|
||||||
|
/* array followed by a 16-bit */
|
||||||
|
/* array, otherwise a 16-bit array */
|
||||||
|
/* followed by an 8-bit array. */
|
||||||
} GX_ItemVarDataRec, *GX_ItemVarData;
|
} GX_ItemVarDataRec, *GX_ItemVarData;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,9 @@ FT_BEGIN_HEADER
|
||||||
typedef void
|
typedef void
|
||||||
(*FT_Metrics_Adjust_Func)( FT_Face face );
|
(*FT_Metrics_Adjust_Func)( FT_Face face );
|
||||||
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*FT_Size_Reset_Func)( FT_Size size );
|
||||||
|
|
||||||
|
|
||||||
FT_DEFINE_SERVICE( MetricsVariations )
|
FT_DEFINE_SERVICE( MetricsVariations )
|
||||||
{
|
{
|
||||||
|
@ -90,6 +93,7 @@ FT_BEGIN_HEADER
|
||||||
FT_VOrg_Adjust_Func vorg_adjust;
|
FT_VOrg_Adjust_Func vorg_adjust;
|
||||||
|
|
||||||
FT_Metrics_Adjust_Func metrics_adjust;
|
FT_Metrics_Adjust_Func metrics_adjust;
|
||||||
|
FT_Size_Reset_Func size_reset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +105,8 @@ FT_BEGIN_HEADER
|
||||||
tsb_adjust_, \
|
tsb_adjust_, \
|
||||||
bsb_adjust_, \
|
bsb_adjust_, \
|
||||||
vorg_adjust_, \
|
vorg_adjust_, \
|
||||||
metrics_adjust_ ) \
|
metrics_adjust_, \
|
||||||
|
size_reset_ ) \
|
||||||
static const FT_Service_MetricsVariationsRec class_ = \
|
static const FT_Service_MetricsVariationsRec class_ = \
|
||||||
{ \
|
{ \
|
||||||
hadvance_adjust_, \
|
hadvance_adjust_, \
|
||||||
|
@ -111,7 +116,8 @@ FT_BEGIN_HEADER
|
||||||
tsb_adjust_, \
|
tsb_adjust_, \
|
||||||
bsb_adjust_, \
|
bsb_adjust_, \
|
||||||
vorg_adjust_, \
|
vorg_adjust_, \
|
||||||
metrics_adjust_ \
|
metrics_adjust_, \
|
||||||
|
size_reset_ \
|
||||||
};
|
};
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
|
@ -62,7 +62,7 @@ FT_BEGIN_HEADER
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Set_MM_Blend_Func)( FT_Face face,
|
(*FT_Set_MM_Blend_Func)( FT_Face face,
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Long* coords );
|
FT_Fixed* coords );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Get_Var_Design_Func)( FT_Face face,
|
(*FT_Get_Var_Design_Func)( FT_Face face,
|
||||||
|
@ -70,13 +70,17 @@ FT_BEGIN_HEADER
|
||||||
FT_Fixed* coords );
|
FT_Fixed* coords );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Set_Instance_Func)( FT_Face face,
|
(*FT_Set_Named_Instance_Func)( FT_Face face,
|
||||||
FT_UInt instance_index );
|
FT_UInt instance_index );
|
||||||
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*FT_Get_Default_Named_Instance_Func)( FT_Face face,
|
||||||
|
FT_UInt *instance_index );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Get_MM_Blend_Func)( FT_Face face,
|
(*FT_Get_MM_Blend_Func)( FT_Face face,
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Long* coords );
|
FT_Fixed* coords );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Get_Var_Blend_Func)( FT_Face face,
|
(*FT_Get_Var_Blend_Func)( FT_Face face,
|
||||||
|
@ -86,7 +90,7 @@ FT_BEGIN_HEADER
|
||||||
FT_MM_Var* *mm_var );
|
FT_MM_Var* *mm_var );
|
||||||
|
|
||||||
typedef void
|
typedef void
|
||||||
(*FT_Done_Blend_Func)( FT_Face );
|
(*FT_Done_Blend_Func)( FT_Face face );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
|
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
|
||||||
|
@ -98,6 +102,9 @@ FT_BEGIN_HEADER
|
||||||
FT_UInt* len,
|
FT_UInt* len,
|
||||||
FT_Fixed* weight_vector );
|
FT_Fixed* weight_vector );
|
||||||
|
|
||||||
|
typedef void
|
||||||
|
(*FT_Construct_PS_Name_Func)( FT_Face face );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face,
|
(*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face,
|
||||||
FT_ULong offset,
|
FT_ULong offset,
|
||||||
|
@ -134,11 +141,13 @@ FT_BEGIN_HEADER
|
||||||
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_Named_Instance_Func set_named_instance;
|
||||||
|
FT_Get_Default_Named_Instance_Func get_default_named_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_Construct_PS_Name_Func construct_ps_name;
|
||||||
FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
|
FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
|
||||||
FT_Var_Load_Item_Var_Store_Func load_item_var_store;
|
FT_Var_Load_Item_Var_Store_Func load_item_var_store;
|
||||||
FT_Var_Get_Item_Delta_Func get_item_delta;
|
FT_Var_Get_Item_Delta_Func get_item_delta;
|
||||||
|
@ -157,9 +166,12 @@ FT_BEGIN_HEADER
|
||||||
get_mm_var_, \
|
get_mm_var_, \
|
||||||
set_var_design_, \
|
set_var_design_, \
|
||||||
get_var_design_, \
|
get_var_design_, \
|
||||||
set_instance_, \
|
set_named_instance_, \
|
||||||
set_weightvector_, \
|
get_default_named_instance_, \
|
||||||
get_weightvector_, \
|
set_mm_weightvector_, \
|
||||||
|
get_mm_weightvector_, \
|
||||||
|
\
|
||||||
|
construct_ps_name_, \
|
||||||
load_delta_set_idx_map_, \
|
load_delta_set_idx_map_, \
|
||||||
load_item_var_store_, \
|
load_item_var_store_, \
|
||||||
get_item_delta_, \
|
get_item_delta_, \
|
||||||
|
@ -176,9 +188,12 @@ FT_BEGIN_HEADER
|
||||||
get_mm_var_, \
|
get_mm_var_, \
|
||||||
set_var_design_, \
|
set_var_design_, \
|
||||||
get_var_design_, \
|
get_var_design_, \
|
||||||
set_instance_, \
|
set_named_instance_, \
|
||||||
set_weightvector_, \
|
get_default_named_instance_, \
|
||||||
get_weightvector_, \
|
set_mm_weightvector_, \
|
||||||
|
get_mm_weightvector_, \
|
||||||
|
\
|
||||||
|
construct_ps_name_, \
|
||||||
load_delta_set_idx_map_, \
|
load_delta_set_idx_map_, \
|
||||||
load_item_var_store_, \
|
load_item_var_store_, \
|
||||||
get_item_delta_, \
|
get_item_delta_, \
|
||||||
|
|
|
@ -97,7 +97,7 @@ FT_BEGIN_HEADER
|
||||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
||||||
FT_UInt32 unicode );
|
FT_UInt32 unicode );
|
||||||
|
|
||||||
typedef FT_UInt32
|
typedef FT_UInt
|
||||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
||||||
FT_UInt32 *unicode );
|
FT_UInt32 *unicode );
|
||||||
|
|
||||||
|
|
|
@ -779,13 +779,15 @@ FT_BEGIN_HEADER
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
* TT_Post_20Rec
|
* TT_Post_NamesRec
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Postscript names sub-table, format 2.0. Stores the PS name of each
|
* Postscript names table, either format 2.0 or 2.5.
|
||||||
* glyph in the font face.
|
|
||||||
*
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
|
* loaded ::
|
||||||
|
* A flag to indicate whether the PS names are loaded.
|
||||||
|
*
|
||||||
* num_glyphs ::
|
* num_glyphs ::
|
||||||
* The number of named glyphs in the table.
|
* The number of named glyphs in the table.
|
||||||
*
|
*
|
||||||
|
@ -798,68 +800,13 @@ FT_BEGIN_HEADER
|
||||||
* glyph_names ::
|
* glyph_names ::
|
||||||
* The PS names not in Mac Encoding.
|
* The PS names not in Mac Encoding.
|
||||||
*/
|
*/
|
||||||
typedef struct TT_Post_20Rec_
|
|
||||||
{
|
|
||||||
FT_UShort num_glyphs;
|
|
||||||
FT_UShort num_names;
|
|
||||||
FT_UShort* glyph_indices;
|
|
||||||
FT_Char** glyph_names;
|
|
||||||
|
|
||||||
} TT_Post_20Rec, *TT_Post_20;
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* @struct:
|
|
||||||
* TT_Post_25Rec
|
|
||||||
*
|
|
||||||
* @description:
|
|
||||||
* Postscript names sub-table, format 2.5. Stores the PS name of each
|
|
||||||
* glyph in the font face.
|
|
||||||
*
|
|
||||||
* @fields:
|
|
||||||
* num_glyphs ::
|
|
||||||
* The number of glyphs in the table.
|
|
||||||
*
|
|
||||||
* offsets ::
|
|
||||||
* An array of signed offsets in a normal Mac Postscript name encoding.
|
|
||||||
*/
|
|
||||||
typedef struct TT_Post_25_
|
|
||||||
{
|
|
||||||
FT_UShort num_glyphs;
|
|
||||||
FT_Char* offsets;
|
|
||||||
|
|
||||||
} TT_Post_25Rec, *TT_Post_25;
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* @struct:
|
|
||||||
* TT_Post_NamesRec
|
|
||||||
*
|
|
||||||
* @description:
|
|
||||||
* Postscript names table, either format 2.0 or 2.5.
|
|
||||||
*
|
|
||||||
* @fields:
|
|
||||||
* loaded ::
|
|
||||||
* A flag to indicate whether the PS names are loaded.
|
|
||||||
*
|
|
||||||
* format_20 ::
|
|
||||||
* The sub-table used for format 2.0.
|
|
||||||
*
|
|
||||||
* format_25 ::
|
|
||||||
* The sub-table used for format 2.5.
|
|
||||||
*/
|
|
||||||
typedef struct TT_Post_NamesRec_
|
typedef struct TT_Post_NamesRec_
|
||||||
{
|
{
|
||||||
FT_Bool loaded;
|
FT_Bool loaded;
|
||||||
|
FT_UShort num_glyphs;
|
||||||
union
|
FT_UShort num_names;
|
||||||
{
|
FT_UShort* glyph_indices;
|
||||||
TT_Post_20Rec format_20;
|
FT_Byte** glyph_names;
|
||||||
TT_Post_25Rec format_25;
|
|
||||||
|
|
||||||
} names;
|
|
||||||
|
|
||||||
} TT_Post_NamesRec, *TT_Post_Names;
|
} TT_Post_NamesRec, *TT_Post_Names;
|
||||||
|
|
||||||
|
@ -1253,12 +1200,16 @@ FT_BEGIN_HEADER
|
||||||
* mm ::
|
* mm ::
|
||||||
* A pointer to the Multiple Masters service.
|
* A pointer to the Multiple Masters service.
|
||||||
*
|
*
|
||||||
* var ::
|
* tt_var ::
|
||||||
* A pointer to the Metrics Variations service.
|
* A pointer to the Metrics Variations service for the "truetype"
|
||||||
|
* driver.
|
||||||
*
|
*
|
||||||
* hdmx ::
|
* face_var ::
|
||||||
* The face's horizontal device metrics ('hdmx' table). This table is
|
* A pointer to the Metrics Variations service for this `TT_Face`'s
|
||||||
* optional in TrueType/OpenType fonts.
|
* driver.
|
||||||
|
*
|
||||||
|
* psaux ::
|
||||||
|
* A pointer to the PostScript Auxiliary service.
|
||||||
*
|
*
|
||||||
* gasp ::
|
* gasp ::
|
||||||
* The grid-fitting and scaling properties table ('gasp'). This table
|
* The grid-fitting and scaling properties table ('gasp'). This table
|
||||||
|
@ -1364,6 +1315,12 @@ FT_BEGIN_HEADER
|
||||||
* var_postscript_prefix_len ::
|
* var_postscript_prefix_len ::
|
||||||
* The length of the `var_postscript_prefix` string.
|
* The length of the `var_postscript_prefix` string.
|
||||||
*
|
*
|
||||||
|
* var_default_named_instance ::
|
||||||
|
* The index of the default named instance.
|
||||||
|
*
|
||||||
|
* non_var_style_name ::
|
||||||
|
* The non-variation style name, used as a backup.
|
||||||
|
*
|
||||||
* horz_metrics_size ::
|
* horz_metrics_size ::
|
||||||
* The size of the 'hmtx' table.
|
* The size of the 'hmtx' table.
|
||||||
*
|
*
|
||||||
|
@ -1410,14 +1367,6 @@ FT_BEGIN_HEADER
|
||||||
* A mapping between the strike indices exposed by the API and the
|
* A mapping between the strike indices exposed by the API and the
|
||||||
* indices used in the font's sbit table.
|
* indices used in the font's sbit table.
|
||||||
*
|
*
|
||||||
* cpal ::
|
|
||||||
* A pointer to data related to the 'CPAL' table. `NULL` if the table
|
|
||||||
* is not available.
|
|
||||||
*
|
|
||||||
* colr ::
|
|
||||||
* A pointer to data related to the 'COLR' table. `NULL` if the table
|
|
||||||
* is not available.
|
|
||||||
*
|
|
||||||
* kern_table ::
|
* kern_table ::
|
||||||
* A pointer to the 'kern' table.
|
* A pointer to the 'kern' table.
|
||||||
*
|
*
|
||||||
|
@ -1445,19 +1394,23 @@ FT_BEGIN_HEADER
|
||||||
* vert_metrics_offset ::
|
* vert_metrics_offset ::
|
||||||
* The file offset of the 'vmtx' table.
|
* The file offset of the 'vmtx' table.
|
||||||
*
|
*
|
||||||
* sph_found_func_flags ::
|
|
||||||
* Flags identifying special bytecode functions (used by the v38
|
|
||||||
* implementation of the bytecode interpreter).
|
|
||||||
*
|
|
||||||
* sph_compatibility_mode ::
|
|
||||||
* This flag is set if we are in ClearType backward compatibility mode
|
|
||||||
* (used by the v38 implementation of the bytecode interpreter).
|
|
||||||
*
|
|
||||||
* ebdt_start ::
|
* ebdt_start ::
|
||||||
* The file offset of the sbit data table (CBDT, bdat, etc.).
|
* The file offset of the sbit data table (CBDT, bdat, etc.).
|
||||||
*
|
*
|
||||||
* ebdt_size ::
|
* ebdt_size ::
|
||||||
* The size of the sbit data table.
|
* The size of the sbit data table.
|
||||||
|
*
|
||||||
|
* cpal ::
|
||||||
|
* A pointer to data related to the 'CPAL' table. `NULL` if the table
|
||||||
|
* is not available.
|
||||||
|
*
|
||||||
|
* colr ::
|
||||||
|
* A pointer to data related to the 'COLR' table. `NULL` if the table
|
||||||
|
* is not available.
|
||||||
|
*
|
||||||
|
* svg ::
|
||||||
|
* A pointer to data related to the 'SVG' table. `NULL` if the table
|
||||||
|
* is not available.
|
||||||
*/
|
*/
|
||||||
typedef struct TT_FaceRec_
|
typedef struct TT_FaceRec_
|
||||||
{
|
{
|
||||||
|
@ -1508,8 +1461,14 @@ FT_BEGIN_HEADER
|
||||||
void* mm;
|
void* mm;
|
||||||
|
|
||||||
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
|
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
|
||||||
/* used to handle the HVAR, VVAR, and MVAR OpenType tables */
|
/* used to handle the HVAR, VVAR, and MVAR OpenType tables by the */
|
||||||
void* var;
|
/* "truetype" driver */
|
||||||
|
void* tt_var;
|
||||||
|
|
||||||
|
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
|
||||||
|
/* used to handle the HVAR, VVAR, and MVAR OpenType tables by this */
|
||||||
|
/* TT_Face's driver */
|
||||||
|
void* face_var; /* since 2.13.1 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* a typeless pointer to the PostScript Aux service */
|
/* a typeless pointer to the PostScript Aux service */
|
||||||
|
@ -1591,6 +1550,9 @@ FT_BEGIN_HEADER
|
||||||
const char* var_postscript_prefix; /* since 2.7.2 */
|
const char* var_postscript_prefix; /* since 2.7.2 */
|
||||||
FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
|
FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
|
||||||
|
|
||||||
|
FT_UInt var_default_named_instance; /* since 2.13.1 */
|
||||||
|
|
||||||
|
const char* non_var_style_name; /* since 2.13.1 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* since version 2.2 */
|
/* since version 2.2 */
|
||||||
|
@ -1627,13 +1589,6 @@ FT_BEGIN_HEADER
|
||||||
FT_ULong horz_metrics_offset;
|
FT_ULong horz_metrics_offset;
|
||||||
FT_ULong vert_metrics_offset;
|
FT_ULong vert_metrics_offset;
|
||||||
|
|
||||||
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
|
||||||
/* since 2.4.12 */
|
|
||||||
FT_ULong sph_found_func_flags; /* special functions found */
|
|
||||||
/* for this face */
|
|
||||||
FT_Bool sph_compatibility_mode;
|
|
||||||
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||||
/* since 2.7 */
|
/* since 2.7 */
|
||||||
FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
|
FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
major=30
|
major=30
|
||||||
minor=3
|
minor=4
|
||||||
# note: If bumping the major, also bump major for libXft, libXfont2
|
# note: If bumping the major, also bump major for libXft, libXfont2
|
||||||
# and libfontconfig
|
# and libfontconfig
|
||||||
|
|
|
@ -89,7 +89,7 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
|
||||||
"ت ث ط ظ ك"
|
"ت ث ط ظ ك"
|
||||||
// We don't necessarily have access to medial forms via Unicode in case
|
// We don't necessarily have access to medial forms via Unicode in case
|
||||||
// Arabic presentational forms are missing. The only character that is
|
// Arabic presentational forms are missing. The only character that is
|
||||||
// guaranteed to have the same vertical position with joining (this is,
|
// guaranteed to have the same vertical position with joining (that is,
|
||||||
// non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both
|
// non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both
|
||||||
// round and flat curves.
|
// round and flat curves.
|
||||||
AF_BLUE_STRING_ARABIC_JOIN
|
AF_BLUE_STRING_ARABIC_JOIN
|
||||||
|
|
|
@ -417,15 +417,13 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
FT_Int nn;
|
FT_Int nn;
|
||||||
FT_Int first = 0;
|
FT_Int pp, first, last;
|
||||||
FT_Int last = -1;
|
|
||||||
|
|
||||||
|
|
||||||
for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
|
last = -1;
|
||||||
|
for ( nn = 0; nn < outline.n_contours; nn++ )
|
||||||
{
|
{
|
||||||
FT_Int pp;
|
first = last + 1;
|
||||||
|
|
||||||
|
|
||||||
last = outline.contours[nn];
|
last = outline.contours[nn];
|
||||||
|
|
||||||
/* Avoid single-point contours since they are never rasterized. */
|
/* Avoid single-point contours since they are never rasterized. */
|
||||||
|
@ -570,7 +568,7 @@
|
||||||
FT_Face face )
|
FT_Face face )
|
||||||
{
|
{
|
||||||
FT_Bool started = 0, same_width = 1;
|
FT_Bool started = 0, same_width = 1;
|
||||||
FT_Fixed advance = 0, old_advance = 0;
|
FT_Long advance = 0, old_advance = 0;
|
||||||
|
|
||||||
/* If HarfBuzz is not available, we need a pointer to a single */
|
/* If HarfBuzz is not available, we need a pointer to a single */
|
||||||
/* unsigned long value. */
|
/* unsigned long value. */
|
||||||
|
@ -635,9 +633,10 @@
|
||||||
/* Initialize global metrics. */
|
/* Initialize global metrics. */
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
af_cjk_metrics_init( AF_CJKMetrics metrics,
|
af_cjk_metrics_init( AF_StyleMetrics metrics_, /* AF_CJKMetrics */
|
||||||
FT_Face face )
|
FT_Face face )
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
FT_CharMap oldmap = face->charmap;
|
FT_CharMap oldmap = face->charmap;
|
||||||
|
|
||||||
|
|
||||||
|
@ -756,9 +755,12 @@
|
||||||
/* Scale global values in both directions. */
|
/* Scale global values in both directions. */
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
af_cjk_metrics_scale( AF_CJKMetrics metrics,
|
af_cjk_metrics_scale( AF_StyleMetrics metrics_, /* AF_CJKMetrics */
|
||||||
AF_Scaler scaler )
|
AF_Scaler scaler )
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
|
|
||||||
|
|
||||||
/* we copy the whole structure since the x and y scaling values */
|
/* we copy the whole structure since the x and y scaling values */
|
||||||
/* are not modified, contrary to e.g. the `latin' auto-hinter */
|
/* are not modified, contrary to e.g. the `latin' auto-hinter */
|
||||||
metrics->root.scaler = *scaler;
|
metrics->root.scaler = *scaler;
|
||||||
|
@ -771,11 +773,14 @@
|
||||||
/* Extract standard_width from writing system/script specific */
|
/* Extract standard_width from writing system/script specific */
|
||||||
/* metrics class. */
|
/* metrics class. */
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
af_cjk_get_standard_widths( AF_CJKMetrics metrics,
|
af_cjk_get_standard_widths( AF_StyleMetrics metrics_, /* AF_CJKMetrics */
|
||||||
FT_Pos* stdHW,
|
FT_Pos* stdHW,
|
||||||
FT_Pos* stdVW )
|
FT_Pos* stdVW )
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
|
|
||||||
|
|
||||||
if ( stdHW )
|
if ( stdHW )
|
||||||
*stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
|
*stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
|
||||||
|
|
||||||
|
@ -1377,8 +1382,9 @@
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
af_cjk_hints_init( AF_GlyphHints hints,
|
af_cjk_hints_init( AF_GlyphHints hints,
|
||||||
AF_CJKMetrics metrics )
|
AF_StyleMetrics metrics_ ) /* AF_CJKMetrics */
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
FT_Render_Mode mode;
|
FT_Render_Mode mode;
|
||||||
FT_UInt32 scaler_flags, other_flags;
|
FT_UInt32 scaler_flags, other_flags;
|
||||||
|
|
||||||
|
@ -1628,7 +1634,7 @@
|
||||||
|
|
||||||
stem_edge->pos = base_edge->pos + fitted_width;
|
stem_edge->pos = base_edge->pos + fitted_width;
|
||||||
|
|
||||||
FT_TRACE5(( " CJKLINK: edge %ld @%d (opos=%.2f) linked to %.2f,"
|
FT_TRACE5(( " CJKLINK: edge %td @%d (opos=%.2f) linked to %.2f,"
|
||||||
" dist was %.2f, now %.2f\n",
|
" dist was %.2f, now %.2f\n",
|
||||||
stem_edge - hints->axis[dim].edges, stem_edge->fpos,
|
stem_edge - hints->axis[dim].edges, stem_edge->fpos,
|
||||||
(double)stem_edge->opos / 64,
|
(double)stem_edge->opos / 64,
|
||||||
|
@ -1852,7 +1858,7 @@
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
FT_TRACE5(( " CJKBLUE: edge %ld @%d (opos=%.2f) snapped to %.2f,"
|
FT_TRACE5(( " CJKBLUE: edge %td @%d (opos=%.2f) snapped to %.2f,"
|
||||||
" was %.2f\n",
|
" was %.2f\n",
|
||||||
edge1 - edges, edge1->fpos, (double)edge1->opos / 64,
|
edge1 - edges, edge1->fpos, (double)edge1->opos / 64,
|
||||||
(double)blue->fit / 64, (double)edge1->pos / 64 ));
|
(double)blue->fit / 64, (double)edge1->pos / 64 ));
|
||||||
|
@ -1916,7 +1922,7 @@
|
||||||
/* this should not happen, but it's better to be safe */
|
/* this should not happen, but it's better to be safe */
|
||||||
if ( edge2->blue_edge )
|
if ( edge2->blue_edge )
|
||||||
{
|
{
|
||||||
FT_TRACE5(( "ASSERTION FAILED for edge %ld\n", edge2-edges ));
|
FT_TRACE5(( "ASSERTION FAILED for edge %td\n", edge2 - edges ));
|
||||||
|
|
||||||
af_cjk_align_linked_edge( hints, dim, edge2, edge );
|
af_cjk_align_linked_edge( hints, dim, edge2, edge );
|
||||||
edge->flags |= AF_EDGE_DONE;
|
edge->flags |= AF_EDGE_DONE;
|
||||||
|
@ -2271,8 +2277,10 @@
|
||||||
af_cjk_hints_apply( FT_UInt glyph_index,
|
af_cjk_hints_apply( FT_UInt glyph_index,
|
||||||
AF_GlyphHints hints,
|
AF_GlyphHints hints,
|
||||||
FT_Outline* outline,
|
FT_Outline* outline,
|
||||||
AF_CJKMetrics metrics )
|
AF_StyleMetrics metrics_ ) /* AF_CJKMetrics */
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
|
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
int dim;
|
int dim;
|
||||||
|
|
||||||
|
|
|
@ -103,22 +103,22 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
#ifdef AF_CONFIG_OPTION_CJK
|
#ifdef AF_CONFIG_OPTION_CJK
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
af_cjk_metrics_init( AF_CJKMetrics metrics,
|
af_cjk_metrics_init( AF_StyleMetrics metrics,
|
||||||
FT_Face face );
|
FT_Face face );
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
af_cjk_metrics_scale( AF_CJKMetrics metrics,
|
af_cjk_metrics_scale( AF_StyleMetrics metrics,
|
||||||
AF_Scaler scaler );
|
AF_Scaler scaler );
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
af_cjk_hints_init( AF_GlyphHints hints,
|
af_cjk_hints_init( AF_GlyphHints hints,
|
||||||
AF_CJKMetrics metrics );
|
AF_StyleMetrics metrics );
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
af_cjk_hints_apply( FT_UInt glyph_index,
|
af_cjk_hints_apply( FT_UInt glyph_index,
|
||||||
AF_GlyphHints hints,
|
AF_GlyphHints hints,
|
||||||
FT_Outline* outline,
|
FT_Outline* outline,
|
||||||
AF_CJKMetrics metrics );
|
AF_StyleMetrics metrics );
|
||||||
|
|
||||||
/* shared; called from afindic.c */
|
/* shared; called from afindic.c */
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
|
|
|
@ -376,8 +376,11 @@
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
af_face_globals_free( AF_FaceGlobals globals )
|
af_face_globals_free( void* globals_ )
|
||||||
{
|
{
|
||||||
|
AF_FaceGlobals globals = (AF_FaceGlobals)globals_;
|
||||||
|
|
||||||
|
|
||||||
if ( globals )
|
if ( globals )
|
||||||
{
|
{
|
||||||
FT_Memory memory = globals->face->memory;
|
FT_Memory memory = globals->face->memory;
|
||||||
|
|
|
@ -156,7 +156,7 @@ FT_BEGIN_HEADER
|
||||||
AF_StyleMetrics *ametrics );
|
AF_StyleMetrics *ametrics );
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
af_face_globals_free( AF_FaceGlobals globals );
|
af_face_globals_free( void* globals );
|
||||||
|
|
||||||
FT_LOCAL( FT_Bool )
|
FT_LOCAL( FT_Bool )
|
||||||
af_face_globals_is_digit( AF_FaceGlobals globals,
|
af_face_globals_is_digit( AF_FaceGlobals globals,
|
||||||
|
|
|
@ -321,6 +321,7 @@
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
af_print_idx( char* p,
|
af_print_idx( char* p,
|
||||||
|
size_t n,
|
||||||
int idx )
|
int idx )
|
||||||
{
|
{
|
||||||
if ( idx == -1 )
|
if ( idx == -1 )
|
||||||
|
@ -330,7 +331,7 @@
|
||||||
p[2] = '\0';
|
p[2] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ft_sprintf( p, "%d", idx );
|
ft_snprintf( p, n, "%d", idx );
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
@ -457,12 +458,12 @@
|
||||||
" %5d %5d %7.2f %7.2f %7.2f %7.2f"
|
" %5d %5d %7.2f %7.2f %7.2f %7.2f"
|
||||||
" %5s %5s %5s %5s\n",
|
" %5s %5s %5s %5s\n",
|
||||||
point_idx,
|
point_idx,
|
||||||
af_print_idx( buf1,
|
af_print_idx( buf1, 16,
|
||||||
af_get_edge_index( hints, segment_idx_1, 1 ) ),
|
af_get_edge_index( hints, segment_idx_1, 1 ) ),
|
||||||
af_print_idx( buf2, segment_idx_1 ),
|
af_print_idx( buf2, 16, segment_idx_1 ),
|
||||||
af_print_idx( buf3,
|
af_print_idx( buf3, 16,
|
||||||
af_get_edge_index( hints, segment_idx_0, 0 ) ),
|
af_get_edge_index( hints, segment_idx_0, 0 ) ),
|
||||||
af_print_idx( buf4, segment_idx_0 ),
|
af_print_idx( buf4, 16, segment_idx_0 ),
|
||||||
( point->flags & AF_FLAG_NEAR )
|
( point->flags & AF_FLAG_NEAR )
|
||||||
? " near "
|
? " near "
|
||||||
: ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
|
: ( point->flags & AF_FLAG_WEAK_INTERPOLATION )
|
||||||
|
@ -476,16 +477,20 @@
|
||||||
(double)point->x / 64,
|
(double)point->x / 64,
|
||||||
(double)point->y / 64,
|
(double)point->y / 64,
|
||||||
|
|
||||||
af_print_idx( buf5, af_get_strong_edge_index( hints,
|
af_print_idx( buf5, 16,
|
||||||
|
af_get_strong_edge_index( hints,
|
||||||
point->before,
|
point->before,
|
||||||
1 ) ),
|
1 ) ),
|
||||||
af_print_idx( buf6, af_get_strong_edge_index( hints,
|
af_print_idx( buf6, 16,
|
||||||
|
af_get_strong_edge_index( hints,
|
||||||
point->after,
|
point->after,
|
||||||
1 ) ),
|
1 ) ),
|
||||||
af_print_idx( buf7, af_get_strong_edge_index( hints,
|
af_print_idx( buf7, 16,
|
||||||
|
af_get_strong_edge_index( hints,
|
||||||
point->before,
|
point->before,
|
||||||
0 ) ),
|
0 ) ),
|
||||||
af_print_idx( buf8, af_get_strong_edge_index( hints,
|
af_print_idx( buf8, 16,
|
||||||
|
af_get_strong_edge_index( hints,
|
||||||
point->after,
|
point->after,
|
||||||
0 ) ) ));
|
0 ) ) ));
|
||||||
}
|
}
|
||||||
|
@ -574,9 +579,12 @@
|
||||||
AF_INDEX_NUM( seg->first, points ),
|
AF_INDEX_NUM( seg->first, points ),
|
||||||
AF_INDEX_NUM( seg->last, points ),
|
AF_INDEX_NUM( seg->last, points ),
|
||||||
|
|
||||||
af_print_idx( buf1, AF_INDEX_NUM( seg->link, segments ) ),
|
af_print_idx( buf1, 16,
|
||||||
af_print_idx( buf2, AF_INDEX_NUM( seg->serif, segments ) ),
|
AF_INDEX_NUM( seg->link, segments ) ),
|
||||||
af_print_idx( buf3, AF_INDEX_NUM( seg->edge, edges ) ),
|
af_print_idx( buf2, 16,
|
||||||
|
AF_INDEX_NUM( seg->serif, segments ) ),
|
||||||
|
af_print_idx( buf3, 16,
|
||||||
|
AF_INDEX_NUM( seg->edge, edges ) ),
|
||||||
|
|
||||||
seg->height,
|
seg->height,
|
||||||
seg->height - ( seg->max_coord - seg->min_coord ),
|
seg->height - ( seg->max_coord - seg->min_coord ),
|
||||||
|
@ -716,8 +724,10 @@
|
||||||
AF_INDEX_NUM( edge, edges ),
|
AF_INDEX_NUM( edge, edges ),
|
||||||
(double)(int)edge->opos / 64,
|
(double)(int)edge->opos / 64,
|
||||||
af_dir_str( (AF_Direction)edge->dir ),
|
af_dir_str( (AF_Direction)edge->dir ),
|
||||||
af_print_idx( buf1, AF_INDEX_NUM( edge->link, edges ) ),
|
af_print_idx( buf1, 16,
|
||||||
af_print_idx( buf2, AF_INDEX_NUM( edge->serif, edges ) ),
|
AF_INDEX_NUM( edge->link, edges ) ),
|
||||||
|
af_print_idx( buf2, 16,
|
||||||
|
AF_INDEX_NUM( edge->serif, edges ) ),
|
||||||
|
|
||||||
edge->blue_edge ? 'y' : 'n',
|
edge->blue_edge ? 'y' : 'n',
|
||||||
(double)edge->opos / 64,
|
(double)edge->opos / 64,
|
||||||
|
|
|
@ -28,9 +28,12 @@
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
af_indic_metrics_init( AF_CJKMetrics metrics,
|
af_indic_metrics_init( AF_StyleMetrics metrics_, /* AF_CJKMetrics */
|
||||||
FT_Face face )
|
FT_Face face )
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
|
|
||||||
|
|
||||||
/* skip blue zone init in CJK routines */
|
/* skip blue zone init in CJK routines */
|
||||||
FT_CharMap oldmap = face->charmap;
|
FT_CharMap oldmap = face->charmap;
|
||||||
|
|
||||||
|
@ -55,7 +58,7 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
af_indic_metrics_scale( AF_CJKMetrics metrics,
|
af_indic_metrics_scale( AF_StyleMetrics metrics,
|
||||||
AF_Scaler scaler )
|
AF_Scaler scaler )
|
||||||
{
|
{
|
||||||
/* use CJK routines */
|
/* use CJK routines */
|
||||||
|
@ -65,7 +68,7 @@
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
af_indic_hints_init( AF_GlyphHints hints,
|
af_indic_hints_init( AF_GlyphHints hints,
|
||||||
AF_CJKMetrics metrics )
|
AF_StyleMetrics metrics )
|
||||||
{
|
{
|
||||||
/* use CJK routines */
|
/* use CJK routines */
|
||||||
return af_cjk_hints_init( hints, metrics );
|
return af_cjk_hints_init( hints, metrics );
|
||||||
|
@ -76,7 +79,7 @@
|
||||||
af_indic_hints_apply( FT_UInt glyph_index,
|
af_indic_hints_apply( FT_UInt glyph_index,
|
||||||
AF_GlyphHints hints,
|
AF_GlyphHints hints,
|
||||||
FT_Outline* outline,
|
FT_Outline* outline,
|
||||||
AF_CJKMetrics metrics )
|
AF_StyleMetrics metrics )
|
||||||
{
|
{
|
||||||
/* use CJK routines */
|
/* use CJK routines */
|
||||||
return af_cjk_hints_apply( glyph_index, hints, outline, metrics );
|
return af_cjk_hints_apply( glyph_index, hints, outline, metrics );
|
||||||
|
@ -87,10 +90,13 @@
|
||||||
/* metrics class. */
|
/* metrics class. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
af_indic_get_standard_widths( AF_CJKMetrics metrics,
|
af_indic_get_standard_widths( AF_StyleMetrics metrics_, /* AF_CJKMetrics */
|
||||||
FT_Pos* stdHW,
|
FT_Pos* stdHW,
|
||||||
FT_Pos* stdVW )
|
FT_Pos* stdVW )
|
||||||
{
|
{
|
||||||
|
AF_CJKMetrics metrics = (AF_CJKMetrics)metrics_;
|
||||||
|
|
||||||
|
|
||||||
if ( stdHW )
|
if ( stdHW )
|
||||||
*stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
|
*stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
|
||||||
|
|
||||||
|
|
|
@ -496,22 +496,19 @@
|
||||||
/* now compute min or max point indices and coordinates */
|
/* now compute min or max point indices and coordinates */
|
||||||
points = outline.points;
|
points = outline.points;
|
||||||
best_point = -1;
|
best_point = -1;
|
||||||
|
best_contour_first = -1;
|
||||||
|
best_contour_last = -1;
|
||||||
best_y = 0; /* make compiler happy */
|
best_y = 0; /* make compiler happy */
|
||||||
best_contour_first = 0; /* ditto */
|
|
||||||
best_contour_last = 0; /* ditto */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
FT_Int nn;
|
FT_Int nn;
|
||||||
FT_Int first = 0;
|
FT_Int pp, first, last;
|
||||||
FT_Int last = -1;
|
|
||||||
|
|
||||||
|
|
||||||
for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ )
|
last = -1;
|
||||||
|
for ( nn = 0; nn < outline.n_contours; nn++ )
|
||||||
{
|
{
|
||||||
FT_Int old_best_point = best_point;
|
first = last + 1;
|
||||||
FT_Int pp;
|
|
||||||
|
|
||||||
|
|
||||||
last = outline.contours[nn];
|
last = outline.contours[nn];
|
||||||
|
|
||||||
/* Avoid single-point contours since they are never */
|
/* Avoid single-point contours since they are never */
|
||||||
|
@ -551,7 +548,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( best_point != old_best_point )
|
if ( best_point > best_contour_last )
|
||||||
{
|
{
|
||||||
best_contour_first = first;
|
best_contour_first = first;
|
||||||
best_contour_last = last;
|
best_contour_last = last;
|
||||||
|
@ -1025,7 +1022,7 @@
|
||||||
{
|
{
|
||||||
*a = *b;
|
*a = *b;
|
||||||
FT_TRACE5(( "blue zone overlap:"
|
FT_TRACE5(( "blue zone overlap:"
|
||||||
" adjusting %s %ld to %ld\n",
|
" adjusting %s %td to %ld\n",
|
||||||
a_is_top ? "overshoot" : "reference",
|
a_is_top ? "overshoot" : "reference",
|
||||||
blue_sorted[i] - axis->blues,
|
blue_sorted[i] - axis->blues,
|
||||||
*a ));
|
*a ));
|
||||||
|
@ -1069,7 +1066,7 @@
|
||||||
FT_Face face )
|
FT_Face face )
|
||||||
{
|
{
|
||||||
FT_Bool started = 0, same_width = 1;
|
FT_Bool started = 0, same_width = 1;
|
||||||
FT_Fixed advance = 0, old_advance = 0;
|
FT_Long advance = 0, old_advance = 0;
|
||||||
|
|
||||||
/* If HarfBuzz is not available, we need a pointer to a single */
|
/* If HarfBuzz is not available, we need a pointer to a single */
|
||||||
/* unsigned long value. */
|
/* unsigned long value. */
|
||||||
|
@ -1134,9 +1131,11 @@
|
||||||
/* Initialize global metrics. */
|
/* Initialize global metrics. */
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
af_latin_metrics_init( AF_LatinMetrics metrics,
|
af_latin_metrics_init( AF_StyleMetrics metrics_, /* AF_LatinMetrics */
|
||||||
FT_Face face )
|
FT_Face face )
|
||||||
{
|
{
|
||||||
|
AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_;
|
||||||
|
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
FT_CharMap oldmap = face->charmap;
|
FT_CharMap oldmap = face->charmap;
|
||||||
|
@ -1489,9 +1488,12 @@
|
||||||
/* Scale global values in both directions. */
|
/* Scale global values in both directions. */
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
af_latin_metrics_scale( AF_LatinMetrics metrics,
|
af_latin_metrics_scale( AF_StyleMetrics metrics_, /* AF_LatinMetrics */
|
||||||
AF_Scaler scaler )
|
AF_Scaler scaler )
|
||||||
{
|
{
|
||||||
|
AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_;
|
||||||
|
|
||||||
|
|
||||||
metrics->root.scaler.render_mode = scaler->render_mode;
|
metrics->root.scaler.render_mode = scaler->render_mode;
|
||||||
metrics->root.scaler.face = scaler->face;
|
metrics->root.scaler.face = scaler->face;
|
||||||
metrics->root.scaler.flags = scaler->flags;
|
metrics->root.scaler.flags = scaler->flags;
|
||||||
|
@ -1504,11 +1506,14 @@
|
||||||
/* Extract standard_width from writing system/script specific */
|
/* Extract standard_width from writing system/script specific */
|
||||||
/* metrics class. */
|
/* metrics class. */
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
af_latin_get_standard_widths( AF_LatinMetrics metrics,
|
af_latin_get_standard_widths( AF_StyleMetrics metrics_, /* AF_LatinMetrics */
|
||||||
FT_Pos* stdHW,
|
FT_Pos* stdHW,
|
||||||
FT_Pos* stdVW )
|
FT_Pos* stdVW )
|
||||||
{
|
{
|
||||||
|
AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_;
|
||||||
|
|
||||||
|
|
||||||
if ( stdHW )
|
if ( stdHW )
|
||||||
*stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
|
*stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
|
||||||
|
|
||||||
|
@ -2041,7 +2046,7 @@
|
||||||
max = seg2->max_coord;
|
max = seg2->max_coord;
|
||||||
|
|
||||||
/* compute maximum coordinate difference of the two segments */
|
/* compute maximum coordinate difference of the two segments */
|
||||||
/* (this is, how much they overlap) */
|
/* (that is, how much they overlap) */
|
||||||
len = max - min;
|
len = max - min;
|
||||||
if ( len >= len_threshold )
|
if ( len >= len_threshold )
|
||||||
{
|
{
|
||||||
|
@ -2610,8 +2615,10 @@
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
af_latin_hints_init( AF_GlyphHints hints,
|
af_latin_hints_init( AF_GlyphHints hints,
|
||||||
AF_LatinMetrics metrics )
|
AF_StyleMetrics metrics_ ) /* AF_LatinMetrics */
|
||||||
{
|
{
|
||||||
|
AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_;
|
||||||
|
|
||||||
FT_Render_Mode mode;
|
FT_Render_Mode mode;
|
||||||
FT_UInt32 scaler_flags, other_flags;
|
FT_UInt32 scaler_flags, other_flags;
|
||||||
FT_Face face = metrics->root.scaler.face;
|
FT_Face face = metrics->root.scaler.face;
|
||||||
|
@ -2953,7 +2960,7 @@
|
||||||
|
|
||||||
stem_edge->pos = base_edge->pos + fitted_width;
|
stem_edge->pos = base_edge->pos + fitted_width;
|
||||||
|
|
||||||
FT_TRACE5(( " LINK: edge %ld (opos=%.2f) linked to %.2f,"
|
FT_TRACE5(( " LINK: edge %td (opos=%.2f) linked to %.2f,"
|
||||||
" dist was %.2f, now %.2f\n",
|
" dist was %.2f, now %.2f\n",
|
||||||
stem_edge - hints->axis[dim].edges,
|
stem_edge - hints->axis[dim].edges,
|
||||||
(double)stem_edge->opos / 64, (double)stem_edge->pos / 64,
|
(double)stem_edge->opos / 64, (double)stem_edge->pos / 64,
|
||||||
|
@ -3078,13 +3085,13 @@
|
||||||
|
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
if ( !anchor )
|
if ( !anchor )
|
||||||
FT_TRACE5(( " BLUE_ANCHOR: edge %ld (opos=%.2f) snapped to %.2f,"
|
FT_TRACE5(( " BLUE_ANCHOR: edge %td (opos=%.2f) snapped to %.2f,"
|
||||||
" was %.2f (anchor=edge %ld)\n",
|
" was %.2f (anchor=edge %td)\n",
|
||||||
edge1 - edges,
|
edge1 - edges,
|
||||||
(double)edge1->opos / 64, (double)blue->fit / 64,
|
(double)edge1->opos / 64, (double)blue->fit / 64,
|
||||||
(double)edge1->pos / 64, edge - edges ));
|
(double)edge1->pos / 64, edge - edges ));
|
||||||
else
|
else
|
||||||
FT_TRACE5(( " BLUE: edge %ld (opos=%.2f) snapped to %.2f,"
|
FT_TRACE5(( " BLUE: edge %td (opos=%.2f) snapped to %.2f,"
|
||||||
" was %.2f\n",
|
" was %.2f\n",
|
||||||
edge1 - edges,
|
edge1 - edges,
|
||||||
(double)edge1->opos / 64, (double)blue->fit / 64,
|
(double)edge1->opos / 64, (double)blue->fit / 64,
|
||||||
|
@ -3134,7 +3141,7 @@
|
||||||
/* this should not happen, but it's better to be safe */
|
/* this should not happen, but it's better to be safe */
|
||||||
if ( edge2->blue_edge )
|
if ( edge2->blue_edge )
|
||||||
{
|
{
|
||||||
FT_TRACE5(( " ASSERTION FAILED for edge %ld\n", edge2 - edges ));
|
FT_TRACE5(( " ASSERTION FAILED for edge %td\n", edge2 - edges ));
|
||||||
|
|
||||||
af_latin_align_linked_edge( hints, dim, edge2, edge );
|
af_latin_align_linked_edge( hints, dim, edge2, edge );
|
||||||
edge->flags |= AF_EDGE_DONE;
|
edge->flags |= AF_EDGE_DONE;
|
||||||
|
@ -3202,7 +3209,7 @@
|
||||||
anchor = edge;
|
anchor = edge;
|
||||||
edge->flags |= AF_EDGE_DONE;
|
edge->flags |= AF_EDGE_DONE;
|
||||||
|
|
||||||
FT_TRACE5(( " ANCHOR: edge %ld (opos=%.2f) and %ld (opos=%.2f)"
|
FT_TRACE5(( " ANCHOR: edge %td (opos=%.2f) and %td (opos=%.2f)"
|
||||||
" snapped to %.2f and %.2f\n",
|
" snapped to %.2f and %.2f\n",
|
||||||
edge - edges, (double)edge->opos / 64,
|
edge - edges, (double)edge->opos / 64,
|
||||||
edge2 - edges, (double)edge2->opos / 64,
|
edge2 - edges, (double)edge2->opos / 64,
|
||||||
|
@ -3231,7 +3238,7 @@
|
||||||
|
|
||||||
if ( edge2->flags & AF_EDGE_DONE )
|
if ( edge2->flags & AF_EDGE_DONE )
|
||||||
{
|
{
|
||||||
FT_TRACE5(( " ADJUST: edge %ld (pos=%.2f) moved to %.2f\n",
|
FT_TRACE5(( " ADJUST: edge %td (pos=%.2f) moved to %.2f\n",
|
||||||
edge - edges, (double)edge->pos / 64,
|
edge - edges, (double)edge->pos / 64,
|
||||||
(double)( edge2->pos - cur_len ) / 64 ));
|
(double)( edge2->pos - cur_len ) / 64 ));
|
||||||
|
|
||||||
|
@ -3272,7 +3279,7 @@
|
||||||
edge->pos = cur_pos1 - cur_len / 2;
|
edge->pos = cur_pos1 - cur_len / 2;
|
||||||
edge2->pos = cur_pos1 + cur_len / 2;
|
edge2->pos = cur_pos1 + cur_len / 2;
|
||||||
|
|
||||||
FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)"
|
FT_TRACE5(( " STEM: edge %td (opos=%.2f) linked to %td (opos=%.2f)"
|
||||||
" snapped to %.2f and %.2f\n",
|
" snapped to %.2f and %.2f\n",
|
||||||
edge - edges, (double)edge->opos / 64,
|
edge - edges, (double)edge->opos / 64,
|
||||||
edge2 - edges, (double)edge2->opos / 64,
|
edge2 - edges, (double)edge2->opos / 64,
|
||||||
|
@ -3303,7 +3310,7 @@
|
||||||
edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
|
edge->pos = ( delta1 < delta2 ) ? cur_pos1 : cur_pos2;
|
||||||
edge2->pos = edge->pos + cur_len;
|
edge2->pos = edge->pos + cur_len;
|
||||||
|
|
||||||
FT_TRACE5(( " STEM: edge %ld (opos=%.2f) linked to %ld (opos=%.2f)"
|
FT_TRACE5(( " STEM: edge %td (opos=%.2f) linked to %td (opos=%.2f)"
|
||||||
" snapped to %.2f and %.2f\n",
|
" snapped to %.2f and %.2f\n",
|
||||||
edge - edges, (double)edge->opos / 64,
|
edge - edges, (double)edge->opos / 64,
|
||||||
edge2 - edges, (double)edge2->opos / 64,
|
edge2 - edges, (double)edge2->opos / 64,
|
||||||
|
@ -3326,7 +3333,7 @@
|
||||||
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
||||||
{
|
{
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
|
FT_TRACE5(( " BOUND: edge %td (pos=%.2f) moved to %.2f\n",
|
||||||
edge - edges,
|
edge - edges,
|
||||||
(double)edge->pos / 64,
|
(double)edge->pos / 64,
|
||||||
(double)edge[-1].pos / 64 ));
|
(double)edge[-1].pos / 64 ));
|
||||||
|
@ -3428,7 +3435,7 @@
|
||||||
if ( delta < 64 + 16 )
|
if ( delta < 64 + 16 )
|
||||||
{
|
{
|
||||||
af_latin_align_serif_edge( hints, edge->serif, edge );
|
af_latin_align_serif_edge( hints, edge->serif, edge );
|
||||||
FT_TRACE5(( " SERIF: edge %ld (opos=%.2f) serif to %ld (opos=%.2f)"
|
FT_TRACE5(( " SERIF: edge %td (opos=%.2f) serif to %td (opos=%.2f)"
|
||||||
" aligned to %.2f\n",
|
" aligned to %.2f\n",
|
||||||
edge - edges, (double)edge->opos / 64,
|
edge - edges, (double)edge->opos / 64,
|
||||||
edge->serif - edges, (double)edge->serif->opos / 64,
|
edge->serif - edges, (double)edge->serif->opos / 64,
|
||||||
|
@ -3438,9 +3445,9 @@
|
||||||
{
|
{
|
||||||
edge->pos = FT_PIX_ROUND( edge->opos );
|
edge->pos = FT_PIX_ROUND( edge->opos );
|
||||||
anchor = edge;
|
anchor = edge;
|
||||||
FT_TRACE5(( " SERIF_ANCHOR: edge %ld (opos=%.2f)"
|
FT_TRACE5(( " SERIF_ANCHOR: edge %td (opos=%.2f)"
|
||||||
" snapped to %.2f\n",
|
" snapped to %.2f\n",
|
||||||
edge-edges,
|
edge - edges,
|
||||||
(double)edge->opos / 64, (double)edge->pos / 64 ));
|
(double)edge->opos / 64, (double)edge->pos / 64 ));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3467,8 +3474,8 @@
|
||||||
after->pos - before->pos,
|
after->pos - before->pos,
|
||||||
after->opos - before->opos );
|
after->opos - before->opos );
|
||||||
|
|
||||||
FT_TRACE5(( " SERIF_LINK1: edge %ld (opos=%.2f) snapped to %.2f"
|
FT_TRACE5(( " SERIF_LINK1: edge %td (opos=%.2f) snapped to %.2f"
|
||||||
" from %ld (opos=%.2f)\n",
|
" from %td (opos=%.2f)\n",
|
||||||
edge - edges, (double)edge->opos / 64,
|
edge - edges, (double)edge->opos / 64,
|
||||||
(double)edge->pos / 64,
|
(double)edge->pos / 64,
|
||||||
before - edges, (double)before->opos / 64 ));
|
before - edges, (double)before->opos / 64 ));
|
||||||
|
@ -3477,7 +3484,7 @@
|
||||||
{
|
{
|
||||||
edge->pos = anchor->pos +
|
edge->pos = anchor->pos +
|
||||||
( ( edge->opos - anchor->opos + 16 ) & ~31 );
|
( ( edge->opos - anchor->opos + 16 ) & ~31 );
|
||||||
FT_TRACE5(( " SERIF_LINK2: edge %ld (opos=%.2f)"
|
FT_TRACE5(( " SERIF_LINK2: edge %td (opos=%.2f)"
|
||||||
" snapped to %.2f\n",
|
" snapped to %.2f\n",
|
||||||
edge - edges,
|
edge - edges,
|
||||||
(double)edge->opos / 64, (double)edge->pos / 64 ));
|
(double)edge->opos / 64, (double)edge->pos / 64 ));
|
||||||
|
@ -3498,7 +3505,7 @@
|
||||||
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
||||||
{
|
{
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
|
FT_TRACE5(( " BOUND: edge %td (pos=%.2f) moved to %.2f\n",
|
||||||
edge - edges,
|
edge - edges,
|
||||||
(double)edge->pos / 64,
|
(double)edge->pos / 64,
|
||||||
(double)edge[-1].pos / 64 ));
|
(double)edge[-1].pos / 64 ));
|
||||||
|
@ -3519,7 +3526,7 @@
|
||||||
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
if ( edge->link && FT_ABS( edge->link->pos - edge[-1].pos ) > 16 )
|
||||||
{
|
{
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
FT_TRACE5(( " BOUND: edge %ld (pos=%.2f) moved to %.2f\n",
|
FT_TRACE5(( " BOUND: edge %td (pos=%.2f) moved to %.2f\n",
|
||||||
edge - edges,
|
edge - edges,
|
||||||
(double)edge->pos / 64,
|
(double)edge->pos / 64,
|
||||||
(double)edge[1].pos / 64 ));
|
(double)edge[1].pos / 64 ));
|
||||||
|
@ -3547,8 +3554,10 @@
|
||||||
af_latin_hints_apply( FT_UInt glyph_index,
|
af_latin_hints_apply( FT_UInt glyph_index,
|
||||||
AF_GlyphHints hints,
|
AF_GlyphHints hints,
|
||||||
FT_Outline* outline,
|
FT_Outline* outline,
|
||||||
AF_LatinMetrics metrics )
|
AF_StyleMetrics metrics_ ) /* AF_LatinMetrics */
|
||||||
{
|
{
|
||||||
|
AF_LatinMetrics metrics = (AF_LatinMetrics)metrics_;
|
||||||
|
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
int dim;
|
int dim;
|
||||||
|
|
||||||
|
|
|
@ -116,11 +116,11 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
af_latin_metrics_init( AF_LatinMetrics metrics,
|
af_latin_metrics_init( AF_StyleMetrics metrics,
|
||||||
FT_Face face );
|
FT_Face face );
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
af_latin_metrics_scale( AF_LatinMetrics metrics,
|
af_latin_metrics_scale( AF_StyleMetrics metrics,
|
||||||
AF_Scaler scaler );
|
AF_Scaler scaler );
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
|
|
|
@ -55,10 +55,8 @@
|
||||||
error = af_face_globals_new( face, &loader->globals, module );
|
error = af_face_globals_new( face, &loader->globals, module );
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
face->autohint.data =
|
face->autohint.data = (FT_Pointer)loader->globals;
|
||||||
(FT_Pointer)loader->globals;
|
face->autohint.finalizer = af_face_globals_free;
|
||||||
face->autohint.finalizer =
|
|
||||||
(FT_Generic_Finalizer)af_face_globals_free;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,10 +89,8 @@
|
||||||
error = af_face_globals_new( face, &globals, module );
|
error = af_face_globals_new( face, &globals, module );
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
face->autohint.data =
|
face->autohint.data = (FT_Pointer)globals;
|
||||||
(FT_Pointer)globals;
|
face->autohint.finalizer = af_face_globals_free;
|
||||||
face->autohint.finalizer =
|
|
||||||
(FT_Generic_Finalizer)af_face_globals_free;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,8 +372,9 @@
|
||||||
FT_DEFINE_SERVICE_PROPERTIESREC(
|
FT_DEFINE_SERVICE_PROPERTIESREC(
|
||||||
af_service_properties,
|
af_service_properties,
|
||||||
|
|
||||||
(FT_Properties_SetFunc)af_property_set, /* set_property */
|
af_property_set, /* FT_Properties_SetFunc set_property */
|
||||||
(FT_Properties_GetFunc)af_property_get ) /* get_property */
|
af_property_get /* FT_Properties_GetFunc get_property */
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
FT_DEFINE_SERVICEDESCREC1(
|
FT_DEFINE_SERVICEDESCREC1(
|
||||||
|
@ -430,12 +429,14 @@
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
af_autofitter_load_glyph( AF_Module module,
|
af_autofitter_load_glyph( FT_AutoHinter module_,
|
||||||
FT_GlyphSlot slot,
|
FT_GlyphSlot slot,
|
||||||
FT_Size size,
|
FT_Size size,
|
||||||
FT_UInt glyph_index,
|
FT_UInt glyph_index,
|
||||||
FT_Int32 load_flags )
|
FT_Int32 load_flags )
|
||||||
{
|
{
|
||||||
|
AF_Module module = (AF_Module)module_;
|
||||||
|
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
FT_Memory memory = module->root.library->memory;
|
FT_Memory memory = module->root.library->memory;
|
||||||
|
|
||||||
|
@ -499,10 +500,10 @@
|
||||||
FT_DEFINE_AUTOHINTER_INTERFACE(
|
FT_DEFINE_AUTOHINTER_INTERFACE(
|
||||||
af_autofitter_interface,
|
af_autofitter_interface,
|
||||||
|
|
||||||
NULL, /* reset_face */
|
NULL, /* FT_AutoHinter_GlobalResetFunc reset_face */
|
||||||
NULL, /* get_global_hints */
|
NULL, /* FT_AutoHinter_GlobalGetFunc get_global_hints */
|
||||||
NULL, /* done_global_hints */
|
NULL, /* FT_AutoHinter_GlobalDoneFunc done_global_hints */
|
||||||
(FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph /* load_glyph */
|
af_autofitter_load_glyph /* FT_AutoHinter_GlyphLoadFunc load_glyph */
|
||||||
)
|
)
|
||||||
|
|
||||||
FT_DEFINE_MODULE(
|
FT_DEFINE_MODULE(
|
||||||
|
@ -517,9 +518,9 @@
|
||||||
|
|
||||||
(const void*)&af_autofitter_interface,
|
(const void*)&af_autofitter_interface,
|
||||||
|
|
||||||
(FT_Module_Constructor)af_autofitter_init, /* module_init */
|
af_autofitter_init, /* FT_Module_Constructor module_init */
|
||||||
(FT_Module_Destructor) af_autofitter_done, /* module_done */
|
af_autofitter_done, /* FT_Module_Destructor module_done */
|
||||||
(FT_Module_Requester) af_get_interface /* get_interface */
|
af_get_interface /* FT_Module_Requester get_interface */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@
|
||||||
/*
|
/*
|
||||||
* We now check whether we can construct blue zones, using glyphs
|
* We now check whether we can construct blue zones, using glyphs
|
||||||
* covered by the feature only. In case there is not a single zone
|
* covered by the feature only. In case there is not a single zone
|
||||||
* (this is, not a single character is covered), we skip this coverage.
|
* (that is, not a single character is covered), we skip this coverage.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if ( style_class->coverage != AF_COVERAGE_DEFAULT )
|
if ( style_class->coverage != AF_COVERAGE_DEFAULT )
|
||||||
|
@ -313,9 +313,9 @@
|
||||||
* hinted and usually rendered glyph.
|
* hinted and usually rendered glyph.
|
||||||
*
|
*
|
||||||
* Consider the superscript feature of font `pala.ttf': Some of the
|
* Consider the superscript feature of font `pala.ttf': Some of the
|
||||||
* glyphs are `real', this is, they have a zero vertical offset, but
|
* glyphs are `real', that is, they have a zero vertical offset, but
|
||||||
* most of them are small caps glyphs shifted up to the superscript
|
* most of them are small caps glyphs shifted up to the superscript
|
||||||
* position (this is, the `sups' feature is present in both the GSUB and
|
* position (that is, the `sups' feature is present in both the GSUB and
|
||||||
* GPOS tables). The code for blue zones computation actually uses a
|
* GPOS tables). The code for blue zones computation actually uses a
|
||||||
* feature's y offset so that the `real' glyphs get correct hints. But
|
* feature's y offset so that the `real' glyphs get correct hints. But
|
||||||
* later on it is impossible to decide whether a glyph index belongs to,
|
* later on it is impossible to decide whether a glyph index belongs to,
|
||||||
|
|
|
@ -108,7 +108,7 @@ hb_ft_font_create_ (FT_Face ft_face,
|
||||||
#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
#else /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||||
|
|
||||||
/* ANSI C doesn't like empty source files */
|
/* ANSI C doesn't like empty source files */
|
||||||
typedef int _ft_hb_dummy;
|
typedef int ft_hb_dummy_;
|
||||||
|
|
||||||
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
#endif /* !FT_CONFIG_OPTION_USE_HARFBUZZ */
|
||||||
|
|
||||||
|
|
|
@ -82,10 +82,13 @@
|
||||||
* @Return:
|
* @Return:
|
||||||
* Always 0. Needed for the interface only.
|
* Always 0. Needed for the interface only.
|
||||||
*/
|
*/
|
||||||
static int
|
FT_CALLBACK_DEF( int )
|
||||||
BBox_Move_To( FT_Vector* to,
|
BBox_Move_To( const FT_Vector* to,
|
||||||
TBBox_Rec* user )
|
void* user_ )
|
||||||
{
|
{
|
||||||
|
TBBox_Rec* user = (TBBox_Rec*)user_;
|
||||||
|
|
||||||
|
|
||||||
FT_UPDATE_BBOX( to, user->bbox );
|
FT_UPDATE_BBOX( to, user->bbox );
|
||||||
|
|
||||||
user->last = *to;
|
user->last = *to;
|
||||||
|
@ -116,10 +119,13 @@
|
||||||
* @Return:
|
* @Return:
|
||||||
* Always 0. Needed for the interface only.
|
* Always 0. Needed for the interface only.
|
||||||
*/
|
*/
|
||||||
static int
|
FT_CALLBACK_DEF( int )
|
||||||
BBox_Line_To( FT_Vector* to,
|
BBox_Line_To( const FT_Vector* to,
|
||||||
TBBox_Rec* user )
|
void* user_ )
|
||||||
{
|
{
|
||||||
|
TBBox_Rec* user = (TBBox_Rec*)user_;
|
||||||
|
|
||||||
|
|
||||||
user->last = *to;
|
user->last = *to;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -205,11 +211,14 @@
|
||||||
* In the case of a non-monotonous arc, we compute directly the
|
* In the case of a non-monotonous arc, we compute directly the
|
||||||
* extremum coordinates, as it is sufficiently fast.
|
* extremum coordinates, as it is sufficiently fast.
|
||||||
*/
|
*/
|
||||||
static int
|
FT_CALLBACK_DEF( int )
|
||||||
BBox_Conic_To( FT_Vector* control,
|
BBox_Conic_To( const FT_Vector* control,
|
||||||
FT_Vector* to,
|
const FT_Vector* to,
|
||||||
TBBox_Rec* user )
|
void* user_ )
|
||||||
{
|
{
|
||||||
|
TBBox_Rec* user = (TBBox_Rec*)user_;
|
||||||
|
|
||||||
|
|
||||||
/* in case `to' is implicit and not included in bbox yet */
|
/* in case `to' is implicit and not included in bbox yet */
|
||||||
FT_UPDATE_BBOX( to, user->bbox );
|
FT_UPDATE_BBOX( to, user->bbox );
|
||||||
|
|
||||||
|
@ -410,12 +419,15 @@
|
||||||
* In the case of a non-monotonous arc, we don't compute directly
|
* In the case of a non-monotonous arc, we don't compute directly
|
||||||
* extremum coordinates, we subdivide instead.
|
* extremum coordinates, we subdivide instead.
|
||||||
*/
|
*/
|
||||||
static int
|
FT_CALLBACK_DEF( int )
|
||||||
BBox_Cubic_To( FT_Vector* control1,
|
BBox_Cubic_To( const FT_Vector* control1,
|
||||||
FT_Vector* control2,
|
const FT_Vector* control2,
|
||||||
FT_Vector* to,
|
const FT_Vector* to,
|
||||||
TBBox_Rec* user )
|
void* user_ )
|
||||||
{
|
{
|
||||||
|
TBBox_Rec* user = (TBBox_Rec*)user_;
|
||||||
|
|
||||||
|
|
||||||
/* We don't need to check `to' since it is always an on-point, */
|
/* We don't need to check `to' since it is always an on-point, */
|
||||||
/* thus within the bbox. Only segments with an off-point outside */
|
/* thus within the bbox. Only segments with an off-point outside */
|
||||||
/* the bbox can possibly reach new extreme values. */
|
/* the bbox can possibly reach new extreme values. */
|
||||||
|
|
|
@ -749,65 +749,43 @@
|
||||||
FT_BASE_DEF( FT_Bool )
|
FT_BASE_DEF( FT_Bool )
|
||||||
FT_Matrix_Check( const FT_Matrix* matrix )
|
FT_Matrix_Check( const FT_Matrix* matrix )
|
||||||
{
|
{
|
||||||
FT_Matrix m;
|
FT_Fixed xx, xy, yx, yy;
|
||||||
FT_Fixed val[4];
|
FT_Fixed val;
|
||||||
FT_Fixed nonzero_minval, maxval;
|
FT_Int shift;
|
||||||
FT_Fixed temp1, temp2;
|
FT_ULong temp1, temp2;
|
||||||
FT_UInt i;
|
|
||||||
|
|
||||||
|
|
||||||
if ( !matrix )
|
if ( !matrix )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
val[0] = FT_ABS( matrix->xx );
|
xx = matrix->xx;
|
||||||
val[1] = FT_ABS( matrix->xy );
|
xy = matrix->xy;
|
||||||
val[2] = FT_ABS( matrix->yx );
|
yx = matrix->yx;
|
||||||
val[3] = FT_ABS( matrix->yy );
|
yy = matrix->yy;
|
||||||
|
val = FT_ABS( xx ) | FT_ABS( xy ) | FT_ABS( yx ) | FT_ABS( yy );
|
||||||
|
|
||||||
/*
|
/* we only handle non-zero 32-bit values */
|
||||||
* To avoid overflow, we ensure that each value is not larger than
|
if ( !val || val > 0x7FFFFFFFL )
|
||||||
*
|
|
||||||
* int(sqrt(2^31 / 4)) = 23170 ;
|
|
||||||
*
|
|
||||||
* we also check that no value becomes zero if we have to scale.
|
|
||||||
*/
|
|
||||||
|
|
||||||
maxval = 0;
|
|
||||||
nonzero_minval = FT_LONG_MAX;
|
|
||||||
|
|
||||||
for ( i = 0; i < 4; i++ )
|
|
||||||
{
|
|
||||||
if ( val[i] > maxval )
|
|
||||||
maxval = val[i];
|
|
||||||
if ( val[i] && val[i] < nonzero_minval )
|
|
||||||
nonzero_minval = val[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we only handle 32bit values */
|
|
||||||
if ( maxval > 0x7FFFFFFFL )
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( maxval > 23170 )
|
/* Scale matrix to avoid the temp1 overflow, which is */
|
||||||
|
/* more stringent than avoiding the temp2 overflow. */
|
||||||
|
|
||||||
|
shift = FT_MSB( val ) - 12;
|
||||||
|
|
||||||
|
if ( shift > 0 )
|
||||||
{
|
{
|
||||||
FT_Fixed scale = FT_DivFix( maxval, 23170 );
|
xx >>= shift;
|
||||||
|
xy >>= shift;
|
||||||
|
yx >>= shift;
|
||||||
if ( !FT_DivFix( nonzero_minval, scale ) )
|
yy >>= shift;
|
||||||
return 0; /* value range too large */
|
|
||||||
|
|
||||||
m.xx = FT_DivFix( matrix->xx, scale );
|
|
||||||
m.xy = FT_DivFix( matrix->xy, scale );
|
|
||||||
m.yx = FT_DivFix( matrix->yx, scale );
|
|
||||||
m.yy = FT_DivFix( matrix->yy, scale );
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m = *matrix;
|
|
||||||
|
|
||||||
temp1 = FT_ABS( m.xx * m.yy - m.xy * m.yx );
|
temp1 = 32U * (FT_ULong)FT_ABS( xx * yy - xy * yx );
|
||||||
temp2 = m.xx * m.xx + m.xy * m.xy + m.yx * m.yx + m.yy * m.yy;
|
temp2 = (FT_ULong)( xx * xx ) + (FT_ULong)( xy * xy ) +
|
||||||
|
(FT_ULong)( yx * yx ) + (FT_ULong)( yy * yy );
|
||||||
|
|
||||||
if ( temp1 == 0 ||
|
if ( temp1 <= temp2 )
|
||||||
temp2 / temp1 > 50 )
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1061,7 +1039,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* This approach has the advantage that the angle between */
|
/* This approach has the advantage that the angle between */
|
||||||
/* `in' and `out' is not checked. In case one of the two */
|
/* `in' and `out' is not checked. In case one of the two */
|
||||||
/* vectors is `dominant', this is, much larger than the */
|
/* vectors is `dominant', that is, much larger than the */
|
||||||
/* other vector, we thus always have a flat corner. */
|
/* other vector, we thus always have a flat corner. */
|
||||||
/* */
|
/* */
|
||||||
/* hypotenuse */
|
/* hypotenuse */
|
||||||
|
@ -1092,9 +1070,6 @@
|
||||||
{
|
{
|
||||||
FT_UInt i;
|
FT_UInt i;
|
||||||
FT_Int64 temp;
|
FT_Int64 temp;
|
||||||
#ifndef FT_INT64
|
|
||||||
FT_Int64 halfUnit;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef FT_INT64
|
#ifdef FT_INT64
|
||||||
|
@ -1103,7 +1078,7 @@
|
||||||
for ( i = 0; i < count; ++i )
|
for ( i = 0; i < count; ++i )
|
||||||
temp += (FT_Int64)s[i] * f[i];
|
temp += (FT_Int64)s[i] * f[i];
|
||||||
|
|
||||||
return ( temp + 0x8000 ) >> 16;
|
return (FT_Int32)( ( temp + 0x8000 ) >> 16 );
|
||||||
#else
|
#else
|
||||||
temp.hi = 0;
|
temp.hi = 0;
|
||||||
temp.lo = 0;
|
temp.lo = 0;
|
||||||
|
@ -1139,13 +1114,10 @@
|
||||||
FT_Add64( &temp, &multResult, &temp );
|
FT_Add64( &temp, &multResult, &temp );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Round value. */
|
/* Shift and round value. */
|
||||||
halfUnit.hi = 0;
|
return (FT_Int32)( ( ( temp.hi << 16 ) | ( temp.lo >> 16 ) )
|
||||||
halfUnit.lo = 0x8000;
|
+ ( 1 & ( temp.lo >> 15 ) ) );
|
||||||
FT_Add64( &temp, &halfUnit, &temp );
|
|
||||||
|
|
||||||
return (FT_Int32)( ( (FT_Int32)( temp.hi & 0xFFFF ) << 16 ) |
|
|
||||||
( temp.lo >> 16 ) );
|
|
||||||
|
|
||||||
#endif /* !FT_INT64 */
|
#endif /* !FT_INT64 */
|
||||||
|
|
||||||
|
|
|
@ -963,7 +963,7 @@
|
||||||
#else /* !FT_DEBUG_MEMORY */
|
#else /* !FT_DEBUG_MEMORY */
|
||||||
|
|
||||||
/* ANSI C doesn't like empty source files */
|
/* ANSI C doesn't like empty source files */
|
||||||
typedef int _debug_mem_dummy;
|
typedef int debug_mem_dummy_;
|
||||||
|
|
||||||
#endif /* !FT_DEBUG_MEMORY */
|
#endif /* !FT_DEBUG_MEMORY */
|
||||||
|
|
||||||
|
|
|
@ -1082,7 +1082,7 @@
|
||||||
#else /* !FT_MACINTOSH */
|
#else /* !FT_MACINTOSH */
|
||||||
|
|
||||||
/* ANSI C doesn't like empty source files */
|
/* ANSI C doesn't like empty source files */
|
||||||
typedef int _ft_mac_dummy;
|
typedef int ft_mac_dummy_;
|
||||||
|
|
||||||
#endif /* !FT_MACINTOSH */
|
#endif /* !FT_MACINTOSH */
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,14 @@
|
||||||
error = FT_ERR( Invalid_Argument );
|
error = FT_ERR( Invalid_Argument );
|
||||||
if ( service->set_mm_design )
|
if ( service->set_mm_design )
|
||||||
error = service->set_mm_design( face, num_coords, coords );
|
error = service->set_mm_design( face, num_coords, coords );
|
||||||
|
|
||||||
|
if ( !error )
|
||||||
|
{
|
||||||
|
if ( num_coords )
|
||||||
|
face->face_flags |= FT_FACE_FLAG_VARIATION;
|
||||||
|
else
|
||||||
|
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enforce recomputation of auto-hinting data */
|
/* enforce recomputation of auto-hinting data */
|
||||||
|
@ -220,6 +228,14 @@
|
||||||
error = FT_ERR( Invalid_Argument );
|
error = FT_ERR( Invalid_Argument );
|
||||||
if ( service->set_mm_weightvector )
|
if ( service->set_mm_weightvector )
|
||||||
error = service->set_mm_weightvector( face, len, weightvector );
|
error = service->set_mm_weightvector( face, len, weightvector );
|
||||||
|
|
||||||
|
if ( !error )
|
||||||
|
{
|
||||||
|
if ( len )
|
||||||
|
face->face_flags |= FT_FACE_FLAG_VARIATION;
|
||||||
|
else
|
||||||
|
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* enforce recomputation of auto-hinting data */
|
/* enforce recomputation of auto-hinting data */
|
||||||
|
@ -283,6 +299,30 @@
|
||||||
if ( service_mm->set_var_design )
|
if ( service_mm->set_var_design )
|
||||||
error = service_mm->set_var_design( face, num_coords, coords );
|
error = service_mm->set_var_design( face, num_coords, coords );
|
||||||
|
|
||||||
|
if ( !error || error == -1 )
|
||||||
|
{
|
||||||
|
FT_Bool is_variation_old = FT_IS_VARIATION( face );
|
||||||
|
|
||||||
|
|
||||||
|
if ( num_coords )
|
||||||
|
face->face_flags |= FT_FACE_FLAG_VARIATION;
|
||||||
|
else
|
||||||
|
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
||||||
|
|
||||||
|
if ( service_mm->construct_ps_name )
|
||||||
|
{
|
||||||
|
if ( error == -1 )
|
||||||
|
{
|
||||||
|
/* The PS name of a named instance and a non-named instance */
|
||||||
|
/* usually differs, even if the axis values are identical. */
|
||||||
|
if ( is_variation_old != FT_IS_VARIATION( face ) )
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* internal error code -1 means `no change'; we can exit immediately */
|
/* internal error code -1 means `no change'; we can exit immediately */
|
||||||
if ( error == -1 )
|
if ( error == -1 )
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
|
@ -359,6 +399,30 @@
|
||||||
if ( service_mm->set_mm_blend )
|
if ( service_mm->set_mm_blend )
|
||||||
error = service_mm->set_mm_blend( face, num_coords, coords );
|
error = service_mm->set_mm_blend( face, num_coords, coords );
|
||||||
|
|
||||||
|
if ( !error || error == -1 )
|
||||||
|
{
|
||||||
|
FT_Bool is_variation_old = FT_IS_VARIATION( face );
|
||||||
|
|
||||||
|
|
||||||
|
if ( num_coords )
|
||||||
|
face->face_flags |= FT_FACE_FLAG_VARIATION;
|
||||||
|
else
|
||||||
|
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
||||||
|
|
||||||
|
if ( service_mm->construct_ps_name )
|
||||||
|
{
|
||||||
|
if ( error == -1 )
|
||||||
|
{
|
||||||
|
/* The PS name of a named instance and a non-named instance */
|
||||||
|
/* usually differs, even if the axis values are identical. */
|
||||||
|
if ( is_variation_old != FT_IS_VARIATION( face ) )
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* internal error code -1 means `no change'; we can exit immediately */
|
/* internal error code -1 means `no change'; we can exit immediately */
|
||||||
if ( error == -1 )
|
if ( error == -1 )
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
|
@ -410,6 +474,30 @@
|
||||||
if ( service_mm->set_mm_blend )
|
if ( service_mm->set_mm_blend )
|
||||||
error = service_mm->set_mm_blend( face, num_coords, coords );
|
error = service_mm->set_mm_blend( face, num_coords, coords );
|
||||||
|
|
||||||
|
if ( !error || error == -1 )
|
||||||
|
{
|
||||||
|
FT_Bool is_variation_old = FT_IS_VARIATION( face );
|
||||||
|
|
||||||
|
|
||||||
|
if ( num_coords )
|
||||||
|
face->face_flags |= FT_FACE_FLAG_VARIATION;
|
||||||
|
else
|
||||||
|
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
||||||
|
|
||||||
|
if ( service_mm->construct_ps_name )
|
||||||
|
{
|
||||||
|
if ( error == -1 )
|
||||||
|
{
|
||||||
|
/* The PS name of a named instance and a non-named instance */
|
||||||
|
/* usually differs, even if the axis values are identical. */
|
||||||
|
if ( is_variation_old != FT_IS_VARIATION( face ) )
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* internal error code -1 means `no change'; we can exit immediately */
|
/* internal error code -1 means `no change'; we can exit immediately */
|
||||||
if ( error == -1 )
|
if ( error == -1 )
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
|
@ -535,8 +623,35 @@
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
error = FT_ERR( Invalid_Argument );
|
error = FT_ERR( Invalid_Argument );
|
||||||
if ( service_mm->set_instance )
|
if ( service_mm->set_named_instance )
|
||||||
error = service_mm->set_instance( face, instance_index );
|
error = service_mm->set_named_instance( face, instance_index );
|
||||||
|
|
||||||
|
if ( !error || error == -1 )
|
||||||
|
{
|
||||||
|
FT_Bool is_variation_old = FT_IS_VARIATION( face );
|
||||||
|
|
||||||
|
|
||||||
|
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
||||||
|
face->face_index = ( instance_index << 16 ) |
|
||||||
|
( face->face_index & 0xFFFFL );
|
||||||
|
|
||||||
|
if ( service_mm->construct_ps_name )
|
||||||
|
{
|
||||||
|
if ( error == -1 )
|
||||||
|
{
|
||||||
|
/* The PS name of a named instance and a non-named instance */
|
||||||
|
/* usually differs, even if the axis values are identical. */
|
||||||
|
if ( is_variation_old != FT_IS_VARIATION( face ) )
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
service_mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* internal error code -1 means `no change'; we can exit immediately */
|
||||||
|
if ( error == -1 )
|
||||||
|
return FT_Err_Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !error )
|
if ( !error )
|
||||||
|
@ -554,11 +669,32 @@
|
||||||
face->autohint.data = NULL;
|
face->autohint.data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* documentation is in ftmm.h */
|
||||||
|
|
||||||
|
FT_EXPORT_DEF( FT_Error )
|
||||||
|
FT_Get_Default_Named_Instance( FT_Face face,
|
||||||
|
FT_UInt *instance_index )
|
||||||
|
{
|
||||||
|
FT_Error error;
|
||||||
|
|
||||||
|
FT_Service_MultiMasters service_mm = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
/* check of `face' delayed to `ft_face_get_mm_service' */
|
||||||
|
|
||||||
|
error = ft_face_get_mm_service( face, &service_mm );
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
face->face_index = ( instance_index << 16 ) |
|
/* no error if `get_default_named_instance` is not available */
|
||||||
( face->face_index & 0xFFFFL );
|
if ( service_mm->get_default_named_instance )
|
||||||
face->face_flags &= ~FT_FACE_FLAG_VARIATION;
|
error = service_mm->get_default_named_instance( face,
|
||||||
|
instance_index );
|
||||||
|
else
|
||||||
|
error = FT_Err_Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -1019,7 +1019,8 @@
|
||||||
/* elegant. */
|
/* elegant. */
|
||||||
|
|
||||||
/* try to load SVG documents if available */
|
/* try to load SVG documents if available */
|
||||||
if ( FT_HAS_SVG( face ) )
|
if ( ( load_flags & FT_LOAD_NO_SVG ) == 0 &&
|
||||||
|
FT_HAS_SVG( face ) )
|
||||||
{
|
{
|
||||||
error = driver->clazz->load_glyph( slot, face->size,
|
error = driver->clazz->load_glyph( slot, face->size,
|
||||||
glyph_index,
|
glyph_index,
|
||||||
|
@ -1245,9 +1246,13 @@
|
||||||
/* destructor for sizes list */
|
/* destructor for sizes list */
|
||||||
static void
|
static void
|
||||||
destroy_size( FT_Memory memory,
|
destroy_size( FT_Memory memory,
|
||||||
FT_Size size,
|
void* size_,
|
||||||
FT_Driver driver )
|
void* driver_ )
|
||||||
{
|
{
|
||||||
|
FT_Size size = (FT_Size)size_;
|
||||||
|
FT_Driver driver = (FT_Driver)driver_;
|
||||||
|
|
||||||
|
|
||||||
/* finalize client-specific data */
|
/* finalize client-specific data */
|
||||||
if ( size->generic.finalizer )
|
if ( size->generic.finalizer )
|
||||||
size->generic.finalizer( size );
|
size->generic.finalizer( size );
|
||||||
|
@ -1293,9 +1298,11 @@
|
||||||
/* destructor for faces list */
|
/* destructor for faces list */
|
||||||
static void
|
static void
|
||||||
destroy_face( FT_Memory memory,
|
destroy_face( FT_Memory memory,
|
||||||
FT_Face face,
|
void* face_,
|
||||||
FT_Driver driver )
|
void* driver_ )
|
||||||
{
|
{
|
||||||
|
FT_Face face = (FT_Face)face_;
|
||||||
|
FT_Driver driver = (FT_Driver)driver_;
|
||||||
FT_Driver_Class clazz = driver->clazz;
|
FT_Driver_Class clazz = driver->clazz;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1310,7 +1317,7 @@
|
||||||
|
|
||||||
/* discard all sizes for this face */
|
/* discard all sizes for this face */
|
||||||
FT_List_Finalize( &face->sizes_list,
|
FT_List_Finalize( &face->sizes_list,
|
||||||
(FT_List_Destructor)destroy_size,
|
destroy_size,
|
||||||
memory,
|
memory,
|
||||||
driver );
|
driver );
|
||||||
face->size = NULL;
|
face->size = NULL;
|
||||||
|
@ -1346,7 +1353,7 @@
|
||||||
Destroy_Driver( FT_Driver driver )
|
Destroy_Driver( FT_Driver driver )
|
||||||
{
|
{
|
||||||
FT_List_Finalize( &driver->faces_list,
|
FT_List_Finalize( &driver->faces_list,
|
||||||
(FT_List_Destructor)destroy_face,
|
destroy_face,
|
||||||
driver->root.memory,
|
driver->root.memory,
|
||||||
driver );
|
driver );
|
||||||
}
|
}
|
||||||
|
@ -1740,6 +1747,7 @@
|
||||||
FT_Memory memory = library->memory;
|
FT_Memory memory = library->memory;
|
||||||
|
|
||||||
|
|
||||||
|
args.driver = NULL;
|
||||||
args.flags = 0;
|
args.flags = 0;
|
||||||
|
|
||||||
if ( driver_name )
|
if ( driver_name )
|
||||||
|
|
|
@ -58,7 +58,9 @@
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
FT_Int n; /* index of contour in outline */
|
FT_Int n; /* index of contour in outline */
|
||||||
FT_UInt first; /* index of first point in contour */
|
FT_Int first; /* index of first point in contour */
|
||||||
|
FT_Int last; /* index of last point in contour */
|
||||||
|
|
||||||
FT_Int tag; /* current point's state */
|
FT_Int tag; /* current point's state */
|
||||||
|
|
||||||
FT_Int shift;
|
FT_Int shift;
|
||||||
|
@ -73,18 +75,17 @@
|
||||||
|
|
||||||
shift = func_interface->shift;
|
shift = func_interface->shift;
|
||||||
delta = func_interface->delta;
|
delta = func_interface->delta;
|
||||||
first = 0;
|
|
||||||
|
|
||||||
|
last = -1;
|
||||||
for ( n = 0; n < outline->n_contours; n++ )
|
for ( n = 0; n < outline->n_contours; n++ )
|
||||||
{
|
{
|
||||||
FT_Int last; /* index of last point in contour */
|
FT_TRACE5(( "FT_Outline_Decompose: Contour %d\n", n ));
|
||||||
|
|
||||||
|
|
||||||
FT_TRACE5(( "FT_Outline_Decompose: Outline %d\n", n ));
|
|
||||||
|
|
||||||
|
first = last + 1;
|
||||||
last = outline->contours[n];
|
last = outline->contours[n];
|
||||||
if ( last < 0 )
|
if ( last < first )
|
||||||
goto Invalid_Outline;
|
goto Invalid_Outline;
|
||||||
|
|
||||||
limit = outline->points + last;
|
limit = outline->points + last;
|
||||||
|
|
||||||
v_start = outline->points[first];
|
v_start = outline->points[first];
|
||||||
|
@ -282,8 +283,6 @@
|
||||||
Close:
|
Close:
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
first = (FT_UInt)last + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FT_TRACE5(( "FT_Outline_Decompose: Done\n" ));
|
FT_TRACE5(( "FT_Outline_Decompose: Done\n" ));
|
||||||
|
@ -368,7 +367,7 @@
|
||||||
if ( n_points <= 0 || n_contours <= 0 )
|
if ( n_points <= 0 || n_contours <= 0 )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
|
|
||||||
end0 = end = -1;
|
end0 = -1;
|
||||||
for ( n = 0; n < n_contours; n++ )
|
for ( n = 0; n < n_contours; n++ )
|
||||||
{
|
{
|
||||||
end = outline->contours[n];
|
end = outline->contours[n];
|
||||||
|
@ -380,7 +379,7 @@
|
||||||
end0 = end;
|
end0 = end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( end != n_points - 1 )
|
if ( end0 != n_points - 1 )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
|
|
||||||
/* XXX: check the tags array */
|
/* XXX: check the tags array */
|
||||||
|
@ -388,7 +387,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Bad:
|
Bad:
|
||||||
return FT_THROW( Invalid_Argument );
|
return FT_THROW( Invalid_Outline );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -550,10 +549,12 @@
|
||||||
if ( !outline )
|
if ( !outline )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
first = 0;
|
last = -1;
|
||||||
|
|
||||||
for ( n = 0; n < outline->n_contours; n++ )
|
for ( n = 0; n < outline->n_contours; n++ )
|
||||||
{
|
{
|
||||||
|
/* keep the first contour point as is and swap points around it */
|
||||||
|
/* to guarantee that the cubic arches stay valid after reverse */
|
||||||
|
first = last + 2;
|
||||||
last = outline->contours[n];
|
last = outline->contours[n];
|
||||||
|
|
||||||
/* reverse point table */
|
/* reverse point table */
|
||||||
|
@ -591,8 +592,6 @@
|
||||||
q--;
|
q--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
first = last + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outline->flags ^= FT_OUTLINE_REVERSE_FILL;
|
outline->flags ^= FT_OUTLINE_REVERSE_FILL;
|
||||||
|
@ -941,7 +940,7 @@
|
||||||
|
|
||||||
points = outline->points;
|
points = outline->points;
|
||||||
|
|
||||||
first = 0;
|
last = -1;
|
||||||
for ( c = 0; c < outline->n_contours; c++ )
|
for ( c = 0; c < outline->n_contours; c++ )
|
||||||
{
|
{
|
||||||
FT_Vector in, out, anchor, shift;
|
FT_Vector in, out, anchor, shift;
|
||||||
|
@ -949,8 +948,9 @@
|
||||||
FT_Int i, j, k;
|
FT_Int i, j, k;
|
||||||
|
|
||||||
|
|
||||||
l_in = 0;
|
first = last + 1;
|
||||||
last = outline->contours[c];
|
last = outline->contours[c];
|
||||||
|
l_in = 0;
|
||||||
|
|
||||||
/* pacify compiler */
|
/* pacify compiler */
|
||||||
in.x = in.y = anchor.x = anchor.y = 0;
|
in.x = in.y = anchor.x = anchor.y = 0;
|
||||||
|
@ -1037,8 +1037,6 @@
|
||||||
in = out;
|
in = out;
|
||||||
l_in = l_out;
|
l_in = l_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
first = last + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
|
@ -1054,7 +1052,7 @@
|
||||||
FT_Int xshift, yshift;
|
FT_Int xshift, yshift;
|
||||||
FT_Vector* points;
|
FT_Vector* points;
|
||||||
FT_Vector v_prev, v_cur;
|
FT_Vector v_prev, v_cur;
|
||||||
FT_Int c, n, first;
|
FT_Int c, n, first, last;
|
||||||
FT_Pos area = 0;
|
FT_Pos area = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1086,11 +1084,11 @@
|
||||||
|
|
||||||
points = outline->points;
|
points = outline->points;
|
||||||
|
|
||||||
first = 0;
|
last = -1;
|
||||||
for ( c = 0; c < outline->n_contours; c++ )
|
for ( c = 0; c < outline->n_contours; c++ )
|
||||||
{
|
{
|
||||||
FT_Int last = outline->contours[c];
|
first = last + 1;
|
||||||
|
last = outline->contours[c];
|
||||||
|
|
||||||
v_prev.x = points[last].x >> xshift;
|
v_prev.x = points[last].x >> xshift;
|
||||||
v_prev.y = points[last].y >> yshift;
|
v_prev.y = points[last].y >> yshift;
|
||||||
|
@ -1106,8 +1104,6 @@
|
||||||
|
|
||||||
v_prev = v_cur;
|
v_prev = v_cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
first = last + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( area > 0 )
|
if ( area > 0 )
|
||||||
|
|
|
@ -141,6 +141,8 @@
|
||||||
if ( read_bytes > count )
|
if ( read_bytes > count )
|
||||||
read_bytes = count;
|
read_bytes = count;
|
||||||
|
|
||||||
|
/* Allow "reading" zero bytes without UB even if buffer is NULL */
|
||||||
|
if ( count )
|
||||||
FT_MEM_COPY( buffer, stream->base + pos, read_bytes );
|
FT_MEM_COPY( buffer, stream->base + pos, read_bytes );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +180,8 @@
|
||||||
if ( read_bytes > count )
|
if ( read_bytes > count )
|
||||||
read_bytes = count;
|
read_bytes = count;
|
||||||
|
|
||||||
|
/* Allow "reading" zero bytes without UB even if buffer is NULL */
|
||||||
|
if ( count )
|
||||||
FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );
|
FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2055,7 +2055,9 @@
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
FT_Int n; /* index of contour in outline */
|
FT_Int n; /* index of contour in outline */
|
||||||
FT_UInt first; /* index of first point in contour */
|
FT_Int first; /* index of first point in contour */
|
||||||
|
FT_Int last; /* index of last point in contour */
|
||||||
|
|
||||||
FT_Int tag; /* current point's state */
|
FT_Int tag; /* current point's state */
|
||||||
|
|
||||||
|
|
||||||
|
@ -2067,22 +2069,17 @@
|
||||||
|
|
||||||
FT_Stroker_Rewind( stroker );
|
FT_Stroker_Rewind( stroker );
|
||||||
|
|
||||||
first = 0;
|
last = -1;
|
||||||
|
|
||||||
for ( n = 0; n < outline->n_contours; n++ )
|
for ( n = 0; n < outline->n_contours; n++ )
|
||||||
{
|
{
|
||||||
FT_UInt last; /* index of last point in contour */
|
first = last + 1;
|
||||||
|
last = outline->contours[n];
|
||||||
|
|
||||||
last = (FT_UInt)outline->contours[n];
|
|
||||||
limit = outline->points + last;
|
|
||||||
|
|
||||||
/* skip empty points; we don't stroke these */
|
/* skip empty points; we don't stroke these */
|
||||||
if ( last <= first )
|
if ( last <= first )
|
||||||
{
|
|
||||||
first = last + 1;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
limit = outline->points + last;
|
||||||
|
|
||||||
v_start = outline->points[first];
|
v_start = outline->points[first];
|
||||||
v_last = outline->points[last];
|
v_last = outline->points[last];
|
||||||
|
@ -2231,8 +2228,6 @@
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
first = last + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
|
|
|
@ -97,9 +97,18 @@
|
||||||
|
|
||||||
FT_EXPORT_DEF( void )
|
FT_EXPORT_DEF( void )
|
||||||
FT_GlyphSlot_Embolden( FT_GlyphSlot slot )
|
FT_GlyphSlot_Embolden( FT_GlyphSlot slot )
|
||||||
|
{
|
||||||
|
FT_GlyphSlot_AdjustWeight( slot, 0x0AAA, 0x0AAA );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FT_EXPORT_DEF( void )
|
||||||
|
FT_GlyphSlot_AdjustWeight( FT_GlyphSlot slot,
|
||||||
|
FT_Fixed xdelta,
|
||||||
|
FT_Fixed ydelta )
|
||||||
{
|
{
|
||||||
FT_Library library;
|
FT_Library library;
|
||||||
FT_Face face;
|
FT_Size size;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
FT_Pos xstr, ystr;
|
FT_Pos xstr, ystr;
|
||||||
|
|
||||||
|
@ -108,16 +117,15 @@
|
||||||
return;
|
return;
|
||||||
|
|
||||||
library = slot->library;
|
library = slot->library;
|
||||||
face = slot->face;
|
size = slot->face->size;
|
||||||
|
|
||||||
if ( slot->format != FT_GLYPH_FORMAT_OUTLINE &&
|
if ( slot->format != FT_GLYPH_FORMAT_OUTLINE &&
|
||||||
slot->format != FT_GLYPH_FORMAT_BITMAP )
|
slot->format != FT_GLYPH_FORMAT_BITMAP )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* some reasonable strength */
|
/* express deltas in pixels in 26.6 format */
|
||||||
xstr = FT_MulFix( face->units_per_EM,
|
xstr = (FT_Pos)size->metrics.x_ppem * xdelta / 1024;
|
||||||
face->size->metrics.y_scale ) / 24;
|
ystr = (FT_Pos)size->metrics.y_ppem * ydelta / 1024;
|
||||||
ystr = xstr;
|
|
||||||
|
|
||||||
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
|
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
|
||||||
FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
|
FT_Outline_EmboldenXY( &slot->outline, xstr, ystr );
|
||||||
|
|
|
@ -206,7 +206,7 @@
|
||||||
* The number of bytes to read from the stream.
|
* The number of bytes to read from the stream.
|
||||||
*
|
*
|
||||||
* @Return:
|
* @Return:
|
||||||
* The number of bytes actually read. If `count' is zero (this is,
|
* The number of bytes actually read. If `count' is zero (that is,
|
||||||
* the function is used for seeking), a non-zero return value
|
* the function is used for seeking), a non-zero return value
|
||||||
* indicates an error.
|
* indicates an error.
|
||||||
*/
|
*/
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
FT_FILE* file;
|
FT_FILE* file;
|
||||||
|
|
||||||
|
|
||||||
if ( !count && offset > stream->size )
|
if ( offset > stream->size && !count )
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
file = STREAM_FILE( stream );
|
file = STREAM_FILE( stream );
|
||||||
|
@ -227,6 +227,11 @@
|
||||||
if ( stream->pos != offset )
|
if ( stream->pos != offset )
|
||||||
ft_fseek( file, (long)offset, SEEK_SET );
|
ft_fseek( file, (long)offset, SEEK_SET );
|
||||||
|
|
||||||
|
/* Avoid calling `fread` with `buffer=NULL` and `count=0`, */
|
||||||
|
/* which is undefined behaviour. */
|
||||||
|
if ( !count )
|
||||||
|
return 0;
|
||||||
|
|
||||||
return (unsigned long)ft_fread( buffer, 1, count, file );
|
return (unsigned long)ft_fread( buffer, 1, count, file );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
|
|
||||||
#include<windows.h>
|
#include<windows.h>
|
||||||
|
|
||||||
#define FT_VERSION 2,13,0,0
|
#define FT_VERSION 2,13,2,0
|
||||||
#define FT_VERSION_STR "2.13.0"
|
#define FT_VERSION_STR "2.13.2"
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION FT_VERSION
|
FILEVERSION FT_VERSION
|
||||||
|
|
|
@ -239,10 +239,6 @@ FT_BEGIN_HEADER
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
bdf_free_font( bdf_font_t* font );
|
bdf_free_font( bdf_font_t* font );
|
||||||
|
|
||||||
FT_LOCAL( bdf_property_t * )
|
|
||||||
bdf_get_property( char* name,
|
|
||||||
bdf_font_t* font );
|
|
||||||
|
|
||||||
FT_LOCAL( bdf_property_t * )
|
FT_LOCAL( bdf_property_t * )
|
||||||
bdf_get_font_property( bdf_font_t* font,
|
bdf_get_font_property( bdf_font_t* font,
|
||||||
const char* name );
|
const char* name );
|
||||||
|
|
|
@ -311,9 +311,9 @@ THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
BDF_Face_Done( FT_Face bdfface ) /* BDF_Face */
|
BDF_Face_Done( FT_Face face ) /* BDF_Face */
|
||||||
{
|
{
|
||||||
BDF_Face face = (BDF_Face)bdfface;
|
BDF_Face bdfface = (BDF_Face)face;
|
||||||
FT_Memory memory;
|
FT_Memory memory;
|
||||||
|
|
||||||
|
|
||||||
|
@ -322,30 +322,30 @@ THE SOFTWARE.
|
||||||
|
|
||||||
memory = FT_FACE_MEMORY( face );
|
memory = FT_FACE_MEMORY( face );
|
||||||
|
|
||||||
bdf_free_font( face->bdffont );
|
bdf_free_font( bdfface->bdffont );
|
||||||
|
|
||||||
FT_FREE( face->en_table );
|
FT_FREE( bdfface->en_table );
|
||||||
|
|
||||||
FT_FREE( face->charset_encoding );
|
FT_FREE( bdfface->charset_encoding );
|
||||||
FT_FREE( face->charset_registry );
|
FT_FREE( bdfface->charset_registry );
|
||||||
FT_FREE( bdfface->family_name );
|
FT_FREE( face->family_name );
|
||||||
FT_FREE( bdfface->style_name );
|
FT_FREE( face->style_name );
|
||||||
|
|
||||||
FT_FREE( bdfface->available_sizes );
|
FT_FREE( face->available_sizes );
|
||||||
|
|
||||||
FT_FREE( face->bdffont );
|
FT_FREE( bdfface->bdffont );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
BDF_Face_Init( FT_Stream stream,
|
BDF_Face_Init( FT_Stream stream,
|
||||||
FT_Face bdfface, /* BDF_Face */
|
FT_Face face, /* BDF_Face */
|
||||||
FT_Int face_index,
|
FT_Int face_index,
|
||||||
FT_Int num_params,
|
FT_Int num_params,
|
||||||
FT_Parameter* params )
|
FT_Parameter* params )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
BDF_Face face = (BDF_Face)bdfface;
|
BDF_Face bdfface = (BDF_Face)face;
|
||||||
FT_Memory memory = FT_FACE_MEMORY( face );
|
FT_Memory memory = FT_FACE_MEMORY( face );
|
||||||
|
|
||||||
bdf_font_t* font = NULL;
|
bdf_font_t* font = NULL;
|
||||||
|
@ -375,7 +375,7 @@ THE SOFTWARE.
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/* we have a bdf font: let's construct the face object */
|
/* we have a bdf font: let's construct the face object */
|
||||||
face->bdffont = font;
|
bdfface->bdffont = font;
|
||||||
|
|
||||||
/* BDF cannot have multiple faces in a single font file.
|
/* BDF cannot have multiple faces in a single font file.
|
||||||
* XXX: non-zero face_index is already invalid argument, but
|
* XXX: non-zero face_index is already invalid argument, but
|
||||||
|
@ -386,7 +386,7 @@ THE SOFTWARE.
|
||||||
if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
|
if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
|
||||||
{
|
{
|
||||||
FT_ERROR(( "BDF_Face_Init: invalid face index\n" ));
|
FT_ERROR(( "BDF_Face_Init: invalid face index\n" ));
|
||||||
BDF_Face_Done( bdfface );
|
BDF_Face_Done( face );
|
||||||
return FT_THROW( Invalid_Argument );
|
return FT_THROW( Invalid_Argument );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,10 +401,10 @@ THE SOFTWARE.
|
||||||
font->unencoded_size,
|
font->unencoded_size,
|
||||||
font->unencoded_used ));
|
font->unencoded_used ));
|
||||||
|
|
||||||
bdfface->num_faces = 1;
|
face->num_faces = 1;
|
||||||
bdfface->face_index = 0;
|
face->face_index = 0;
|
||||||
|
|
||||||
bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
|
face->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
|
||||||
FT_FACE_FLAG_HORIZONTAL;
|
FT_FACE_FLAG_HORIZONTAL;
|
||||||
|
|
||||||
prop = bdf_get_font_property( font, "SPACING" );
|
prop = bdf_get_font_property( font, "SPACING" );
|
||||||
|
@ -412,7 +412,7 @@ THE SOFTWARE.
|
||||||
prop->value.atom &&
|
prop->value.atom &&
|
||||||
( *(prop->value.atom) == 'M' || *(prop->value.atom) == 'm' ||
|
( *(prop->value.atom) == 'M' || *(prop->value.atom) == 'm' ||
|
||||||
*(prop->value.atom) == 'C' || *(prop->value.atom) == 'c' ) )
|
*(prop->value.atom) == 'C' || *(prop->value.atom) == 'c' ) )
|
||||||
bdfface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
face->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
||||||
|
|
||||||
/* FZ XXX: TO DO: FT_FACE_FLAGS_VERTICAL */
|
/* FZ XXX: TO DO: FT_FACE_FLAGS_VERTICAL */
|
||||||
/* FZ XXX: I need a font to implement this */
|
/* FZ XXX: I need a font to implement this */
|
||||||
|
@ -420,26 +420,27 @@ THE SOFTWARE.
|
||||||
prop = bdf_get_font_property( font, "FAMILY_NAME" );
|
prop = bdf_get_font_property( font, "FAMILY_NAME" );
|
||||||
if ( prop && prop->value.atom )
|
if ( prop && prop->value.atom )
|
||||||
{
|
{
|
||||||
if ( FT_STRDUP( bdfface->family_name, prop->value.atom ) )
|
if ( FT_STRDUP( face->family_name, prop->value.atom ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
bdfface->family_name = NULL;
|
face->family_name = NULL;
|
||||||
|
|
||||||
if ( FT_SET_ERROR( bdf_interpret_style( face ) ) )
|
if ( FT_SET_ERROR( bdf_interpret_style( bdfface ) ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/* the number of glyphs (with one slot for the undefined glyph */
|
/* the number of glyphs (with one slot for the undefined glyph */
|
||||||
/* at position 0 and all unencoded glyphs) */
|
/* at position 0 and all unencoded glyphs) */
|
||||||
bdfface->num_glyphs = (FT_Long)( font->glyphs_size + 1 );
|
face->num_glyphs = (FT_Long)( font->glyphs_size + 1 );
|
||||||
|
|
||||||
bdfface->num_fixed_sizes = 1;
|
face->num_fixed_sizes = 1;
|
||||||
if ( FT_NEW( bdfface->available_sizes ) )
|
if ( FT_NEW( face->available_sizes ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
{
|
{
|
||||||
FT_Bitmap_Size* bsize = bdfface->available_sizes;
|
FT_Bitmap_Size* bsize = face->available_sizes;
|
||||||
FT_Short resolution_x = 0, resolution_y = 0;
|
FT_Short resolution_x = 0;
|
||||||
|
FT_Short resolution_y = 0;
|
||||||
long value;
|
long value;
|
||||||
|
|
||||||
|
|
||||||
|
@ -598,20 +599,20 @@ THE SOFTWARE.
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_QNEW_ARRAY( face->en_table, font->glyphs_size ) )
|
if ( FT_QNEW_ARRAY( bdfface->en_table, font->glyphs_size ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
face->default_glyph = 0;
|
bdfface->default_glyph = 0;
|
||||||
for ( n = 0; n < font->glyphs_size; n++ )
|
for ( n = 0; n < font->glyphs_size; n++ )
|
||||||
{
|
{
|
||||||
(face->en_table[n]).enc = cur[n].encoding;
|
(bdfface->en_table[n]).enc = cur[n].encoding;
|
||||||
FT_TRACE4(( " idx %ld, val 0x%lX\n", n, cur[n].encoding ));
|
FT_TRACE4(( " idx %ld, val 0x%lX\n", n, cur[n].encoding ));
|
||||||
(face->en_table[n]).glyph = (FT_UShort)n;
|
(bdfface->en_table[n]).glyph = (FT_UShort)n;
|
||||||
|
|
||||||
if ( cur[n].encoding == font->default_char )
|
if ( cur[n].encoding == font->default_char )
|
||||||
{
|
{
|
||||||
if ( n < FT_UINT_MAX )
|
if ( n < FT_UINT_MAX )
|
||||||
face->default_glyph = (FT_UInt)n;
|
bdfface->default_glyph = (FT_UInt)n;
|
||||||
else
|
else
|
||||||
FT_TRACE1(( "BDF_Face_Init:"
|
FT_TRACE1(( "BDF_Face_Init:"
|
||||||
" idx %ld is too large for this system\n", n ));
|
" idx %ld is too large for this system\n", n ));
|
||||||
|
@ -639,15 +640,15 @@ THE SOFTWARE.
|
||||||
const char* s;
|
const char* s;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_STRDUP( face->charset_encoding,
|
if ( FT_STRDUP( bdfface->charset_encoding,
|
||||||
charset_encoding->value.atom ) ||
|
charset_encoding->value.atom ) ||
|
||||||
FT_STRDUP( face->charset_registry,
|
FT_STRDUP( bdfface->charset_registry,
|
||||||
charset_registry->value.atom ) )
|
charset_registry->value.atom ) )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
/* Uh, oh, compare first letters manually to avoid dependency */
|
/* Uh, oh, compare first letters manually to avoid dependency */
|
||||||
/* on locales. */
|
/* on locales. */
|
||||||
s = face->charset_registry;
|
s = bdfface->charset_registry;
|
||||||
if ( ( s[0] == 'i' || s[0] == 'I' ) &&
|
if ( ( s[0] == 'i' || s[0] == 'I' ) &&
|
||||||
( s[1] == 's' || s[1] == 'S' ) &&
|
( s[1] == 's' || s[1] == 'S' ) &&
|
||||||
( s[2] == 'o' || s[2] == 'O' ) )
|
( s[2] == 'o' || s[2] == 'O' ) )
|
||||||
|
@ -655,11 +656,11 @@ THE SOFTWARE.
|
||||||
s += 3;
|
s += 3;
|
||||||
if ( !ft_strcmp( s, "10646" ) ||
|
if ( !ft_strcmp( s, "10646" ) ||
|
||||||
( !ft_strcmp( s, "8859" ) &&
|
( !ft_strcmp( s, "8859" ) &&
|
||||||
!ft_strcmp( face->charset_encoding, "1" ) ) )
|
!ft_strcmp( bdfface->charset_encoding, "1" ) ) )
|
||||||
unicode_charmap = 1;
|
unicode_charmap = 1;
|
||||||
/* another name for ASCII */
|
/* another name for ASCII */
|
||||||
else if ( !ft_strcmp( s, "646.1991" ) &&
|
else if ( !ft_strcmp( s, "646.1991" ) &&
|
||||||
!ft_strcmp( face->charset_encoding, "IRV" ) )
|
!ft_strcmp( bdfface->charset_encoding, "IRV" ) )
|
||||||
unicode_charmap = 1;
|
unicode_charmap = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -667,7 +668,7 @@ THE SOFTWARE.
|
||||||
FT_CharMapRec charmap;
|
FT_CharMapRec charmap;
|
||||||
|
|
||||||
|
|
||||||
charmap.face = FT_FACE( face );
|
charmap.face = face;
|
||||||
charmap.encoding = FT_ENCODING_NONE;
|
charmap.encoding = FT_ENCODING_NONE;
|
||||||
/* initial platform/encoding should indicate unset status? */
|
/* initial platform/encoding should indicate unset status? */
|
||||||
charmap.platform_id = TT_PLATFORM_APPLE_UNICODE;
|
charmap.platform_id = TT_PLATFORM_APPLE_UNICODE;
|
||||||
|
@ -693,7 +694,7 @@ THE SOFTWARE.
|
||||||
FT_CharMapRec charmap;
|
FT_CharMapRec charmap;
|
||||||
|
|
||||||
|
|
||||||
charmap.face = FT_FACE( face );
|
charmap.face = face;
|
||||||
charmap.encoding = FT_ENCODING_ADOBE_STANDARD;
|
charmap.encoding = FT_ENCODING_ADOBE_STANDARD;
|
||||||
charmap.platform_id = TT_PLATFORM_ADOBE;
|
charmap.platform_id = TT_PLATFORM_ADOBE;
|
||||||
charmap.encoding_id = TT_ADOBE_ID_STANDARD;
|
charmap.encoding_id = TT_ADOBE_ID_STANDARD;
|
||||||
|
@ -701,8 +702,8 @@ THE SOFTWARE.
|
||||||
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
|
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
|
||||||
|
|
||||||
/* Select default charmap */
|
/* Select default charmap */
|
||||||
if ( bdfface->num_charmaps )
|
if ( face->num_charmaps )
|
||||||
bdfface->charmap = bdfface->charmaps[0];
|
face->charmap = face->charmaps[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -711,7 +712,7 @@ THE SOFTWARE.
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
Fail:
|
Fail:
|
||||||
BDF_Face_Done( bdfface );
|
BDF_Face_Done( face );
|
||||||
return FT_THROW( Unknown_File_Format );
|
return FT_THROW( Unknown_File_Format );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -868,17 +869,18 @@ THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
bdf_get_bdf_property( BDF_Face face,
|
bdf_get_bdf_property( FT_Face face, /* BDF_Face */
|
||||||
const char* prop_name,
|
const char* prop_name,
|
||||||
BDF_PropertyRec *aproperty )
|
BDF_PropertyRec *aproperty )
|
||||||
{
|
{
|
||||||
|
BDF_Face bdfface = (BDF_Face)face;
|
||||||
bdf_property_t* prop;
|
bdf_property_t* prop;
|
||||||
|
|
||||||
|
|
||||||
FT_ASSERT( face && face->bdffont );
|
FT_ASSERT( bdfface && bdfface->bdffont );
|
||||||
|
|
||||||
prop = bdf_get_font_property( face->bdffont, prop_name );
|
prop = bdf_get_font_property( bdfface->bdffont, prop_name );
|
||||||
if ( prop )
|
if ( prop )
|
||||||
{
|
{
|
||||||
switch ( prop->format )
|
switch ( prop->format )
|
||||||
|
@ -921,13 +923,16 @@ THE SOFTWARE.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
bdf_get_charset_id( BDF_Face face,
|
bdf_get_charset_id( FT_Face face, /* BDF_Face */
|
||||||
const char* *acharset_encoding,
|
const char* *acharset_encoding,
|
||||||
const char* *acharset_registry )
|
const char* *acharset_registry )
|
||||||
{
|
{
|
||||||
*acharset_encoding = face->charset_encoding;
|
BDF_Face bdfface = (BDF_Face)face;
|
||||||
*acharset_registry = face->charset_registry;
|
|
||||||
|
|
||||||
|
*acharset_encoding = bdfface->charset_encoding;
|
||||||
|
*acharset_registry = bdfface->charset_registry;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -964,7 +969,6 @@ THE SOFTWARE.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_TABLE_DEF
|
FT_CALLBACK_TABLE_DEF
|
||||||
const FT_Driver_ClassRec bdf_driver_class =
|
const FT_Driver_ClassRec bdf_driver_class =
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,9 @@
|
||||||
#define FT_COMPONENT bdflib
|
#define FT_COMPONENT bdflib
|
||||||
|
|
||||||
|
|
||||||
|
#define BUFSIZE 128
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Default BDF font options.
|
* Default BDF font options.
|
||||||
|
@ -378,7 +381,7 @@
|
||||||
*alen = 0;
|
*alen = 0;
|
||||||
|
|
||||||
if ( list == NULL || list->used == 0 )
|
if ( list == NULL || list->used == 0 )
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
dp = list->field[0];
|
dp = list->field[0];
|
||||||
for ( i = j = 0; i < list->used; i++ )
|
for ( i = j = 0; i < list->used; i++ )
|
||||||
|
@ -887,18 +890,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( bdf_property_t* )
|
static bdf_property_t*
|
||||||
bdf_get_property( char* name,
|
bdf_get_property( const char* name,
|
||||||
bdf_font_t* font )
|
bdf_font_t* font )
|
||||||
{
|
{
|
||||||
size_t* propid;
|
size_t* propid;
|
||||||
|
|
||||||
|
|
||||||
if ( name == NULL || *name == 0 )
|
if ( name == NULL || *name == 0 )
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
if ( ( propid = ft_hash_str_lookup( name, &(font->proptbl) ) ) == NULL )
|
if ( ( propid = ft_hash_str_lookup( name, &(font->proptbl) ) ) == NULL )
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
if ( *propid >= num_bdf_properties_ )
|
if ( *propid >= num_bdf_properties_ )
|
||||||
return font->user_props + ( *propid - num_bdf_properties_ );
|
return font->user_props + ( *propid - num_bdf_properties_ );
|
||||||
|
@ -944,7 +947,7 @@
|
||||||
|
|
||||||
static FT_Error
|
static FT_Error
|
||||||
bdf_add_comment_( bdf_font_t* font,
|
bdf_add_comment_( bdf_font_t* font,
|
||||||
char* comment,
|
const char* comment,
|
||||||
unsigned long len )
|
unsigned long len )
|
||||||
{
|
{
|
||||||
char* cp;
|
char* cp;
|
||||||
|
@ -1053,27 +1056,24 @@
|
||||||
bdf_property_t* p;
|
bdf_property_t* p;
|
||||||
|
|
||||||
|
|
||||||
*name = sp = ep = line;
|
sp = ep = line;
|
||||||
|
|
||||||
while ( *ep && *ep != ' ' && *ep != '\t' )
|
while ( *ep && *ep != ' ' && *ep != '\t' )
|
||||||
ep++;
|
ep++;
|
||||||
|
|
||||||
hold = -1;
|
|
||||||
if ( *ep )
|
|
||||||
{
|
|
||||||
hold = *ep;
|
hold = *ep;
|
||||||
*ep = 0;
|
*ep = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
p = bdf_get_property( sp, font );
|
p = bdf_get_property( sp, font );
|
||||||
|
|
||||||
/* Restore the character that was saved before any return can happen. */
|
|
||||||
if ( hold != -1 )
|
|
||||||
*ep = (char)hold;
|
|
||||||
|
|
||||||
/* If the property exists and is not an atom, just return here. */
|
/* If the property exists and is not an atom, just return here. */
|
||||||
if ( p && p->format != BDF_ATOM )
|
if ( p && p->format != BDF_ATOM )
|
||||||
|
{
|
||||||
|
*ep = (char)hold; /* Undo NUL-termination. */
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
*name = sp;
|
||||||
|
|
||||||
/* The property is an atom. Trim all leading and trailing whitespace */
|
/* The property is an atom. Trim all leading and trailing whitespace */
|
||||||
/* and double quotes for the atom value. */
|
/* and double quotes for the atom value. */
|
||||||
|
@ -1081,25 +1081,26 @@
|
||||||
ep = line + linelen;
|
ep = line + linelen;
|
||||||
|
|
||||||
/* Trim the leading whitespace if it exists. */
|
/* Trim the leading whitespace if it exists. */
|
||||||
if ( *sp )
|
if ( sp < ep )
|
||||||
*sp++ = 0;
|
do
|
||||||
while ( *sp &&
|
|
||||||
( *sp == ' ' || *sp == '\t' ) )
|
|
||||||
sp++;
|
sp++;
|
||||||
|
while ( *sp == ' ' || *sp == '\t' );
|
||||||
|
|
||||||
/* Trim the leading double quote if it exists. */
|
/* Trim the leading double quote if it exists. */
|
||||||
if ( *sp == '"' )
|
if ( *sp == '"' )
|
||||||
sp++;
|
sp++;
|
||||||
|
|
||||||
*value = sp;
|
*value = sp;
|
||||||
|
|
||||||
/* Trim the trailing whitespace if it exists. */
|
/* Trim the trailing whitespace if it exists. */
|
||||||
while ( ep > sp &&
|
if ( sp < ep )
|
||||||
( *( ep - 1 ) == ' ' || *( ep - 1 ) == '\t' ) )
|
do
|
||||||
*--ep = 0;
|
*ep-- = '\0';
|
||||||
|
while ( *ep == ' ' || *ep == '\t' );
|
||||||
|
|
||||||
/* Trim the trailing double quote if it exists. */
|
/* Trim the trailing double quote if it exists. */
|
||||||
if ( ep > sp && *( ep - 1 ) == '"' )
|
if ( *ep == '"' )
|
||||||
*--ep = 0;
|
*ep = '\0';
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1775,7 +1776,7 @@
|
||||||
bdf_parse_t_* p;
|
bdf_parse_t_* p;
|
||||||
char* name;
|
char* name;
|
||||||
char* value;
|
char* value;
|
||||||
char nbuf[128];
|
char nbuf[BUFSIZE];
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
FT_UNUSED( lineno );
|
FT_UNUSED( lineno );
|
||||||
|
@ -1796,7 +1797,7 @@
|
||||||
if ( bdf_get_font_property( p->font, "FONT_ASCENT" ) == 0 )
|
if ( bdf_get_font_property( p->font, "FONT_ASCENT" ) == 0 )
|
||||||
{
|
{
|
||||||
p->font->font_ascent = p->font->bbx.ascent;
|
p->font->font_ascent = p->font->bbx.ascent;
|
||||||
ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
|
ft_snprintf( nbuf, BUFSIZE, "%hd", p->font->bbx.ascent );
|
||||||
error = bdf_add_property_( p->font, "FONT_ASCENT",
|
error = bdf_add_property_( p->font, "FONT_ASCENT",
|
||||||
nbuf, lineno );
|
nbuf, lineno );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
@ -1808,7 +1809,7 @@
|
||||||
if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 )
|
if ( bdf_get_font_property( p->font, "FONT_DESCENT" ) == 0 )
|
||||||
{
|
{
|
||||||
p->font->font_descent = p->font->bbx.descent;
|
p->font->font_descent = p->font->bbx.descent;
|
||||||
ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
|
ft_snprintf( nbuf, BUFSIZE, "%hd", p->font->bbx.descent );
|
||||||
error = bdf_add_property_( p->font, "FONT_DESCENT",
|
error = bdf_add_property_( p->font, "FONT_DESCENT",
|
||||||
nbuf, lineno );
|
nbuf, lineno );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
@ -2116,7 +2117,7 @@
|
||||||
/* Check for the CHARS field -- font properties are optional */
|
/* Check for the CHARS field -- font properties are optional */
|
||||||
if ( _bdf_strncmp( line, "CHARS", 5 ) == 0 )
|
if ( _bdf_strncmp( line, "CHARS", 5 ) == 0 )
|
||||||
{
|
{
|
||||||
char nbuf[128];
|
char nbuf[BUFSIZE];
|
||||||
|
|
||||||
|
|
||||||
if ( !( p->flags & BDF_FONT_BBX_ ) )
|
if ( !( p->flags & BDF_FONT_BBX_ ) )
|
||||||
|
@ -2130,7 +2131,7 @@
|
||||||
/* Add the two standard X11 properties which are required */
|
/* Add the two standard X11 properties which are required */
|
||||||
/* for compiling fonts. */
|
/* for compiling fonts. */
|
||||||
p->font->font_ascent = p->font->bbx.ascent;
|
p->font->font_ascent = p->font->bbx.ascent;
|
||||||
ft_sprintf( nbuf, "%hd", p->font->bbx.ascent );
|
ft_snprintf( nbuf, BUFSIZE, "%hd", p->font->bbx.ascent );
|
||||||
error = bdf_add_property_( p->font, "FONT_ASCENT",
|
error = bdf_add_property_( p->font, "FONT_ASCENT",
|
||||||
nbuf, lineno );
|
nbuf, lineno );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
@ -2138,7 +2139,7 @@
|
||||||
FT_TRACE2(( "bdf_parse_properties_: " ACMSG1, p->font->bbx.ascent ));
|
FT_TRACE2(( "bdf_parse_properties_: " ACMSG1, p->font->bbx.ascent ));
|
||||||
|
|
||||||
p->font->font_descent = p->font->bbx.descent;
|
p->font->font_descent = p->font->bbx.descent;
|
||||||
ft_sprintf( nbuf, "%hd", p->font->bbx.descent );
|
ft_snprintf( nbuf, BUFSIZE, "%hd", p->font->bbx.descent );
|
||||||
error = bdf_add_property_( p->font, "FONT_DESCENT",
|
error = bdf_add_property_( p->font, "FONT_DESCENT",
|
||||||
nbuf, lineno );
|
nbuf, lineno );
|
||||||
if ( error )
|
if ( error )
|
||||||
|
|
|
@ -62,10 +62,12 @@
|
||||||
|
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
ft_bzip2_alloc( FT_Memory memory,
|
ft_bzip2_alloc( void* memory_, /* FT_Memory */
|
||||||
int items,
|
int items,
|
||||||
int size )
|
int size )
|
||||||
{
|
{
|
||||||
|
FT_Memory memory = (FT_Memory)memory_;
|
||||||
|
|
||||||
FT_ULong sz = (FT_ULong)size * (FT_ULong)items;
|
FT_ULong sz = (FT_ULong)size * (FT_ULong)items;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
FT_Pointer p = NULL;
|
FT_Pointer p = NULL;
|
||||||
|
@ -77,9 +79,12 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ft_bzip2_free( FT_Memory memory,
|
ft_bzip2_free( void* memory_, /* FT_Memory */
|
||||||
void* address )
|
void* address )
|
||||||
{
|
{
|
||||||
|
FT_Memory memory = (FT_Memory)memory_;
|
||||||
|
|
||||||
|
|
||||||
FT_MEM_FREE( address );
|
FT_MEM_FREE( address );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,8 +175,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize bzlib */
|
/* initialize bzlib */
|
||||||
bzstream->bzalloc = (alloc_func)ft_bzip2_alloc;
|
bzstream->bzalloc = ft_bzip2_alloc;
|
||||||
bzstream->bzfree = (free_func) ft_bzip2_free;
|
bzstream->bzfree = ft_bzip2_free;
|
||||||
bzstream->opaque = zip->memory;
|
bzstream->opaque = zip->memory;
|
||||||
|
|
||||||
bzstream->avail_in = 0;
|
bzstream->avail_in = 0;
|
||||||
|
|
8
lib/freetype/src/cache/ftcbasic.c
vendored
8
lib/freetype/src/cache/ftcbasic.c
vendored
|
@ -337,7 +337,7 @@
|
||||||
#if 1 /* inlining is about 50% faster! */
|
#if 1 /* inlining is about 50% faster! */
|
||||||
FTC_GCACHE_LOOKUP_CMP( cache,
|
FTC_GCACHE_LOOKUP_CMP( cache,
|
||||||
ftc_basic_family_compare,
|
ftc_basic_family_compare,
|
||||||
FTC_GNode_Compare,
|
ftc_gnode_compare,
|
||||||
hash, gindex,
|
hash, gindex,
|
||||||
&query,
|
&query,
|
||||||
node,
|
node,
|
||||||
|
@ -411,7 +411,7 @@
|
||||||
|
|
||||||
FTC_GCACHE_LOOKUP_CMP( cache,
|
FTC_GCACHE_LOOKUP_CMP( cache,
|
||||||
ftc_basic_family_compare,
|
ftc_basic_family_compare,
|
||||||
FTC_GNode_Compare,
|
ftc_gnode_compare,
|
||||||
hash, gindex,
|
hash, gindex,
|
||||||
&query,
|
&query,
|
||||||
node,
|
node,
|
||||||
|
@ -537,7 +537,7 @@
|
||||||
#if 1 /* inlining is about 50% faster! */
|
#if 1 /* inlining is about 50% faster! */
|
||||||
FTC_GCACHE_LOOKUP_CMP( cache,
|
FTC_GCACHE_LOOKUP_CMP( cache,
|
||||||
ftc_basic_family_compare,
|
ftc_basic_family_compare,
|
||||||
FTC_SNode_Compare,
|
ftc_snode_compare,
|
||||||
hash, gindex,
|
hash, gindex,
|
||||||
&query,
|
&query,
|
||||||
node,
|
node,
|
||||||
|
@ -613,7 +613,7 @@
|
||||||
|
|
||||||
FTC_GCACHE_LOOKUP_CMP( cache,
|
FTC_GCACHE_LOOKUP_CMP( cache,
|
||||||
ftc_basic_family_compare,
|
ftc_basic_family_compare,
|
||||||
FTC_SNode_Compare,
|
ftc_snode_compare,
|
||||||
hash, gindex,
|
hash, gindex,
|
||||||
&query,
|
&query,
|
||||||
node,
|
node,
|
||||||
|
|
121
lib/freetype/src/cache/ftccache.c
vendored
121
lib/freetype/src/cache/ftccache.c
vendored
|
@ -94,8 +94,8 @@
|
||||||
|
|
||||||
|
|
||||||
idx = hash & cache->mask;
|
idx = hash & cache->mask;
|
||||||
if ( idx < cache->p )
|
if ( idx >= cache->p )
|
||||||
idx = hash & ( 2 * cache->mask + 1 );
|
idx = hash & ( cache->mask >> 1 );
|
||||||
|
|
||||||
return cache->buckets + idx;
|
return cache->buckets + idx;
|
||||||
}
|
}
|
||||||
|
@ -114,8 +114,8 @@
|
||||||
{
|
{
|
||||||
FTC_Node node, *pnode;
|
FTC_Node node, *pnode;
|
||||||
FT_UFast p = cache->p;
|
FT_UFast p = cache->p;
|
||||||
FT_UFast mask = cache->mask;
|
FT_UFast size = cache->mask + 1; /* available size */
|
||||||
FT_UFast count = mask + p + 1; /* number of buckets */
|
FT_UFast half = size >> 1;
|
||||||
|
|
||||||
|
|
||||||
/* do we need to expand the buckets array? */
|
/* do we need to expand the buckets array? */
|
||||||
|
@ -127,20 +127,22 @@
|
||||||
/* try to expand the buckets array _before_ splitting
|
/* try to expand the buckets array _before_ splitting
|
||||||
* the bucket lists
|
* the bucket lists
|
||||||
*/
|
*/
|
||||||
if ( p >= mask )
|
if ( p == size )
|
||||||
{
|
{
|
||||||
FT_Memory memory = cache->memory;
|
FT_Memory memory = cache->memory;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
/* if we can't expand the array, leave immediately */
|
/* if we can't expand the array, leave immediately */
|
||||||
if ( FT_RENEW_ARRAY( cache->buckets,
|
if ( FT_QRENEW_ARRAY( cache->buckets, size, size * 2 ) )
|
||||||
( mask + 1 ) * 2, ( mask + 1 ) * 4 ) )
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
cache->mask = 2 * size - 1;
|
||||||
|
half = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* split a single bucket */
|
/* the bucket to split */
|
||||||
pnode = cache->buckets + p;
|
pnode = cache->buckets + p - half;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
@ -148,7 +150,7 @@
|
||||||
if ( !node )
|
if ( !node )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( node->hash & ( mask + 1 ) )
|
if ( node->hash & half )
|
||||||
{
|
{
|
||||||
*pnode = node->link;
|
*pnode = node->link;
|
||||||
node->link = new_list;
|
node->link = new_list;
|
||||||
|
@ -158,56 +160,50 @@
|
||||||
pnode = &node->link;
|
pnode = &node->link;
|
||||||
}
|
}
|
||||||
|
|
||||||
cache->buckets[p + mask + 1] = new_list;
|
cache->buckets[p] = new_list;
|
||||||
|
|
||||||
cache->slack += FTC_HASH_MAX_LOAD;
|
cache->slack += FTC_HASH_MAX_LOAD;
|
||||||
|
|
||||||
if ( p >= mask )
|
|
||||||
{
|
|
||||||
cache->mask = 2 * mask + 1;
|
|
||||||
cache->p = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
cache->p = p + 1;
|
cache->p = p + 1;
|
||||||
|
|
||||||
|
FT_TRACE2(( "ftc_cache_resize: cache %u increased to %u hashes\n",
|
||||||
|
cache->index, cache->p ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do we need to shrink the buckets array? */
|
/* do we need to shrink the buckets array? */
|
||||||
else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD )
|
else if ( cache->slack > (FT_Long)p * FTC_HASH_SUB_LOAD )
|
||||||
{
|
{
|
||||||
FT_UFast old_index = p + mask;
|
FTC_Node old_list = cache->buckets[--p];
|
||||||
FTC_Node* pold;
|
|
||||||
|
|
||||||
|
|
||||||
if ( old_index + 1 <= FTC_HASH_INITIAL_SIZE )
|
if ( p < FTC_HASH_INITIAL_SIZE )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( p == 0 )
|
if ( p == half )
|
||||||
{
|
{
|
||||||
FT_Memory memory = cache->memory;
|
FT_Memory memory = cache->memory;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
/* if we can't shrink the array, leave immediately */
|
/* if we can't shrink the array, leave immediately */
|
||||||
if ( FT_QRENEW_ARRAY( cache->buckets,
|
if ( FT_QRENEW_ARRAY( cache->buckets, size, half ) )
|
||||||
( mask + 1 ) * 2, mask + 1 ) )
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
cache->mask >>= 1;
|
cache->mask = half - 1;
|
||||||
p = cache->mask;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
p--;
|
|
||||||
|
|
||||||
pnode = cache->buckets + p;
|
/* the bucket to merge */
|
||||||
|
pnode = cache->buckets + p - half;
|
||||||
|
|
||||||
while ( *pnode )
|
while ( *pnode )
|
||||||
pnode = &(*pnode)->link;
|
pnode = &(*pnode)->link;
|
||||||
|
|
||||||
pold = cache->buckets + old_index;
|
*pnode = old_list;
|
||||||
*pnode = *pold;
|
|
||||||
*pold = NULL;
|
|
||||||
|
|
||||||
cache->slack -= FTC_HASH_MAX_LOAD;
|
cache->slack -= FTC_HASH_MAX_LOAD;
|
||||||
cache->p = p;
|
cache->p = p;
|
||||||
|
|
||||||
|
FT_TRACE2(( "ftc_cache_resize: cache %u decreased to %u hashes\n",
|
||||||
|
cache->index, cache->p ));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* otherwise, the hash table is balanced */
|
/* otherwise, the hash table is balanced */
|
||||||
|
@ -239,7 +235,7 @@
|
||||||
if ( node == node0 )
|
if ( node == node0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pnode = &(*pnode)->link;
|
pnode = &node->link;
|
||||||
}
|
}
|
||||||
|
|
||||||
*pnode = node0->link;
|
*pnode = node0->link;
|
||||||
|
@ -322,13 +318,6 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
|
||||||
FTC_Cache_Init( FTC_Cache cache )
|
|
||||||
{
|
|
||||||
return ftc_cache_init( cache );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
ftc_cache_init( FTC_Cache cache )
|
ftc_cache_init( FTC_Cache cache )
|
||||||
{
|
{
|
||||||
|
@ -336,27 +325,35 @@
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
cache->p = 0;
|
cache->p = FTC_HASH_INITIAL_SIZE;
|
||||||
cache->mask = FTC_HASH_INITIAL_SIZE - 1;
|
cache->mask = FTC_HASH_INITIAL_SIZE - 1;
|
||||||
cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
|
cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
|
||||||
|
|
||||||
FT_MEM_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
|
FT_MEM_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE );
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
FT_LOCAL_DEF( FT_Error )
|
||||||
FTC_Cache_Clear( FTC_Cache cache )
|
FTC_Cache_Init( FTC_Cache cache )
|
||||||
{
|
{
|
||||||
if ( cache && cache->buckets )
|
return ftc_cache_init( cache );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FT_LOCAL_DEF( void )
|
||||||
|
ftc_cache_done( FTC_Cache cache )
|
||||||
|
{
|
||||||
|
FT_Memory memory = cache->memory;
|
||||||
|
|
||||||
|
|
||||||
|
if ( cache->buckets )
|
||||||
{
|
{
|
||||||
FTC_Manager manager = cache->manager;
|
FTC_Manager manager = cache->manager;
|
||||||
|
FT_UFast count = cache->p;
|
||||||
FT_UFast i;
|
FT_UFast i;
|
||||||
FT_UFast count;
|
|
||||||
|
|
||||||
|
|
||||||
count = cache->p + cache->mask + 1;
|
|
||||||
|
|
||||||
for ( i = 0; i < count; i++ )
|
for ( i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
FTC_Node node = cache->buckets[i], next;
|
FTC_Node node = cache->buckets[i], next;
|
||||||
|
@ -376,30 +373,14 @@
|
||||||
cache->clazz.node_free( node, cache );
|
cache->clazz.node_free( node, cache );
|
||||||
node = next;
|
node = next;
|
||||||
}
|
}
|
||||||
cache->buckets[i] = NULL;
|
|
||||||
}
|
|
||||||
ftc_cache_resize( cache );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
|
||||||
ftc_cache_done( FTC_Cache cache )
|
|
||||||
{
|
|
||||||
if ( cache->memory )
|
|
||||||
{
|
|
||||||
FT_Memory memory = cache->memory;
|
|
||||||
|
|
||||||
|
|
||||||
FTC_Cache_Clear( cache );
|
|
||||||
|
|
||||||
FT_FREE( cache->buckets );
|
FT_FREE( cache->buckets );
|
||||||
cache->mask = 0;
|
|
||||||
cache->p = 0;
|
|
||||||
cache->slack = 0;
|
|
||||||
|
|
||||||
cache->memory = NULL;
|
cache->p = 0;
|
||||||
}
|
cache->mask = 0;
|
||||||
|
cache->slack = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -562,12 +543,12 @@
|
||||||
FTC_Cache_RemoveFaceID( FTC_Cache cache,
|
FTC_Cache_RemoveFaceID( FTC_Cache cache,
|
||||||
FTC_FaceID face_id )
|
FTC_FaceID face_id )
|
||||||
{
|
{
|
||||||
FT_UFast i, count;
|
|
||||||
FTC_Manager manager = cache->manager;
|
FTC_Manager manager = cache->manager;
|
||||||
FTC_Node frees = NULL;
|
FTC_Node frees = NULL;
|
||||||
|
FT_UFast count = cache->p;
|
||||||
|
FT_UFast i;
|
||||||
|
|
||||||
|
|
||||||
count = cache->p + cache->mask + 1;
|
|
||||||
for ( i = 0; i < count; i++ )
|
for ( i = 0; i < count; i++ )
|
||||||
{
|
{
|
||||||
FTC_Node* pnode = cache->buckets + i;
|
FTC_Node* pnode = cache->buckets + i;
|
||||||
|
|
13
lib/freetype/src/cache/ftccache.h
vendored
13
lib/freetype/src/cache/ftccache.h
vendored
|
@ -72,11 +72,12 @@ FT_BEGIN_HEADER
|
||||||
#define FTC_NODE_NEXT( x ) FTC_NODE( (x)->mru.next )
|
#define FTC_NODE_NEXT( x ) FTC_NODE( (x)->mru.next )
|
||||||
#define FTC_NODE_PREV( x ) FTC_NODE( (x)->mru.prev )
|
#define FTC_NODE_PREV( x ) FTC_NODE( (x)->mru.prev )
|
||||||
|
|
||||||
|
/* address the hash table entries */
|
||||||
#ifdef FTC_INLINE
|
#ifdef FTC_INLINE
|
||||||
#define FTC_NODE_TOP_FOR_HASH( cache, hash ) \
|
#define FTC_NODE_TOP_FOR_HASH( cache, hash ) \
|
||||||
( ( cache )->buckets + \
|
( ( cache )->buckets + \
|
||||||
( ( ( ( hash ) & ( cache )->mask ) < ( cache )->p ) \
|
( ( ( ( hash ) & ( cache )->mask ) >= ( cache )->p ) \
|
||||||
? ( ( hash ) & ( ( cache )->mask * 2 + 1 ) ) \
|
? ( ( hash ) & ( ( cache )->mask >> 1 ) ) \
|
||||||
: ( ( hash ) & ( cache )->mask ) ) )
|
: ( ( hash ) & ( cache )->mask ) ) )
|
||||||
#else
|
#else
|
||||||
FT_LOCAL( FTC_Node* )
|
FT_LOCAL( FTC_Node* )
|
||||||
|
@ -139,11 +140,13 @@ FT_BEGIN_HEADER
|
||||||
} FTC_CacheClassRec;
|
} FTC_CacheClassRec;
|
||||||
|
|
||||||
|
|
||||||
/* each cache really implements a dynamic hash table to manage its nodes */
|
/* each cache really implements a hash table to manage its nodes */
|
||||||
|
/* the number of the table entries (buckets) can change dynamically */
|
||||||
|
/* each bucket contains a linked lists of nodes for a given hash */
|
||||||
typedef struct FTC_CacheRec_
|
typedef struct FTC_CacheRec_
|
||||||
{
|
{
|
||||||
FT_UFast p;
|
FT_UFast p; /* hash table counter */
|
||||||
FT_UFast mask;
|
FT_UFast mask; /* hash table index range */
|
||||||
FT_Long slack;
|
FT_Long slack;
|
||||||
FTC_Node* buckets;
|
FTC_Node* buckets;
|
||||||
|
|
||||||
|
|
46
lib/freetype/src/cache/ftcglyph.c
vendored
46
lib/freetype/src/cache/ftcglyph.c
vendored
|
@ -79,20 +79,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef FTC_INLINE
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Bool )
|
|
||||||
FTC_GNode_Compare( FTC_GNode gnode,
|
|
||||||
FTC_GQuery gquery,
|
|
||||||
FTC_Cache cache,
|
|
||||||
FT_Bool* list_changed )
|
|
||||||
{
|
|
||||||
return ftc_gnode_compare( FTC_NODE( gnode ), gquery,
|
|
||||||
cache, list_changed );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/***** *****/
|
/***** *****/
|
||||||
|
@ -115,22 +101,22 @@
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
ftc_gcache_init( FTC_Cache ftccache )
|
ftc_gcache_init( FTC_Cache cache )
|
||||||
{
|
{
|
||||||
FTC_GCache cache = (FTC_GCache)ftccache;
|
FTC_GCache gcache = (FTC_GCache)cache;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
|
||||||
|
|
||||||
error = FTC_Cache_Init( FTC_CACHE( cache ) );
|
error = FTC_Cache_Init( cache );
|
||||||
if ( !error )
|
if ( !error )
|
||||||
{
|
{
|
||||||
FTC_GCacheClass clazz = (FTC_GCacheClass)FTC_CACHE( cache )->org_class;
|
FTC_GCacheClass clazz = (FTC_GCacheClass)cache->org_class;
|
||||||
|
|
||||||
FTC_MruList_Init( &cache->families,
|
FTC_MruList_Init( &gcache->families,
|
||||||
clazz->family_class,
|
clazz->family_class,
|
||||||
0, /* no maximum here! */
|
0, /* no maximum here! */
|
||||||
cache,
|
cache,
|
||||||
FTC_CACHE( cache )->memory );
|
cache->memory );
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
|
@ -140,31 +126,31 @@
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
FTC_GCache_Init( FTC_GCache cache )
|
FTC_GCache_Init( FTC_GCache gcache )
|
||||||
{
|
{
|
||||||
return ftc_gcache_init( FTC_CACHE( cache ) );
|
return ftc_gcache_init( FTC_CACHE( gcache ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
ftc_gcache_done( FTC_Cache ftccache )
|
ftc_gcache_done( FTC_Cache cache )
|
||||||
{
|
{
|
||||||
FTC_GCache cache = (FTC_GCache)ftccache;
|
FTC_GCache gcache = (FTC_GCache)cache;
|
||||||
|
|
||||||
|
|
||||||
FTC_Cache_Done( (FTC_Cache)cache );
|
FTC_Cache_Done( cache );
|
||||||
FTC_MruList_Done( &cache->families );
|
FTC_MruList_Done( &gcache->families );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
FTC_GCache_Done( FTC_GCache cache )
|
FTC_GCache_Done( FTC_GCache gcache )
|
||||||
{
|
{
|
||||||
ftc_gcache_done( FTC_CACHE( cache ) );
|
ftc_gcache_done( FTC_CACHE( gcache ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
@ -183,7 +169,7 @@
|
||||||
#ifndef FTC_INLINE
|
#ifndef FTC_INLINE
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
FTC_GCache_Lookup( FTC_GCache cache,
|
FTC_GCache_Lookup( FTC_GCache gcache,
|
||||||
FT_Offset hash,
|
FT_Offset hash,
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FTC_GQuery query,
|
FTC_GQuery query,
|
||||||
|
@ -204,7 +190,7 @@
|
||||||
/* out-of-memory condition occurs during glyph node initialization. */
|
/* out-of-memory condition occurs during glyph node initialization. */
|
||||||
family->num_nodes++;
|
family->num_nodes++;
|
||||||
|
|
||||||
error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, anode );
|
error = FTC_Cache_Lookup( FTC_CACHE( gcache ), hash, query, anode );
|
||||||
|
|
||||||
if ( --family->num_nodes == 0 )
|
if ( --family->num_nodes == 0 )
|
||||||
FTC_FAMILY_FREE( family, cache );
|
FTC_FAMILY_FREE( family, cache );
|
||||||
|
|
15
lib/freetype/src/cache/ftcglyph.h
vendored
15
lib/freetype/src/cache/ftcglyph.h
vendored
|
@ -58,7 +58,7 @@
|
||||||
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
||||||
* my_node_new (must call FTC_GNode_Init)
|
* my_node_new (must call FTC_GNode_Init)
|
||||||
* my_node_free (must call FTC_GNode_Done)
|
* my_node_free (must call FTC_GNode_Done)
|
||||||
* my_node_compare (must call FTC_GNode_Compare)
|
* my_node_compare (must call ftc_gnode_compare)
|
||||||
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
||||||
* of match)
|
* of match)
|
||||||
*
|
*
|
||||||
|
@ -179,19 +179,6 @@ FT_BEGIN_HEADER
|
||||||
FT_UInt gindex, /* glyph index for node */
|
FT_UInt gindex, /* glyph index for node */
|
||||||
FTC_Family family );
|
FTC_Family family );
|
||||||
|
|
||||||
#ifdef FTC_INLINE
|
|
||||||
|
|
||||||
/* returns TRUE iff the query's glyph index correspond to the node; */
|
|
||||||
/* this assumes that the `family' and `hash' fields of the query are */
|
|
||||||
/* already correctly set */
|
|
||||||
FT_LOCAL( FT_Bool )
|
|
||||||
FTC_GNode_Compare( FTC_GNode gnode,
|
|
||||||
FTC_GQuery gquery,
|
|
||||||
FTC_Cache cache,
|
|
||||||
FT_Bool* list_changed );
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* call this function to clear a node's family -- this is necessary */
|
/* call this function to clear a node's family -- this is necessary */
|
||||||
/* to implement the `node_remove_faceid' cache method correctly */
|
/* to implement the `node_remove_faceid' cache method correctly */
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
|
|
40
lib/freetype/src/cache/ftcmanag.c
vendored
40
lib/freetype/src/cache/ftcmanag.c
vendored
|
@ -426,7 +426,7 @@
|
||||||
memory = manager->memory;
|
memory = manager->memory;
|
||||||
|
|
||||||
/* now discard all caches */
|
/* now discard all caches */
|
||||||
for (idx = manager->num_caches; idx-- > 0; )
|
for ( idx = manager->num_caches; idx-- > 0; )
|
||||||
{
|
{
|
||||||
FTC_Cache cache = manager->caches[idx];
|
FTC_Cache cache = manager->caches[idx];
|
||||||
|
|
||||||
|
@ -537,7 +537,7 @@
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
FTC_Manager_Compress( FTC_Manager manager )
|
FTC_Manager_Compress( FTC_Manager manager )
|
||||||
{
|
{
|
||||||
FTC_Node node, first;
|
FTC_Node node, prev, first;
|
||||||
|
|
||||||
|
|
||||||
if ( !manager )
|
if ( !manager )
|
||||||
|
@ -557,20 +557,16 @@
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* go to last node -- it's a circular list */
|
/* go to last node -- it's a circular list */
|
||||||
node = FTC_NODE_PREV( first );
|
prev = FTC_NODE_PREV( first );
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
FTC_Node prev;
|
node = prev;
|
||||||
|
prev = FTC_NODE_PREV( node );
|
||||||
|
|
||||||
prev = ( node == first ) ? NULL : FTC_NODE_PREV( node );
|
|
||||||
|
|
||||||
if ( node->ref_count <= 0 )
|
if ( node->ref_count <= 0 )
|
||||||
ftc_node_destroy( node, manager );
|
ftc_node_destroy( node, manager );
|
||||||
|
|
||||||
node = prev;
|
} while ( node != first && manager->cur_weight > manager->max_weight );
|
||||||
|
|
||||||
} while ( node && manager->cur_weight > manager->max_weight );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -633,20 +629,20 @@
|
||||||
FT_UInt count )
|
FT_UInt count )
|
||||||
{
|
{
|
||||||
FTC_Node first = manager->nodes_list;
|
FTC_Node first = manager->nodes_list;
|
||||||
FTC_Node node;
|
FTC_Node prev, node;
|
||||||
FT_UInt result;
|
FT_UInt result = 0;
|
||||||
|
|
||||||
|
|
||||||
/* try to remove `count' nodes from the list */
|
/* try to remove `count' nodes from the list */
|
||||||
if ( !first ) /* empty list! */
|
if ( !first || !count )
|
||||||
return 0;
|
return result;
|
||||||
|
|
||||||
/* go to last node - it's a circular list */
|
/* go to last node -- it's a circular list */
|
||||||
node = FTC_NODE_PREV(first);
|
prev = FTC_NODE_PREV( first );
|
||||||
for ( result = 0; result < count; )
|
do
|
||||||
{
|
{
|
||||||
FTC_Node prev = FTC_NODE_PREV( node );
|
node = prev;
|
||||||
|
prev = FTC_NODE_PREV( node );
|
||||||
|
|
||||||
/* don't touch locked nodes */
|
/* don't touch locked nodes */
|
||||||
if ( node->ref_count <= 0 )
|
if ( node->ref_count <= 0 )
|
||||||
|
@ -654,12 +650,8 @@
|
||||||
ftc_node_destroy( node, manager );
|
ftc_node_destroy( node, manager );
|
||||||
result++;
|
result++;
|
||||||
}
|
}
|
||||||
|
} while ( node != first && result < count );
|
||||||
|
|
||||||
if ( node == first )
|
|
||||||
break;
|
|
||||||
|
|
||||||
node = prev;
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
24
lib/freetype/src/cache/ftcmru.c
vendored
24
lib/freetype/src/cache/ftcmru.c
vendored
|
@ -329,29 +329,23 @@
|
||||||
FTC_MruNode_CompareFunc selection,
|
FTC_MruNode_CompareFunc selection,
|
||||||
FT_Pointer key )
|
FT_Pointer key )
|
||||||
{
|
{
|
||||||
FTC_MruNode first, node, next;
|
FTC_MruNode first = list->nodes;
|
||||||
|
FTC_MruNode prev, node;
|
||||||
|
|
||||||
|
|
||||||
first = list->nodes;
|
if ( !first || !selection )
|
||||||
while ( first && ( !selection || selection( first, key ) ) )
|
return;
|
||||||
{
|
|
||||||
FTC_MruList_Remove( list, first );
|
|
||||||
first = list->nodes;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( first )
|
prev = first->prev;
|
||||||
|
do
|
||||||
{
|
{
|
||||||
node = first->next;
|
node = prev;
|
||||||
while ( node != first )
|
prev = node->prev;
|
||||||
{
|
|
||||||
next = node->next;
|
|
||||||
|
|
||||||
if ( selection( node, key ) )
|
if ( selection( node, key ) )
|
||||||
FTC_MruList_Remove( list, node );
|
FTC_MruList_Remove( list, node );
|
||||||
|
|
||||||
node = next;
|
} while ( node != first );
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
17
lib/freetype/src/cache/ftcsbits.c
vendored
17
lib/freetype/src/cache/ftcsbits.c
vendored
|
@ -342,7 +342,7 @@
|
||||||
FT_Bool result;
|
FT_Bool result;
|
||||||
|
|
||||||
|
|
||||||
if (list_changed)
|
if ( list_changed )
|
||||||
*list_changed = FALSE;
|
*list_changed = FALSE;
|
||||||
result = FT_BOOL( gnode->family == gquery->family &&
|
result = FT_BOOL( gnode->family == gquery->family &&
|
||||||
gindex - gnode->gindex < snode->count );
|
gindex - gnode->gindex < snode->count );
|
||||||
|
@ -411,19 +411,4 @@
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef FTC_INLINE
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Bool )
|
|
||||||
FTC_SNode_Compare( FTC_SNode snode,
|
|
||||||
FTC_GQuery gquery,
|
|
||||||
FTC_Cache cache,
|
|
||||||
FT_Bool* list_changed )
|
|
||||||
{
|
|
||||||
return ftc_snode_compare( FTC_NODE( snode ), gquery,
|
|
||||||
cache, list_changed );
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
11
lib/freetype/src/cache/ftcsbits.h
vendored
11
lib/freetype/src/cache/ftcsbits.h
vendored
|
@ -81,17 +81,6 @@ FT_BEGIN_HEADER
|
||||||
FTC_SNode_Weight( FTC_SNode inode );
|
FTC_SNode_Weight( FTC_SNode inode );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef FTC_INLINE
|
|
||||||
|
|
||||||
FT_LOCAL( FT_Bool )
|
|
||||||
FTC_SNode_Compare( FTC_SNode snode,
|
|
||||||
FTC_GQuery gquery,
|
|
||||||
FTC_Cache cache,
|
|
||||||
FT_Bool* list_changed);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
FT_END_HEADER
|
FT_END_HEADER
|
||||||
|
|
|
@ -32,9 +32,10 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_cmap_encoding_init( CFF_CMapStd cmap,
|
cff_cmap_encoding_init( FT_CMap cmap,
|
||||||
FT_Pointer pointer )
|
FT_Pointer pointer )
|
||||||
{
|
{
|
||||||
|
CFF_CMapStd cffcmap = (CFF_CMapStd)cmap;
|
||||||
TT_Face face = (TT_Face)FT_CMAP_FACE( cmap );
|
TT_Face face = (TT_Face)FT_CMAP_FACE( cmap );
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Font cff = (CFF_Font)face->extra.data;
|
||||||
CFF_Encoding encoding = &cff->encoding;
|
CFF_Encoding encoding = &cff->encoding;
|
||||||
|
@ -42,63 +43,56 @@
|
||||||
FT_UNUSED( pointer );
|
FT_UNUSED( pointer );
|
||||||
|
|
||||||
|
|
||||||
cmap->gids = encoding->codes;
|
cffcmap->gids = encoding->codes;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
cff_cmap_encoding_done( CFF_CMapStd cmap )
|
cff_cmap_encoding_done( FT_CMap cmap )
|
||||||
{
|
{
|
||||||
cmap->gids = NULL;
|
CFF_CMapStd cffcmap = (CFF_CMapStd)cmap;
|
||||||
|
|
||||||
|
|
||||||
|
cffcmap->gids = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_UInt )
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
cff_cmap_encoding_char_index( CFF_CMapStd cmap,
|
cff_cmap_encoding_char_index( FT_CMap cmap,
|
||||||
FT_UInt32 char_code )
|
FT_UInt32 char_code )
|
||||||
{
|
{
|
||||||
|
CFF_CMapStd cffcmap = (CFF_CMapStd)cmap;
|
||||||
FT_UInt result = 0;
|
FT_UInt result = 0;
|
||||||
|
|
||||||
|
|
||||||
if ( char_code < 256 )
|
if ( char_code < 256 )
|
||||||
result = cmap->gids[char_code];
|
result = cffcmap->gids[char_code];
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_UInt32 )
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
cff_cmap_encoding_char_next( CFF_CMapStd cmap,
|
cff_cmap_encoding_char_next( FT_CMap cmap,
|
||||||
FT_UInt32 *pchar_code )
|
FT_UInt32 *pchar_code )
|
||||||
{
|
{
|
||||||
|
CFF_CMapStd cffcmap = (CFF_CMapStd)cmap;
|
||||||
FT_UInt result = 0;
|
FT_UInt result = 0;
|
||||||
FT_UInt32 char_code = *pchar_code;
|
FT_UInt32 char_code = *pchar_code;
|
||||||
|
|
||||||
|
|
||||||
*pchar_code = 0;
|
while ( char_code < 255 )
|
||||||
|
|
||||||
if ( char_code < 255 )
|
|
||||||
{
|
{
|
||||||
FT_UInt code = (FT_UInt)( char_code + 1 );
|
result = cffcmap->gids[++char_code];
|
||||||
|
if ( result )
|
||||||
|
|
||||||
for (;;)
|
|
||||||
{
|
{
|
||||||
if ( code >= 256 )
|
*pchar_code = char_code;
|
||||||
break;
|
|
||||||
|
|
||||||
result = cmap->gids[code];
|
|
||||||
if ( result != 0 )
|
|
||||||
{
|
|
||||||
*pchar_code = code;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
code++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,9 +124,10 @@
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
FT_CALLBACK_DEF( const char* )
|
FT_CALLBACK_DEF( const char* )
|
||||||
cff_sid_to_glyph_name( TT_Face face,
|
cff_sid_to_glyph_name( void* face_, /* TT_Face */
|
||||||
FT_UInt idx )
|
FT_UInt idx )
|
||||||
{
|
{
|
||||||
|
TT_Face face = (TT_Face)face_;
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Font cff = (CFF_Font)face->extra.data;
|
||||||
CFF_Charset charset = &cff->charset;
|
CFF_Charset charset = &cff->charset;
|
||||||
FT_UInt sid = charset->sids[idx];
|
FT_UInt sid = charset->sids[idx];
|
||||||
|
@ -143,10 +138,11 @@
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_cmap_unicode_init( PS_Unicodes unicodes,
|
cff_cmap_unicode_init( FT_CMap cmap, /* PS_Unicodes */
|
||||||
FT_Pointer pointer )
|
FT_Pointer pointer )
|
||||||
{
|
{
|
||||||
TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes );
|
PS_Unicodes unicodes = (PS_Unicodes)cmap;
|
||||||
|
TT_Face face = (TT_Face)FT_CMAP_FACE( cmap );
|
||||||
FT_Memory memory = FT_FACE_MEMORY( face );
|
FT_Memory memory = FT_FACE_MEMORY( face );
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Font cff = (CFF_Font)face->extra.data;
|
||||||
CFF_Charset charset = &cff->charset;
|
CFF_Charset charset = &cff->charset;
|
||||||
|
@ -166,16 +162,17 @@
|
||||||
return psnames->unicodes_init( memory,
|
return psnames->unicodes_init( memory,
|
||||||
unicodes,
|
unicodes,
|
||||||
cff->num_glyphs,
|
cff->num_glyphs,
|
||||||
(PS_GetGlyphNameFunc)&cff_sid_to_glyph_name,
|
&cff_sid_to_glyph_name,
|
||||||
(PS_FreeGlyphNameFunc)NULL,
|
(PS_FreeGlyphNameFunc)NULL,
|
||||||
(FT_Pointer)face );
|
(FT_Pointer)face );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( void )
|
FT_CALLBACK_DEF( void )
|
||||||
cff_cmap_unicode_done( PS_Unicodes unicodes )
|
cff_cmap_unicode_done( FT_CMap cmap ) /* PS_Unicodes */
|
||||||
{
|
{
|
||||||
FT_Face face = FT_CMAP_FACE( unicodes );
|
PS_Unicodes unicodes = (PS_Unicodes)cmap;
|
||||||
|
FT_Face face = FT_CMAP_FACE( cmap );
|
||||||
FT_Memory memory = FT_FACE_MEMORY( face );
|
FT_Memory memory = FT_FACE_MEMORY( face );
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,10 +182,11 @@
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_UInt )
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
cff_cmap_unicode_char_index( PS_Unicodes unicodes,
|
cff_cmap_unicode_char_index( FT_CMap cmap, /* PS_Unicodes */
|
||||||
FT_UInt32 char_code )
|
FT_UInt32 char_code )
|
||||||
{
|
{
|
||||||
TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes );
|
PS_Unicodes unicodes = (PS_Unicodes)cmap;
|
||||||
|
TT_Face face = (TT_Face)FT_CMAP_FACE( cmap );
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Font cff = (CFF_Font)face->extra.data;
|
||||||
FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
|
FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
|
||||||
|
|
||||||
|
@ -197,11 +195,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_CALLBACK_DEF( FT_UInt32 )
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
cff_cmap_unicode_char_next( PS_Unicodes unicodes,
|
cff_cmap_unicode_char_next( FT_CMap cmap, /* PS_Unicodes */
|
||||||
FT_UInt32 *pchar_code )
|
FT_UInt32 *pchar_code )
|
||||||
{
|
{
|
||||||
TT_Face face = (TT_Face)FT_CMAP_FACE( unicodes );
|
PS_Unicodes unicodes = (PS_Unicodes)cmap;
|
||||||
|
TT_Face face = (TT_Face)FT_CMAP_FACE( cmap );
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Font cff = (CFF_Font)face->extra.data;
|
||||||
FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
|
FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
|
||||||
|
|
||||||
|
|
|
@ -108,20 +108,20 @@
|
||||||
* They can be implemented by format-specific interfaces.
|
* They can be implemented by format-specific interfaces.
|
||||||
*/
|
*/
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_kerning( FT_Face ttface, /* TT_Face */
|
cff_get_kerning( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt left_glyph,
|
FT_UInt left_glyph,
|
||||||
FT_UInt right_glyph,
|
FT_UInt right_glyph,
|
||||||
FT_Vector* kerning )
|
FT_Vector* kerning )
|
||||||
{
|
{
|
||||||
TT_Face face = (TT_Face)ttface;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
|
SFNT_Service sfnt = (SFNT_Service)cffface->sfnt;
|
||||||
|
|
||||||
|
|
||||||
kerning->x = 0;
|
kerning->x = 0;
|
||||||
kerning->y = 0;
|
kerning->y = 0;
|
||||||
|
|
||||||
if ( sfnt )
|
if ( sfnt )
|
||||||
kerning->x = sfnt->get_kerning( face, left_glyph, right_glyph );
|
kerning->x = sfnt->get_kerning( cffface, left_glyph, right_glyph );
|
||||||
|
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
}
|
}
|
||||||
|
@ -158,23 +158,23 @@
|
||||||
* FreeType error code. 0 means success.
|
* FreeType error code. 0 means success.
|
||||||
*/
|
*/
|
||||||
FT_CALLBACK_DEF( FT_Error )
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_glyph_load( FT_GlyphSlot cffslot, /* CFF_GlyphSlot */
|
cff_glyph_load( FT_GlyphSlot slot, /* CFF_GlyphSlot */
|
||||||
FT_Size cffsize, /* CFF_Size */
|
FT_Size size, /* CFF_Size */
|
||||||
FT_UInt glyph_index,
|
FT_UInt glyph_index,
|
||||||
FT_Int32 load_flags )
|
FT_Int32 load_flags )
|
||||||
{
|
{
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
CFF_GlyphSlot slot = (CFF_GlyphSlot)cffslot;
|
CFF_GlyphSlot cffslot = (CFF_GlyphSlot)slot;
|
||||||
CFF_Size size = (CFF_Size)cffsize;
|
CFF_Size cffsize = (CFF_Size)size;
|
||||||
|
|
||||||
|
|
||||||
if ( !slot )
|
if ( !cffslot )
|
||||||
return FT_THROW( Invalid_Slot_Handle );
|
return FT_THROW( Invalid_Slot_Handle );
|
||||||
|
|
||||||
FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index ));
|
FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index ));
|
||||||
|
|
||||||
/* check whether we want a scaled outline or bitmap */
|
/* check whether we want a scaled outline or bitmap */
|
||||||
if ( !size )
|
if ( !cffsize )
|
||||||
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
|
load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING;
|
||||||
|
|
||||||
/* reset the size object if necessary */
|
/* reset the size object if necessary */
|
||||||
|
@ -184,12 +184,12 @@
|
||||||
if ( size )
|
if ( size )
|
||||||
{
|
{
|
||||||
/* these two objects must have the same parent */
|
/* these two objects must have the same parent */
|
||||||
if ( cffsize->face != cffslot->face )
|
if ( size->face != slot->face )
|
||||||
return FT_THROW( Invalid_Face_Handle );
|
return FT_THROW( Invalid_Face_Handle );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now load the glyph outline if necessary */
|
/* now load the glyph outline if necessary */
|
||||||
error = cff_slot_load( slot, size, glyph_index, load_flags );
|
error = cff_slot_load( cffslot, cffsize, glyph_index, load_flags );
|
||||||
|
|
||||||
/* force drop-out mode to 2 - irrelevant now */
|
/* force drop-out mode to 2 - irrelevant now */
|
||||||
/* slot->outline.dropout_mode = 2; */
|
/* slot->outline.dropout_mode = 2; */
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
/* it is no longer necessary that those values are identical to */
|
/* it is no longer necessary that those values are identical to */
|
||||||
/* the values in the `CFF' table */
|
/* the values in the `CFF' table */
|
||||||
|
|
||||||
TT_Face ttface = (TT_Face)face;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
FT_Short dummy;
|
FT_Short dummy;
|
||||||
|
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
/* no fast retrieval for blended MM fonts without VVAR table */
|
/* no fast retrieval for blended MM fonts without VVAR table */
|
||||||
if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
|
if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
|
||||||
!( ttface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
|
!( cffface->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) )
|
||||||
return FT_THROW( Unimplemented_Feature );
|
return FT_THROW( Unimplemented_Feature );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@
|
||||||
/* otherwise we extract the info from the CFF glyphstrings */
|
/* otherwise we extract the info from the CFF glyphstrings */
|
||||||
/* (instead of synthesizing a global value using the `OS/2' */
|
/* (instead of synthesizing a global value using the `OS/2' */
|
||||||
/* table) */
|
/* table) */
|
||||||
if ( !ttface->vertical_info )
|
if ( !cffface->vertical_info )
|
||||||
goto Missing_Table;
|
goto Missing_Table;
|
||||||
|
|
||||||
for ( nn = 0; nn < count; nn++ )
|
for ( nn = 0; nn < count; nn++ )
|
||||||
|
@ -241,7 +241,7 @@
|
||||||
FT_UShort ah;
|
FT_UShort ah;
|
||||||
|
|
||||||
|
|
||||||
( (SFNT_Service)ttface->sfnt )->get_metrics( ttface,
|
( (SFNT_Service)cffface->sfnt )->get_metrics( cffface,
|
||||||
1,
|
1,
|
||||||
start + nn,
|
start + nn,
|
||||||
&dummy,
|
&dummy,
|
||||||
|
@ -259,12 +259,12 @@
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
/* no fast retrieval for blended MM fonts without HVAR table */
|
/* no fast retrieval for blended MM fonts without HVAR table */
|
||||||
if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
|
if ( ( FT_IS_NAMED_INSTANCE( face ) || FT_IS_VARIATION( face ) ) &&
|
||||||
!( ttface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
|
!( cffface->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) )
|
||||||
return FT_THROW( Unimplemented_Feature );
|
return FT_THROW( Unimplemented_Feature );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* check whether we have data from the `hmtx' table at all */
|
/* check whether we have data from the `hmtx' table at all */
|
||||||
if ( !ttface->horizontal.number_Of_HMetrics )
|
if ( !cffface->horizontal.number_Of_HMetrics )
|
||||||
goto Missing_Table;
|
goto Missing_Table;
|
||||||
|
|
||||||
for ( nn = 0; nn < count; nn++ )
|
for ( nn = 0; nn < count; nn++ )
|
||||||
|
@ -272,7 +272,7 @@
|
||||||
FT_UShort aw;
|
FT_UShort aw;
|
||||||
|
|
||||||
|
|
||||||
( (SFNT_Service)ttface->sfnt )->get_metrics( ttface,
|
( (SFNT_Service)cffface->sfnt )->get_metrics( cffface,
|
||||||
0,
|
0,
|
||||||
start + nn,
|
start + nn,
|
||||||
&dummy,
|
&dummy,
|
||||||
|
@ -312,13 +312,14 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_glyph_name( CFF_Face face,
|
cff_get_glyph_name( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt glyph_index,
|
FT_UInt glyph_index,
|
||||||
FT_Pointer buffer,
|
FT_Pointer buffer,
|
||||||
FT_UInt buffer_max )
|
FT_UInt buffer_max )
|
||||||
{
|
{
|
||||||
CFF_Font font = (CFF_Font)face->extra.data;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
CFF_Font font = (CFF_Font)cffface->extra.data;
|
||||||
FT_String* gname;
|
FT_String* gname;
|
||||||
FT_UShort sid;
|
FT_UShort sid;
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
@ -338,10 +339,7 @@
|
||||||
|
|
||||||
|
|
||||||
if ( service && service->get_name )
|
if ( service && service->get_name )
|
||||||
return service->get_name( FT_FACE( face ),
|
return service->get_name( face, glyph_index, buffer, buffer_max );
|
||||||
glyph_index,
|
|
||||||
buffer,
|
|
||||||
buffer_max );
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FT_ERROR(( "cff_get_glyph_name:"
|
FT_ERROR(( "cff_get_glyph_name:"
|
||||||
|
@ -366,7 +364,7 @@
|
||||||
/* first, locate the sid in the charset table */
|
/* first, locate the sid in the charset table */
|
||||||
sid = font->charset.sids[glyph_index];
|
sid = font->charset.sids[glyph_index];
|
||||||
|
|
||||||
/* now, lookup the name itself */
|
/* now, look up the name itself */
|
||||||
gname = cff_index_get_sid_string( font, sid );
|
gname = cff_index_get_sid_string( font, sid );
|
||||||
|
|
||||||
if ( gname )
|
if ( gname )
|
||||||
|
@ -379,21 +377,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_UInt
|
FT_CALLBACK_DEF( FT_UInt )
|
||||||
cff_get_name_index( CFF_Face face,
|
cff_get_name_index( FT_Face face, /* CFF_Face */
|
||||||
const FT_String* glyph_name )
|
const FT_String* glyph_name )
|
||||||
{
|
{
|
||||||
CFF_Font cff;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
CFF_Charset charset;
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
|
CFF_Charset charset = &cff->charset;
|
||||||
FT_Service_PsCMaps psnames;
|
FT_Service_PsCMaps psnames;
|
||||||
FT_String* name;
|
FT_String* name;
|
||||||
FT_UShort sid;
|
FT_UShort sid;
|
||||||
FT_UInt i;
|
FT_UInt i;
|
||||||
|
|
||||||
|
|
||||||
cff = (CFF_FontRec *)face->extra.data;
|
|
||||||
charset = &cff->charset;
|
|
||||||
|
|
||||||
/* CFF2 table does not have glyph names; */
|
/* CFF2 table does not have glyph names; */
|
||||||
/* we need to use `post' table method */
|
/* we need to use `post' table method */
|
||||||
if ( cff->version_major == 2 )
|
if ( cff->version_major == 2 )
|
||||||
|
@ -408,7 +404,7 @@
|
||||||
|
|
||||||
|
|
||||||
if ( service && service->name_index )
|
if ( service && service->name_index )
|
||||||
return service->name_index( FT_FACE( face ), glyph_name );
|
return service->name_index( face, glyph_name );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FT_ERROR(( "cff_get_name_index:"
|
FT_ERROR(( "cff_get_name_index:"
|
||||||
|
@ -446,8 +442,8 @@
|
||||||
FT_DEFINE_SERVICE_GLYPHDICTREC(
|
FT_DEFINE_SERVICE_GLYPHDICTREC(
|
||||||
cff_service_glyph_dict,
|
cff_service_glyph_dict,
|
||||||
|
|
||||||
(FT_GlyphDict_GetNameFunc) cff_get_glyph_name, /* get_name */
|
cff_get_glyph_name, /* FT_GlyphDict_GetNameFunc get_name */
|
||||||
(FT_GlyphDict_NameIndexFunc)cff_get_name_index /* name_index */
|
cff_get_name_index /* FT_GlyphDict_NameIndexFunc name_index */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -456,25 +452,32 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FT_Int
|
FT_CALLBACK_DEF( FT_Int )
|
||||||
cff_ps_has_glyph_names( FT_Face face )
|
cff_ps_has_glyph_names( FT_Face face )
|
||||||
{
|
{
|
||||||
return ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) > 0;
|
return ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_ps_get_font_info( CFF_Face face,
|
cff_ps_get_font_info( FT_Face face, /* CFF_Face */
|
||||||
PS_FontInfoRec* afont_info )
|
PS_FontInfoRec* afont_info )
|
||||||
{
|
{
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
|
|
||||||
|
if ( cffface->is_cff2 )
|
||||||
|
{
|
||||||
|
error = FT_THROW( Invalid_Argument );
|
||||||
|
goto Fail;
|
||||||
|
}
|
||||||
|
|
||||||
if ( cff && !cff->font_info )
|
if ( cff && !cff->font_info )
|
||||||
{
|
{
|
||||||
CFF_FontRecDict dict = &cff->top_font.font_dict;
|
CFF_FontRecDict dict = &cff->top_font.font_dict;
|
||||||
FT_Memory memory = face->root.memory;
|
FT_Memory memory = FT_FACE_MEMORY( face );
|
||||||
PS_FontInfoRec* font_info = NULL;
|
PS_FontInfoRec* font_info = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
@ -507,18 +510,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_ps_get_font_extra( CFF_Face face,
|
cff_ps_get_font_extra( FT_Face face, /* CFF_Face */
|
||||||
PS_FontExtraRec* afont_extra )
|
PS_FontExtraRec* afont_extra )
|
||||||
{
|
{
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
|
|
||||||
|
|
||||||
if ( cff && !cff->font_extra )
|
if ( cff && !cff->font_extra )
|
||||||
{
|
{
|
||||||
CFF_FontRecDict dict = &cff->top_font.font_dict;
|
CFF_FontRecDict dict = &cff->top_font.font_dict;
|
||||||
FT_Memory memory = face->root.memory;
|
FT_Memory memory = FT_FACE_MEMORY( face );
|
||||||
PS_FontExtraRec* font_extra = NULL;
|
PS_FontExtraRec* font_extra = NULL;
|
||||||
FT_String* embedded_postscript;
|
FT_String* embedded_postscript;
|
||||||
|
|
||||||
|
@ -588,13 +592,13 @@
|
||||||
FT_DEFINE_SERVICE_PSINFOREC(
|
FT_DEFINE_SERVICE_PSINFOREC(
|
||||||
cff_service_ps_info,
|
cff_service_ps_info,
|
||||||
|
|
||||||
(PS_GetFontInfoFunc) cff_ps_get_font_info, /* ps_get_font_info */
|
cff_ps_get_font_info, /* PS_GetFontInfoFunc ps_get_font_info */
|
||||||
(PS_GetFontExtraFunc) cff_ps_get_font_extra, /* ps_get_font_extra */
|
cff_ps_get_font_extra, /* PS_GetFontExtraFunc ps_get_font_extra */
|
||||||
(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, /* ps_has_glyph_names */
|
cff_ps_has_glyph_names, /* PS_HasGlyphNamesFunc ps_has_glyph_names */
|
||||||
/* unsupported with CFF fonts */
|
/* unsupported with CFF fonts */
|
||||||
(PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */
|
NULL, /* PS_GetFontPrivateFunc ps_get_font_private */
|
||||||
/* not implemented */
|
/* not implemented */
|
||||||
(PS_GetFontValueFunc) NULL /* ps_get_font_value */
|
NULL /* PS_GetFontValueFunc ps_get_font_value */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -603,17 +607,18 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const char*
|
FT_CALLBACK_DEF( const char* )
|
||||||
cff_get_ps_name( CFF_Face face )
|
cff_get_ps_name( FT_Face face ) /* CFF_Face */
|
||||||
{
|
{
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
|
SFNT_Service sfnt = (SFNT_Service)cffface->sfnt;
|
||||||
|
|
||||||
|
|
||||||
/* following the OpenType specification 1.7, we return the name stored */
|
/* following the OpenType specification 1.7, we return the name stored */
|
||||||
/* in the `name' table for a CFF wrapped into an SFNT container */
|
/* in the `name' table for a CFF wrapped into an SFNT container */
|
||||||
|
|
||||||
if ( FT_IS_SFNT( FT_FACE( face ) ) && sfnt )
|
if ( FT_IS_SFNT( face ) && sfnt )
|
||||||
{
|
{
|
||||||
FT_Library library = FT_FACE_LIBRARY( face );
|
FT_Library library = FT_FACE_LIBRARY( face );
|
||||||
FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
|
FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
|
||||||
|
@ -625,17 +630,17 @@
|
||||||
|
|
||||||
|
|
||||||
if ( service && service->get_ps_font_name )
|
if ( service && service->get_ps_font_name )
|
||||||
return service->get_ps_font_name( FT_FACE( face ) );
|
return service->get_ps_font_name( face );
|
||||||
}
|
}
|
||||||
|
|
||||||
return (const char*)cff->font_name;
|
return cff ? (const char*)cff->font_name : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_DEFINE_SERVICE_PSFONTNAMEREC(
|
FT_DEFINE_SERVICE_PSFONTNAMEREC(
|
||||||
cff_service_ps_name,
|
cff_service_ps_name,
|
||||||
|
|
||||||
(FT_PsName_GetFunc)cff_get_ps_name /* get_ps_font_name */
|
cff_get_ps_name /* FT_PsName_GetFunc get_ps_font_name */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -649,7 +654,7 @@
|
||||||
* Otherwise call the service function in the sfnt module.
|
* Otherwise call the service function in the sfnt module.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_cmap_info( FT_CharMap charmap,
|
cff_get_cmap_info( FT_CharMap charmap,
|
||||||
TT_CMapInfo *cmap_info )
|
TT_CMapInfo *cmap_info )
|
||||||
{
|
{
|
||||||
|
@ -683,7 +688,7 @@
|
||||||
FT_DEFINE_SERVICE_TTCMAPSREC(
|
FT_DEFINE_SERVICE_TTCMAPSREC(
|
||||||
cff_service_get_cmap_info,
|
cff_service_get_cmap_info,
|
||||||
|
|
||||||
(TT_CMap_Info_GetFunc)cff_get_cmap_info /* get_cmap_info */
|
cff_get_cmap_info /* TT_CMap_Info_GetFunc get_cmap_info */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -691,14 +696,15 @@
|
||||||
* CID INFO SERVICE
|
* CID INFO SERVICE
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_ros( CFF_Face face,
|
cff_get_ros( FT_Face face, /* FT_Face */
|
||||||
const char* *registry,
|
const char* *registry,
|
||||||
const char* *ordering,
|
const char* *ordering,
|
||||||
FT_Int *supplement )
|
FT_Int *supplement )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
|
|
||||||
|
|
||||||
if ( cff )
|
if ( cff )
|
||||||
|
@ -748,12 +754,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_is_cid( CFF_Face face,
|
cff_get_is_cid( FT_Face face, /* CFF_Face */
|
||||||
FT_Bool *is_cid )
|
FT_Bool *is_cid )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
CFF_Font cff = (CFF_Font)face->extra.data;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
|
|
||||||
|
|
||||||
*is_cid = 0;
|
*is_cid = 0;
|
||||||
|
@ -771,17 +778,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_cid_from_glyph_index( CFF_Face face,
|
cff_get_cid_from_glyph_index( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt glyph_index,
|
FT_UInt glyph_index,
|
||||||
FT_UInt *cid )
|
FT_UInt *cid )
|
||||||
{
|
{
|
||||||
FT_Error error = FT_Err_Ok;
|
FT_Error error = FT_Err_Ok;
|
||||||
CFF_Font cff;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
CFF_Font cff = (CFF_Font)cffface->extra.data;
|
||||||
|
|
||||||
|
|
||||||
cff = (CFF_Font)face->extra.data;
|
|
||||||
|
|
||||||
if ( cff )
|
if ( cff )
|
||||||
{
|
{
|
||||||
FT_UInt c;
|
FT_UInt c;
|
||||||
|
@ -814,12 +820,12 @@
|
||||||
FT_DEFINE_SERVICE_CIDREC(
|
FT_DEFINE_SERVICE_CIDREC(
|
||||||
cff_service_cid_info,
|
cff_service_cid_info,
|
||||||
|
|
||||||
(FT_CID_GetRegistryOrderingSupplementFunc)
|
cff_get_ros,
|
||||||
cff_get_ros, /* get_ros */
|
/* FT_CID_GetRegistryOrderingSupplementFunc get_ros */
|
||||||
(FT_CID_GetIsInternallyCIDKeyedFunc)
|
cff_get_is_cid,
|
||||||
cff_get_is_cid, /* get_is_cid */
|
/* FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid */
|
||||||
(FT_CID_GetCIDFromGlyphIndexFunc)
|
cff_get_cid_from_glyph_index
|
||||||
cff_get_cid_from_glyph_index /* get_cid_from_glyph_index */
|
/* FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -831,9 +837,9 @@
|
||||||
FT_DEFINE_SERVICE_PROPERTIESREC(
|
FT_DEFINE_SERVICE_PROPERTIESREC(
|
||||||
cff_service_properties,
|
cff_service_properties,
|
||||||
|
|
||||||
(FT_Properties_SetFunc)ps_property_set, /* set_property */
|
ps_property_set, /* FT_Properties_SetFunc set_property */
|
||||||
(FT_Properties_GetFunc)ps_property_get ) /* get_property */
|
ps_property_get /* FT_Properties_GetFunc get_property */
|
||||||
|
)
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
|
|
||||||
|
@ -842,160 +848,195 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_set_mm_blend( CFF_Face face,
|
cff_set_mm_blend( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Fixed* coords )
|
FT_Fixed* coords )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->set_mm_blend( FT_FACE( face ), num_coords, coords );
|
return mm->set_mm_blend( face, num_coords, coords );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_mm_blend( CFF_Face face,
|
cff_get_mm_blend( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Fixed* coords )
|
FT_Fixed* coords )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->get_mm_blend( FT_FACE( face ), num_coords, coords );
|
return mm->get_mm_blend( face, num_coords, coords );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_set_mm_weightvector( CFF_Face face,
|
cff_set_mm_weightvector( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt len,
|
FT_UInt len,
|
||||||
FT_Fixed* weightvector )
|
FT_Fixed* weightvector )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->set_mm_weightvector( FT_FACE( face ), len, weightvector );
|
return mm->set_mm_weightvector( face, len, weightvector );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_mm_weightvector( CFF_Face face,
|
cff_get_mm_weightvector( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt* len,
|
FT_UInt* len,
|
||||||
FT_Fixed* weightvector )
|
FT_Fixed* weightvector )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->get_mm_weightvector( FT_FACE( face ), len, weightvector );
|
return mm->get_mm_weightvector( face, len, weightvector );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( void )
|
||||||
cff_get_mm_var( CFF_Face face,
|
cff_construct_ps_name( FT_Face face ) /* CFF_Face */
|
||||||
|
{
|
||||||
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
|
mm->construct_ps_name( face );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
|
cff_get_mm_var( FT_Face face, /* CFF_Face */
|
||||||
FT_MM_Var* *master )
|
FT_MM_Var* *master )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->get_mm_var( FT_FACE( face ), master );
|
return mm->get_mm_var( face, master );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_set_var_design( CFF_Face face,
|
cff_set_var_design( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Fixed* coords )
|
FT_Fixed* coords )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->set_var_design( FT_FACE( face ), num_coords, coords );
|
return mm->set_var_design( face, num_coords, coords );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_get_var_design( CFF_Face face,
|
cff_get_var_design( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Fixed* coords )
|
FT_Fixed* coords )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->get_var_design( FT_FACE( face ), num_coords, coords );
|
return mm->get_var_design( face, num_coords, coords );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_set_instance( CFF_Face face,
|
cff_set_named_instance( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt instance_index )
|
FT_UInt instance_index )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->set_instance( FT_FACE( face ), instance_index );
|
return mm->set_named_instance( face, instance_index );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_load_item_variation_store( CFF_Face face,
|
cff_get_default_named_instance( FT_Face face, /* CFF_Face */
|
||||||
|
FT_UInt *instance_index )
|
||||||
|
{
|
||||||
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
|
return mm->get_default_named_instance( face, instance_index );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
|
cff_load_item_variation_store( FT_Face face, /* CFF_Face */
|
||||||
FT_ULong offset,
|
FT_ULong offset,
|
||||||
GX_ItemVarStore itemStore )
|
GX_ItemVarStore itemStore )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->load_item_var_store( FT_FACE(face), offset, itemStore );
|
return mm->load_item_var_store( face, offset, itemStore );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_load_delta_set_index_mapping( CFF_Face face,
|
cff_load_delta_set_index_mapping( FT_Face face, /* CFF_Face */
|
||||||
FT_ULong offset,
|
FT_ULong offset,
|
||||||
GX_DeltaSetIdxMap map,
|
GX_DeltaSetIdxMap map,
|
||||||
GX_ItemVarStore itemStore,
|
GX_ItemVarStore itemStore,
|
||||||
FT_ULong table_len )
|
FT_ULong table_len )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->load_delta_set_idx_map( FT_FACE( face ), offset, map,
|
return mm->load_delta_set_idx_map( face, offset, map,
|
||||||
itemStore, table_len );
|
itemStore, table_len );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static FT_Int
|
FT_CALLBACK_DEF( FT_Int )
|
||||||
cff_get_item_delta( CFF_Face face,
|
cff_get_item_delta( FT_Face face, /* CFF_Face */
|
||||||
GX_ItemVarStore itemStore,
|
GX_ItemVarStore itemStore,
|
||||||
FT_UInt outerIndex,
|
FT_UInt outerIndex,
|
||||||
FT_UInt innerIndex )
|
FT_UInt innerIndex )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->get_item_delta( FT_FACE( face ), itemStore,
|
return mm->get_item_delta( face, itemStore, outerIndex, innerIndex );
|
||||||
outerIndex, innerIndex );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
FT_CALLBACK_DEF( void )
|
||||||
cff_done_item_variation_store( CFF_Face face,
|
cff_done_item_variation_store( FT_Face face, /* CFF_Face */
|
||||||
GX_ItemVarStore itemStore )
|
GX_ItemVarStore itemStore )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
mm->done_item_var_store( FT_FACE( face ), itemStore );
|
mm->done_item_var_store( face, itemStore );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
FT_CALLBACK_DEF( void )
|
||||||
cff_done_delta_set_index_map( CFF_Face face,
|
cff_done_delta_set_index_map( FT_Face face, /* CFF_Face */
|
||||||
GX_DeltaSetIdxMap deltaSetIdxMap )
|
GX_DeltaSetIdxMap deltaSetIdxMap )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
mm->done_delta_set_idx_map( FT_FACE ( face ), deltaSetIdxMap );
|
mm->done_delta_set_idx_map( face, deltaSetIdxMap );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1003,36 +1044,35 @@
|
||||||
FT_DEFINE_SERVICE_MULTIMASTERSREC(
|
FT_DEFINE_SERVICE_MULTIMASTERSREC(
|
||||||
cff_service_multi_masters,
|
cff_service_multi_masters,
|
||||||
|
|
||||||
(FT_Get_MM_Func) NULL, /* get_mm */
|
NULL, /* FT_Get_MM_Func get_mm */
|
||||||
(FT_Set_MM_Design_Func) NULL, /* set_mm_design */
|
NULL, /* FT_Set_MM_Design_Func set_mm_design */
|
||||||
(FT_Set_MM_Blend_Func) cff_set_mm_blend, /* set_mm_blend */
|
cff_set_mm_blend, /* FT_Set_MM_Blend_Func set_mm_blend */
|
||||||
(FT_Get_MM_Blend_Func) cff_get_mm_blend, /* get_mm_blend */
|
cff_get_mm_blend, /* FT_Get_MM_Blend_Func get_mm_blend */
|
||||||
(FT_Get_MM_Var_Func) cff_get_mm_var, /* get_mm_var */
|
cff_get_mm_var, /* FT_Get_MM_Var_Func get_mm_var */
|
||||||
(FT_Set_Var_Design_Func)cff_set_var_design, /* set_var_design */
|
cff_set_var_design, /* FT_Set_Var_Design_Func set_var_design */
|
||||||
(FT_Get_Var_Design_Func)cff_get_var_design, /* get_var_design */
|
cff_get_var_design, /* FT_Get_Var_Design_Func get_var_design */
|
||||||
(FT_Set_Instance_Func) cff_set_instance, /* set_instance */
|
cff_set_named_instance,
|
||||||
(FT_Set_MM_WeightVector_Func)
|
/* FT_Set_Named_Instance_Func set_named_instance */
|
||||||
|
cff_get_default_named_instance,
|
||||||
|
/* FT_Get_Default_Named_Instance_Func get_default_named_instance */
|
||||||
cff_set_mm_weightvector,
|
cff_set_mm_weightvector,
|
||||||
/* set_mm_weightvector */
|
/* FT_Set_MM_WeightVector_Func set_mm_weightvector */
|
||||||
(FT_Get_MM_WeightVector_Func)
|
|
||||||
cff_get_mm_weightvector,
|
cff_get_mm_weightvector,
|
||||||
/* get_mm_weightvector */
|
/* FT_Get_MM_WeightVector_Func get_mm_weightvector */
|
||||||
(FT_Var_Load_Delta_Set_Idx_Map_Func)
|
cff_construct_ps_name,
|
||||||
|
/* FT_Construct_PS_Name_Func construct_ps_name */
|
||||||
cff_load_delta_set_index_mapping,
|
cff_load_delta_set_index_mapping,
|
||||||
/* load_delta_set_idx_map */
|
/* FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map */
|
||||||
(FT_Var_Load_Item_Var_Store_Func)
|
|
||||||
cff_load_item_variation_store,
|
cff_load_item_variation_store,
|
||||||
/* load_item_variation_store */
|
/* FT_Var_Load_Item_Var_Store_Func load_item_variation_store */
|
||||||
(FT_Var_Get_Item_Delta_Func)
|
cff_get_item_delta,
|
||||||
cff_get_item_delta, /* get_item_delta */
|
/* FT_Var_Get_Item_Delta_Func get_item_delta */
|
||||||
(FT_Var_Done_Item_Var_Store_Func)
|
|
||||||
cff_done_item_variation_store,
|
cff_done_item_variation_store,
|
||||||
/* done_item_variation_store */
|
/* FT_Var_Done_Item_Var_Store_Func done_item_variation_store */
|
||||||
(FT_Var_Done_Delta_Set_Idx_Map_Func)
|
|
||||||
cff_done_delta_set_index_map,
|
cff_done_delta_set_index_map,
|
||||||
/* done_delta_set_index_map */
|
/* FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_index_map */
|
||||||
(FT_Get_Var_Blend_Func) cff_get_var_blend, /* get_var_blend */
|
cff_get_var_blend, /* FT_Get_Var_Blend_Func get_var_blend */
|
||||||
(FT_Done_Blend_Func) cff_done_blend /* done_blend */
|
cff_done_blend /* FT_Done_Blend_Func done_blend */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1041,41 +1081,46 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static FT_Error
|
FT_CALLBACK_DEF( FT_Error )
|
||||||
cff_hadvance_adjust( CFF_Face face,
|
cff_hadvance_adjust( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt gindex,
|
FT_UInt gindex,
|
||||||
FT_Int *avalue )
|
FT_Int *avalue )
|
||||||
{
|
{
|
||||||
FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MetricsVariations
|
||||||
|
var = (FT_Service_MetricsVariations)cffface->tt_var;
|
||||||
|
|
||||||
|
|
||||||
return var->hadvance_adjust( FT_FACE( face ), gindex, avalue );
|
return var->hadvance_adjust( face, gindex, avalue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
FT_CALLBACK_DEF( void )
|
||||||
cff_metrics_adjust( CFF_Face face )
|
cff_metrics_adjust( FT_Face face ) /* CFF_Face */
|
||||||
{
|
{
|
||||||
FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MetricsVariations
|
||||||
|
var = (FT_Service_MetricsVariations)cffface->tt_var;
|
||||||
|
|
||||||
|
|
||||||
var->metrics_adjust( FT_FACE( face ) );
|
var->metrics_adjust( face );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FT_DEFINE_SERVICE_METRICSVARIATIONSREC(
|
FT_DEFINE_SERVICE_METRICSVARIATIONSREC(
|
||||||
cff_service_metrics_variations,
|
cff_service_metrics_variations,
|
||||||
|
|
||||||
(FT_HAdvance_Adjust_Func)cff_hadvance_adjust, /* hadvance_adjust */
|
cff_hadvance_adjust, /* FT_HAdvance_Adjust_Func hadvance_adjust */
|
||||||
(FT_LSB_Adjust_Func) NULL, /* lsb_adjust */
|
NULL, /* FT_LSB_Adjust_Func lsb_adjust */
|
||||||
(FT_RSB_Adjust_Func) NULL, /* rsb_adjust */
|
NULL, /* FT_RSB_Adjust_Func rsb_adjust */
|
||||||
|
|
||||||
(FT_VAdvance_Adjust_Func)NULL, /* vadvance_adjust */
|
NULL, /* FT_VAdvance_Adjust_Func vadvance_adjust */
|
||||||
(FT_TSB_Adjust_Func) NULL, /* tsb_adjust */
|
NULL, /* FT_TSB_Adjust_Func tsb_adjust */
|
||||||
(FT_BSB_Adjust_Func) NULL, /* bsb_adjust */
|
NULL, /* FT_BSB_Adjust_Func bsb_adjust */
|
||||||
(FT_VOrg_Adjust_Func) NULL, /* vorg_adjust */
|
NULL, /* FT_VOrg_Adjust_Func vorg_adjust */
|
||||||
|
|
||||||
(FT_Metrics_Adjust_Func) cff_metrics_adjust /* metrics_adjust */
|
cff_metrics_adjust, /* FT_Metrics_Adjust_Func metrics_adjust */
|
||||||
|
NULL /* FT_Size_Reset_Func size_reset */
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1088,11 +1133,11 @@
|
||||||
FT_DEFINE_SERVICE_CFFLOADREC(
|
FT_DEFINE_SERVICE_CFFLOADREC(
|
||||||
cff_service_cff_load,
|
cff_service_cff_load,
|
||||||
|
|
||||||
(FT_Get_Standard_Encoding_Func)cff_get_standard_encoding,
|
cff_get_standard_encoding, /* FT_Get_Standard_Encoding_Func get_standard_encoding */
|
||||||
(FT_Load_Private_Dict_Func) cff_load_private_dict,
|
cff_load_private_dict, /* FT_Load_Private_Dict_Func load_private_dict */
|
||||||
(FT_FD_Select_Get_Func) cff_fd_select_get,
|
cff_fd_select_get, /* FT_FD_Select_Get_Func fd_select_get */
|
||||||
(FT_Blend_Check_Vector_Func) cff_blend_check_vector,
|
cff_blend_check_vector, /* FT_Blend_Check_Vector_Func blend_check_vector */
|
||||||
(FT_Blend_Build_Vector_Func) cff_blend_build_vector
|
cff_blend_build_vector /* FT_Blend_Build_Vector_Func blend_build_vector */
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -356,7 +356,9 @@
|
||||||
|
|
||||||
#ifdef FT_CONFIG_OPTION_SVG
|
#ifdef FT_CONFIG_OPTION_SVG
|
||||||
/* check for OT-SVG */
|
/* check for OT-SVG */
|
||||||
if ( ( load_flags & FT_LOAD_COLOR ) && face->svg )
|
if ( ( load_flags & FT_LOAD_NO_SVG ) == 0 &&
|
||||||
|
( load_flags & FT_LOAD_COLOR ) &&
|
||||||
|
face->svg )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We load the SVG document and try to grab the advances from the
|
* We load the SVG document and try to grab the advances from the
|
||||||
|
|
|
@ -400,7 +400,7 @@
|
||||||
|
|
||||||
/* Allocate a table containing pointers to an index's elements. */
|
/* Allocate a table containing pointers to an index's elements. */
|
||||||
/* The `pool' argument makes this function convert the index */
|
/* The `pool' argument makes this function convert the index */
|
||||||
/* entries to C-style strings (this is, null-terminated). */
|
/* entries to C-style strings (that is, null-terminated). */
|
||||||
static FT_Error
|
static FT_Error
|
||||||
cff_index_get_pointers( CFF_Index idx,
|
cff_index_get_pointers( CFF_Index idx,
|
||||||
FT_Byte*** table,
|
FT_Byte*** table,
|
||||||
|
@ -1361,14 +1361,15 @@
|
||||||
for ( i = 0; i < numBlends; i++ )
|
for ( i = 0; i < numBlends; i++ )
|
||||||
{
|
{
|
||||||
const FT_Int32* weight = &blend->BV[1];
|
const FT_Int32* weight = &blend->BV[1];
|
||||||
FT_UInt32 sum;
|
FT_Fixed 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_fixed( parser, &parser->stack[i + base] );
|
||||||
|
|
||||||
for ( j = 1; j < blend->lenBV; j++ )
|
for ( j = 1; j < blend->lenBV; j++ )
|
||||||
sum += cff_parse_num( parser, &parser->stack[delta++] ) * *weight++;
|
sum += FT_MulFix( cff_parse_fixed( parser, &parser->stack[delta++] ),
|
||||||
|
*weight++ );
|
||||||
|
|
||||||
/* 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;
|
||||||
|
@ -1589,16 +1590,17 @@
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
|
|
||||||
FT_LOCAL_DEF( FT_Error )
|
FT_LOCAL_DEF( FT_Error )
|
||||||
cff_get_var_blend( CFF_Face face,
|
cff_get_var_blend( FT_Face face, /* CFF_Face */
|
||||||
FT_UInt *num_coords,
|
FT_UInt *num_coords,
|
||||||
FT_Fixed* *coords,
|
FT_Fixed* *coords,
|
||||||
FT_Fixed* *normalizedcoords,
|
FT_Fixed* *normalizedcoords,
|
||||||
FT_MM_Var* *mm_var )
|
FT_MM_Var* *mm_var )
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
return mm->get_var_blend( FT_FACE( face ),
|
return mm->get_var_blend( face,
|
||||||
num_coords,
|
num_coords,
|
||||||
coords,
|
coords,
|
||||||
normalizedcoords,
|
normalizedcoords,
|
||||||
|
@ -1607,13 +1609,14 @@
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
cff_done_blend( CFF_Face face )
|
cff_done_blend( FT_Face face ) /* CFF_Face */
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
CFF_Face cffface = (CFF_Face)face;
|
||||||
|
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)cffface->mm;
|
||||||
|
|
||||||
|
|
||||||
if (mm)
|
if ( mm )
|
||||||
mm->done_blend( FT_FACE( face ) );
|
mm->done_blend( face );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
||||||
|
@ -1650,13 +1653,6 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Zero out the code to gid/sid mappings. */
|
|
||||||
for ( j = 0; j < 256; j++ )
|
|
||||||
{
|
|
||||||
encoding->sids [j] = 0;
|
|
||||||
encoding->codes[j] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Note: The encoding table in a CFF font is indexed by glyph index; */
|
/* Note: The encoding table in a CFF font is indexed by glyph index; */
|
||||||
/* the first encoded glyph index is 1. Hence, we read the character */
|
/* the first encoded glyph index is 1. Hence, we read the character */
|
||||||
/* code (`glyph_code') at index j and make the assignment: */
|
/* code (`glyph_code') at index j and make the assignment: */
|
||||||
|
@ -1671,6 +1667,10 @@
|
||||||
|
|
||||||
if ( offset > 1 )
|
if ( offset > 1 )
|
||||||
{
|
{
|
||||||
|
/* Zero out the code to gid/sid mappings. */
|
||||||
|
FT_ARRAY_ZERO( encoding->sids, 256 );
|
||||||
|
FT_ARRAY_ZERO( encoding->codes, 256 );
|
||||||
|
|
||||||
encoding->offset = base_offset + offset;
|
encoding->offset = base_offset + offset;
|
||||||
|
|
||||||
/* we need to parse the table to determine its size */
|
/* we need to parse the table to determine its size */
|
||||||
|
@ -2012,7 +2012,7 @@
|
||||||
/* Top and Font DICTs are not allowed to have blend operators. */
|
/* Top and Font DICTs are not allowed to have blend operators. */
|
||||||
error = cff_parser_init( &parser,
|
error = cff_parser_init( &parser,
|
||||||
code,
|
code,
|
||||||
&subfont->font_dict,
|
top,
|
||||||
font->library,
|
font->library,
|
||||||
stackSize,
|
stackSize,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -105,14 +105,14 @@ FT_BEGIN_HEADER
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
cff_get_var_blend( CFF_Face face,
|
cff_get_var_blend( FT_Face face,
|
||||||
FT_UInt *num_coords,
|
FT_UInt *num_coords,
|
||||||
FT_Fixed* *coords,
|
FT_Fixed* *coords,
|
||||||
FT_Fixed* *normalizedcoords,
|
FT_Fixed* *normalizedcoords,
|
||||||
FT_MM_Var* *mm_var );
|
FT_MM_Var* *mm_var );
|
||||||
|
|
||||||
FT_LOCAL( void )
|
FT_LOCAL( void )
|
||||||
cff_done_blend( CFF_Face face );
|
cff_done_blend( FT_Face face );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@
|
||||||
FT_Module module;
|
FT_Module module;
|
||||||
|
|
||||||
|
|
||||||
module = FT_Get_Module( size->root.face->driver->root.library,
|
module = FT_Get_Module( font->library, "pshinter" );
|
||||||
"pshinter" );
|
|
||||||
return ( module && pshinter && pshinter->get_globals_funcs )
|
return ( module && pshinter && pshinter->get_globals_funcs )
|
||||||
? pshinter->get_globals_funcs( module )
|
? pshinter->get_globals_funcs( module )
|
||||||
: 0;
|
: 0;
|
||||||
|
@ -182,8 +182,7 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
cff_make_private_dict( &font->top_font, &priv );
|
cff_make_private_dict( &font->top_font, &priv );
|
||||||
error = funcs->create( cffsize->face->memory, &priv,
|
error = funcs->create( memory, &priv, &internal->topfont );
|
||||||
&internal->topfont );
|
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
@ -193,8 +192,7 @@
|
||||||
|
|
||||||
|
|
||||||
cff_make_private_dict( sub, &priv );
|
cff_make_private_dict( sub, &priv );
|
||||||
error = funcs->create( cffsize->face->memory, &priv,
|
error = funcs->create( memory, &priv, &internal->subfonts[i - 1] );
|
||||||
&internal->subfonts[i - 1] );
|
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
@ -381,8 +379,7 @@
|
||||||
FT_Module module;
|
FT_Module module;
|
||||||
|
|
||||||
|
|
||||||
module = FT_Get_Module( slot->face->driver->root.library,
|
module = FT_Get_Module( slot->library, "pshinter" );
|
||||||
"pshinter" );
|
|
||||||
if ( module )
|
if ( module )
|
||||||
{
|
{
|
||||||
T2_Hints_Funcs funcs;
|
T2_Hints_Funcs funcs;
|
||||||
|
@ -722,22 +719,15 @@
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
{
|
{
|
||||||
FT_Service_MultiMasters mm = (FT_Service_MultiMasters)face->mm;
|
|
||||||
FT_Service_MetricsVariations var = (FT_Service_MetricsVariations)face->var;
|
|
||||||
|
|
||||||
FT_UInt instance_index = (FT_UInt)face_index >> 16;
|
FT_UInt instance_index = (FT_UInt)face_index >> 16;
|
||||||
|
|
||||||
|
|
||||||
if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
|
if ( FT_HAS_MULTIPLE_MASTERS( cffface ) &&
|
||||||
mm &&
|
|
||||||
instance_index > 0 )
|
instance_index > 0 )
|
||||||
{
|
{
|
||||||
error = mm->set_instance( cffface, instance_index );
|
error = FT_Set_Named_Instance( cffface, instance_index );
|
||||||
if ( error )
|
if ( error )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
if ( var )
|
|
||||||
var->metrics_adjust( cffface );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
|
||||||
|
@ -1160,7 +1150,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
cff_done_blend( face );
|
cff_done_blend( cffface );
|
||||||
face->blend = NULL;
|
face->blend = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,10 +63,7 @@
|
||||||
|
|
||||||
/* allocate the stack buffer */
|
/* allocate the stack buffer */
|
||||||
if ( FT_QNEW_ARRAY( parser->stack, stackSize ) )
|
if ( FT_QNEW_ARRAY( parser->stack, stackSize ) )
|
||||||
{
|
|
||||||
FT_FREE( parser->stack );
|
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
|
||||||
|
|
||||||
parser->stackSize = stackSize;
|
parser->stackSize = stackSize;
|
||||||
parser->top = parser->stack; /* empty stack */
|
parser->top = parser->stack; /* empty stack */
|
||||||
|
@ -76,23 +73,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
|
||||||
static void
|
|
||||||
finalize_t2_strings( FT_Memory memory,
|
|
||||||
void* data,
|
|
||||||
void* user )
|
|
||||||
{
|
|
||||||
CFF_T2_String t2 = (CFF_T2_String)data;
|
|
||||||
|
|
||||||
|
|
||||||
FT_UNUSED( user );
|
|
||||||
|
|
||||||
memory->free( memory, t2->start );
|
|
||||||
memory->free( memory, data );
|
|
||||||
}
|
|
||||||
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
|
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
FT_LOCAL_DEF( void )
|
||||||
cff_parser_done( CFF_Parser parser )
|
cff_parser_done( CFF_Parser parser )
|
||||||
{
|
{
|
||||||
|
@ -102,63 +82,19 @@
|
||||||
FT_FREE( parser->stack );
|
FT_FREE( parser->stack );
|
||||||
|
|
||||||
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
||||||
FT_List_Finalize( &parser->t2_strings,
|
FT_List_Finalize( &parser->t2_strings, NULL, memory, NULL );
|
||||||
finalize_t2_strings,
|
|
||||||
memory,
|
|
||||||
NULL );
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Assuming `first >= last'. */
|
/* The parser limit checks in the next two functions are supposed */
|
||||||
|
/* to detect the immediate crossing of the stream boundary. They */
|
||||||
static FT_Error
|
/* shall not be triggered from the distant t2_strings buffers. */
|
||||||
cff_parser_within_limits( CFF_Parser parser,
|
|
||||||
FT_Byte* first,
|
|
||||||
FT_Byte* last )
|
|
||||||
{
|
|
||||||
#ifndef CFF_CONFIG_OPTION_OLD_ENGINE
|
|
||||||
|
|
||||||
/* Fast path for regular FreeType builds with the "new" engine; */
|
|
||||||
/* `first >= parser->start' can be assumed. */
|
|
||||||
|
|
||||||
FT_UNUSED( first );
|
|
||||||
|
|
||||||
return last < parser->limit ? FT_Err_Ok : FT_THROW( Invalid_Argument );
|
|
||||||
|
|
||||||
#else /* CFF_CONFIG_OPTION_OLD_ENGINE */
|
|
||||||
|
|
||||||
FT_ListNode node;
|
|
||||||
|
|
||||||
|
|
||||||
if ( first >= parser->start &&
|
|
||||||
last < parser->limit )
|
|
||||||
return FT_Err_Ok;
|
|
||||||
|
|
||||||
node = parser->t2_strings.head;
|
|
||||||
|
|
||||||
while ( node )
|
|
||||||
{
|
|
||||||
CFF_T2_String t2 = (CFF_T2_String)node->data;
|
|
||||||
|
|
||||||
|
|
||||||
if ( first >= t2->start &&
|
|
||||||
last < t2->limit )
|
|
||||||
return FT_Err_Ok;
|
|
||||||
|
|
||||||
node = node->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FT_THROW( Invalid_Argument );
|
|
||||||
|
|
||||||
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* read an integer */
|
/* read an integer */
|
||||||
static FT_Long
|
static FT_Long
|
||||||
cff_parse_integer( CFF_Parser parser,
|
cff_parse_integer( FT_Byte* start,
|
||||||
FT_Byte* start )
|
FT_Byte* limit )
|
||||||
{
|
{
|
||||||
FT_Byte* p = start;
|
FT_Byte* p = start;
|
||||||
FT_Int v = *p++;
|
FT_Int v = *p++;
|
||||||
|
@ -167,14 +103,14 @@
|
||||||
|
|
||||||
if ( v == 28 )
|
if ( v == 28 )
|
||||||
{
|
{
|
||||||
if ( cff_parser_within_limits( parser, p, p + 1 ) )
|
if ( p + 2 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
|
|
||||||
val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );
|
val = (FT_Short)( ( (FT_UShort)p[0] << 8 ) | p[1] );
|
||||||
}
|
}
|
||||||
else if ( v == 29 )
|
else if ( v == 29 )
|
||||||
{
|
{
|
||||||
if ( cff_parser_within_limits( parser, p, p + 3 ) )
|
if ( p + 4 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
|
|
||||||
val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) |
|
val = (FT_Long)( ( (FT_ULong)p[0] << 24 ) |
|
||||||
|
@ -188,14 +124,14 @@
|
||||||
}
|
}
|
||||||
else if ( v < 251 )
|
else if ( v < 251 )
|
||||||
{
|
{
|
||||||
if ( cff_parser_within_limits( parser, p, p ) )
|
if ( p + 1 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
|
|
||||||
val = ( v - 247 ) * 256 + p[0] + 108;
|
val = ( v - 247 ) * 256 + p[0] + 108;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( cff_parser_within_limits( parser, p, p ) )
|
if ( p + 1 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
|
|
||||||
val = -( v - 251 ) * 256 - p[0] - 108;
|
val = -( v - 251 ) * 256 - p[0] - 108;
|
||||||
|
@ -244,8 +180,8 @@
|
||||||
|
|
||||||
/* read a real */
|
/* read a real */
|
||||||
static FT_Fixed
|
static FT_Fixed
|
||||||
cff_parse_real( CFF_Parser parser,
|
cff_parse_real( FT_Byte* start,
|
||||||
FT_Byte* start,
|
FT_Byte* limit,
|
||||||
FT_Long power_ten,
|
FT_Long power_ten,
|
||||||
FT_Long* scaling )
|
FT_Long* scaling )
|
||||||
{
|
{
|
||||||
|
@ -282,7 +218,7 @@
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
/* Make sure we don't read past the end. */
|
/* Make sure we don't read past the end. */
|
||||||
if ( cff_parser_within_limits( parser, p, p ) )
|
if ( p + 1 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +255,7 @@
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
/* Make sure we don't read past the end. */
|
/* Make sure we don't read past the end. */
|
||||||
if ( cff_parser_within_limits( parser, p, p ) )
|
if ( p + 1 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,7 +294,7 @@
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
/* Make sure we don't read past the end. */
|
/* Make sure we don't read past the end. */
|
||||||
if ( cff_parser_within_limits( parser, p, p ) )
|
if ( p + 1 > limit && limit >= p )
|
||||||
goto Bad;
|
goto Bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,7 +461,7 @@
|
||||||
if ( **d == 30 )
|
if ( **d == 30 )
|
||||||
{
|
{
|
||||||
/* binary-coded decimal is truncated to integer */
|
/* binary-coded decimal is truncated to integer */
|
||||||
return cff_parse_real( parser, *d, 0, NULL ) >> 16;
|
return cff_parse_real( *d, parser->limit, 0, NULL ) >> 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ( **d == 255 )
|
else if ( **d == 255 )
|
||||||
|
@ -551,7 +487,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
return cff_parse_integer( parser, *d );
|
return cff_parse_integer( *d, parser->limit );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -562,15 +498,33 @@
|
||||||
FT_Long scaling )
|
FT_Long scaling )
|
||||||
{
|
{
|
||||||
if ( **d == 30 )
|
if ( **d == 30 )
|
||||||
return cff_parse_real( parser, *d, scaling, NULL );
|
return cff_parse_real( *d, parser->limit, scaling, NULL );
|
||||||
else
|
else if ( **d == 255 )
|
||||||
{
|
{
|
||||||
FT_Long val = cff_parse_integer( parser, *d );
|
FT_Fixed val = ( ( ( (FT_UInt32)*( d[0] + 1 ) << 24 ) |
|
||||||
|
( (FT_UInt32)*( d[0] + 2 ) << 16 ) |
|
||||||
|
( (FT_UInt32)*( d[0] + 3 ) << 8 ) |
|
||||||
|
(FT_UInt32)*( d[0] + 4 ) ) );
|
||||||
|
|
||||||
if ( scaling )
|
if ( scaling )
|
||||||
{
|
{
|
||||||
if ( FT_ABS( val ) > power_ten_limits[scaling] )
|
if ( FT_ABS( val ) > power_ten_limits[scaling] )
|
||||||
|
{
|
||||||
|
FT_TRACE4(( "!!!OVERFLOW:!!!" ));
|
||||||
|
return val > 0 ? 0x7FFFFFFFL : -0x7FFFFFFFL;
|
||||||
|
}
|
||||||
|
val *= power_tens[scaling];
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FT_Long val = cff_parse_integer( *d, parser->limit );
|
||||||
|
|
||||||
|
|
||||||
|
if ( scaling )
|
||||||
|
{
|
||||||
|
if ( ( FT_ABS( val ) << 16 ) > power_ten_limits[scaling] )
|
||||||
{
|
{
|
||||||
val = val > 0 ? 0x7FFFFFFFL : -0x7FFFFFFFL;
|
val = val > 0 ? 0x7FFFFFFFL : -0x7FFFFFFFL;
|
||||||
goto Overflow;
|
goto Overflow;
|
||||||
|
@ -600,7 +554,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* read a floating point number, either integer or real */
|
/* read a floating point number, either integer or real */
|
||||||
static FT_Fixed
|
FT_LOCAL_DEF( FT_Fixed )
|
||||||
cff_parse_fixed( CFF_Parser parser,
|
cff_parse_fixed( CFF_Parser parser,
|
||||||
FT_Byte** d )
|
FT_Byte** d )
|
||||||
{
|
{
|
||||||
|
@ -630,14 +584,14 @@
|
||||||
FT_ASSERT( scaling );
|
FT_ASSERT( scaling );
|
||||||
|
|
||||||
if ( **d == 30 )
|
if ( **d == 30 )
|
||||||
return cff_parse_real( parser, *d, 0, scaling );
|
return cff_parse_real( *d, parser->limit, 0, scaling );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FT_Long number;
|
FT_Long number;
|
||||||
FT_Int integer_length;
|
FT_Int integer_length;
|
||||||
|
|
||||||
|
|
||||||
number = cff_parse_integer( parser, d[0] );
|
number = cff_parse_integer( *d, parser->limit );
|
||||||
|
|
||||||
if ( number > 0x7FFFL )
|
if ( number > 0x7FFFL )
|
||||||
{
|
{
|
||||||
|
@ -686,7 +640,7 @@
|
||||||
|
|
||||||
dict->has_font_matrix = TRUE;
|
dict->has_font_matrix = TRUE;
|
||||||
|
|
||||||
/* We expect a well-formed font matrix, this is, the matrix elements */
|
/* We expect a well-formed font matrix, that is, the matrix elements */
|
||||||
/* `xx' and `yy' are of approximately the same magnitude. To avoid */
|
/* `xx' and `yy' are of approximately the same magnitude. To avoid */
|
||||||
/* loss of precision, we use the magnitude of the largest matrix */
|
/* loss of precision, we use the magnitude of the largest matrix */
|
||||||
/* element to scale all other elements. The scaling factor is then */
|
/* element to scale all other elements. The scaling factor is then */
|
||||||
|
@ -1265,10 +1219,7 @@
|
||||||
FT_ULong charstring_len;
|
FT_ULong charstring_len;
|
||||||
|
|
||||||
FT_Fixed* stack;
|
FT_Fixed* stack;
|
||||||
FT_ListNode node;
|
FT_Byte* q = NULL;
|
||||||
CFF_T2_String t2;
|
|
||||||
FT_Fixed t2_size;
|
|
||||||
FT_Byte* q;
|
|
||||||
|
|
||||||
|
|
||||||
charstring_base = ++p;
|
charstring_base = ++p;
|
||||||
|
@ -1309,39 +1260,18 @@
|
||||||
/* Now copy the stack data in the temporary decoder object, */
|
/* Now copy the stack data in the temporary decoder object, */
|
||||||
/* converting it back to charstring number representations */
|
/* converting it back to charstring number representations */
|
||||||
/* (this is ugly, I know). */
|
/* (this is ugly, I know). */
|
||||||
|
/* The maximum required size is 5 bytes per stack element. */
|
||||||
|
if ( FT_QALLOC( q, (FT_Long)( 2 * sizeof ( FT_ListNode ) ) +
|
||||||
|
5 * ( decoder.top - decoder.stack ) ) )
|
||||||
|
goto Exit;
|
||||||
|
|
||||||
node = (FT_ListNode)memory->alloc( memory,
|
FT_List_Add( &parser->t2_strings, (FT_ListNode)q );
|
||||||
sizeof ( FT_ListNodeRec ) );
|
|
||||||
if ( !node )
|
|
||||||
goto Out_Of_Memory_Error;
|
|
||||||
|
|
||||||
FT_List_Add( &parser->t2_strings, node );
|
q += 2 * sizeof ( FT_ListNode );
|
||||||
|
|
||||||
t2 = (CFF_T2_String)memory->alloc( memory,
|
for ( stack = decoder.stack; stack < decoder.top; stack++ )
|
||||||
sizeof ( CFF_T2_StringRec ) );
|
|
||||||
if ( !t2 )
|
|
||||||
goto Out_Of_Memory_Error;
|
|
||||||
|
|
||||||
node->data = t2;
|
|
||||||
|
|
||||||
/* `5' is the conservative upper bound of required bytes per stack */
|
|
||||||
/* element. */
|
|
||||||
|
|
||||||
t2_size = 5 * ( decoder.top - decoder.stack );
|
|
||||||
|
|
||||||
q = (FT_Byte*)memory->alloc( memory, t2_size );
|
|
||||||
if ( !q )
|
|
||||||
goto Out_Of_Memory_Error;
|
|
||||||
|
|
||||||
t2->start = q;
|
|
||||||
t2->limit = q + t2_size;
|
|
||||||
|
|
||||||
stack = decoder.stack;
|
|
||||||
|
|
||||||
while ( stack < decoder.top )
|
|
||||||
{
|
{
|
||||||
FT_ULong num;
|
FT_Long num = *stack;
|
||||||
FT_Bool neg;
|
|
||||||
|
|
||||||
|
|
||||||
if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )
|
if ( (FT_UInt)( parser->top - parser->stack ) >= parser->stackSize )
|
||||||
|
@ -1349,59 +1279,30 @@
|
||||||
|
|
||||||
*parser->top++ = q;
|
*parser->top++ = q;
|
||||||
|
|
||||||
if ( *stack < 0 )
|
|
||||||
{
|
|
||||||
num = (FT_ULong)NEG_LONG( *stack );
|
|
||||||
neg = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
num = (FT_ULong)*stack;
|
|
||||||
neg = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( num & 0xFFFFU )
|
if ( num & 0xFFFFU )
|
||||||
{
|
{
|
||||||
if ( neg )
|
|
||||||
num = (FT_ULong)-num;
|
|
||||||
|
|
||||||
*q++ = 255;
|
*q++ = 255;
|
||||||
*q++ = ( num & 0xFF000000U ) >> 24;
|
*q++ = (FT_Byte)( ( num >> 24 ) & 0xFF );
|
||||||
*q++ = ( num & 0x00FF0000U ) >> 16;
|
*q++ = (FT_Byte)( ( num >> 16 ) & 0xFF );
|
||||||
*q++ = ( num & 0x0000FF00U ) >> 8;
|
*q++ = (FT_Byte)( ( num >> 8 ) & 0xFF );
|
||||||
*q++ = num & 0x000000FFU;
|
*q++ = (FT_Byte)( ( num ) & 0xFF );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
num >>= 16;
|
num >>= 16;
|
||||||
|
|
||||||
if ( neg )
|
if ( -107 <= num && num <= 107 )
|
||||||
{
|
|
||||||
if ( num <= 107 )
|
|
||||||
*q++ = (FT_Byte)( 139 - num );
|
|
||||||
else if ( num <= 1131 )
|
|
||||||
{
|
|
||||||
*q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 251 );
|
|
||||||
*q++ = (FT_Byte)( ( num - 108 ) & 0xFF );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
num = (FT_ULong)-num;
|
|
||||||
|
|
||||||
*q++ = 28;
|
|
||||||
*q++ = (FT_Byte)( num >> 8 );
|
|
||||||
*q++ = (FT_Byte)( num & 0xFF );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( num <= 107 )
|
|
||||||
*q++ = (FT_Byte)( num + 139 );
|
*q++ = (FT_Byte)( num + 139 );
|
||||||
else if ( num <= 1131 )
|
else if ( 108 <= num && num <= 1131 )
|
||||||
{
|
{
|
||||||
*q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 247 );
|
*q++ = (FT_Byte)( ( ( num - 108 ) >> 8 ) + 247 );
|
||||||
*q++ = (FT_Byte)( ( num - 108 ) & 0xFF );
|
*q++ = (FT_Byte)( ( num - 108 ) & 0xFF );
|
||||||
}
|
}
|
||||||
|
else if ( -1131 <= num && num <= -108 )
|
||||||
|
{
|
||||||
|
*q++ = (FT_Byte)( ( ( -num - 108 ) >> 8 ) + 251 );
|
||||||
|
*q++ = (FT_Byte)( ( -num - 108) & 0xFF );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*q++ = 28;
|
*q++ = 28;
|
||||||
|
@ -1410,9 +1311,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stack++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
|
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
|
||||||
else
|
else
|
||||||
|
@ -1598,12 +1496,6 @@
|
||||||
Exit:
|
Exit:
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
|
||||||
Out_Of_Memory_Error:
|
|
||||||
error = FT_THROW( Out_Of_Memory );
|
|
||||||
goto Exit;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Stack_Overflow:
|
Stack_Overflow:
|
||||||
error = FT_THROW( Invalid_Argument );
|
error = FT_THROW( Invalid_Argument );
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
|
@ -76,6 +76,10 @@ FT_BEGIN_HEADER
|
||||||
cff_parse_num( CFF_Parser parser,
|
cff_parse_num( CFF_Parser parser,
|
||||||
FT_Byte** d );
|
FT_Byte** d );
|
||||||
|
|
||||||
|
FT_LOCAL( FT_Fixed )
|
||||||
|
cff_parse_fixed( CFF_Parser parser,
|
||||||
|
FT_Byte** d );
|
||||||
|
|
||||||
FT_LOCAL( FT_Error )
|
FT_LOCAL( FT_Error )
|
||||||
cff_parser_init( CFF_Parser parser,
|
cff_parser_init( CFF_Parser parser,
|
||||||
FT_UInt code,
|
FT_UInt code,
|
||||||
|
@ -133,15 +137,6 @@ FT_BEGIN_HEADER
|
||||||
FT_END_HEADER
|
FT_END_HEADER
|
||||||
|
|
||||||
|
|
||||||
#ifdef CFF_CONFIG_OPTION_OLD_ENGINE
|
|
||||||
typedef struct CFF_T2_String_
|
|
||||||
{
|
|
||||||
FT_Byte* start;
|
|
||||||
FT_Byte* limit;
|
|
||||||
|
|
||||||
} CFF_T2_StringRec, *CFF_T2_String;
|
|
||||||
#endif /* CFF_CONFIG_OPTION_OLD_ENGINE */
|
|
||||||
|
|
||||||
#endif /* CFFPARSE_H_ */
|
#endif /* CFFPARSE_H_ */
|
||||||
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue