mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
Update to FreeType 2.1.8
svn path=/trunk/; revision=9349
This commit is contained in:
parent
418b7e53a6
commit
2fbb38750c
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
# FreeType 2 top Jamfile (c) 2001, 2002, 2003 David Turner
|
||||
# FreeType 2 top Jamfile (c) 2001, 2002, 2003, 2004 David Turner
|
||||
#
|
||||
|
||||
# The HDRMACRO is already defined in FTJam and is used to add
|
||||
|
@ -61,13 +61,15 @@ FT2_BUILD_INCLUDE ?= ;
|
|||
# IMPORTANT: You'll need to change the content of "ftmodule.h" as well
|
||||
# if you modify this list or provide your own.
|
||||
#
|
||||
FT2_COMPONENTS ?= gzip # support for gzip-compressed files
|
||||
FT2_COMPONENTS ?= autofit # auto-fitter
|
||||
autohint # auto-hinter
|
||||
base # base component (public APIs)
|
||||
bdf # BDF font driver
|
||||
cache # cache sub-system
|
||||
cff # CFF/CEF font driver
|
||||
cid # PostScript CID-keyed font driver
|
||||
gzip # support for gzip-compressed files
|
||||
lzw # support for LZW-compressed files
|
||||
pcf # PCF font driver
|
||||
pfr # PFR/TrueDoc font driver
|
||||
psaux # common PostScript routines module
|
||||
|
@ -146,7 +148,7 @@ if $(DEBUG_HINTER)
|
|||
|
||||
actions RefDoc
|
||||
{
|
||||
python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.5 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h $(FT2_INCLUDE)/freetype/cache/*.h
|
||||
python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.8 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h $(FT2_INCLUDE)/freetype/cache/*.h
|
||||
}
|
||||
|
||||
RefDoc refdoc ;
|
||||
|
|
|
@ -1,135 +0,0 @@
|
|||
# FreeType 2 top Jamfile (c) 2001, 2002, 2003 David Turner
|
||||
#
|
||||
|
||||
# The HDRMACRO is already defined in FTJam and is used to add
|
||||
# the content of certain macros to the list of included header
|
||||
# files.
|
||||
#
|
||||
# We can compile FreeType 2 with classic Jam however thanks to
|
||||
# the following code
|
||||
#
|
||||
if ! $(JAM_TOOLSET)
|
||||
{
|
||||
rule HDRMACRO
|
||||
{
|
||||
# nothing
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# We need to invoke a SubDir rule if the FT2 source directory top is not the
|
||||
# current directory. This allows us to build FreeType 2 as part of a larger
|
||||
# project easily.
|
||||
#
|
||||
if $(FT2_TOP) != $(DOT)
|
||||
{
|
||||
SubDir FT2_TOP ;
|
||||
}
|
||||
|
||||
|
||||
# The following macros define the include directory, the source directory,
|
||||
# and the final library name (without library extensions). They can be
|
||||
# replaced by other definitions when the library is compiled as part of
|
||||
# a larger project.
|
||||
#
|
||||
|
||||
# Name of FreeType include directory during compilation.
|
||||
# This is relative to FT2_TOP.
|
||||
#
|
||||
FT2_INCLUDE_DIR ?= include ;
|
||||
|
||||
# Name of FreeType source directory during compilation.
|
||||
# This is relative to FT2_TOP.
|
||||
#
|
||||
FT2_SRC_DIR ?= src ;
|
||||
|
||||
# Name of final library, without extension.
|
||||
#
|
||||
FT2_LIB ?= $(LIBPREFIX)freetype ;
|
||||
|
||||
|
||||
# Define FT2_BUILD_INCLUDE to point to your build-specific directory.
|
||||
# This is prepended to FT2_INCLUDE_DIR. It can be used to specify
|
||||
# the location of a custom <ft2build.h> which will point to custom
|
||||
# versions of "ftmodule.h" and "ftoption.h", for example.
|
||||
#
|
||||
FT2_BUILD_INCLUDE ?= ;
|
||||
|
||||
# The list of modules to compile on any given build of the library.
|
||||
# By default, this will contain _all_ modules defined in FT2_SRC_DIR.
|
||||
#
|
||||
# IMPORTANT: You'll need to change the content of "ftmodule.h" as well
|
||||
# if you modify this list or provide your own.
|
||||
#
|
||||
FT2_COMPONENTS ?= gzip # support for gzip-compressed files
|
||||
autohint # auto-hinter
|
||||
base # base component (public APIs)
|
||||
bdf # BDF font driver
|
||||
cache # cache sub-system
|
||||
cff # CFF/CEF font driver
|
||||
cid # PostScript CID-keyed font driver
|
||||
pcf # PCF font driver
|
||||
pfr # PFR/TrueDoc font driver
|
||||
psaux # common PostScript routines module
|
||||
pshinter # PostScript hinter module
|
||||
psnames # PostScript names handling
|
||||
raster # monochrome rasterizer
|
||||
smooth # anti-aliased rasterizer
|
||||
sfnt # SFNT-based format support routines
|
||||
truetype # TrueType font driver
|
||||
type1 # PostScript Type 1 font driver
|
||||
type42 # PostScript Type 42 (embedded TrueType) driver
|
||||
winfonts # Windows FON/FNT font driver
|
||||
;
|
||||
|
||||
|
||||
# Don't touch.
|
||||
#
|
||||
FT2_INCLUDE = $(FT2_BUILD_INCLUDE)
|
||||
[ FT2_SubDir $(FT2_INCLUDE_DIR) ] ;
|
||||
|
||||
FT2_SRC = [ FT2_SubDir $(FT2_SRC_DIR) ] ;
|
||||
|
||||
# Only used by FreeType developers.
|
||||
#
|
||||
if $(DEBUG_HINTER)
|
||||
{
|
||||
CCFLAGS += -DDEBUG_HINTER ;
|
||||
}
|
||||
|
||||
|
||||
# We need "freetype2/include" in the current include path in order to
|
||||
# compile any part of FreeType 2.
|
||||
#
|
||||
HDRS += $(FT2_INCLUDE) ;
|
||||
|
||||
|
||||
# Uncomment the following line if you want to build individual source files
|
||||
# for each FreeType 2 module. This is only useful during development, and
|
||||
# is better defined as an environment variable anyway!
|
||||
#
|
||||
# FT2_MULTI = true ;
|
||||
|
||||
|
||||
# The file <freetype/config/ftheader.h> is used to define macros that are
|
||||
# later used in #include statements. It needs to be parsed in order to
|
||||
# record these definitions.
|
||||
#
|
||||
HDRMACRO [ FT2_SubDir include freetype config ftheader.h ] ;
|
||||
HDRMACRO [ FT2_SubDir include freetype internal internal.h ] ;
|
||||
|
||||
|
||||
# Now include the Jamfile in "freetype2/src", used to drive the compilation
|
||||
# of each FreeType 2 component and/or module.
|
||||
#
|
||||
SubInclude FT2_TOP $(FT2_SRC_DIR) ;
|
||||
|
||||
|
||||
# Test files (hinter debugging). Only used by FreeType developers.
|
||||
#
|
||||
if $(DEBUG_HINTER)
|
||||
{
|
||||
SubInclude FT2_TOP tests ;
|
||||
}
|
||||
|
||||
# end of top Jamfile
|
|
@ -9,7 +9,7 @@
|
|||
is called `libttf'. They are *not* compatible!
|
||||
|
||||
|
||||
FreeType 2.1.5
|
||||
FreeType 2.1.8
|
||||
==============
|
||||
|
||||
Please read the docs/CHANGES file, it contains IMPORTANT INFORMATION.
|
||||
|
@ -19,9 +19,9 @@
|
|||
Note that the FreeType 2 documentation is now available as a
|
||||
separate package from our sites. See:
|
||||
|
||||
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.5.tar.bz2
|
||||
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.5.tar.gz
|
||||
ftp://ftp.freetype.org/pub/freetype2/ftdoc215.zip
|
||||
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.8.tar.bz2
|
||||
ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.1.8.tar.gz
|
||||
ftp://ftp.freetype.org/pub/freetype2/ftdoc218.zip
|
||||
|
||||
|
||||
Bugs
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CREDITS
|
||||
|
||||
The code in this tree is based (it is actually an exact copy with some
|
||||
ReactOS specific extra files) on the FreeType library, version 2.1.5.
|
||||
ReactOS specific extra files) on the FreeType library, version 2.1.8.
|
||||
It was written and is being maintained by the FreeType team. The projects
|
||||
website is http://www.freetype.org.
|
||||
|
||||
|
@ -66,4 +66,4 @@ file, so it is obvious to everyone which FreeType version we're using.
|
|||
After testing, you can commit the new/changed files to CVS. ALthough files
|
||||
config.mk and freetype.def are generated, they should be included in CVS.
|
||||
|
||||
$Id: README.ROS,v 1.4 2004/01/21 19:23:45 gvg Exp $
|
||||
$Id: README.ROS,v 1.5 2004/05/10 17:48:22 gvg Exp $
|
||||
|
|
16
reactos/lib/freetype/builds/atari/ATARI.H
Normal file
16
reactos/lib/freetype/builds/atari/ATARI.H
Normal file
|
@ -0,0 +1,16 @@
|
|||
#ifndef ATARI_H
|
||||
#define ATARI_H
|
||||
|
||||
#pragma warn -stu
|
||||
|
||||
/* PureC doesn't like 32bit enumerations */
|
||||
|
||||
#ifndef FT_IMAGE_TAG
|
||||
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value
|
||||
#endif /* FT_IMAGE_TAG */
|
||||
|
||||
#ifndef FT_ENC_TAG
|
||||
#define FT_ENC_TAG( value, a, b, c, d ) value
|
||||
#endif /* FT_ENC_TAG */
|
||||
|
||||
#endif /* ATARI_H */
|
37
reactos/lib/freetype/builds/atari/FNames.SIC
Normal file
37
reactos/lib/freetype/builds/atari/FNames.SIC
Normal file
|
@ -0,0 +1,37 @@
|
|||
/* the following changes file names for PureC projects */
|
||||
|
||||
if (argc > 0)
|
||||
{
|
||||
ordner = argv[0];
|
||||
if (basename(ordner) == "") /* ist Ordner */
|
||||
{
|
||||
ChangeFilenames(ordner);
|
||||
}
|
||||
}
|
||||
|
||||
proc ChangeFilenames(folder)
|
||||
local i,entries,directory,file;
|
||||
{
|
||||
entries = filelist(directory,folder);
|
||||
for (i = 0; i < entries; ++i)
|
||||
{
|
||||
file = directory[i,0];
|
||||
if ((directory[i,3]&16) > 0) /* subdirectory */
|
||||
{
|
||||
ChangeFilenames(folder+file+"\\");
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((stricmp(suffix(file),".h")==0)|(stricmp(suffix(file),".c")==0))
|
||||
ChangeFilename(folder,file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc ChangeFilename(path,datei)
|
||||
local newfile,err;
|
||||
{
|
||||
newfile=datei;
|
||||
newfile[0]=(newfile[0] | 32) ^ 32;
|
||||
err=files.rename("-q",path+datei,newfile);
|
||||
}
|
33
reactos/lib/freetype/builds/atari/FREETYPE.PRJ
Normal file
33
reactos/lib/freetype/builds/atari/FREETYPE.PRJ
Normal file
|
@ -0,0 +1,33 @@
|
|||
;FreeType project file
|
||||
|
||||
FREETYPE.LIB
|
||||
|
||||
.C [-K -P -R -A]
|
||||
.L [-J -V]
|
||||
.S
|
||||
|
||||
=
|
||||
|
||||
..\..\src\base\ftsystem.c
|
||||
..\..\src\base\ftdebug.c
|
||||
|
||||
..\..\src\base\ftinit.c
|
||||
..\..\src\base\ftglyph.c
|
||||
..\..\src\base\ftmm
|
||||
..\..\src\base\ftbbox
|
||||
|
||||
..\..\src\base\ftbase.c
|
||||
..\..\src\autohint\autohint.c
|
||||
;..\..\src\cache\ftcache.c
|
||||
..\..\src\cff\cff.c
|
||||
..\..\src\cid\type1cid.c
|
||||
..\..\src\psaux\psaux.c
|
||||
..\..\src\pshinter\pshinter.c
|
||||
..\..\src\psnames\psnames.c
|
||||
..\..\src\raster\raster.c
|
||||
..\..\src\sfnt\sfnt.c
|
||||
..\..\src\smooth\smooth.c
|
||||
..\..\src\truetype\truetype.c
|
||||
..\..\src\type1\type1.c
|
||||
..\..\src\type42\type42.c
|
||||
|
51
reactos/lib/freetype/builds/atari/README.TXT
Normal file
51
reactos/lib/freetype/builds/atari/README.TXT
Normal file
|
@ -0,0 +1,51 @@
|
|||
Compiling FreeType 2 with PureC compiler
|
||||
========================================
|
||||
|
||||
[See below for a German version.]
|
||||
|
||||
To compile FreeType 2 as a library the following changes must be applied:
|
||||
|
||||
- All *.c files must start with an uppercase letter.
|
||||
(In case GEMSCRIPT is available:
|
||||
Simply drag the whole FreeType 2 directory to the file `FNames.SIC'.)
|
||||
|
||||
- You have to change the INCLUDE directory in PureC's compiler options
|
||||
to contain both the `INCLUDE' and `freetype2\include' directory.
|
||||
Example:
|
||||
|
||||
INCLUDE;E:\freetype2\include
|
||||
|
||||
- The file `freetype2/include/Ft2build.h' must be patched as follows to
|
||||
include ATARI.H:
|
||||
|
||||
#ifndef __FT2_BUILD_GENERIC_H__
|
||||
#define __FT2_BUILD_GENERIC_H__
|
||||
|
||||
#include "ATARI.H"
|
||||
|
||||
|
||||
|
||||
Compilieren von FreeType 2 mit PureC
|
||||
====================================
|
||||
|
||||
Um FreeType 2 als eine Bibliothek (library) zu compilieren, muss folgendes
|
||||
ge„ndert werden:
|
||||
|
||||
- Alle *.c-files m<>ssen mit einem GROSSBUCHSTABEN beginnen.
|
||||
(Falls GEMSCRIPT zur Verf<72>gung steht:
|
||||
Den kompletten Ordner freetype2 auf die Datei `FNames.SIC' draggen.)
|
||||
|
||||
- In den Compiler-Optionen von PureC muss das INCLUDE directory auf INCLUDE
|
||||
und freetype2\include verweisen. Z.B.:
|
||||
|
||||
INCLUDE;E:\freetype2\include
|
||||
|
||||
- In der Datei freetype2/include/Ft2build.h muss zu Beginn
|
||||
ein #include "ATARI.H" wie folgt eingef<65>gt werden:
|
||||
|
||||
#ifndef __FT2_BUILD_GENERIC_H__
|
||||
#define __FT2_BUILD_GENERIC_H__
|
||||
|
||||
#include "ATARI.H"
|
||||
|
||||
--- end of README.TXT ---
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2001, 2002, 2003 by
|
||||
# Copyright 1996-2000, 2001, 2002, 2003, 2004 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
@ -97,6 +97,7 @@ BASE_DIR := $(SRC_DIR)/base
|
|||
#
|
||||
PUBLIC_DIR := $(TOP_DIR)/include/freetype
|
||||
INTERNAL_DIR := $(PUBLIC_DIR)/internal
|
||||
SERVICES_DIR := $(INTERNAL_DIR)/services
|
||||
CONFIG_DIR := $(PUBLIC_DIR)/config
|
||||
CACHE_DIR := $(PUBLIC_DIR)/cache
|
||||
|
||||
|
@ -155,7 +156,8 @@ OBJECTS_LIST :=
|
|||
# changes, the whole library is recompiled.
|
||||
#
|
||||
PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h)
|
||||
BASE_H := $(wildcard $(INTERNAL_DIR)/*.h)
|
||||
BASE_H := $(wildcard $(INTERNAL_DIR)/*.h) \
|
||||
$(wildcard $(SERVICES_DIR)/*.h)
|
||||
CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \
|
||||
$(wildcard $(BUILD_DIR)/freetype/config/*.h)
|
||||
CACHE_H := $(wildcard $(CACHE_DIR)/*.h)
|
||||
|
@ -252,7 +254,7 @@ library: $(PROJECT_LIBRARY)
|
|||
refdoc:
|
||||
python $(SRC_DIR)/tools/docmaker/docmaker.py \
|
||||
--prefix=ft2 \
|
||||
--title=FreeType-2.1.5 \
|
||||
--title=FreeType-2.1.8 \
|
||||
--output=$(DOC_DIR) \
|
||||
$(PUBLIC_DIR)/*.h \
|
||||
$(PUBLIC_DIR)/config/*.h \
|
||||
|
|
|
@ -110,6 +110,7 @@ ifdef check_platform
|
|||
$(RM) builds/unix/config.status
|
||||
$(RM) builds/unix/unix-def.mk
|
||||
$(RM) builds/unix/unix-cc.mk
|
||||
$(RM) builds/unix/freetype2.pc
|
||||
$(RM) nul
|
||||
|
||||
endif # test is_unix
|
||||
|
|
|
@ -6,3 +6,4 @@ config.log
|
|||
libtool
|
||||
ftconfig.h
|
||||
freetype-config
|
||||
freetype2.pc
|
||||
|
|
7309
reactos/lib/freetype/builds/unix/aclocal.m4
vendored
7309
reactos/lib/freetype/builds/unix/aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
184
reactos/lib/freetype/builds/unix/config.guess
vendored
184
reactos/lib/freetype/builds/unix/config.guess
vendored
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2003-01-10'
|
||||
timestamp='2004-03-12'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
|
@ -106,6 +106,7 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
|
|||
: ${TMPDIR=/tmp} ;
|
||||
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
|
||||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
|
||||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
|
||||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
|
||||
dummy=$tmp/dummy ;
|
||||
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
|
||||
|
@ -196,12 +197,18 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit 0 ;;
|
||||
amd64:OpenBSD:*:*)
|
||||
echo x86_64-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
cats:OpenBSD:*:*)
|
||||
echo arm-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -220,6 +227,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
mvmeppc:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pegasos:OpenBSD:*:*)
|
||||
echo powerpc-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mipsel-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -235,73 +245,70 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:MicroBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
|
||||
*:ekkoBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
macppc:MirBSD:*:*)
|
||||
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:MirBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
case $UNAME_RELEASE in
|
||||
*4.0)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
fi
|
||||
;;
|
||||
*5.*)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
;;
|
||||
esac
|
||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||
# OSF/1 and Tru64 systems produced since 1995. I hope that
|
||||
# covers most systems running today. This code pipes the CPU
|
||||
# types through head -n 1, so we only detect the type of CPU 0.
|
||||
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
|
||||
case "$ALPHA_CPU_TYPE" in
|
||||
"EV4 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV4.5 (21064)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"LCA4 (21066/21068)")
|
||||
UNAME_MACHINE="alpha" ;;
|
||||
"EV5 (21164)")
|
||||
UNAME_MACHINE="alphaev5" ;;
|
||||
"EV5.6 (21164A)")
|
||||
UNAME_MACHINE="alphaev56" ;;
|
||||
"EV5.6 (21164PC)")
|
||||
UNAME_MACHINE="alphapca56" ;;
|
||||
"EV5.7 (21164PC)")
|
||||
UNAME_MACHINE="alphapca57" ;;
|
||||
"EV6 (21264)")
|
||||
UNAME_MACHINE="alphaev6" ;;
|
||||
"EV6.7 (21264A)")
|
||||
UNAME_MACHINE="alphaev67" ;;
|
||||
"EV6.8CB (21264C)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8AL (21264B)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.8CX (21264D)")
|
||||
UNAME_MACHINE="alphaev68" ;;
|
||||
"EV6.9A (21264/EV69A)")
|
||||
UNAME_MACHINE="alphaev69" ;;
|
||||
"EV7 (21364)")
|
||||
UNAME_MACHINE="alphaev7" ;;
|
||||
"EV7.9 (21364A)")
|
||||
UNAME_MACHINE="alphaev79" ;;
|
||||
esac
|
||||
# A Pn.n version is a patched version.
|
||||
# A Vn.n version is a released version.
|
||||
# A Tn.n version is a released field test version.
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
eval $set_cc_for_build
|
||||
cat <<EOF >$dummy.s
|
||||
.data
|
||||
\$Lformat:
|
||||
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
|
||||
|
||||
.text
|
||||
.globl main
|
||||
.align 4
|
||||
.ent main
|
||||
main:
|
||||
.frame \$30,16,\$26,0
|
||||
ldgp \$29,0(\$27)
|
||||
.prologue 1
|
||||
.long 0x47e03d80 # implver \$0
|
||||
lda \$2,-1
|
||||
.long 0x47e20c21 # amask \$2,\$1
|
||||
lda \$16,\$Lformat
|
||||
mov \$0,\$17
|
||||
not \$1,\$18
|
||||
jsr \$26,printf
|
||||
ldgp \$29,0(\$26)
|
||||
mov 0,\$16
|
||||
jsr \$26,exit
|
||||
.end main
|
||||
EOF
|
||||
$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
|
||||
if test "$?" = 0 ; then
|
||||
case `$dummy` in
|
||||
0-0)
|
||||
UNAME_MACHINE="alpha"
|
||||
;;
|
||||
1-0)
|
||||
UNAME_MACHINE="alphaev5"
|
||||
;;
|
||||
1-1)
|
||||
UNAME_MACHINE="alphaev56"
|
||||
;;
|
||||
1-101)
|
||||
UNAME_MACHINE="alphapca56"
|
||||
;;
|
||||
2-303)
|
||||
UNAME_MACHINE="alphaev6"
|
||||
;;
|
||||
2-307)
|
||||
UNAME_MACHINE="alphaev67"
|
||||
;;
|
||||
2-1307)
|
||||
UNAME_MACHINE="alphaev68"
|
||||
;;
|
||||
3-1307)
|
||||
UNAME_MACHINE="alphaev7"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit 0 ;;
|
||||
Alpha*:OpenVMS:*:*)
|
||||
echo alpha-hp-vms
|
||||
exit 0 ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
|
@ -324,6 +331,9 @@ EOF
|
|||
*:OS/390:*:*)
|
||||
echo i370-ibm-openedition
|
||||
exit 0 ;;
|
||||
*:OS400:*:*)
|
||||
echo powerpc-ibm-os400
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
|
@ -341,6 +351,9 @@ EOF
|
|||
NILE*:*:*:dcosx)
|
||||
echo pyramid-pyramid-svr4
|
||||
exit 0 ;;
|
||||
DRS?6000:unix:4.0:6*)
|
||||
echo sparc-icl-nx6
|
||||
exit 0 ;;
|
||||
DRS?6000:UNIX_SV:4.2*:7*)
|
||||
case `/usr/bin/uname -p` in
|
||||
sparc) echo sparc-icl-nx7 && exit 0 ;;
|
||||
|
@ -413,6 +426,9 @@ EOF
|
|||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
m68k:machten:*:*)
|
||||
echo m68k-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -748,7 +764,7 @@ EOF
|
|||
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
*:UNICOS/mp:*:*)
|
||||
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit 0 ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
|
@ -756,6 +772,11 @@ EOF
|
|||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
5000:UNIX_System_V:4.*:*)
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit 0 ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -777,7 +798,10 @@ EOF
|
|||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
# GNU/KFreeBSD systems have a "k" prefix to indicate we are using
|
||||
# FreeBSD's kernel, but not the complete OS.
|
||||
case ${LIBC} in gnu) kernel_only='k' ;; esac
|
||||
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
|
||||
exit 0 ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
|
@ -788,8 +812,8 @@ EOF
|
|||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit 0 ;;
|
||||
x86:Interix*:3*)
|
||||
echo i586-pc-interix3
|
||||
x86:Interix*:[34]*)
|
||||
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
|
||||
exit 0 ;;
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
|
@ -810,17 +834,28 @@ EOF
|
|||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
exit 0 ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit 0 ;;
|
||||
arm*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-gnu
|
||||
exit 0 ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
|
@ -896,6 +931,9 @@ EOF
|
|||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
exit 0 ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit 0 ;;
|
||||
|
@ -953,6 +991,9 @@ EOF
|
|||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
|
||||
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
|
||||
|
@ -983,6 +1024,9 @@ EOF
|
|||
i*86:atheos:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-atheos
|
||||
exit 0 ;;
|
||||
i*86:syllable:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-syllable
|
||||
exit 0 ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
|
@ -1054,7 +1098,7 @@ EOF
|
|||
exit 0 ;;
|
||||
M68*:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0)
|
||||
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
|
||||
OS_REL=''
|
||||
test -r /etc/.relid \
|
||||
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
|
||||
|
@ -1169,7 +1213,7 @@ EOF
|
|||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit 0 ;;
|
||||
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
echo nsr-tandem-nsk${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:NonStop-UX:*:*)
|
||||
|
@ -1210,6 +1254,12 @@ EOF
|
|||
*:ITS:*:*)
|
||||
echo pdp10-unknown-its
|
||||
exit 0 ;;
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:DragonFly:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
|
|
128
reactos/lib/freetype/builds/unix/config.sub
vendored
128
reactos/lib/freetype/builds/unix/config.sub
vendored
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2003-01-03'
|
||||
timestamp='2004-03-12'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
|
@ -118,7 +118,8 @@ esac
|
|||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
|
||||
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
|
@ -228,14 +229,15 @@ case $basic_machine in
|
|||
| a29k \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
|
||||
| clipper \
|
||||
| c4x | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k \
|
||||
| m32r | m68000 | m68k | m88k | mcore \
|
||||
| ip2k | iq2000 \
|
||||
| m32r | m32rle | m68000 | m68k | m88k | mcore \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
|
@ -247,6 +249,7 @@ case $basic_machine in
|
|||
| mipsisa32 | mipsisa32el \
|
||||
| mipsisa32r2 | mipsisa32r2el \
|
||||
| mipsisa64 | mipsisa64el \
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipstx39 | mipstx39el \
|
||||
|
@ -257,11 +260,11 @@ case $basic_machine in
|
|||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
|
||||
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
|
||||
| strongarm \
|
||||
| tahoe | thumb | tic80 | tron \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xscale | xstormy16 | xtensa \
|
||||
|
@ -296,7 +299,7 @@ case $basic_machine in
|
|||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* \
|
||||
| bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
|
@ -304,8 +307,8 @@ case $basic_machine in
|
|||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* \
|
||||
| m32r-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | mcore-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
|
@ -319,6 +322,7 @@ case $basic_machine in
|
|||
| mipsisa32-* | mipsisa32el-* \
|
||||
| mipsisa32r2-* | mipsisa32r2el-* \
|
||||
| mipsisa64-* | mipsisa64el-* \
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
|
@ -329,11 +333,13 @@ case $basic_machine in
|
|||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
|
||||
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
|
||||
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
|
||||
|
@ -357,6 +363,9 @@ case $basic_machine in
|
|||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
basic_machine=m68010-adobe
|
||||
os=-scout
|
||||
|
@ -371,6 +380,12 @@ case $basic_machine in
|
|||
basic_machine=a29k-none
|
||||
os=-bsd
|
||||
;;
|
||||
amd64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
amd64-*)
|
||||
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
amdahl)
|
||||
basic_machine=580-amdahl
|
||||
os=-sysv
|
||||
|
@ -430,12 +445,20 @@ case $basic_machine in
|
|||
basic_machine=j90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cr16c)
|
||||
basic_machine=cr16c-unknown
|
||||
os=-elf
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
cris | cris-* | etrax*)
|
||||
basic_machine=cris-axis
|
||||
;;
|
||||
crx)
|
||||
basic_machine=crx-unknown
|
||||
os=-elf
|
||||
;;
|
||||
da30 | da30-*)
|
||||
basic_machine=m68k-da30
|
||||
;;
|
||||
|
@ -735,6 +758,10 @@ case $basic_machine in
|
|||
basic_machine=or32-unknown
|
||||
os=-coff
|
||||
;;
|
||||
os400)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-os400
|
||||
;;
|
||||
OSE68000 | ose68000)
|
||||
basic_machine=m68000-ericsson
|
||||
os=-ose
|
||||
|
@ -766,18 +793,24 @@ case $basic_machine in
|
|||
pentiumpro | p6 | 6x86 | athlon | athlon_*)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
pentiumii | pentium2 | pentiumiii | pentium3)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentium4)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumpro-* | p6-* | 6x86-* | athlon-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentiumii-* | pentium2-*)
|
||||
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pentium4-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
;;
|
||||
|
@ -836,6 +869,10 @@ case $basic_machine in
|
|||
sb1el)
|
||||
basic_machine=mipsisa64sb1el-unknown
|
||||
;;
|
||||
sei)
|
||||
basic_machine=mips-sei
|
||||
os=-seiux
|
||||
;;
|
||||
sequent)
|
||||
basic_machine=i386-sequent
|
||||
;;
|
||||
|
@ -843,6 +880,9 @@ case $basic_machine in
|
|||
basic_machine=sh-hitachi
|
||||
os=-hms
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparclite-wrs | simso-wrs)
|
||||
basic_machine=sparclite-wrs
|
||||
os=-vxworks
|
||||
|
@ -917,14 +957,18 @@ case $basic_machine in
|
|||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic4x | c4x*)
|
||||
basic_machine=tic4x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
|
@ -938,6 +982,10 @@ case $basic_machine in
|
|||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
tpf)
|
||||
basic_machine=s390x-ibm
|
||||
os=-tpf
|
||||
;;
|
||||
udi29k)
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
|
@ -1027,13 +1075,13 @@ case $basic_machine in
|
|||
we32k)
|
||||
basic_machine=we32k-att
|
||||
;;
|
||||
sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
|
||||
sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
|
||||
basic_machine=sh-unknown
|
||||
;;
|
||||
sh64)
|
||||
basic_machine=sh64-unknown
|
||||
;;
|
||||
sparc | sparcv9 | sparcv9b)
|
||||
sparc | sparcv8 | sparcv9 | sparcv9b)
|
||||
basic_machine=sparc-sun
|
||||
;;
|
||||
cydra)
|
||||
|
@ -1106,19 +1154,20 @@ case $os in
|
|||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -microbsd*)
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
@ -1142,6 +1191,9 @@ case $os in
|
|||
-mac*)
|
||||
os=`echo $os | sed -e 's|mac|macos|'`
|
||||
;;
|
||||
-linux-dietlibc)
|
||||
os=-linux-dietlibc
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
|
@ -1154,6 +1206,9 @@ case $os in
|
|||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince*)
|
||||
os=-wince
|
||||
;;
|
||||
|
@ -1175,6 +1230,9 @@ case $os in
|
|||
-atheos*)
|
||||
os=-atheos
|
||||
;;
|
||||
-syllable*)
|
||||
os=-syllable
|
||||
;;
|
||||
-386bsd)
|
||||
os=-bsd
|
||||
;;
|
||||
|
@ -1197,6 +1255,9 @@ case $os in
|
|||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
os=-sysv3
|
||||
;;
|
||||
|
@ -1227,6 +1288,12 @@ case $os in
|
|||
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
|
||||
os=-mint
|
||||
;;
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
|
@ -1258,6 +1325,9 @@ case $basic_machine in
|
|||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
os=-tops20
|
||||
|
@ -1436,9 +1506,15 @@ case $basic_machine in
|
|||
-mvs* | -opened*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-os400*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-tpf*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-vxsim* | -vxworks* | -windiss*)
|
||||
vendor=wrs
|
||||
;;
|
||||
|
|
18397
reactos/lib/freetype/builds/unix/configure
vendored
18397
reactos/lib/freetype/builds/unix/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,91 +1,121 @@
|
|||
dnl This file is part of the FreeType project.
|
||||
dnl
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
# This file is part of the FreeType project.
|
||||
#
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([ftconfig.in])
|
||||
|
||||
dnl configuration file -- stay in 8.3 limit
|
||||
AC_CONFIG_HEADER(ftconfig.h:ftconfig.in)
|
||||
|
||||
dnl Don't forget to update VERSION.DLL!
|
||||
version_info='9:4:3'
|
||||
AC_SUBST(version_info)
|
||||
# Don't forget to update docs/VERSION.DLL!
|
||||
|
||||
version_info='9:6:3'
|
||||
AC_SUBST([version_info])
|
||||
ft_version=`echo $version_info | tr : .`
|
||||
AC_SUBST(ft_version)
|
||||
AC_SUBST([ft_version])
|
||||
|
||||
dnl checks for system type
|
||||
AC_CANONICAL_TARGET([])
|
||||
|
||||
dnl checks for programs
|
||||
# checks for system type
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
|
||||
# checks for programs
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
|
||||
dnl get Compiler flags right.
|
||||
|
||||
# get compiler flags right
|
||||
|
||||
if test "x$CC" = xgcc; then
|
||||
XX_CFLAGS="-Wall"
|
||||
XX_ANSIFLAGS="-pedantic -ansi"
|
||||
else
|
||||
case "$host" in
|
||||
*-dec-osf*)
|
||||
CFLAGS=
|
||||
XX_CFLAGS="-std1 -g3"
|
||||
XX_ANSIFLAGS=
|
||||
;;
|
||||
*)
|
||||
XX_CFLAGS=
|
||||
XX_ANSIFLAGS=
|
||||
;;
|
||||
*-dec-osf*)
|
||||
CFLAGS=
|
||||
XX_CFLAGS="-std1 -g3"
|
||||
XX_ANSIFLAGS=
|
||||
;;
|
||||
*)
|
||||
XX_CFLAGS=
|
||||
XX_ANSIFLAGS=
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_SUBST(XX_CFLAGS)
|
||||
AC_SUBST(XX_ANSIFLAGS)
|
||||
AC_SUBST([XX_CFLAGS])
|
||||
AC_SUBST([XX_ANSIFLAGS])
|
||||
|
||||
AC_CHECK_PROG(RMF, rm, rm -f)
|
||||
AC_CHECK_PROG(RMDIR, rmdir, rmdir)
|
||||
|
||||
dnl Since this file will be finally moved to another directory we make
|
||||
dnl the path of the install script absolute. This small code snippet has
|
||||
dnl been taken from automake's `ylwrap' script.
|
||||
# auxiliary programs
|
||||
|
||||
AC_CHECK_PROG([RMF], [rm], [rm -f])
|
||||
AC_CHECK_PROG([RMDIR], [rmdir], [rmdir])
|
||||
|
||||
|
||||
# Since this file will be finally moved to another directory we make
|
||||
# the path of the install script absolute. This small code snippet has
|
||||
# been taken from automake's `ylwrap' script.
|
||||
|
||||
AC_PROG_INSTALL
|
||||
case "$INSTALL" in
|
||||
/*)
|
||||
;;
|
||||
*/*)
|
||||
INSTALL="`pwd`/$INSTALL" ;;
|
||||
/*)
|
||||
;;
|
||||
*/*)
|
||||
INSTALL="`pwd`/$INSTALL" ;;
|
||||
esac
|
||||
|
||||
dnl checks for header files
|
||||
|
||||
# checks for header files
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h unistd.h)
|
||||
AC_CHECK_HEADERS([fcntl.h unistd.h])
|
||||
|
||||
|
||||
# checks for typedefs, structures, and compiler characteristics
|
||||
|
||||
dnl checks for typedefs, structures, and compiler characteristics
|
||||
AC_C_CONST
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF([int])
|
||||
AC_CHECK_SIZEOF([long])
|
||||
|
||||
dnl checks for library functions
|
||||
|
||||
dnl Here we check whether we can use our mmap file component.
|
||||
# checks for library functions
|
||||
|
||||
# Here we check whether we can use our mmap file component.
|
||||
|
||||
AC_FUNC_MMAP
|
||||
if test "$ac_cv_func_mmap_fixed_mapped" != yes; then
|
||||
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
|
||||
else
|
||||
FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
|
||||
|
||||
FT_MUNMAP_DECL
|
||||
AC_CHECK_DECLS([munmap],
|
||||
[],
|
||||
[],
|
||||
[
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/mman.h>
|
||||
|
||||
])
|
||||
|
||||
FT_MUNMAP_PARAM
|
||||
fi
|
||||
AC_SUBST(FTSYS_SRC)
|
||||
AC_SUBST([FTSYS_SRC])
|
||||
|
||||
AC_CHECK_FUNCS(memcpy memmove)
|
||||
AC_CHECK_FUNCS([memcpy memmove])
|
||||
|
||||
dnl Check for system zlib
|
||||
AC_ARG_WITH(zlib,
|
||||
[ --without-zlib use internal zlib instead of system-wide])
|
||||
|
||||
# Check for system zlib
|
||||
|
||||
AC_ARG_WITH([zlib],
|
||||
dnl don't quote AS_HELP_STRING!
|
||||
AS_HELP_STRING([--without-zlib],
|
||||
[use internal zlib instead of system-wide]))
|
||||
if test x$with_zlib != xno && test -z "$LIBZ"; then
|
||||
AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h, LIBZ='-lz')])
|
||||
AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])])
|
||||
fi
|
||||
if test x$with_zlib != xno && test -n "$LIBZ"; then
|
||||
CFLAGS="$CFLAGS -DFT_CONFIG_OPTION_SYSTEM_ZLIB"
|
||||
|
@ -93,36 +123,56 @@ if test x$with_zlib != xno && test -n "$LIBZ"; then
|
|||
SYSTEM_ZLIB=yes
|
||||
fi
|
||||
|
||||
dnl Whether to use Mac OS resource-based fonts or not
|
||||
AC_ARG_WITH(old-mac-fonts,
|
||||
[ --with-old-mac-fonts allow Mac resource-based fonts to be used])
|
||||
|
||||
# Whether to use Mac OS resource-based fonts or not
|
||||
|
||||
AC_ARG_WITH([old-mac-fonts],
|
||||
dnl don't quote AS_HELP_STRING!
|
||||
AS_HELP_STRING([--with-old-mac-fonts],
|
||||
[allow Mac resource-based fonts to be used]))
|
||||
if test x$with_old_mac_fonts = xyes; then
|
||||
CFLAGS="$CFLAGS -DTARGET_API_MAC_CARBON"
|
||||
LDFLAGS="$LDFLAGS -Xlinker -framework -Xlinker CoreServices \
|
||||
-Xlinker -framework -Xlinker ApplicationServices"
|
||||
else
|
||||
CFLAGS="$CFLAGS -DDARWIN_NO_CARBON"
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBZ)
|
||||
AC_SUBST(CFLAGS)
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(SYSTEM_ZLIB)
|
||||
|
||||
AC_SUBST([LIBZ])
|
||||
AC_SUBST([CFLAGS])
|
||||
AC_SUBST([LDFLAGS])
|
||||
AC_SUBST([SYSTEM_ZLIB])
|
||||
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
# urgh -- these are internal libtool variables...
|
||||
AC_SUBST([enable_shared])
|
||||
AC_SUBST([hardcode_libdir_flag_spec])
|
||||
AC_SUBST([wl])
|
||||
|
||||
dnl create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
||||
dnl and 'builds/unix/unix-cc.mk' that will be used by the build system
|
||||
dnl
|
||||
|
||||
# configuration file -- stay in 8.3 limit
|
||||
#
|
||||
# since #undef doesn't survive in configuration header files we replace
|
||||
# `/undef' with `#undef' after creating the output file
|
||||
|
||||
AC_CONFIG_HEADERS([ftconfig.h:ftconfig.in],
|
||||
[mv ftconfig.h ftconfig.tmp
|
||||
sed 's|/undef|#undef|' < ftconfig.tmp > ftconfig.h
|
||||
rm ftconfig.tmp])
|
||||
|
||||
# create the Unix-specific sub-Makefiles `builds/unix/unix-def.mk'
|
||||
# and 'builds/unix/unix-cc.mk' that will be used by the build system
|
||||
#
|
||||
AC_CONFIG_FILES([unix-cc.mk:unix-cc.in
|
||||
unix-def.mk:unix-def.in
|
||||
freetype-config
|
||||
freetype2.pc:freetype2.in])
|
||||
|
||||
dnl re-generate the Jamfile to use libtool now
|
||||
dnl
|
||||
dnl AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in])
|
||||
# re-generate the Jamfile to use libtool now
|
||||
#
|
||||
# AC_CONFIG_FILES([../../Jamfile:../../Jamfile.in])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
dnl end of configure.ac
|
||||
# end of configure.ac
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002, 2003 by
|
||||
# Copyright 1996-2000, 2002, 2003, 2004 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
@ -66,7 +66,7 @@ ifeq ($(PLATFORM),unix)
|
|||
# platform).
|
||||
#
|
||||
CONFIG_FILE := unix.mk
|
||||
setup: unix-def.mk
|
||||
setup: $(BUILD_DIR)/unix-def.mk
|
||||
unix: setup
|
||||
.PHONY: unix
|
||||
endif
|
||||
|
@ -77,10 +77,10 @@ ifeq ($(PLATFORM),unix)
|
|||
have_mk := $(strip $(wildcard $(OBJ_DIR)/Makefile))
|
||||
ifneq ($(have_mk),)
|
||||
# we are building FT2 not in the src tree
|
||||
unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
|
||||
$(BUILD_DIR)/unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
|
||||
$(TOP_DIR)/builds/unix/configure $(CFG)
|
||||
else
|
||||
unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
|
||||
$(BUILD_DIR)/unix-def.mk: $(TOP_DIR)/builds/unix/unix-def.in
|
||||
cd builds/unix; ./configure $(CFG)
|
||||
endif
|
||||
|
||||
|
|
|
@ -2,18 +2,31 @@
|
|||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
exec_prefix_set=no
|
||||
includedir=@includedir@
|
||||
libdir=@libdir@
|
||||
enable_shared=@enable_shared@
|
||||
wl=@wl@
|
||||
hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOF
|
||||
Usage: freetype-config [OPTIONS] [LIBRARIES]
|
||||
Usage: freetype-config [OPTION]...
|
||||
Get FreeType compilation and linking information.
|
||||
|
||||
Options:
|
||||
[--prefix[=DIR]]
|
||||
[--exec-prefix[=DIR]]
|
||||
[--version]
|
||||
[--libs]
|
||||
[--libtool]
|
||||
[--cflags]
|
||||
--prefix display \`--prefix' value used for building the
|
||||
FreeType library
|
||||
--prefix=PREFIX override \`--prefix' value with PREFIX
|
||||
--exec-prefix display \`--exec-prefix' value used for building
|
||||
the FreeType library
|
||||
--exec-prefix=EPREFIX override \`--exec-prefix' value with EPREFIX
|
||||
--version display libtool version of the FreeType library
|
||||
--libs display flags for linking with the FreeType library
|
||||
--libtool display library name for linking with libtool
|
||||
--cflags display flags for compiling with the FreeType
|
||||
library
|
||||
EOF
|
||||
exit $1
|
||||
}
|
||||
|
@ -24,8 +37,12 @@ fi
|
|||
|
||||
while test $# -gt 0 ; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
-*=*)
|
||||
optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
|
||||
;;
|
||||
*)
|
||||
optarg=
|
||||
;;
|
||||
esac
|
||||
|
||||
case $1 in
|
||||
|
@ -65,40 +82,53 @@ while test $# -gt 0 ; do
|
|||
done
|
||||
|
||||
if test "$local_prefix" = "yes" ; then
|
||||
if test "$exec_prefix_set" != "yes" ; then
|
||||
exec_prefix=$prefix
|
||||
fi
|
||||
if test "$exec_prefix_set" != "yes" ; then
|
||||
exec_prefix=$prefix
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$echo_prefix" = "yes" ; then
|
||||
echo $prefix
|
||||
echo $prefix
|
||||
fi
|
||||
|
||||
if test "$echo_exec_prefix" = "yes" ; then
|
||||
echo $exec_prefix
|
||||
echo $exec_prefix
|
||||
fi
|
||||
|
||||
if test "$exec_prefix_set" = "yes" ; then
|
||||
libdir=$exec_prefix/lib
|
||||
else
|
||||
if test "$local_prefix" = "yes" ; then
|
||||
includedir=$prefix/include
|
||||
libdir=$prefix/lib
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$echo_cflags" = "yes" ; then
|
||||
cflags="-I@includedir@/freetype2"
|
||||
if test "@includedir@" != "/usr/include" ; then
|
||||
echo $cflags -I@includedir@
|
||||
else
|
||||
echo $cflags
|
||||
fi
|
||||
cflags="-I$includedir/freetype2"
|
||||
if test "$includedir" != "/usr/include" ; then
|
||||
echo $cflags -I$includedir
|
||||
else
|
||||
echo $cflags
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$echo_libs" = "yes" ; then
|
||||
libs="-lfreetype @LIBZ@"
|
||||
if test "@libdir@" != "/usr/lib" ; then
|
||||
echo -L@libdir@ $libs
|
||||
else
|
||||
echo $libs
|
||||
fi
|
||||
rpath=
|
||||
if test "$enable_shared" = "yes" ; then
|
||||
eval "rpath=\"$hardcode_libdir_flag_spec\""
|
||||
fi
|
||||
libs="-lfreetype @LIBZ@"
|
||||
if test "$libdir" != "/usr/lib" ; then
|
||||
echo -L$libdir $rpath $libs
|
||||
else
|
||||
echo $libs
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$echo_libtool" = "yes" ; then
|
||||
convlib="libfreetype.la"
|
||||
echo @libdir@/$convlib
|
||||
convlib="libfreetype.la"
|
||||
echo $libdir/$convlib
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
|
|
@ -1,88 +1,104 @@
|
|||
# Configure paths for FreeType2
|
||||
# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
|
||||
#
|
||||
# serial 2
|
||||
|
||||
dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS
|
||||
dnl
|
||||
AC_DEFUN(AC_CHECK_FT2,
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the freetype-config script
|
||||
dnl
|
||||
AC_ARG_WITH(ft-prefix,
|
||||
[ --with-ft-prefix=PREFIX
|
||||
Prefix where FreeType is installed (optional)],
|
||||
ft_config_prefix="$withval", ft_config_prefix="")
|
||||
AC_ARG_WITH(ft-exec-prefix,
|
||||
[ --with-ft-exec-prefix=PREFIX
|
||||
Exec prefix where FreeType is installed (optional)],
|
||||
ft_config_exec_prefix="$withval", ft_config_exec_prefix="")
|
||||
AC_ARG_ENABLE(freetypetest,
|
||||
[ --disable-freetypetest Do not try to compile and run
|
||||
a test FreeType program],
|
||||
[], enable_fttest=yes)
|
||||
# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
|
||||
# MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
|
||||
# FreeType 2.0.4).
|
||||
#
|
||||
AC_DEFUN([AC_CHECK_FT2],
|
||||
[# Get the cflags and libraries from the freetype-config script
|
||||
#
|
||||
AC_ARG_WITH([ft-prefix],
|
||||
dnl don't quote AS_HELP_STRING!
|
||||
AS_HELP_STRING([--with-ft-prefix=PREFIX],
|
||||
[Prefix where FreeType is installed (optional)]),
|
||||
[ft_config_prefix="$withval"],
|
||||
[ft_config_prefix=""])
|
||||
|
||||
if test x$ft_config_exec_prefix != x ; then
|
||||
ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
|
||||
if test x${FT2_CONFIG+set} != xset ; then
|
||||
FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
|
||||
fi
|
||||
fi
|
||||
if test x$ft_config_prefix != x ; then
|
||||
ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
|
||||
if test x${FT2_CONFIG+set} != xset ; then
|
||||
FT2_CONFIG=$ft_config_prefix/bin/freetype-config
|
||||
fi
|
||||
fi
|
||||
AC_PATH_PROG(FT2_CONFIG, freetype-config, no)
|
||||
AC_ARG_WITH([ft-exec-prefix],
|
||||
dnl don't quote AS_HELP_STRING!
|
||||
AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
|
||||
[Exec prefix where FreeType is installed (optional)]),
|
||||
[ft_config_exec_prefix="$withval"],
|
||||
[ft_config_exec_prefix=""])
|
||||
|
||||
AC_ARG_ENABLE([freetypetest],
|
||||
dnl don't quote AS_HELP_STRING!
|
||||
AS_HELP_STRING([--disable-freetypetest],
|
||||
[Do not try to compile and run a test FreeType program]),
|
||||
[],
|
||||
[enable_fttest=yes])
|
||||
|
||||
if test x$ft_config_exec_prefix != x ; then
|
||||
ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
|
||||
if test x${FT2_CONFIG+set} != xset ; then
|
||||
FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$ft_config_prefix != x ; then
|
||||
ft_config_args="$ft_config_args --prefix=$ft_config_prefix"
|
||||
if test x${FT2_CONFIG+set} != xset ; then
|
||||
FT2_CONFIG=$ft_config_prefix/bin/freetype-config
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no])
|
||||
|
||||
min_ft_version=m4_if([$1], [], [7.0.1], [$1])
|
||||
AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version])
|
||||
no_ft=""
|
||||
if test "$FT2_CONFIG" = "no" ; then
|
||||
no_ft=yes
|
||||
else
|
||||
FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
|
||||
FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
|
||||
ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
ft_min_major_version=`echo $min_ft_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
ft_min_minor_version=`echo $min_ft_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
ft_min_micro_version=`echo $min_ft_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test x$enable_fttest = xyes ; then
|
||||
ft_config_is_lt=""
|
||||
if test $ft_config_major_version -lt $ft_min_major_version ; then
|
||||
ft_config_is_lt=yes
|
||||
else
|
||||
if test $ft_config_major_version -eq $ft_min_major_version ; then
|
||||
if test $ft_config_minor_version -lt $ft_min_minor_version ; then
|
||||
ft_config_is_lt=yes
|
||||
else
|
||||
if test $ft_config_minor_version -eq $ft_min_minor_version ; then
|
||||
if test $ft_config_micro_version -lt $ft_min_micro_version ; then
|
||||
ft_config_is_lt=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test x$ft_config_is_lt = xyes ; then
|
||||
no_ft=yes
|
||||
else
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $FT2_CFLAGS"
|
||||
LIBS="$FT2_LIBS $LIBS"
|
||||
|
||||
#
|
||||
# Sanity checks for the results of freetype-config to some extent.
|
||||
#
|
||||
AC_RUN_IFELSE([
|
||||
AC_LANG_SOURCE([[
|
||||
|
||||
min_ft_version=ifelse([$1], ,6.1.0,$1)
|
||||
AC_MSG_CHECKING(for FreeType - version >= $min_ft_version)
|
||||
no_ft=""
|
||||
if test "$FT2_CONFIG" = "no" ; then
|
||||
no_ft=yes
|
||||
else
|
||||
FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags`
|
||||
FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs`
|
||||
ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
ft_min_major_version=`echo $min_ft_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
ft_min_minor_version=`echo $min_ft_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
ft_min_micro_version=`echo $min_ft_version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test x$enable_fttest = xyes ; then
|
||||
ft_config_is_lt=""
|
||||
if test $ft_config_major_version -lt $ft_min_major_version ; then
|
||||
ft_config_is_lt=yes
|
||||
else
|
||||
if test $ft_config_major_version -eq $ft_min_major_version ; then
|
||||
if test $ft_config_minor_version -lt $ft_min_minor_version ; then
|
||||
ft_config_is_lt=yes
|
||||
else
|
||||
if test $ft_config_minor_version -eq $ft_min_minor_version ; then
|
||||
if test $ft_config_micro_version -lt $ft_min_micro_version ; then
|
||||
ft_config_is_lt=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test x$ft_config_is_lt = xyes ; then
|
||||
no_ft=yes
|
||||
else
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $FT2_CFLAGS"
|
||||
LIBS="$FT2_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Sanity checks for the results of freetype-config to some extent
|
||||
dnl
|
||||
AC_TRY_RUN([
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include <stdio.h>
|
||||
|
@ -92,7 +108,7 @@ int
|
|||
main()
|
||||
{
|
||||
FT_Library library;
|
||||
FT_Error error;
|
||||
FT_Error error;
|
||||
|
||||
error = FT_Init_FreeType(&library);
|
||||
|
||||
|
@ -104,40 +120,59 @@ main()
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi # test $ft_config_version -lt $ft_min_version
|
||||
fi # test x$enable_fttest = xyes
|
||||
fi # test "$FT2_CONFIG" = "no"
|
||||
if test x$no_ft = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$FT2_CONFIG" = "no" ; then
|
||||
echo "*** The freetype-config script installed by FreeType 2 could not be found."
|
||||
echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the FT2_CONFIG environment variable to the"
|
||||
echo "*** full path to freetype-config."
|
||||
|
||||
]])
|
||||
],
|
||||
[],
|
||||
[no_ft=yes],
|
||||
[echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"])
|
||||
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi # test $ft_config_version -lt $ft_min_version
|
||||
fi # test x$enable_fttest = xyes
|
||||
fi # test "$FT2_CONFIG" = "no"
|
||||
|
||||
if test x$no_ft = x ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
m4_if([$2], [], [:], [$2])
|
||||
else
|
||||
if test x$ft_config_is_lt = xyes ; then
|
||||
echo "*** Your installed version of the FreeType 2 library is too old."
|
||||
echo "*** If you have different versions of FreeType 2, make sure that"
|
||||
echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix"
|
||||
echo "*** are used, or set the FT2_CONFIG environment variable to the"
|
||||
echo "*** full path to freetype-config."
|
||||
AC_MSG_RESULT([no])
|
||||
if test "$FT2_CONFIG" = "no" ; then
|
||||
AC_MSG_WARN([
|
||||
|
||||
The freetype-config script installed by FreeType 2 could not be found.
|
||||
If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in
|
||||
your path, or set the FT2_CONFIG environment variable to the
|
||||
full path to freetype-config.
|
||||
])
|
||||
else
|
||||
echo "*** The FreeType test program failed to run. If your system uses"
|
||||
echo "*** shared libraries and they are installed outside the normal"
|
||||
echo "*** system library path, make sure the variable LD_LIBRARY_PATH"
|
||||
echo "*** (or whatever is appropiate for your system) is correctly set."
|
||||
if test x$ft_config_is_lt = xyes ; then
|
||||
AC_MSG_WARN([
|
||||
|
||||
Your installed version of the FreeType 2 library is too old.
|
||||
If you have different versions of FreeType 2, make sure that
|
||||
correct values for --with-ft-prefix or --with-ft-exec-prefix
|
||||
are used, or set the FT2_CONFIG environment variable to the
|
||||
full path to freetype-config.
|
||||
])
|
||||
else
|
||||
AC_MSG_WARN([
|
||||
|
||||
The FreeType test program failed to run. If your system uses
|
||||
shared libraries and they are installed outside the normal
|
||||
system library path, make sure the variable LD_LIBRARY_PATH
|
||||
(or whatever is appropiate for your system) is correctly set.
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
FT2_CFLAGS=""
|
||||
FT2_LIBS=""
|
||||
m4_if([$3], [], [:], [$3])
|
||||
fi
|
||||
FT2_CFLAGS=""
|
||||
FT2_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(FT2_CFLAGS)
|
||||
AC_SUBST(FT2_LIBS)
|
||||
])
|
||||
|
||||
AC_SUBST([FT2_CFLAGS])
|
||||
AC_SUBST([FT2_LIBS])])
|
||||
|
||||
# end of freetype2.m4
|
||||
|
|
|
@ -1,31 +1,23 @@
|
|||
## FreeType specific autoconf tests
|
||||
|
||||
# serial 1 FT_MUNMAP_DECL
|
||||
# serial 2
|
||||
|
||||
AC_DEFUN(FT_MUNMAP_DECL,
|
||||
[AC_MSG_CHECKING([whether munmap must be declared])
|
||||
AC_CACHE_VAL(ft_cv_munmap_decl,
|
||||
[AC_TRY_COMPILE([
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/mman.h>],
|
||||
[char *(*pfn) = (char *(*))munmap],
|
||||
ft_cv_munmap_decl=no,
|
||||
ft_cv_munmap_decl=yes)])
|
||||
AC_MSG_RESULT($ft_cv_munmap_decl)
|
||||
if test $ft_cv_munmap_decl = yes; then
|
||||
AC_DEFINE(NEED_MUNMAP_DECL,,
|
||||
[Define to 1 if munmap() is not defined in <sys/mman.h>])
|
||||
fi])
|
||||
AC_DEFUN([FT_MUNMAP_PARAM],
|
||||
[AC_MSG_CHECKING([for munmap's first parameter type])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_SOURCE([[
|
||||
|
||||
AC_DEFUN(FT_MUNMAP_PARAM,
|
||||
[AC_MSG_CHECKING([for munmap's first parameter type])
|
||||
AC_TRY_COMPILE([
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
int munmap(void *, size_t);],,
|
||||
AC_MSG_RESULT([void *]);AC_DEFINE(MUNMAP_USES_VOIDP,,
|
||||
[Define to 1 if the first argument of munmap is of type void *]),
|
||||
AC_MSG_RESULT([char *]))
|
||||
])
|
||||
int munmap(void *, size_t);
|
||||
|
||||
]])
|
||||
],
|
||||
[AC_MSG_RESULT([void *])
|
||||
AC_DEFINE([MUNMAP_USES_VOIDP],
|
||||
[],
|
||||
[Define to 1 if the first argument of munmap is of type void *])],
|
||||
[AC_MSG_RESULT([char *])])
|
||||
])
|
||||
|
||||
# end of ft-munmap.m4
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -21,14 +21,15 @@
|
|||
/* This is a Unix-specific version of <ft2build.h> that should be used */
|
||||
/* exclusively *after* installation of the library. */
|
||||
/* */
|
||||
/* It assumes that "/usr/local/include/freetype2" (or wathever is */
|
||||
/* returned by the "freetype-config --cflags" command) is in your */
|
||||
/* compilation include path. */
|
||||
/* It assumes that "/usr/local/include/freetype2" (or whatever is */
|
||||
/* returned by the "freetype-config --cflags" or "pkg-config --cflags" */
|
||||
/* command) is in your compilation include path. */
|
||||
/* */
|
||||
/* We don't need to do anything special in this release. However, for */
|
||||
/* FreeType 2.1, the following installation changes will be performed: */
|
||||
/* a future FreeType 2 release, the following installation changes will */
|
||||
/* be performed: */
|
||||
/* */
|
||||
/* - The contents of "freetype-2.1/include/freetype" will be installed */
|
||||
/* - The contents of "freetype-2.x/include/freetype" will be installed */
|
||||
/* to "/usr/local/include/freetype2" instead of */
|
||||
/* "/usr/local/include/freetype2/freetype". */
|
||||
/* */
|
||||
|
@ -39,11 +40,11 @@
|
|||
/* replace all "<freetype/xxx>" with "<freetype2/xxx>". */
|
||||
/* */
|
||||
/* - Adding "/usr/local/include/freetype2" to your compilation include */
|
||||
/* path will not be necessary anymore. The command */
|
||||
/* "freetype-config --cflags" will return an empty string. */
|
||||
/* path will not be necessary anymore. */
|
||||
/* */
|
||||
/* - Client applications which adhere to the new inclusion scheme */
|
||||
/* WILL NOT NEED TO BE MODIFIED to compile with FT 2.1! */
|
||||
/* These changes will be transparent to client applications which use */
|
||||
/* freetype-config (or pkg-config). No modifications will be necessary */
|
||||
/* to compile with the new scheme. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
@ -51,7 +52,7 @@
|
|||
#ifndef __FT2_BUILD_UNIX_H__
|
||||
#define __FT2_BUILD_UNIX_H__
|
||||
|
||||
/* "/usr/local/include/freetype2" must be in your current inclusion path */
|
||||
/* "<prefix>/include/freetype2" must be in your current inclusion path */
|
||||
#include <freetype/config/ftheader.h>
|
||||
|
||||
#endif /* __FT2_BUILD_UNIX_H__ */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* UNIX-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2000, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -57,15 +57,17 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
#define HAVE_UNISTD_H 0
|
||||
#define HAVE_FCNTL_H 0
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
#undef SIZEOF_INT
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
#define SIZEOF_INT 2
|
||||
#define SIZEOF_LONG 2
|
||||
|
||||
#define FT_SIZEOF_INT SIZEOF_INT
|
||||
#define FT_SIZEOF_LONG SIZEOF_LONG
|
||||
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
|
||||
/* Preferred alignment of data */
|
||||
#define FT_ALIGNMENT 8
|
||||
|
@ -89,6 +91,19 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Mac support */
|
||||
/* */
|
||||
/* This is the only necessary change, so it is defined here instead */
|
||||
/* providing a new configuration file. */
|
||||
/* */
|
||||
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
|
||||
( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* IntN types */
|
||||
|
@ -112,31 +127,88 @@ FT_BEGIN_HEADER
|
|||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
|
||||
/* look up an integer type that is at least 32 bits */
|
||||
#if FT_SIZEOF_INT >= 4
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= 4
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit int type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
|
||||
/* FT_LONG64 must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
#define FT_INT64 long
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of __BORLANDC__ in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the "long long" type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
#else
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Many compilers provide the non-ANSI `long long' 64-bit type. You can */
|
||||
/* activate it by defining the FTCALC_USE_LONG_LONG macro in */
|
||||
/* `ftoption.h'. */
|
||||
/* A 64-bit data type will create compilation problems if you compile */
|
||||
/* in strict ANSI mode. To avoid them, we disable their use if */
|
||||
/* __STDC__ is defined. You can however ignore this rule by */
|
||||
/* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
|
||||
/* */
|
||||
/* Note that this will produce many -ansi warnings during library */
|
||||
/* compilation, and that in many cases, the generated code will be */
|
||||
/* neither smaller nor faster! */
|
||||
/* */
|
||||
#ifdef FTCALC_USE_LONG_LONG
|
||||
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long
|
||||
#ifdef __STDC__
|
||||
|
||||
#endif /* FTCALC_USE_LONG_LONG */
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
/* Undefine the 64-bit macros in strict ANSI compilation mode. */
|
||||
/* Since `#undef' doesn't survive in configuration header files */
|
||||
/* we use the postprocessing facility of AC_CONFIG_HEADERS to */
|
||||
/* replace the leading `/' with `#'. */
|
||||
/undef FT_LONG64
|
||||
/undef FT_INT64
|
||||
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
|
||||
|
||||
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
@ -151,7 +223,7 @@ FT_BEGIN_HEADER
|
|||
#define FT_LOCAL_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_LOCAL( x ) extern x
|
||||
#define FT_LOCAL_DEF( x ) extern x
|
||||
#define FT_LOCAL_DEF( x ) x
|
||||
#endif
|
||||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
@ -255,6 +327,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCONFIG_H__ */
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Unix-specific FreeType low-level system interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -67,6 +67,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -182,16 +183,16 @@
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* ft_close_stream */
|
||||
/* ft_close_stream_by_munmap */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The function to close a stream. */
|
||||
/* The function to close a stream which is opened by mmap. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: A pointer to the stream object. */
|
||||
/* */
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_close_stream( FT_Stream stream )
|
||||
ft_close_stream_by_munmap( FT_Stream stream )
|
||||
{
|
||||
munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size );
|
||||
|
||||
|
@ -201,6 +202,28 @@
|
|||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* ft_close_stream_by_free */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The function to close a stream which is created by ft_alloc. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: A pointer to the stream object. */
|
||||
/* */
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_close_stream_by_free( FT_Stream stream )
|
||||
{
|
||||
ft_free( NULL, stream->descriptor.pointer );
|
||||
|
||||
stream->descriptor.pointer = NULL;
|
||||
stream->size = 0;
|
||||
stream->base = 0;
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftobjs.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
@ -252,11 +275,49 @@
|
|||
file,
|
||||
0 );
|
||||
|
||||
if ( (long)stream->base == -1 )
|
||||
if ( (long)stream->base != -1 )
|
||||
stream->close = ft_close_stream_by_munmap;
|
||||
else
|
||||
{
|
||||
ssize_t total_read_count;
|
||||
|
||||
|
||||
FT_ERROR(( "FT_Stream_Open:" ));
|
||||
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
|
||||
goto Fail_Map;
|
||||
|
||||
stream->base = ft_alloc( NULL, stream->size );
|
||||
|
||||
if ( !stream->base )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Open:" ));
|
||||
FT_ERROR(( " could not `alloc' memory\n" ));
|
||||
goto Fail_Map;
|
||||
}
|
||||
|
||||
total_read_count = 0;
|
||||
do {
|
||||
ssize_t read_count;
|
||||
|
||||
|
||||
read_count = read( file,
|
||||
stream->base + total_read_count,
|
||||
stream->size - total_read_count );
|
||||
|
||||
if ( ( read_count == -1 ) )
|
||||
{
|
||||
if ( errno == EINTR )
|
||||
continue;
|
||||
|
||||
FT_ERROR(( "FT_Stream_Open:" ));
|
||||
FT_ERROR(( " error while `read'ing file `%s'\n", filepathname ));
|
||||
goto Fail_Read;
|
||||
}
|
||||
|
||||
total_read_count += read_count;
|
||||
|
||||
} while ( total_read_count != stream->size );
|
||||
|
||||
stream->close = ft_close_stream_by_free;
|
||||
}
|
||||
|
||||
close( file );
|
||||
|
@ -264,8 +325,7 @@
|
|||
stream->descriptor.pointer = stream->base;
|
||||
stream->pathname.pointer = (char*)filepathname;
|
||||
|
||||
stream->close = ft_close_stream;
|
||||
stream->read = 0;
|
||||
stream->read = 0;
|
||||
|
||||
FT_TRACE1(( "FT_Stream_Open:" ));
|
||||
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
|
||||
|
@ -273,6 +333,9 @@
|
|||
|
||||
return FT_Err_Ok;
|
||||
|
||||
Fail_Read:
|
||||
ft_free( NULL, stream->base );
|
||||
|
||||
Fail_Map:
|
||||
close( file );
|
||||
|
||||
|
|
|
@ -1,21 +1,38 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
# This originally came from X11R5 (mit/util/scripts/install.sh).
|
||||
|
||||
scriptversion=2003-01-17.15
|
||||
scriptversion=2004-02-15.20
|
||||
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
# (FSF changes in the public domain.)
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
|
@ -55,7 +72,8 @@ dst=
|
|||
dir_arg=
|
||||
|
||||
usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
|
||||
or: $0 -d DIR1 DIR2...
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 -d DIRECTORIES...
|
||||
|
||||
In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
|
||||
In the second, create the directory path DIR.
|
||||
|
@ -117,144 +135,173 @@ while test -n "$1"; do
|
|||
|
||||
--version) echo "$0 $scriptversion"; exit 0;;
|
||||
|
||||
*) if test -z "$src"; then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
*) # When -d is used, all remaining arguments are directories to create.
|
||||
test -n "$dir_arg" && break
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$src"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
if test -d "$dst"; then
|
||||
instcmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
if test -z "$1"; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# (this part is taken from Noah Friedman's mkinstalldirs script.)
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
test -d "$pathcomp" || $mkdirprog "$pathcomp"
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $instcmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
if test -z "$transformarg"; then
|
||||
dstfile=`basename "$dst"`
|
||||
if test -d "$dst"; then
|
||||
instcmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
dstfile=`basename "$dst" $transformbasename \
|
||||
| sed $transformarg`$transformbasename
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename.
|
||||
test -z "$dstfile" && dstfile=`basename "$dst"`
|
||||
# This sed command emulates the dirname command.
|
||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
rmtmp=$dstdir/#rm.$$#
|
||||
# Make sure that the destination directory exists.
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
$doit $instcmd "$src" "$dsttmp" &&
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS=$oIFS
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||
pathcomp=
|
||||
|
||||
# Now remove or move aside any old file at destination location. We
|
||||
# try this two ways since rm can't unlink itself on some systems and
|
||||
# the destination file might be busy for other reasons. In this case,
|
||||
# the final cleanup might fail but the new file should still install
|
||||
# successfully.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
if test ! -d "$pathcomp"; then
|
||||
$mkdirprog "$pathcomp" || lasterr=$?
|
||||
# mkdir can fail with a `File exist' error in case several
|
||||
# install-sh are creating the directory concurrently. This
|
||||
# is OK.
|
||||
test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; }
|
||||
fi
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $instcmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
if test -z "$transformarg"; then
|
||||
dstfile=`basename "$dst"`
|
||||
else
|
||||
dstfile=`basename "$dst" $transformbasename \
|
||||
| sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename.
|
||||
test -z "$dstfile" && dstfile=`basename "$dst"`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
$doit $instcmd "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||
|
||||
# Now remove or move aside any old file at destination location. We
|
||||
# try this two ways since rm can't unlink itself on some systems and
|
||||
# the destination file might be busy for other reasons. In this case,
|
||||
# the final cleanup might fail but the new file should still install
|
||||
# successfully.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
fi &&
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
fi || { (exit 1); exit; }
|
||||
done
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
{
|
||||
|
|
|
@ -51,6 +51,8 @@ install: $(PROJECT_LIBRARY)
|
|||
done
|
||||
$(INSTALL_DATA) $(BUILD_DIR)/ft2unix.h \
|
||||
$(DESTDIR)$(includedir)/ft2build.h
|
||||
$(INSTALL_DATA) $(BUILD_DIR)/ftconfig.h \
|
||||
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftconfig.h
|
||||
$(INSTALL_SCRIPT) -m 755 $(OBJ_BUILD)/freetype-config \
|
||||
$(DESTDIR)$(bindir)/freetype-config
|
||||
$(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,20 +1,32 @@
|
|||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
|
||||
scriptversion=2004-02-15.20
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
errstatus=0
|
||||
dirmode=""
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage" 1>&2
|
||||
echo "$usage"
|
||||
exit 0
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
|
@ -23,6 +35,10 @@ while test $# -gt 0 ; do
|
|||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 $scriptversion"
|
||||
exit 0
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
|
@ -50,17 +66,37 @@ case $# in
|
|||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p -- . 2>/dev/null; then
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
@ -84,17 +120,17 @@ do
|
|||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
lasterr=""
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
lasterr=""
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -107,5 +143,8 @@ exit $errstatus
|
|||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
||||
# mkinstalldirs ends here
|
||||
|
|
|
@ -70,7 +70,10 @@ T := -o$(space)
|
|||
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
|
||||
# ANSI compliance.
|
||||
#
|
||||
CFLAGS := -c @XX_CFLAGS@ @CPPFLAGS@ @CFLAGS@
|
||||
# We use our own FreeType configuration file.
|
||||
#
|
||||
CFLAGS := -c @XX_CFLAGS@ @CPPFLAGS@ @CFLAGS@ \
|
||||
-DFT_CONFIG_CONFIG_H="<ftconfig.h>"
|
||||
|
||||
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
|
||||
#
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002 by
|
||||
# Copyright 1996-2000, 2002, 2004 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
@ -21,8 +21,6 @@ TOP_DIR := $(shell cd $(TOP_DIR); pwd)
|
|||
DELETE := @RMF@
|
||||
DELDIR := @RMDIR@
|
||||
SEP := /
|
||||
BUILD_DIR := $(TOP_DIR)/builds/unix
|
||||
PLATFORM := unix
|
||||
|
||||
# this is used for `make distclean' and `make install'
|
||||
ifndef OBJ_BUILD
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000, 2002 by
|
||||
# Copyright 1996-2000, 2002, 2004 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
@ -12,10 +12,14 @@
|
|||
# indicate that you have read the license and understand and accept it
|
||||
# fully.
|
||||
|
||||
have_mk := $(strip $(wildcard $(TOP_DIR)/builds/unix/unix-def.mk))
|
||||
# We need these declarations here since unix-def.mk is a generated file.
|
||||
BUILD_DIR := $(TOP_DIR)/builds/unix
|
||||
PLATFORM := unix
|
||||
|
||||
have_mk := $(strip $(wildcard $(BUILD_DIR)/unix-def.mk))
|
||||
ifneq ($(have_mk),)
|
||||
include $(TOP_DIR)/builds/unix/unix-def.mk
|
||||
include $(TOP_DIR)/builds/unix/unix-cc.mk
|
||||
include $(BUILD_DIR)/unix-def.mk
|
||||
include $(BUILD_DIR)/unix-cc.mk
|
||||
else
|
||||
# we are building FT2 not in the src tree
|
||||
include $(OBJ_DIR)/unix-def.mk
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* VMS-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -34,8 +34,8 @@
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef FTCONFIG_H
|
||||
#define FTCONFIG_H
|
||||
#ifndef __FTCONFIG_H__
|
||||
#define __FTCONFIG_H__
|
||||
|
||||
|
||||
/* Include the header file containing all developer build options */
|
||||
|
@ -43,6 +43,7 @@
|
|||
#include FT_CONFIG_OPTIONS_H
|
||||
#include FT_CONFIG_STANDARD_LIBRARY_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -66,6 +67,8 @@ FT_BEGIN_HEADER
|
|||
#define FT_SIZEOF_INT 4
|
||||
#define FT_SIZEOF_LONG 4
|
||||
|
||||
#define FT_CHAR_BIT 8
|
||||
|
||||
|
||||
/* Preferred alignment of data */
|
||||
#define FT_ALIGNMENT 8
|
||||
|
@ -89,6 +92,19 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Mac support */
|
||||
/* */
|
||||
/* This is the only necessary change, so it is defined here instead */
|
||||
/* providing a new configuration file. */
|
||||
/* */
|
||||
#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \
|
||||
( defined( __MWERKS__ ) && defined( macintosh ) )
|
||||
#define FT_MACINTOSH 1
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* IntN types */
|
||||
|
@ -112,32 +128,84 @@ FT_BEGIN_HEADER
|
|||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
/* look up an integer type that is at least 32 bits */
|
||||
#if FT_SIZEOF_INT >= 4
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= 4
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* determine whether we have a 64-bit int type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
|
||||
/* FT_LONG64 must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long
|
||||
#define FT_INT64 long
|
||||
|
||||
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __BORLANDC__ ) /* Borland C++ */
|
||||
|
||||
/* XXXX: We should probably check the value of __BORLANDC__ in order */
|
||||
/* to test the compiler version. */
|
||||
|
||||
/* this compiler provides the __int64 type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 __int64
|
||||
|
||||
#elif defined( __WATCOMC__ ) /* Watcom C++ */
|
||||
|
||||
/* Watcom doesn't provide 64-bit data types */
|
||||
|
||||
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#elif defined( __GNUC__ )
|
||||
|
||||
/* GCC provides the "long long" type */
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
#else
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Many compilers provide the non-ANSI `long long' 64-bit type. You can */
|
||||
/* activate it by defining the FTCALC_USE_LONG_LONG macro in */
|
||||
/* `ftoption.h'. */
|
||||
/* A 64-bit data type will create compilation problems if you compile */
|
||||
/* in strict ANSI mode. To avoid them, we disable their use if */
|
||||
/* __STDC__ is defined. You can however ignore this rule by */
|
||||
/* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
|
||||
/* */
|
||||
/* Note that this will produce many -ansi warnings during library */
|
||||
/* compilation, and that in many cases, the generated code will be */
|
||||
/* neither smaller nor faster! */
|
||||
/* */
|
||||
#ifdef FTCALC_USE_LONG_LONG
|
||||
#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||
|
||||
#define FT_LONG64
|
||||
#define FT_INT64 long long
|
||||
#ifdef __STDC__
|
||||
|
||||
#endif /* FTCALC_USE_LONG_LONG */
|
||||
/* undefine the 64-bit macros in strict ANSI compilation mode */
|
||||
#undef FT_LONG64
|
||||
#undef FT_INT64
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
|
||||
|
||||
|
||||
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
|
||||
|
@ -157,6 +225,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
|
||||
|
||||
|
||||
#ifndef FT_BASE
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -167,15 +236,16 @@ FT_BEGIN_HEADER
|
|||
|
||||
#endif /* !FT_BASE */
|
||||
|
||||
#ifndef BASE_DEF
|
||||
|
||||
#ifndef FT_BASE_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define BASE_DEF( x ) extern "C" x
|
||||
#define FT_BASE_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define BASE_DEF( x ) extern x
|
||||
#define FT_BASE_DEF( x ) extern x
|
||||
#endif
|
||||
|
||||
#endif /* !BASE_DEF */
|
||||
#endif /* !FT_BASE_DEF */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT
|
||||
|
@ -188,6 +258,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
#endif /* !FT_EXPORT */
|
||||
|
||||
|
||||
#ifndef FT_EXPORT_DEF
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -209,6 +280,9 @@ FT_BEGIN_HEADER
|
|||
|
||||
#endif /* !FT_EXPORT_VAR */
|
||||
|
||||
/* The following macros are needed to compile the library with a */
|
||||
/* C++ compiler and with 16bit compilers. */
|
||||
/* */
|
||||
|
||||
/* This is special. Within C++, you must specify `extern "C"' for */
|
||||
/* functions which are used via function pointers, and you also */
|
||||
|
@ -216,23 +290,42 @@ FT_BEGIN_HEADER
|
|||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
||||
/* functions which are accessed by (global) function pointers. */
|
||||
/* */
|
||||
/* */
|
||||
/* FT_CALLBACK_DEF is used to _define_ a callback function. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
||||
/* contains pointers to callback functions. */
|
||||
/* */
|
||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
||||
/* that contains pointers to callback functions. */
|
||||
/* */
|
||||
/* */
|
||||
/* Some 16bit compilers have to redefine these macros to insert */
|
||||
/* the infamous `_cdecl' or `__fastcall' declarations. */
|
||||
/* */
|
||||
#ifndef FT_CALLBACK_DEF
|
||||
#ifdef __cplusplus
|
||||
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
|
||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||
#else
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_DEF */
|
||||
|
||||
#define FT_CALLBACK_DEF( x ) static x
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF
|
||||
#ifndef FT_CALLBACK_TABLE
|
||||
#ifdef __cplusplus
|
||||
#define FT_CALLBACK_TABLE extern "C"
|
||||
#define FT_CALLBACK_TABLE_DEF extern "C"
|
||||
#else
|
||||
#define FT_CALLBACK_TABLE extern
|
||||
#define FT_CALLBACK_TABLE_DEF /* nothing */
|
||||
#endif
|
||||
#endif /* FT_CALLBACK_TABLE */
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* FTCONFIG_H */
|
||||
|
||||
#endif /* __FTCONFIG_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -54,7 +54,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "freetype - Win32 Debug"
|
||||
|
||||
|
@ -78,7 +78,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214_D.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218_D.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "freetype - Win32 Debug Multithreaded"
|
||||
|
||||
|
@ -103,7 +103,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"lib\freetype200b8_D.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214MT_D.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218MT_D.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "freetype - Win32 Release Multithreaded"
|
||||
|
||||
|
@ -127,7 +127,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"lib\freetype200b8.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214MT.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218MT.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "freetype - Win32 Release Singlethreaded"
|
||||
|
||||
|
@ -152,7 +152,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206.lib"
|
||||
# ADD LIB32 /out:"..\..\..\objs\freetype214ST.lib"
|
||||
# ADD LIB32 /out:"..\..\..\objs\freetype218ST.lib"
|
||||
# SUBTRACT LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "freetype - Win32 Debug Singlethreaded"
|
||||
|
@ -178,7 +178,7 @@ BSC32=bscmake.exe
|
|||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"..\..\..\objs\freetype206_D.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype214ST_D.lib"
|
||||
# ADD LIB32 /nologo /out:"..\..\..\objs\freetype218ST_D.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
@ -235,6 +235,10 @@ SOURCE=..\..\..\src\gzip\ftgzip.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\lzw\ftlzw.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\base\ftinit.c
|
||||
# SUBTRACT CPP /Fr
|
||||
# End Source File
|
||||
|
|
33
reactos/lib/freetype/builds/win32/visualc/freetype.sln
Normal file
33
reactos/lib/freetype/builds/win32/visualc/freetype.sln
Normal file
|
@ -0,0 +1,33 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Debug Multithreaded = Debug Multithreaded
|
||||
Debug Singlethreaded = Debug Singlethreaded
|
||||
Release = Release
|
||||
Release Multithreaded = Release Multithreaded
|
||||
Release Singlethreaded = Release Singlethreaded
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded.ActiveCfg = Debug Multithreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded.Build.0 = Debug Multithreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded.ActiveCfg = Debug Singlethreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded.Build.0 = Debug Singlethreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded.ActiveCfg = Release Multithreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Multithreaded.Build.0 = Release Multithreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded.ActiveCfg = Release Singlethreaded|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release Singlethreaded.Build.0 = Release Singlethreaded|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
1717
reactos/lib/freetype/builds/win32/visualc/freetype.vcproj
Normal file
1717
reactos/lib/freetype/builds/win32/visualc/freetype.vcproj
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,27 +1,38 @@
|
|||
<html>
|
||||
<header>
|
||||
<title>FreeType 2 Project Files for Visual C++</title>
|
||||
<title>
|
||||
FreeType 2 Project Files for Visual C++ and VS.NET 2003
|
||||
</title>
|
||||
</header>
|
||||
<body>
|
||||
|
||||
<h1>FreeType 2 Project Files for Visual C++</h1>
|
||||
<h1>
|
||||
FreeType 2 Project Files for Visual C++ and VS.NET 2003
|
||||
</h1>
|
||||
|
||||
<p>This directory contains a project file for Visual C++, named
|
||||
<tt>freetype.dsp</tt>. It will compile the following libraries
|
||||
from the FreeType 2.1.4 sources:</p>
|
||||
<p>This directory contains a project files for Visual C++, named
|
||||
<tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>. It
|
||||
will compile the following libraries from the FreeType 2.1.8 sources:</p>
|
||||
|
||||
<ul>
|
||||
<pre>
|
||||
freetype214.lib - release build; single threaded
|
||||
freetype214_D.lib - debug build; single threaded
|
||||
freetype214MT.lib - release build; multi-threaded
|
||||
freetype214MT_D.lib - debug build; multi-threaded
|
||||
</pre>
|
||||
freetype218.lib - release build; single threaded
|
||||
freetype218_D.lib - debug build; single threaded
|
||||
freetype218MT.lib - release build; multi-threaded
|
||||
freetype218MT_D.lib - debug build; multi-threaded</pre>
|
||||
</ul>
|
||||
|
||||
<p>Build directories are placed in the top-level "objs" directory</p>
|
||||
<p>Be sure to extract the files with the Windows (CR+LF) line endings. ZIP
|
||||
archives are already stored this way, so no further step is required. If
|
||||
you use some <tt>.tar.*z</tt> archives, be sure to configure your extracting
|
||||
tool to convert the line endings. For example, with <a
|
||||
href="http://www.winzip.com">WinZip</a>, you should activate the <it>TAR
|
||||
file smart CR/LF Conversion</it> option. Alternatively, you may consider
|
||||
using the <tt>unix2dos</tt> or <tt>u2d</tt> utilities that are floating
|
||||
around, which specifically deal with this particular problem.
|
||||
|
||||
<p>Enjoy :-)</p>
|
||||
<p>Build directories are placed in the top-level <tt>objs</tt>
|
||||
directory.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
12
reactos/lib/freetype/configure
vendored
12
reactos/lib/freetype/configure
vendored
|
@ -5,7 +5,6 @@
|
|||
# This should re-generate the following files:
|
||||
#
|
||||
# config.mk
|
||||
# Jamfile
|
||||
# install
|
||||
#
|
||||
|
||||
|
@ -14,9 +13,14 @@ if test "x$GNUMAKE" = x; then
|
|||
fi
|
||||
|
||||
if test -z "`$GNUMAKE -v 2>/dev/null | grep GNU`"; then
|
||||
echo "Sorry, GNU make is required to build FreeType2." >&2
|
||||
echo "Please try \`GNUMAKE=<GNU make command name> $0'." >&2
|
||||
exit 1
|
||||
if test -z "`$GNUMAKE -v 2>/dev/null | grep makepp`"; then
|
||||
echo "GNU make (>= 3.79.1) or makepp (>= 1.19) is required to build FreeType2." >&2
|
||||
echo "Please try" >&2
|
||||
echo " \`GNUMAKE=<GNU make command name> $0'." >&2
|
||||
echo "or >&2"
|
||||
echo " \`GNUMAKE=\"makepp --norc-substitution\" $0'." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Uh, oh. This is taken from autoconf. They know what they are doing...
|
||||
|
|
|
@ -28,14 +28,14 @@
|
|||
* "ftoption.h"), then invoke Jam as usual.
|
||||
*/
|
||||
|
||||
#ifndef __FT2_BUILD_GENERIC_H__
|
||||
#define __FT2_BUILD_GENERIC_H__
|
||||
#ifndef __FT2_BUILD_DEVEL_H__
|
||||
#define __FT2_BUILD_DEVEL_H__
|
||||
|
||||
#define FT_CONFIG_OPTIONS_H <ftoption.h>
|
||||
|
||||
#include <freetype/config/ftheader.h>
|
||||
|
||||
#endif /* __FT2_BUILD_GENERIC_H__ */
|
||||
#endif /* __FT2_BUILD_DEVEL_H__ */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -95,6 +95,21 @@ FT_BEGIN_HEADER
|
|||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* LZW-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'compress' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with various X11 distributions. The implementation */
|
||||
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
|
||||
/* (see src/lzw/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_LZW
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Gzip-compressed file support. */
|
||||
|
@ -102,11 +117,10 @@ FT_BEGIN_HEADER
|
|||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* that come with XFree86. The implementation uses `zlib' to */
|
||||
/* partially uncompress the file on the fly (see src/base/ftgzip.c). */
|
||||
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this "feature". Note that */
|
||||
/* this will however force you to link the zlib to any program that */
|
||||
/* also uses FreeType. */
|
||||
/* Define this macro if you want to enable this `feature'. See also */
|
||||
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_ZLIB
|
||||
|
||||
|
@ -116,7 +130,7 @@ FT_BEGIN_HEADER
|
|||
/* ZLib library selection */
|
||||
/* */
|
||||
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
|
||||
/* It allows FreeType's "ftgzip" component to link to the system's */
|
||||
/* It allows FreeType's `ftgzip' component to link to the system's */
|
||||
/* installation of the ZLib library. This is useful on systems like */
|
||||
/* Unix or VMS where it generally is already available. */
|
||||
/* */
|
||||
|
@ -230,6 +244,29 @@ FT_BEGIN_HEADER
|
|||
#define FT_CONFIG_OPTION_MAC_FONTS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Guessing methods to access embedded resource forks */
|
||||
/* */
|
||||
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
|
||||
/* GNU/Linux). */
|
||||
/* */
|
||||
/* Resource forks which include fonts data are stored sometimes in */
|
||||
/* locations which users or developers don't expected. In some cases, */
|
||||
/* resource forks start with some offset from the head of a file. In */
|
||||
/* other cases, the actual resource fork is stored in file different */
|
||||
/* from what the user specifies. If this option is activated, */
|
||||
/* FreeType tries to guess whether such offsets or different file */
|
||||
/* names must be used. */
|
||||
/* */
|
||||
/* Note that normal, direct access of resource forks is controlled via */
|
||||
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_MAC_FONTS
|
||||
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Allow the use of FT_Incremental_Interface to load typefaces that */
|
||||
|
@ -296,7 +333,7 @@ FT_BEGIN_HEADER
|
|||
/* Do not #undef this macro here since the build system might define */
|
||||
/* it for certain configurations only. */
|
||||
/* */
|
||||
/* #define FT_DEBUG_MEMORY */
|
||||
#define FT_DEBUG_MEMORY
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -101,15 +101,15 @@ IV. Overriding default configuration and module headers
|
|||
name the configuration headers. To do so, you need a custom
|
||||
"ft2build.h" whose content can be as simple as:
|
||||
|
||||
#ifndef __FT2_BUILD_GENERIC_H__
|
||||
#define __FT2_BUILD_GENERIC_H__
|
||||
#ifndef __FT2_BUILD_MY_PLATFORM_H__
|
||||
#define __FT2_BUILD_MY_PLATFORM_H__
|
||||
|
||||
#define FT_CONFIG_OPTIONS_H <custom/my-ftoption.h>
|
||||
#define FT_CONFIG_MACROS_H <custom/my-ftmodule.h>
|
||||
#define FT_CONFIG_OPTIONS_H <custom/my-ftoption.h>
|
||||
#define FT_CONFIG_MODULES_H <custom/my-ftmodule.h>
|
||||
|
||||
#include <freetype/config/ftheader.h>
|
||||
|
||||
#endif /* __FT2_BUILD_GENERIC_H__ */
|
||||
#endif /* __FT2_BUILD_MY_PLATFORM_H__ */
|
||||
|
||||
Place those files in a separate directory, e.g.:
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ II. Custom builds of the library
|
|||
|
||||
[2] make++, a make tool written in Perl, has sufficient support of GNU
|
||||
make extensions to build FreeType. See
|
||||
http://makepp.sourceforge.net for more information.
|
||||
http://makepp.sourceforge.net for more information; you need version
|
||||
1.19 or newer, and you must pass option `--norc-substitution'.
|
||||
|
||||
--- end of INSTALL ---
|
||||
|
|
|
@ -23,7 +23,8 @@ the file INSTALL.UNX instead.
|
|||
|
||||
Note that make++, a make tool written in Perl, supports enough
|
||||
features of GNU make to compile FreeType. See
|
||||
http://makepp.sourceforge.net for more information.
|
||||
http://makepp.sourceforge.net for more information; you need version
|
||||
1.19 or newer, and you must pass option `--norc-substitution'.
|
||||
|
||||
Make sure that you are invoking GNU Make from the command line, by
|
||||
typing something like:
|
||||
|
|
|
@ -13,7 +13,8 @@ Win32:
|
|||
[Well, this is not really correct. Recently, a perl implementation
|
||||
of make called `makepp' has appeared which can also build FreeType 2
|
||||
successfully on Unix platforms. See http://makepp.sourceforge.net
|
||||
for more details.]
|
||||
for more details; you need version 1.19 or newer, and you must pass
|
||||
option `--norc-substitution'.]
|
||||
|
||||
Trying to compile the library with a different Make tool will print
|
||||
a message like:
|
||||
|
|
|
@ -51,7 +51,10 @@ libtool number, as well as the shared object number found on _most_
|
|||
systems, but not all of them:
|
||||
|
||||
release libtool so
|
||||
--------------------------------------------------------------------
|
||||
-------------------------------
|
||||
2.1.8 9.6.3 6.3.6
|
||||
2.1.7 9.5.3 6.3.5
|
||||
2.1.6 9.5.3 6.3.5
|
||||
2.1.5 9.4.3 6.3.4
|
||||
2.1.4 9.3.3 6.3.3
|
||||
2.1.3 9.2.3 6.3.2
|
||||
|
@ -60,6 +63,8 @@ systems, but not all of them:
|
|||
2.1.0 8.0.2 ?
|
||||
2.0.9 9.0.3 ?
|
||||
2.0.8 8.0.2 ?
|
||||
2.0.4 7.0.1 ?
|
||||
2.0.1 6.1.0 ?
|
||||
|
||||
The libtool numbers are a bit inconsistent due to the library's history:
|
||||
|
||||
|
@ -86,19 +91,19 @@ other release numbers.
|
|||
old_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS=`freetype-config --cflags`
|
||||
AC_TRY_CPP([
|
||||
#include <freetype/freetype.h>
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#if (FREETYPE_MAJOR*1000 + FREETYPE_MINOR)*1000 + FREETYPE_PATCH < 2000009
|
||||
#error Freetype version too low.
|
||||
#endif
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
FREETYPE_LIBS=`freetype-config --libs`
|
||||
AC_SUBST(FREETYPE_LIBS)
|
||||
AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])
|
||||
CPPFLAGS="$old_CPPFLAGS"
|
||||
],[
|
||||
AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])
|
||||
])
|
||||
],
|
||||
[AC_MSG_RESULT(yes)
|
||||
FREETYPE_LIBS=`freetype-config --libs`
|
||||
AC_SUBST(FREETYPE_LIBS)
|
||||
AC_DEFINE(HAVE_FREETYPE,1,[Define if you have the FreeType2 library])
|
||||
CPPFLAGS="$old_CPPFLAGS"],
|
||||
[AC_MSG_ERROR([Need FreeType library version 2.0.9 or higher])])
|
||||
|
||||
|
||||
--- end of VERSION.DLL ---
|
||||
|
|
|
@ -2,24 +2,27 @@
|
|||
The FreeType 2 font engine is copyrighted work and cannot be used
|
||||
legally without a software license. In order to make this project
|
||||
usable to a vast majority of developers, we distribute it under two
|
||||
mutually exclusive licenses.
|
||||
mutually exclusive open-source licenses.
|
||||
|
||||
This means that *you* must choose *one* license of the two described
|
||||
This means that *you* must choose *one* of the two licenses described
|
||||
below, then obey all its terms and conditions when using FreeType 2 in
|
||||
any of your projects or products.
|
||||
|
||||
- The FreeType License, found in the file "FTL.TXT", which is an
|
||||
BSD-style open-source license *with* an advertising clause that
|
||||
forces you to explicitely cite the FreeType project in your
|
||||
product's documentation. All details are in the license file.
|
||||
- The FreeType License, found in the file `FTL.TXT', which is similar
|
||||
to the original BSD license *with* an advertising clause that forces
|
||||
you to explicitly cite the FreeType project in your product's
|
||||
documentation. All details are in the license file. This license
|
||||
is suited to products which don't use the GNU General Public
|
||||
License.
|
||||
|
||||
- The GNU General Public License, found in "GPL.TXT", which is the
|
||||
traditionnal and "viral" GPL license that forces you to redistribute
|
||||
the _complete_ sources of all your products that use FreeType 2.
|
||||
- The GNU General Public License version 2, found in `GPL.TXT' (any
|
||||
later version can be used also), for programs which already use the
|
||||
GPL. Note that the FTL is incompatible with the GPL due to its
|
||||
advertisement clause.
|
||||
|
||||
Note that the contributed PCF driver comes with a license similar to
|
||||
that of X Window System which is compatible to the above two licenses
|
||||
(see file src/pcf/readme).
|
||||
The contributed PCF driver comes with a license similar to that of the X
|
||||
Window System. It is compatible to the above two licenses (see file
|
||||
src/pcf/readme).
|
||||
|
||||
|
||||
--- end of licence.txt ---
|
||||
|
|
624
reactos/lib/freetype/docs/raster.txt
Normal file
624
reactos/lib/freetype/docs/raster.txt
Normal file
|
@ -0,0 +1,624 @@
|
|||
|
||||
How FreeType's rasterizer work
|
||||
|
||||
by David Turner
|
||||
|
||||
Revised 2003-Dec-08
|
||||
|
||||
|
||||
This file is an attempt to explain the internals of the FreeType
|
||||
rasterizer. The rasterizer is of quite general purpose and could
|
||||
easily be integrated into other programs.
|
||||
|
||||
|
||||
I. Introduction
|
||||
|
||||
II. Rendering Technology
|
||||
1. Requirements
|
||||
2. Profiles and Spans
|
||||
a. Sweeping the Shape
|
||||
b. Decomposing Outlines into Profiles
|
||||
c. The Render Pool
|
||||
d. Computing Profiles Extents
|
||||
e. Computing Profiles Coordinates
|
||||
f. Sweeping and Sorting the Spans
|
||||
|
||||
|
||||
I. Introduction
|
||||
===============
|
||||
|
||||
A rasterizer is a library in charge of converting a vectorial
|
||||
representation of a shape into a bitmap. The FreeType rasterizer
|
||||
has been originally developed to render the glyphs found in
|
||||
TrueType files, made up of segments and second-order Béziers.
|
||||
Meanwhile it has been extended to render third-order Bézier curves
|
||||
also. This document is an explanation of its design and
|
||||
implementation.
|
||||
|
||||
While these explanations start from the basics, a knowledge of
|
||||
common rasterization techniques is assumed.
|
||||
|
||||
|
||||
II. Rendering Technology
|
||||
========================
|
||||
|
||||
1. Requirements
|
||||
---------------
|
||||
|
||||
We assume that all scaling, rotating, hinting, etc., has been
|
||||
already done. The glyph is thus described by a list of points in
|
||||
the device space.
|
||||
|
||||
- All point coordinates are in the 26.6 fixed float format. The
|
||||
used orientation is:
|
||||
|
||||
|
||||
^ y
|
||||
| reference orientation
|
||||
|
|
||||
*----> x
|
||||
0
|
||||
|
||||
|
||||
`26.6' means that 26 bits are used for the integer part of a
|
||||
value and 6 bits are used for the fractional part.
|
||||
Consequently, the `distance' between two neighbouring pixels is
|
||||
64 `units' (1 unit = 1/64th of a pixel).
|
||||
|
||||
Note that, for the rasterizer, pixel centers are located at
|
||||
integer coordinates. The TrueType bytecode interpreter,
|
||||
however, assumes that the lower left edge of a pixel (which is
|
||||
taken to be a square with a length of 1 unit) has integer
|
||||
coordinates.
|
||||
|
||||
|
||||
^ y ^ y
|
||||
| |
|
||||
| (1,1) | (0.5,0.5)
|
||||
+-----------+ +-----+-----+
|
||||
| | | | |
|
||||
| | | | |
|
||||
| | | o-----+-----> x
|
||||
| | | (0,0) |
|
||||
| | | |
|
||||
o-----------+-----> x +-----------+
|
||||
(0,0) (-0.5,-0.5)
|
||||
|
||||
TrueType bytecode interpreter FreeType rasterizer
|
||||
|
||||
|
||||
A pixel line in the target bitmap is called a `scanline'.
|
||||
|
||||
- A glyph is usually made of several contours, also called
|
||||
`outlines'. A contour is simply a closed curve that delimits an
|
||||
outer or inner region of the glyph. It is described by a series
|
||||
of successive points of the points table.
|
||||
|
||||
Each point of the glyph has an associated flag that indicates
|
||||
whether it is `on' or `off' the curve. Two successive `on'
|
||||
points indicate a line segment joining the two points.
|
||||
|
||||
One `off' point amidst two `on' points indicates a second-degree
|
||||
(conic) Bézier parametric arc, defined by these three points
|
||||
(the `off' point being the control point, and the `on' ones the
|
||||
start and end points). Similarly, a third-degree (cubic) Bézier
|
||||
curve is described by four points (two `off' control points
|
||||
between two `on' points).
|
||||
|
||||
Finally, for second-order curves only, two successive `off'
|
||||
points forces the rasterizer to create, during rendering, an
|
||||
`on' point amidst them, at their exact middle. This greatly
|
||||
facilitates the definition of successive Bézier arcs.
|
||||
|
||||
The parametric form of a second-order Bézier curve is:
|
||||
|
||||
P(t) = (1-t)^2*P1 + 2*t*(1-t)*P2 + t^2*P3
|
||||
|
||||
(P1 and P3 are the end points, P2 the control point.)
|
||||
|
||||
The parametric form of a third-order Bézier curve is:
|
||||
|
||||
P(t) = (1-t)^3*P1 + 3*t*(1-t)^2*P2 + 3*t^2*(1-t)*P3 + t^3*P4
|
||||
|
||||
(P1 and P4 are the end points, P2 and P3 the control points.)
|
||||
|
||||
For both formulae, t is a real number in the range [0..1].
|
||||
|
||||
Note that the rasterizer does not use these formulae directly.
|
||||
They exhibit, however, one very useful property of Bézier arcs:
|
||||
Each point of the curve is a weighted average of the control
|
||||
points.
|
||||
|
||||
As all weights are positive and always sum up to 1, whatever the
|
||||
value of t, each arc point lies within the triangle (polygon)
|
||||
defined by the arc's three (four) control points.
|
||||
|
||||
In the following, only second-order curves are discussed since
|
||||
rasterization of third-order curves is completely identical.
|
||||
|
||||
Here some samples for second-order curves.
|
||||
|
||||
|
||||
* # on curve
|
||||
* off curve
|
||||
__---__
|
||||
#-__ _-- -_
|
||||
--__ _- -
|
||||
--__ # \
|
||||
--__ #
|
||||
-#
|
||||
Two `on' points
|
||||
Two `on' points and one `off' point
|
||||
between them
|
||||
|
||||
*
|
||||
# __ Two `on' points with two `off'
|
||||
\ - - points between them. The point
|
||||
\ / \ marked `0' is the middle of the
|
||||
- 0 \ `off' points, and is a `virtual
|
||||
-_ _- # on' point where the curve passes.
|
||||
-- It does not appear in the point
|
||||
* list.
|
||||
|
||||
|
||||
2. Profiles and Spans
|
||||
---------------------
|
||||
|
||||
The following is a basic explanation of the _kind_ of computations
|
||||
made by the rasterizer to build a bitmap from a vector
|
||||
representation. Note that the actual implementation is slightly
|
||||
different, due to performance tuning and other factors.
|
||||
|
||||
However, the following ideas remain in the same category, and are
|
||||
more convenient to understand.
|
||||
|
||||
|
||||
a. Sweeping the Shape
|
||||
|
||||
The best way to fill a shape is to decompose it into a number of
|
||||
simple horizontal segments, then turn them on in the target
|
||||
bitmap. These segments are called `spans'.
|
||||
|
||||
__---__
|
||||
_-- -_
|
||||
_- -
|
||||
- \
|
||||
/ \
|
||||
/ \
|
||||
| \
|
||||
|
||||
__---__ Example: filling a shape
|
||||
_----------_ with spans.
|
||||
_--------------
|
||||
----------------\
|
||||
/-----------------\ This is typically done from the top
|
||||
/ \ to the bottom of the shape, in a
|
||||
| | \ movement called a `sweep'.
|
||||
V
|
||||
|
||||
__---__
|
||||
_----------_
|
||||
_--------------
|
||||
----------------\
|
||||
/-----------------\
|
||||
/-------------------\
|
||||
|---------------------\
|
||||
|
||||
|
||||
In order to draw a span, the rasterizer must compute its
|
||||
coordinates, which are simply the x coordinates of the shape's
|
||||
contours, taken on the y scanlines.
|
||||
|
||||
|
||||
/---/ |---| Note that there are usually
|
||||
/---/ |---| several spans per scanline.
|
||||
| /---/ |---|
|
||||
| /---/_______|---| When rendering this shape to the
|
||||
V /----------------| current scanline y, we must
|
||||
/-----------------| compute the x values of the
|
||||
a /----| |---| points a, b, c, and d.
|
||||
- - - * * - - - - * * - - y -
|
||||
/ / b c| |d
|
||||
|
||||
|
||||
/---/ |---|
|
||||
/---/ |---| And then turn on the spans a-b
|
||||
/---/ |---| and c-d.
|
||||
/---/_______|---|
|
||||
/----------------|
|
||||
/-----------------|
|
||||
a /----| |---|
|
||||
- - - ####### - - - - ##### - - y -
|
||||
/ / b c| |d
|
||||
|
||||
|
||||
b. Decomposing Outlines into Profiles
|
||||
|
||||
For each scanline during the sweep, we need the following
|
||||
information:
|
||||
|
||||
o The number of spans on the current scanline, given by the
|
||||
number of shape points intersecting the scanline (these are
|
||||
the points a, b, c, and d in the above example).
|
||||
|
||||
o The x coordinates of these points.
|
||||
|
||||
x coordinates are computed before the sweep, in a phase called
|
||||
`decomposition' which converts the glyph into *profiles*.
|
||||
|
||||
Put it simply, a `profile' is a contour's portion that can only
|
||||
be either ascending or descending, i.e., it is monotonic in the
|
||||
vertical direction (we also say y-monotonic). There is no such
|
||||
thing as a horizontal profile, as we shall see.
|
||||
|
||||
Here are a few examples:
|
||||
|
||||
|
||||
this square
|
||||
1 2
|
||||
---->---- is made of two
|
||||
| | | |
|
||||
| | profiles | |
|
||||
^ v ^ + v
|
||||
| | | |
|
||||
| | | |
|
||||
----<----
|
||||
|
||||
up down
|
||||
|
||||
|
||||
this triangle
|
||||
|
||||
P2 1 2
|
||||
|
||||
|\ is made of two | \
|
||||
^ | \ \ | \
|
||||
| | \ \ profiles | \ |
|
||||
| | \ v ^ | \ |
|
||||
| \ | | + \ v
|
||||
| \ | | \
|
||||
P1 ---___ \ ---___ \
|
||||
---_\ ---_ \
|
||||
<--__ P3 up down
|
||||
|
||||
|
||||
|
||||
A more general contour can be made of more than two profiles:
|
||||
|
||||
__ ^
|
||||
/ | / ___ / |
|
||||
/ | / | / | / |
|
||||
| | / / => | v / /
|
||||
| | | | | | ^ |
|
||||
^ | |___| | | ^ + | + | + v
|
||||
| | | v | |
|
||||
| | | up |
|
||||
|___________| | down |
|
||||
|
||||
<-- up down
|
||||
|
||||
|
||||
Successive profiles are always joined by horizontal segments
|
||||
that are not part of the profiles themselves.
|
||||
|
||||
For the rasterizer, a profile is simply an *array* that
|
||||
associates one horizontal *pixel* coordinate to each bitmap
|
||||
*scanline* crossed by the contour's section containing the
|
||||
profile. Note that profiles are *oriented* up or down along the
|
||||
glyph's original flow orientation.
|
||||
|
||||
In other graphics libraries, profiles are also called `edges' or
|
||||
`edgelists'.
|
||||
|
||||
|
||||
c. The Render Pool
|
||||
|
||||
FreeType has been designed to be able to run well on _very_
|
||||
light systems, including embedded systems with very few memory.
|
||||
|
||||
A render pool will be allocated once; the rasterizer uses this
|
||||
pool for all its needs by managing this memory directly in it.
|
||||
The algorithms that are used for profile computation make it
|
||||
possible to use the pool as a simple growing heap. This means
|
||||
that this memory management is actually quite easy and faster
|
||||
than any kind of malloc()/free() combination.
|
||||
|
||||
Moreover, we'll see later that the rasterizer is able, when
|
||||
dealing with profiles too large and numerous to lie all at once
|
||||
in the render pool, to immediately decompose recursively the
|
||||
rendering process into independent sub-tasks, each taking less
|
||||
memory to be performed (see `sub-banding' below).
|
||||
|
||||
The render pool doesn't need to be large. A 4KByte pool is
|
||||
enough for nearly all renditions, though nearly 100% slower than
|
||||
a more confortable 16KByte or 32KByte pool (that was tested with
|
||||
complex glyphs at sizes over 500 pixels).
|
||||
|
||||
|
||||
d. Computing Profiles Extents
|
||||
|
||||
Remember that a profile is an array, associating a _scanline_ to
|
||||
the x pixel coordinate of its intersection with a contour.
|
||||
|
||||
Though it's not exactly how the FreeType rasterizer works, it is
|
||||
convenient to think that we need a profile's height before
|
||||
allocating it in the pool and computing its coordinates.
|
||||
|
||||
The profile's height is the number of scanlines crossed by the
|
||||
y-monotonic section of a contour. We thus need to compute these
|
||||
sections from the vectorial description. In order to do that,
|
||||
we are obliged to compute all (local and global) y extrema of
|
||||
the glyph (minima and maxima).
|
||||
|
||||
|
||||
P2 For instance, this triangle has only
|
||||
two y-extrema, which are simply
|
||||
|\
|
||||
| \ P2.y as a vertical maximum
|
||||
| \ P3.y as a vertical minimum
|
||||
| \
|
||||
| \ P1.y is not a vertical extremum (though
|
||||
| \ it is a horizontal minimum, which we
|
||||
P1 ---___ \ don't need).
|
||||
---_\
|
||||
P3
|
||||
|
||||
|
||||
Note that the extrema are expressed in pixel units, not in
|
||||
scanlines. The triangle's height is certainly (P3.y-P2.y+1)
|
||||
pixel units, but its profiles' heights are computed in
|
||||
scanlines. The exact conversion is simple:
|
||||
|
||||
- min scanline = FLOOR ( min y )
|
||||
- max scanline = CEILING( max y )
|
||||
|
||||
A problem arises with Bézier Arcs. While a segment is always
|
||||
necessarily y-monotonic (i.e., flat, ascending, or descending),
|
||||
which makes extrema computations easy, the ascent of an arc can
|
||||
vary between its control points.
|
||||
|
||||
|
||||
P2
|
||||
*
|
||||
# on curve
|
||||
* off curve
|
||||
__-x--_
|
||||
_-- -_
|
||||
P1 _- - A non y-monotonic Bézier arc.
|
||||
# \
|
||||
- The arc goes from P1 to P3.
|
||||
\
|
||||
\ P3
|
||||
#
|
||||
|
||||
|
||||
We first need to be able to easily detect non-monotonic arcs,
|
||||
according to their control points. I will state here, without
|
||||
proof, that the monotony condition can be expressed as:
|
||||
|
||||
P1.y <= P2.y <= P3.y for an ever-ascending arc
|
||||
|
||||
P1.y >= P2.y >= P3.y for an ever-descending arc
|
||||
|
||||
with the special case of
|
||||
|
||||
P1.y = P2.y = P3.y where the arc is said to be `flat'.
|
||||
|
||||
As you can see, these conditions can be very easily tested.
|
||||
They are, however, extremely important, as any arc that does not
|
||||
satisfy them necessarily contains an extremum.
|
||||
|
||||
Note also that a monotonic arc can contain an extremum too,
|
||||
which is then one of its `on' points:
|
||||
|
||||
|
||||
P1 P2
|
||||
#---__ * P1P2P3 is ever-descending, but P1
|
||||
-_ is an y-extremum.
|
||||
-
|
||||
---_ \
|
||||
-> \
|
||||
\ P3
|
||||
#
|
||||
|
||||
|
||||
Let's go back to our previous example:
|
||||
|
||||
|
||||
P2
|
||||
*
|
||||
# on curve
|
||||
* off curve
|
||||
__-x--_
|
||||
_-- -_
|
||||
P1 _- - A non-y-monotonic Bézier arc.
|
||||
# \
|
||||
- Here we have
|
||||
\ P2.y >= P1.y &&
|
||||
\ P3 P2.y >= P3.y (!)
|
||||
#
|
||||
|
||||
|
||||
We need to compute the vertical maximum of this arc to be able
|
||||
to compute a profile's height (the point marked by an `x'). The
|
||||
arc's equation indicates that a direct computation is possible,
|
||||
but we rely on a different technique, which use will become
|
||||
apparent soon.
|
||||
|
||||
Bézier arcs have the special property of being very easily
|
||||
decomposed into two sub-arcs, which are themselves Bézier arcs.
|
||||
Moreover, it is easy to prove that there is at most one vertical
|
||||
extremum on each Bézier arc (for second-degree curves; similar
|
||||
conditions can be found for third-order arcs).
|
||||
|
||||
For instance, the following arc P1P2P3 can be decomposed into
|
||||
two sub-arcs Q1Q2Q3 and R1R2R3:
|
||||
|
||||
|
||||
P2
|
||||
*
|
||||
# on curve
|
||||
* off curve
|
||||
|
||||
|
||||
original Bézier arc P1P2P3.
|
||||
__---__
|
||||
_-- --_
|
||||
_- -_
|
||||
- -
|
||||
/ \
|
||||
/ \
|
||||
# #
|
||||
P1 P3
|
||||
|
||||
|
||||
|
||||
P2
|
||||
*
|
||||
|
||||
|
||||
|
||||
Q3 Decomposed into two subarcs
|
||||
Q2 R2 Q1Q2Q3 and R1R2R3
|
||||
* __-#-__ *
|
||||
_-- --_
|
||||
_- R1 -_ Q1 = P1 R3 = P3
|
||||
- - Q2 = (P1+P2)/2 R2 = (P2+P3)/2
|
||||
/ \
|
||||
/ \ Q3 = R1 = (Q2+R2)/2
|
||||
# #
|
||||
Q1 R3 Note that Q2, R2, and Q3=R1
|
||||
are on a single line which is
|
||||
tangent to the curve.
|
||||
|
||||
|
||||
We have then decomposed a non-y-monotonic Bézier curve into two
|
||||
smaller sub-arcs. Note that in the above drawing, both sub-arcs
|
||||
are monotonic, and that the extremum is then Q3=R1. However, in
|
||||
a more general case, only one sub-arc is guaranteed to be
|
||||
monotonic. Getting back to our former example:
|
||||
|
||||
|
||||
Q2
|
||||
*
|
||||
|
||||
__-x--_ R1
|
||||
_-- #_
|
||||
Q1 _- Q3 - R2
|
||||
# \ *
|
||||
-
|
||||
\
|
||||
\ R3
|
||||
#
|
||||
|
||||
|
||||
Here, we see that, though Q1Q2Q3 is still non-monotonic, R1R2R3
|
||||
is ever descending: We thus know that it doesn't contain the
|
||||
extremum. We can then re-subdivide Q1Q2Q3 into two sub-arcs and
|
||||
go on recursively, stopping when we encounter two monotonic
|
||||
subarcs, or when the subarcs become simply too small.
|
||||
|
||||
We will finally find the vertical extremum. Note that the
|
||||
iterative process of finding an extremum is called `flattening'.
|
||||
|
||||
|
||||
e. Computing Profiles Coordinates
|
||||
|
||||
Once we have the height of each profile, we are able to allocate
|
||||
it in the render pool. The next task is to compute coordinates
|
||||
for each scanline.
|
||||
|
||||
In the case of segments, the computation is straightforward,
|
||||
using the Euclidian algorithm (also known as Bresenham).
|
||||
However, for Bézier arcs, the job is a little more complicated.
|
||||
|
||||
We assume that all Béziers that are part of a profile are the
|
||||
result of flattening the curve, which means that they are all
|
||||
y-monotonic (ascending or descending, and never flat). We now
|
||||
have to compute the intersections of arcs with the profile's
|
||||
scanlines. One way is to use a similar scheme to flattening
|
||||
called `stepping'.
|
||||
|
||||
|
||||
Consider this arc, going from P1 to
|
||||
--------------------- P3. Suppose that we need to
|
||||
compute its intersections with the
|
||||
drawn scanlines. As already
|
||||
--------------------- mentioned this can be done
|
||||
directly, but the involed algorithm
|
||||
* P2 _---# P3 is far too slow.
|
||||
------------- _-- --
|
||||
_-
|
||||
_/ Instead, it is still possible to
|
||||
---------/----------- use the decomposition property in
|
||||
/ the same recursive way, i.e.,
|
||||
| subdivide the arc into subarcs
|
||||
------|-------------- until these get too small to cross
|
||||
| more than one scanline!
|
||||
|
|
||||
-----|--------------- This is very easily done using a
|
||||
| rasterizer-managed stack of
|
||||
| subarcs.
|
||||
# P1
|
||||
|
||||
|
||||
f. Sweeping and Sorting the Spans
|
||||
|
||||
Once all our profiles have been computed, we begin the sweep to
|
||||
build (and fill) the spans.
|
||||
|
||||
As both the TrueType and Type 1 specifications use the winding
|
||||
fill rule (but with opposite directions), we place, on each
|
||||
scanline, the present profiles in two separate lists.
|
||||
|
||||
One list, called the `left' one, only contains ascending
|
||||
profiles, while the other `right' list contains the descending
|
||||
profiles.
|
||||
|
||||
As each glyph is made of closed curves, a simple geometric
|
||||
property ensures that the two lists contain the same number of
|
||||
elements.
|
||||
|
||||
Creating spans is thus straightforward:
|
||||
|
||||
1. We sort each list in increasing horizontal order.
|
||||
|
||||
2. We pair each value of the left list with its corresponding
|
||||
value in the right list.
|
||||
|
||||
|
||||
/ / | | For example, we have here
|
||||
/ / | | four profiles. Two of
|
||||
>/ / | | | them are ascending (1 &
|
||||
1// / ^ | | | 2 3), while the two others
|
||||
// // 3| | | v are descending (2 & 4).
|
||||
/ //4 | | | On the given scanline,
|
||||
a / /< | | the left list is (1,3),
|
||||
- - - *-----* - - - - *---* - - y - and the right one is
|
||||
/ / b c| |d (4,2) (sorted).
|
||||
|
||||
There are then two spans, joining
|
||||
1 to 4 (i.e. a-b) and 3 to 2
|
||||
(i.e. c-d)!
|
||||
|
||||
|
||||
Sorting doesn't necessarily take much time, as in 99 cases out
|
||||
of 100, the lists' order is kept from one scanline to the next.
|
||||
We can thus implement it with two simple singly-linked lists,
|
||||
sorted by a classic bubble-sort, which takes a minimum amount of
|
||||
time when the lists are already sorted.
|
||||
|
||||
A previous version of the rasterizer used more elaborate
|
||||
structures, like arrays to perform `faster' sorting. It turned
|
||||
out that this old scheme is not faster than the one described
|
||||
above.
|
||||
|
||||
Once the spans have been `created', we can simply draw them in
|
||||
the target bitmap.
|
||||
|
||||
|
||||
--- end of raster.txt ---
|
||||
|
||||
Local Variables:
|
||||
coding: latin-1
|
||||
End:
|
|
@ -7,12 +7,26 @@ How to prepare a new release
|
|||
. builds/unix/configure.ac (version_info): Update according to the libtool
|
||||
rules, then regenerate the configure script.
|
||||
|
||||
. builds/freetype.mk (refdoc): Update the --title option.
|
||||
. builds/freetype.mk (refdoc): Update the `--title' option.
|
||||
|
||||
. docs/CHANGES: Document differences to last release.
|
||||
|
||||
. README: Update.
|
||||
|
||||
. docs/VERSION.DLL: Document changed version_info.
|
||||
. docs/VERSION.DLL: Document changed `version_info'.
|
||||
|
||||
. ChangeLog: Announce new release.
|
||||
|
||||
. Call `make refdoc' to update HTML reference. Copy it to
|
||||
freetype2/docs/reference in the `www' CVS module and update the CVS.
|
||||
Then call `update-www' in ~/cvs/scripts on www.freetype.org to
|
||||
update and distribute everything to sourceforge.
|
||||
|
||||
. Tag the CVS (freetype, ft2demos, www/freetype2/docs).
|
||||
|
||||
. Update `make-release' and `make-current' in ~/cvs/scripts/ on
|
||||
www.freetype.org, then call them.
|
||||
|
||||
. Create an md5 checksum file (with md5sum).
|
||||
|
||||
. Announce new release on announce@freetype.org and to relevant newsgroups.
|
||||
|
|
|
@ -4,6 +4,8 @@ FT_Done_Memory
|
|||
FT_New_Memory
|
||||
FT_Stream_Open
|
||||
ft_debug_init
|
||||
FT_Trace_Get_Count
|
||||
FT_Trace_Get_Name
|
||||
FT_Add_Default_Modules
|
||||
FT_Done_FreeType
|
||||
FT_Init_FreeType
|
||||
|
@ -29,6 +31,7 @@ FT_Done_Size
|
|||
FT_FloorFix
|
||||
FT_Free
|
||||
FT_Get_Char_Index
|
||||
FT_Get_CMap_Language_ID
|
||||
FT_Get_First_Char
|
||||
FT_Get_Glyph_Name
|
||||
FT_Get_Kerning
|
||||
|
@ -66,6 +69,7 @@ FT_Load_Char
|
|||
FT_Load_Glyph
|
||||
FT_Load_Sfnt_Table
|
||||
FT_Lookup_Renderer
|
||||
ft_module_get_service
|
||||
FT_MulDiv
|
||||
FT_MulFix
|
||||
FT_MulTo64
|
||||
|
@ -82,18 +86,23 @@ FT_Outline_Done
|
|||
FT_Outline_Done_Internal
|
||||
FT_Outline_Get_Bitmap
|
||||
FT_Outline_Get_CBox
|
||||
FT_Outline_Get_Orientation
|
||||
FT_Outline_New
|
||||
FT_Outline_New_Internal
|
||||
FT_Outline_Render
|
||||
FT_Outline_Reverse
|
||||
FT_Outline_Transform
|
||||
FT_Outline_Translate
|
||||
FT_Raccess_Get_DataOffsets
|
||||
FT_Raccess_Get_HeaderInfo
|
||||
FT_Raccess_Guess
|
||||
FT_Realloc
|
||||
FT_Remove_Module
|
||||
FT_Render_Glyph
|
||||
FT_Render_Glyph_Internal
|
||||
FT_RoundFix
|
||||
FT_Select_Charmap
|
||||
ft_service_list_lookup
|
||||
FT_Set_Char_Size
|
||||
FT_Set_Charmap
|
||||
FT_Set_Debug_Hook
|
||||
|
@ -107,12 +116,14 @@ FT_Stream_Close
|
|||
FT_Stream_EnterFrame
|
||||
FT_Stream_ExitFrame
|
||||
FT_Stream_ExtractFrame
|
||||
FT_Stream_Free
|
||||
FT_Stream_GetChar
|
||||
FT_Stream_GetLong
|
||||
FT_Stream_GetLongLE
|
||||
FT_Stream_GetOffset
|
||||
FT_Stream_GetShort
|
||||
FT_Stream_GetShortLE
|
||||
FT_Stream_New
|
||||
FT_Stream_OpenMemory
|
||||
FT_Stream_Pos
|
||||
FT_Stream_Read
|
||||
|
@ -137,6 +148,9 @@ FT_Vector_Polarize
|
|||
FT_Vector_Rotate
|
||||
FT_Vector_Transform
|
||||
FT_Vector_Unit
|
||||
FT_Outline_Get_BBox
|
||||
FT_Get_BDF_Charset_ID
|
||||
FT_Get_BDF_Property
|
||||
ft_bitmap_glyph_class
|
||||
FT_Done_Glyph
|
||||
FT_Get_Glyph
|
||||
|
@ -150,90 +164,104 @@ ft_outline_glyph_class
|
|||
FT_Get_Multi_Master
|
||||
FT_Set_MM_Blend_Coordinates
|
||||
FT_Set_MM_Design_Coordinates
|
||||
FT_Get_BDF_Charset_ID
|
||||
FT_Get_BDF_Property
|
||||
FT_Get_PS_Font_Info
|
||||
FT_Has_PS_Glyph_Names
|
||||
FT_Get_X11_Font_Format
|
||||
FT_Get_PFR_Advance
|
||||
FT_Get_PFR_Kerning
|
||||
FT_Get_PFR_Metrics
|
||||
FT_Glyph_Stroke
|
||||
FT_Glyph_StrokeBorder
|
||||
FT_Outline_GetInsideBorder
|
||||
FT_Outline_GetOutsideBorder
|
||||
FT_Stroker_BeginSubPath
|
||||
FT_Stroker_ConicTo
|
||||
FT_Stroker_CubicTo
|
||||
FT_Stroker_Done
|
||||
FT_Stroker_EndSubPath
|
||||
FT_Stroker_Export
|
||||
FT_Stroker_ExportBorder
|
||||
FT_Stroker_GetBorderCounts
|
||||
FT_Stroker_GetCounts
|
||||
FT_Stroker_LineTo
|
||||
FT_Stroker_New
|
||||
FT_Stroker_ParseOutline
|
||||
FT_Stroker_Rewind
|
||||
FT_Stroker_Set
|
||||
FT_Get_PS_Font_Info
|
||||
FT_Has_PS_Glyph_Names
|
||||
FT_Get_WinFNT_Header
|
||||
FT_Outline_Get_BBox
|
||||
FT_Get_X11_Font_Format
|
||||
ah_arctan
|
||||
autohint_module_class
|
||||
ft_autohinter_service
|
||||
bdf_cmap_class
|
||||
bdf_driver_class
|
||||
FT_LruList_Destroy
|
||||
FT_LruList_Lookup
|
||||
FT_LruList_New
|
||||
FT_LruList_Remove
|
||||
FT_LruList_Remove_Selection
|
||||
FT_LruList_Reset
|
||||
ftc_cache_clear
|
||||
ftc_cache_done
|
||||
ftc_cache_init
|
||||
ftc_cache_lookup
|
||||
ftc_basic_image_cache_class
|
||||
ftc_basic_image_family_class
|
||||
ftc_basic_sbit_cache_class
|
||||
ftc_basic_sbit_family_class
|
||||
FTC_Cache_Clear
|
||||
FTC_Cache_Done
|
||||
FTC_Cache_Init
|
||||
FTC_Cache_Lookup
|
||||
FTC_Cache_NewNode
|
||||
FTC_Cache_RemoveFaceID
|
||||
ftc_cmap_cache_class
|
||||
FTC_CMapCache_Lookup
|
||||
FTC_CMapCache_New
|
||||
ftc_face_list_class
|
||||
ftc_family_done
|
||||
ftc_family_init
|
||||
ftc_family_table_alloc
|
||||
ftc_family_table_free
|
||||
ftc_glyph_family_done
|
||||
ftc_glyph_family_init
|
||||
ftc_glyph_node_compare
|
||||
ftc_glyph_node_done
|
||||
ftc_glyph_node_init
|
||||
ftc_image_cache_class
|
||||
FTC_Image_Cache_Lookup
|
||||
FTC_Image_Cache_New
|
||||
FTC_Family_Init
|
||||
FTC_GCache_Done
|
||||
FTC_GCache_Init
|
||||
FTC_GCache_Lookup
|
||||
FTC_GCache_New
|
||||
FTC_GNode_Compare
|
||||
FTC_GNode_Done
|
||||
FTC_GNode_Init
|
||||
FTC_GNode_UnselectFamily
|
||||
FTC_ImageCache_Lookup
|
||||
FTC_ImageCache_New
|
||||
FTC_INode_Free
|
||||
FTC_INode_New
|
||||
FTC_INode_Weight
|
||||
FTC_Manager_Compress
|
||||
FTC_Manager_Done
|
||||
FTC_Manager_Lookup_Face
|
||||
FTC_Manager_Lookup_Size
|
||||
FTC_Manager_FlushN
|
||||
FTC_Manager_LookupFace
|
||||
FTC_Manager_LookupSize
|
||||
FTC_Manager_New
|
||||
FTC_Manager_Register_Cache
|
||||
FTC_Manager_RegisterCache
|
||||
FTC_Manager_RemoveFaceID
|
||||
FTC_Manager_Reset
|
||||
FTC_MruList_Done
|
||||
FTC_MruList_Find
|
||||
FTC_MruList_Init
|
||||
FTC_MruList_Lookup
|
||||
FTC_MruList_New
|
||||
FTC_MruList_Remove
|
||||
FTC_MruList_RemoveSelection
|
||||
FTC_MruList_Reset
|
||||
FTC_MruNode_Prepend
|
||||
FTC_MruNode_Remove
|
||||
FTC_MruNode_Up
|
||||
ftc_node_destroy
|
||||
ftc_node_done
|
||||
FTC_Node_Unref
|
||||
ftc_sbit_cache_class
|
||||
FTC_SBit_Cache_Lookup
|
||||
FTC_SBit_Cache_New
|
||||
FTC_SBitCache_Lookup
|
||||
FTC_SBitCache_New
|
||||
ftc_size_list_class
|
||||
FTC_SNode_Compare
|
||||
FTC_SNode_Free
|
||||
FTC_SNode_New
|
||||
FTC_SNode_Weight
|
||||
cff_cmap_encoding_class_rec
|
||||
cff_cmap_unicode_class_rec
|
||||
cff_driver_class
|
||||
t1cid_driver_class
|
||||
FT_Stream_OpenGzip
|
||||
BitOrderInvert
|
||||
FourByteSwap
|
||||
FT_Stream_OpenLZW
|
||||
pcf_cmap_class
|
||||
pcf_driver_class
|
||||
RepadBitmap
|
||||
TwoByteSwap
|
||||
pfr_cmap_class_rec
|
||||
pfr_driver_class
|
||||
pfr_service_rec
|
||||
pfr_metrics_service_rec
|
||||
ps_parser_funcs
|
||||
ps_table_funcs
|
||||
psaux_module_class
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType internal cache interface (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* Copyright 2000-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -20,9 +20,7 @@
|
|||
#define __FTCCACHE_H__
|
||||
|
||||
|
||||
/* define to allow cache lookup inlining */
|
||||
#define FTC_CACHE_USE_INLINE
|
||||
|
||||
#include FT_CACHE_INTERNAL_MRU_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -30,13 +28,7 @@ FT_BEGIN_HEADER
|
|||
typedef struct FTC_CacheRec_* FTC_Cache;
|
||||
|
||||
/* handle to cache class */
|
||||
typedef const struct FTC_Cache_ClassRec_* FTC_Cache_Class;
|
||||
|
||||
/* handle to cache node family */
|
||||
typedef struct FTC_FamilyRec_* FTC_Family;
|
||||
|
||||
/* handle to cache root query */
|
||||
typedef struct FTC_QueryRec_* FTC_Query;
|
||||
typedef const struct FTC_CacheClassRec_* FTC_CacheClass;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -62,12 +54,11 @@ FT_BEGIN_HEADER
|
|||
/* structure size should be 20 bytes on 32-bits machines */
|
||||
typedef struct FTC_NodeRec_
|
||||
{
|
||||
FTC_Node mru_next; /* circular mru list pointer */
|
||||
FTC_Node mru_prev; /* circular mru list pointer */
|
||||
FTC_Node link; /* used for hashing */
|
||||
FT_UInt32 hash; /* used for hashing too */
|
||||
FT_UShort fam_index; /* index of family the node belongs to */
|
||||
FT_Short ref_count; /* reference count for this node */
|
||||
FTC_MruNodeRec mru; /* circular mru list pointer */
|
||||
FTC_Node link; /* used for hashing */
|
||||
FT_UInt32 hash; /* used for hashing too */
|
||||
FT_UShort cache_index; /* index of cache the node belongs to */
|
||||
FT_Short ref_count; /* reference count for this node */
|
||||
|
||||
} FTC_NodeRec;
|
||||
|
||||
|
@ -75,6 +66,9 @@ FT_BEGIN_HEADER
|
|||
#define FTC_NODE( x ) ( (FTC_Node)(x) )
|
||||
#define FTC_NODE_P( x ) ( (FTC_Node*)(x) )
|
||||
|
||||
#define FTC_NODE__NEXT(x) FTC_NODE( (x)->mru.next )
|
||||
#define FTC_NODE__PREV(x) FTC_NODE( (x)->mru.prev )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
@ -83,83 +77,12 @@ FT_BEGIN_HEADER
|
|||
/* cache sub-system internals. */
|
||||
/* */
|
||||
|
||||
/* can be used as a FTC_Node_DoneFunc */
|
||||
FT_EXPORT( void )
|
||||
ftc_node_done( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* reserved for manager's use */
|
||||
FT_EXPORT( void )
|
||||
ftc_node_destroy( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** CACHE QUERY DEFINITIONS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* A structure modelling a cache node query. The following fields must */
|
||||
/* all be set by the @FTC_Family_CompareFunc method of a cache's family */
|
||||
/* list. */
|
||||
/* */
|
||||
typedef struct FTC_QueryRec_
|
||||
{
|
||||
FTC_Family family;
|
||||
FT_UFast hash;
|
||||
|
||||
} FTC_QueryRec;
|
||||
|
||||
|
||||
#define FTC_QUERY( x ) ( (FTC_Query)(x) )
|
||||
#define FTC_QUERY_P( x ) ( (FTC_Query*)(x) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** CACHE FAMILY DEFINITIONS *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct FTC_FamilyRec_
|
||||
{
|
||||
FT_LruNodeRec lru;
|
||||
FTC_Cache cache;
|
||||
FT_UInt num_nodes;
|
||||
FT_UInt fam_index;
|
||||
|
||||
} FTC_FamilyRec;
|
||||
|
||||
|
||||
#define FTC_FAMILY( x ) ( (FTC_Family)(x) )
|
||||
#define FTC_FAMILY_P( x ) ( (FTC_Family*)(x) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* These functions are exported so that they can be called from */
|
||||
/* user-provided cache classes; otherwise, they are really part of the */
|
||||
/* cache sub-system internals. */
|
||||
/* */
|
||||
|
||||
/* must be called by any FTC_Node_InitFunc routine */
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_family_init( FTC_Family family,
|
||||
FTC_Query query,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
/* can be used as a FTC_Family_DoneFunc; otherwise, must be called */
|
||||
/* by any family finalizer function */
|
||||
FT_EXPORT( void )
|
||||
ftc_family_done( FTC_Family family );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -168,64 +91,12 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* each cache really implements a dynamic hash table to manage its nodes */
|
||||
typedef struct FTC_CacheRec_
|
||||
{
|
||||
FTC_Manager manager;
|
||||
FT_Memory memory;
|
||||
FTC_Cache_Class clazz;
|
||||
|
||||
FT_UInt cache_index; /* in manager's table */
|
||||
FT_Pointer cache_data; /* used by cache node methods */
|
||||
|
||||
FT_UFast p;
|
||||
FT_UFast mask;
|
||||
FT_Long slack;
|
||||
FTC_Node* buckets;
|
||||
|
||||
FT_LruList_ClassRec family_class;
|
||||
FT_LruList families;
|
||||
|
||||
} FTC_CacheRec;
|
||||
|
||||
|
||||
#define FTC_CACHE( x ) ( (FTC_Cache)(x) )
|
||||
#define FTC_CACHE_P( x ) ( (FTC_Cache*)(x) )
|
||||
|
||||
|
||||
/* initialize a given cache */
|
||||
typedef FT_Error
|
||||
(*FTC_Cache_InitFunc)( FTC_Cache cache );
|
||||
|
||||
/* clear a cache */
|
||||
typedef void
|
||||
(*FTC_Cache_ClearFunc)( FTC_Cache cache );
|
||||
|
||||
/* finalize a given cache */
|
||||
typedef void
|
||||
(*FTC_Cache_DoneFunc)( FTC_Cache cache );
|
||||
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_Family_InitFunc)( FTC_Family family,
|
||||
FTC_Query query,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef FT_Int
|
||||
(*FTC_Family_CompareFunc)( FTC_Family family,
|
||||
FTC_Query query );
|
||||
|
||||
typedef void
|
||||
(*FTC_Family_DoneFunc)( FTC_Family family,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* initialize a new cache node */
|
||||
typedef FT_Error
|
||||
(*FTC_Node_InitFunc)( FTC_Node node,
|
||||
FT_Pointer type,
|
||||
FTC_Cache cache );
|
||||
(*FTC_Node_NewFunc)( FTC_Node *pnode,
|
||||
FT_Pointer query,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* compute the weight of a given cache node */
|
||||
typedef FT_ULong
|
||||
(*FTC_Node_WeightFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
@ -236,62 +107,159 @@ FT_BEGIN_HEADER
|
|||
FT_Pointer key,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* finalize a given cache node */
|
||||
|
||||
typedef void
|
||||
(*FTC_Node_DoneFunc)( FTC_Node node,
|
||||
(*FTC_Node_FreeFunc)( FTC_Node node,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_Cache_InitFunc)( FTC_Cache cache );
|
||||
|
||||
typedef struct FTC_Cache_ClassRec_
|
||||
typedef void
|
||||
(*FTC_Cache_DoneFunc)( FTC_Cache cache );
|
||||
|
||||
|
||||
typedef struct FTC_CacheClassRec_
|
||||
{
|
||||
FT_UInt cache_size;
|
||||
FTC_Cache_InitFunc cache_init;
|
||||
FTC_Cache_ClearFunc cache_clear;
|
||||
FTC_Cache_DoneFunc cache_done;
|
||||
FTC_Node_NewFunc node_new;
|
||||
FTC_Node_WeightFunc node_weight;
|
||||
FTC_Node_CompareFunc node_compare;
|
||||
FTC_Node_CompareFunc node_remove_faceid;
|
||||
FTC_Node_FreeFunc node_free;
|
||||
|
||||
FT_UInt family_size;
|
||||
FTC_Family_InitFunc family_init;
|
||||
FTC_Family_CompareFunc family_compare;
|
||||
FTC_Family_DoneFunc family_done;
|
||||
FT_UInt cache_size;
|
||||
FTC_Cache_InitFunc cache_init;
|
||||
FTC_Cache_DoneFunc cache_done;
|
||||
|
||||
FT_UInt node_size;
|
||||
FTC_Node_InitFunc node_init;
|
||||
FTC_Node_WeightFunc node_weight;
|
||||
FTC_Node_CompareFunc node_compare;
|
||||
FTC_Node_DoneFunc node_done;
|
||||
|
||||
} FTC_Cache_ClassRec;
|
||||
} FTC_CacheClassRec;
|
||||
|
||||
|
||||
/* */
|
||||
/* each cache really implements a dynamic hash table to manage its nodes */
|
||||
typedef struct FTC_CacheRec_
|
||||
{
|
||||
FT_UFast p;
|
||||
FT_UFast mask;
|
||||
FT_Long slack;
|
||||
FTC_Node* buckets;
|
||||
|
||||
FTC_CacheClassRec clazz; /* local copy, for speed */
|
||||
|
||||
FTC_Manager manager;
|
||||
FT_Memory memory;
|
||||
FT_UInt index; /* in manager's table */
|
||||
|
||||
FTC_CacheClass org_class; /* original class pointer */
|
||||
|
||||
} FTC_CacheRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* These functions are exported so that they can be called from */
|
||||
/* user-provided cache classes; otherwise, they are really part of the */
|
||||
/* cache sub-system internals. */
|
||||
/* */
|
||||
#define FTC_CACHE( x ) ( (FTC_Cache)(x) )
|
||||
#define FTC_CACHE_P( x ) ( (FTC_Cache*)(x) )
|
||||
|
||||
/* can be used directly as FTC_Cache_DoneFunc(), or called by custom */
|
||||
/* cache finalizers */
|
||||
FT_EXPORT( void )
|
||||
ftc_cache_done( FTC_Cache cache );
|
||||
|
||||
/* can be used directly as FTC_Cache_ClearFunc(), or called by custom */
|
||||
/* cache clear routines */
|
||||
FT_EXPORT( void )
|
||||
ftc_cache_clear( FTC_Cache cache );
|
||||
|
||||
/* initalize the hash table within the cache */
|
||||
/* default cache initialize */
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_cache_init( FTC_Cache cache );
|
||||
FTC_Cache_Init( FTC_Cache cache );
|
||||
|
||||
/* can be called when the key's hash value has been computed */
|
||||
/* default cache finalizer */
|
||||
FT_EXPORT( void )
|
||||
FTC_Cache_Done( FTC_Cache cache );
|
||||
|
||||
/* Call this function to lookup the cache. If no corresponding
|
||||
* node is found, a new one is automatically created. This function
|
||||
* is capable of flushing the cache adequately to make room for the
|
||||
* new cache object.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_cache_lookup( FTC_Cache cache,
|
||||
FTC_Query query,
|
||||
FTC_Node *anode );
|
||||
FTC_Cache_Lookup( FTC_Cache cache,
|
||||
FT_UInt32 hash,
|
||||
FT_Pointer query,
|
||||
FTC_Node *anode );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Cache_NewNode( FTC_Cache cache,
|
||||
FT_UInt32 hash,
|
||||
FT_Pointer query,
|
||||
FTC_Node *anode );
|
||||
|
||||
/* Remove all nodes that relate to a given face_id. This is useful
|
||||
* when un-installing fonts. Note that if a cache node relates to
|
||||
* the face_id, but is locked (i.e., has 'ref_count > 0'), the node
|
||||
* will _not_ be destroyed, but its internal face_id reference will
|
||||
* be modified.
|
||||
*
|
||||
* The final result will be that the node will never come back
|
||||
* in further lookup requests, and will be flushed on demand from
|
||||
* the cache normally when its reference count reaches 0.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FTC_Cache_RemoveFaceID( FTC_Cache cache,
|
||||
FTC_FaceID face_id );
|
||||
|
||||
|
||||
#ifdef FTC_INLINE
|
||||
|
||||
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_Node *_bucket, *_pnode, _node; \
|
||||
FTC_Cache _cache = FTC_CACHE(cache); \
|
||||
FT_UInt32 _hash = (FT_UInt32)(hash); \
|
||||
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
|
||||
FT_UInt _idx; \
|
||||
\
|
||||
\
|
||||
error = 0; \
|
||||
node = NULL; \
|
||||
_idx = _hash & _cache->mask; \
|
||||
if ( _idx < _cache->p ) \
|
||||
_idx = _hash & ( _cache->mask*2 + 1 ); \
|
||||
\
|
||||
_bucket = _pnode = _cache->buckets + _idx; \
|
||||
for (;;) \
|
||||
{ \
|
||||
_node = *_pnode; \
|
||||
if ( _node == NULL ) \
|
||||
goto _NewNode; \
|
||||
\
|
||||
if ( _node->hash == _hash && _nodcomp( _node, query, _cache ) ) \
|
||||
break; \
|
||||
\
|
||||
_pnode = &_node->link; \
|
||||
} \
|
||||
\
|
||||
if ( _node != *_bucket ) \
|
||||
{ \
|
||||
*_pnode = _node->link; \
|
||||
_node->link = *_bucket; \
|
||||
*_bucket = _node; \
|
||||
} \
|
||||
\
|
||||
{ \
|
||||
FTC_Manager _manager = _cache->manager; \
|
||||
\
|
||||
\
|
||||
if ( _node != _manager->nodes_list ) \
|
||||
FTC_MruNode_Up( (FTC_MruNode*)&_manager->nodes_list, \
|
||||
(FTC_MruNode)_node ); \
|
||||
} \
|
||||
goto _Ok; \
|
||||
\
|
||||
_NewNode: \
|
||||
error = FTC_Cache_NewNode( _cache, _hash, query, &_node ); \
|
||||
\
|
||||
_Ok: \
|
||||
*(FTC_Node*)&(node) = _node; \
|
||||
FT_END_STMNT
|
||||
|
||||
#else /* !FTC_INLINE */
|
||||
|
||||
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query, \
|
||||
(FTC_Node*)&(node) ); \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !FTC_INLINE */
|
||||
|
||||
/* */
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType abstract glyph cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* Copyright 2000-2001, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -16,13 +16,84 @@
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* FTC_GCache is an _abstract_ cache object optimized to store glyph
|
||||
* data. It works as follows:
|
||||
*
|
||||
* - It manages FTC_GNode objects. Each one of them can hold one or more
|
||||
* glyph `items'. Item types are not specified in the FTC_GCache but
|
||||
* in classes that extend it.
|
||||
*
|
||||
* - Glyph attributes, like face ID, character size, render mode, etc.,
|
||||
* can be grouped into abstract `glyph families'. This avoids storing
|
||||
* the attributes within the FTC_GCache, since it is likely that many
|
||||
* FTC_GNodes will belong to the same family in typical uses.
|
||||
*
|
||||
* - Each FTC_GNode is thus an FTC_Node with two additional fields:
|
||||
*
|
||||
* * gindex: A glyph index, or the first index in a glyph range.
|
||||
* * family: A pointer to a glyph `family'.
|
||||
*
|
||||
* - Family types are not fully specific in the FTC_Family type, but
|
||||
* by classes that extend it.
|
||||
*
|
||||
* Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
|
||||
* They share an FTC_Family sub-class called FTC_BasicFamily which is
|
||||
* used to store the following data: face ID, pixel/point sizes, load
|
||||
* flags. For more details see the file `src/cache/ftcbasic.c'.
|
||||
*
|
||||
* Client applications can extend FTC_GNode with their own FTC_GNode
|
||||
* and FTC_Family sub-classes to implement more complex caches (e.g.,
|
||||
* handling automatic synthesis, like obliquing & emboldening, colored
|
||||
* glyphs, etc.).
|
||||
*
|
||||
* See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
|
||||
* `ftcsbits.h', which both extend FTC_GCache with additional
|
||||
* optimizations.
|
||||
*
|
||||
* A typical FTC_GCache implementation must provide at least the
|
||||
* following:
|
||||
*
|
||||
* - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
|
||||
* my_node_new (must call FTC_GNode_Init)
|
||||
* my_node_free (must call FTC_GNode_Done)
|
||||
* my_node_compare (must call FTC_GNode_Compare)
|
||||
* my_node_remove_faceid (must call ftc_gnode_unselect in case
|
||||
* of match)
|
||||
*
|
||||
* - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
|
||||
* my_family_compare
|
||||
* my_family_init
|
||||
* my_family_reset (optional)
|
||||
* my_family_done
|
||||
*
|
||||
* - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
|
||||
* data.
|
||||
*
|
||||
* - Constant structures for a FTC_GNodeClass.
|
||||
*
|
||||
* - MyCacheNew() can be implemented easily as a call to the convenience
|
||||
* function FTC_GCache_New.
|
||||
*
|
||||
* - MyCacheLookup with a call to FTC_GCache_Lookup. This function will
|
||||
* automatically:
|
||||
*
|
||||
* - Search for the corresponding family in the cache, or create
|
||||
* a new one if necessary. Put it in FTC_GQUERY(myquery).family
|
||||
*
|
||||
* - Call FTC_Cache_Lookup.
|
||||
*
|
||||
* If it returns NULL, you should create a new node, then call
|
||||
* ftc_cache_add as usual.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Important: The functions defined in this file are only used to */
|
||||
/* implement an abstract glyph cache class. You need to */
|
||||
/* provide additional logic to implement a complete cache. */
|
||||
/* For example, see `ftcimage.h' and `ftcimage.c' which */
|
||||
/* implement a FT_Glyph cache based on this code. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
@ -47,99 +118,53 @@
|
|||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_MANAGER_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include FT_CACHE_INTERNAL_MANAGER_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* each glyph set is characterized by a "glyph set type" which must be */
|
||||
/* defined by sub-classes */
|
||||
typedef struct FTC_GlyphFamilyRec_* FTC_GlyphFamily;
|
||||
/*
|
||||
* We can group glyphs into `families'. Each family correspond to a
|
||||
* given face ID, character size, transform, etc.
|
||||
*
|
||||
* Families are implemented as MRU list nodes. They are
|
||||
* reference-counted.
|
||||
*/
|
||||
|
||||
/* handle to a glyph cache node */
|
||||
typedef struct FTC_GlyphNodeRec_* FTC_GlyphNode;
|
||||
|
||||
|
||||
/* size should be 24 + chunk size on 32-bit machines; */
|
||||
/* note that the node's hash is ((gfam->hash << 16) | glyph_index) -- */
|
||||
/* this _must_ be set properly by the glyph node initializer */
|
||||
/* */
|
||||
typedef struct FTC_GlyphNodeRec_
|
||||
typedef struct FTC_FamilyRec_
|
||||
{
|
||||
FTC_NodeRec node;
|
||||
FT_UShort item_count;
|
||||
FT_UShort item_start;
|
||||
FTC_MruNodeRec mrunode;
|
||||
FT_UInt num_nodes; /* current number of nodes in this family */
|
||||
FTC_Cache cache;
|
||||
FTC_MruListClass clazz;
|
||||
|
||||
} FTC_GlyphNodeRec;
|
||||
} FTC_FamilyRec, *FTC_Family;
|
||||
|
||||
#define FTC_FAMILY(x) ( (FTC_Family)(x) )
|
||||
#define FTC_FAMILY_P(x) ( (FTC_Family*)(x) )
|
||||
|
||||
|
||||
#define FTC_GLYPH_NODE( x ) ( (FTC_GlyphNode)(x) )
|
||||
#define FTC_GLYPH_NODE_P( x ) ( (FTC_GlyphNode*)(x) )
|
||||
|
||||
|
||||
typedef struct FTC_GlyphQueryRec_
|
||||
typedef struct FTC_GNodeRec_
|
||||
{
|
||||
FTC_QueryRec query;
|
||||
FT_UInt gindex;
|
||||
FTC_NodeRec node;
|
||||
FTC_Family family;
|
||||
FT_UInt gindex;
|
||||
|
||||
} FTC_GlyphQueryRec, *FTC_GlyphQuery;
|
||||
} FTC_GNodeRec, *FTC_GNode;
|
||||
|
||||
#define FTC_GNODE( x ) ( (FTC_GNode)(x) )
|
||||
#define FTC_GNODE_P( x ) ( (FTC_GNode*)(x) )
|
||||
|
||||
|
||||
#define FTC_GLYPH_QUERY( x ) ( (FTC_GlyphQuery)(x) )
|
||||
|
||||
|
||||
/* a glyph set is used to categorize glyphs of a given type */
|
||||
typedef struct FTC_GlyphFamilyRec_
|
||||
typedef struct FTC_GQueryRec_
|
||||
{
|
||||
FTC_FamilyRec family;
|
||||
FT_UInt32 hash;
|
||||
FT_UInt item_total; /* total number of glyphs in family */
|
||||
FT_UInt item_count; /* number of glyph items per node */
|
||||
FT_UInt gindex;
|
||||
FTC_Family family;
|
||||
|
||||
} FTC_GlyphFamilyRec;
|
||||
} FTC_GQueryRec, *FTC_GQuery;
|
||||
|
||||
|
||||
#define FTC_GLYPH_FAMILY( x ) ( (FTC_GlyphFamily)(x) )
|
||||
#define FTC_GLYPH_FAMILY_P( x ) ( (FTC_GlyphFamily*)(x) )
|
||||
|
||||
#define FTC_GLYPH_FAMILY_MEMORY( x ) FTC_FAMILY(x)->cache->memory
|
||||
|
||||
|
||||
/* each glyph node contains a 'chunk' of glyph items; */
|
||||
/* translate a glyph index into a chunk index */
|
||||
#define FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) \
|
||||
( ( gindex ) / FTC_GLYPH_FAMILY( gfam )->item_count )
|
||||
|
||||
/* find a glyph index's chunk, and return its start index */
|
||||
#define FTC_GLYPH_FAMILY_START( gfam, gindex ) \
|
||||
( FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) * \
|
||||
FTC_GLYPH_FAMILY( gfam )->item_count )
|
||||
|
||||
/* compute a glyph request's hash value */
|
||||
#define FTC_GLYPH_FAMILY_HASH( gfam, gindex ) \
|
||||
( (FT_UFast)( \
|
||||
( FTC_GLYPH_FAMILY( gfam )->hash << 16 ) | \
|
||||
( FTC_GLYPH_FAMILY_CHUNK( gfam, gindex ) & 0xFFFFU ) ) )
|
||||
|
||||
/* must be called in an FTC_Family_CompareFunc to update the query */
|
||||
/* whenever a glyph set is matched in the lookup, or when it */
|
||||
/* is created */
|
||||
#define FTC_GLYPH_FAMILY_FOUND( gfam, gquery ) \
|
||||
do \
|
||||
{ \
|
||||
FTC_QUERY( gquery )->family = FTC_FAMILY( gfam ); \
|
||||
FTC_QUERY( gquery )->hash = \
|
||||
FTC_GLYPH_FAMILY_HASH( gfam, \
|
||||
FTC_GLYPH_QUERY( gquery )->gindex ); \
|
||||
} while ( 0 )
|
||||
|
||||
/* retrieve glyph index of glyph node */
|
||||
#define FTC_GLYPH_NODE_GINDEX( x ) \
|
||||
( (FT_UInt)( FTC_GLYPH_NODE( x )->node.hash & 0xFFFFU ) )
|
||||
#define FTC_GQUERY( x ) ( (FTC_GQuery)(x) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -151,39 +176,116 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* must be called by derived FTC_Node_InitFunc routines */
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_node_init( FTC_GlyphNode node,
|
||||
FT_UInt gindex, /* glyph index for node */
|
||||
FTC_GlyphFamily gfam );
|
||||
FTC_GNode_Init( FTC_GNode node,
|
||||
FT_UInt gindex, /* glyph index for node */
|
||||
FTC_Family family );
|
||||
|
||||
/* 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_EXPORT( FT_Bool )
|
||||
ftc_glyph_node_compare( FTC_GlyphNode gnode,
|
||||
FTC_GlyphQuery gquery );
|
||||
FTC_GNode_Compare( FTC_GNode gnode,
|
||||
FTC_GQuery gquery );
|
||||
|
||||
/* call this function to clear a node's family -- this is necessary */
|
||||
/* to implement the `node_remove_faceid' cache method correctly */
|
||||
FT_EXPORT( void )
|
||||
FTC_GNode_UnselectFamily( FTC_GNode gnode,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* must be called by derived FTC_Node_DoneFunc routines */
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_node_done( FTC_GlyphNode node,
|
||||
FTC_Cache cache );
|
||||
FTC_GNode_Done( FTC_GNode node,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
/* must be called by derived FTC_Family_InitFunc; */
|
||||
/* calls "ftc_family_init" */
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_glyph_family_init( FTC_GlyphFamily gfam,
|
||||
FT_UInt32 hash,
|
||||
FT_UInt item_count,
|
||||
FT_UInt item_total,
|
||||
FTC_GlyphQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
FT_EXPORT( void )
|
||||
ftc_glyph_family_done( FTC_GlyphFamily gfam );
|
||||
FTC_Family_Init( FTC_Family family,
|
||||
FTC_Cache cache );
|
||||
|
||||
typedef struct FTC_GCacheRec_
|
||||
{
|
||||
FTC_CacheRec cache;
|
||||
FTC_MruListRec families;
|
||||
|
||||
} FTC_GCacheRec, *FTC_GCache;
|
||||
|
||||
#define FTC_GCACHE( x ) ((FTC_GCache)(x))
|
||||
|
||||
|
||||
/* can be used as @FTC_Cache_InitFunc */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_Init( FTC_GCache cache );
|
||||
|
||||
|
||||
/* can be used as @FTC_Cache_DoneFunc */
|
||||
FT_EXPORT( void )
|
||||
FTC_GCache_Done( FTC_GCache cache );
|
||||
|
||||
|
||||
/* the glyph cache class adds fields for the family implementation */
|
||||
typedef struct FTC_GCacheClassRec_
|
||||
{
|
||||
FTC_CacheClassRec clazz;
|
||||
FTC_MruListClass family_class;
|
||||
|
||||
} FTC_GCacheClassRec;
|
||||
|
||||
typedef const FTC_GCacheClassRec* FTC_GCacheClass;
|
||||
|
||||
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
|
||||
|
||||
#define FTC_CACHE__GCACHE_CLASS( x ) \
|
||||
FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
|
||||
#define FTC_CACHE__FAMILY_CLASS( x ) \
|
||||
((FTC_MruListClass) FTC_CACHE__GCACHE_CLASS(x)->family_class)
|
||||
|
||||
|
||||
/* convenience function; use it instead of FTC_Manager_Register_Cache */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_New( FTC_Manager manager,
|
||||
FTC_GCacheClass clazz,
|
||||
FTC_GCache *acache );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_GCache_Lookup( FTC_GCache cache,
|
||||
FT_UInt32 hash,
|
||||
FT_UInt gindex,
|
||||
FTC_GQuery query,
|
||||
FTC_Node *anode );
|
||||
|
||||
|
||||
#ifdef FTC_INLINE
|
||||
|
||||
#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \
|
||||
gindex, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_GCache _gcache = FTC_GCACHE( cache ); \
|
||||
FTC_GQuery _gquery = (FTC_GQuery)( query ); \
|
||||
FTC_MruNode_CompareFunc _fcompare = (FTC_MruNode_CompareFunc)(famcmp); \
|
||||
\
|
||||
\
|
||||
_gquery->gindex = (gindex); \
|
||||
\
|
||||
FTC_MRULIST_LOOKUP_CMP( &_gcache->families, _gquery, _fcompare, \
|
||||
_gquery->family, error ); \
|
||||
if ( !error ) \
|
||||
FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ); \
|
||||
FT_END_STMNT
|
||||
/* */
|
||||
|
||||
|
||||
#else /* !FTC_INLINE */
|
||||
|
||||
#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash, \
|
||||
gindex, query, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex, \
|
||||
FTC_GQUERY( query ), (FTC_Node*)&(node) ); \
|
||||
FT_END_STMNT
|
||||
|
||||
#endif /* !FTC_INLINE */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* */
|
||||
/* ftcimage.h */
|
||||
/* */
|
||||
/* FreeType Image cache (specification). */
|
||||
/* FreeType Generic Image cache (specification) */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
|
@ -16,6 +16,15 @@
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
|
||||
* image per cache node.
|
||||
*
|
||||
* FTC_ICache extends FTC_GCache. For an implementation example,
|
||||
* see FTC_ImageCache in `src/cache/ftbasic.c'.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each image cache really manages FT_Glyph objects. */
|
||||
|
@ -29,284 +38,66 @@
|
|||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
|
||||
#include FT_CACHE_INTERNAL_GLYPH_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** IMAGE CACHE OBJECT *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @struct:
|
||||
* FTC_ImageTypeRec
|
||||
*
|
||||
* @description:
|
||||
* A simple structure used to describe the type of glyph image to be
|
||||
* loaded into the cache.
|
||||
*
|
||||
* @fields:
|
||||
* font :: An @FTC_FontRec used to describe the glyph's face and size.
|
||||
*
|
||||
* flags :: The load flags to be applied when loading the glyph; see
|
||||
* the @FT_LOAD_XXX constants for details.
|
||||
*
|
||||
* @note:
|
||||
* This type completely replaces the @FTC_Image_Desc structure which is
|
||||
* now obsolete.
|
||||
*/
|
||||
typedef struct FTC_ImageTypeRec_
|
||||
/* the FT_Glyph image node type - we store only 1 glyph per node */
|
||||
typedef struct FTC_INodeRec_
|
||||
{
|
||||
FTC_FontRec font;
|
||||
FT_Int32 flags;
|
||||
FTC_GNodeRec gnode;
|
||||
FT_Glyph glyph;
|
||||
|
||||
} FTC_ImageTypeRec;
|
||||
} FTC_INodeRec, *FTC_INode;
|
||||
|
||||
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
|
||||
#define FTC_INODE( x ) ( (FTC_INode)( x ) )
|
||||
#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
|
||||
#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
|
||||
|
||||
/* */
|
||||
typedef FT_Error
|
||||
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
FT_UInt gindex,
|
||||
FTC_Cache cache,
|
||||
FT_Glyph *aglyph );
|
||||
|
||||
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
|
||||
( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_ImageCache */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to an glyph image cache object. They are designed to */
|
||||
/* hold many distinct glyph images while not exceeding a certain */
|
||||
/* memory threshold. */
|
||||
/* */
|
||||
typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_ImageCache_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new glyph image cache. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: The parent manager for the image cache. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* acache :: A handle to the new glyph image cache object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_ImageCache_New( FTC_Manager manager,
|
||||
FTC_ImageCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_ImageCache_Lookup */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves a given glyph image from a glyph image cache. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source glyph image cache. */
|
||||
/* */
|
||||
/* type :: A pointer to a glyph image type descriptor. */
|
||||
/* */
|
||||
/* gindex :: The glyph index to retrieve. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aglyph :: The corresponding @FT_Glyph object. 0 in case of */
|
||||
/* failure. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding cache */
|
||||
/* node after incrementing its reference count (see note */
|
||||
/* below). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The returned glyph is owned and managed by the glyph image cache. */
|
||||
/* Never try to transform or discard it manually! You can however */
|
||||
/* create a copy with @FT_Glyph_Copy and modify the new one. */
|
||||
/* */
|
||||
/* If "anode" is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the glyph image, after increasing its reference */
|
||||
/* count. This ensures that the node (as well as the FT_Glyph) will */
|
||||
/* always be kept in the cache until you call @FTC_Node_Unref to */
|
||||
/* "release" it. */
|
||||
/* */
|
||||
/* If "anode" is NULL, the cache node is left unchanged, which means */
|
||||
/* that the FT_Glyph could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_ImageCache_Lookup( FTC_ImageCache cache,
|
||||
FTC_ImageType type,
|
||||
FT_UInt gindex,
|
||||
FT_Glyph *aglyph,
|
||||
FTC_Node *anode );
|
||||
|
||||
/* */
|
||||
|
||||
#define ftc_image_format( x ) ( (x) & 7 )
|
||||
|
||||
|
||||
#define ftc_image_format_bitmap 0x0000
|
||||
#define ftc_image_format_outline 0x0001
|
||||
|
||||
#define ftc_image_format_mask 0x000F
|
||||
|
||||
#define ftc_image_flag_monochrome 0x0010
|
||||
#define ftc_image_flag_unhinted 0x0020
|
||||
#define ftc_image_flag_autohinted 0x0040
|
||||
#define ftc_image_flag_unscaled 0x0080
|
||||
#define ftc_image_flag_no_sbits 0x0100
|
||||
|
||||
/* monochrome bitmap */
|
||||
#define ftc_image_mono ftc_image_format_bitmap | \
|
||||
ftc_image_flag_monochrome
|
||||
|
||||
/* anti-aliased bitmap */
|
||||
#define ftc_image_grays ftc_image_format_bitmap
|
||||
|
||||
/* scaled outline */
|
||||
#define ftc_image_outline ftc_image_format_outline
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_Image_Desc */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. Use @FTC_ImageTypeRec instead. */
|
||||
/* */
|
||||
/* A simple structure used to describe a given glyph image category. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* font :: An @FTC_FontRec used to describe the glyph's face */
|
||||
/* and size. */
|
||||
/* */
|
||||
/* image_type :: The glyph image's type. */
|
||||
/* */
|
||||
typedef struct FTC_Image_Desc_
|
||||
typedef struct FTC_IFamilyClassRec_
|
||||
{
|
||||
FTC_FontRec font;
|
||||
FT_UInt image_type;
|
||||
FTC_MruListClassRec clazz;
|
||||
FTC_IFamily_LoadGlyphFunc family_load_glyph;
|
||||
|
||||
} FTC_Image_Desc;
|
||||
} FTC_IFamilyClassRec;
|
||||
|
||||
typedef const FTC_IFamilyClassRec* FTC_IFamilyClass;
|
||||
|
||||
#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
|
||||
|
||||
#define FTC_CACHE__IFAMILY_CLASS( x ) \
|
||||
FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_Image_Cache */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS TYPE IS DEPRECATED. Use @FTC_ImageCache instead. */
|
||||
/* */
|
||||
typedef FTC_ImageCache FTC_Image_Cache;
|
||||
/* can be used as a @FTC_Node_FreeFunc */
|
||||
FT_EXPORT( void )
|
||||
FTC_INode_Free( FTC_INode inode,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Image_Cache_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS FUNCTION IS DEPRECATED. Use @FTC_ImageCache_New instead. */
|
||||
/* */
|
||||
/* Creates a new glyph image cache. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: The parent manager for the image cache. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* acache :: A handle to the new glyph image cache object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* Can be used as @FTC_Node_NewFunc. `gquery.index' and `gquery.family'
|
||||
* must be set correctly. This function will call the `family_load_glyph'
|
||||
* method to load the FT_Glyph into the cache node.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Image_Cache_New( FTC_Manager manager,
|
||||
FTC_Image_Cache *acache );
|
||||
FTC_INode_New( FTC_INode *pinode,
|
||||
FTC_GQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Image_Cache_Lookup */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* THIS FUNCTION IS DEPRECATED. Use @FTC_ImageCache_Lookup instead. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source glyph image cache. */
|
||||
/* */
|
||||
/* desc :: A pointer to a glyph image descriptor. */
|
||||
/* */
|
||||
/* gindex :: The glyph index to retrieve. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aglyph :: The corresponding @FT_Glyph object. 0 in case of */
|
||||
/* failure. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The returned glyph is owned and managed by the glyph image cache. */
|
||||
/* Never try to transform or discard it manually! You can however */
|
||||
/* create a copy with @FT_Glyph_Copy and modify the new one. */
|
||||
/* */
|
||||
/* Because the glyph image cache limits the total amount of memory */
|
||||
/* taken by the glyphs it holds, the returned glyph might disappear */
|
||||
/* on a later invocation of this function! It is a cache after */
|
||||
/* all... */
|
||||
/* */
|
||||
/* Use this function to "lock" the glyph as long as it is needed. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Image_Cache_Lookup( FTC_Image_Cache cache,
|
||||
FTC_Image_Desc* desc,
|
||||
FT_UInt gindex,
|
||||
FT_Glyph *aglyph );
|
||||
/* can be used as @FTC_Node_WeightFunc */
|
||||
FT_EXPORT( FT_ULong )
|
||||
FTC_INode_Weight( FTC_INode inode );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCIMAGE_H__ */
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Cache Manager (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -65,7 +65,7 @@
|
|||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_INTERNAL_LRU_H
|
||||
#include FT_CACHE_INTERNAL_MRU_H
|
||||
#include FT_CACHE_INTERNAL_CACHE_H
|
||||
|
||||
|
||||
|
@ -88,91 +88,25 @@ FT_BEGIN_HEADER
|
|||
#define FTC_MAX_CACHES 16
|
||||
|
||||
|
||||
typedef struct FTC_FamilyEntryRec_
|
||||
{
|
||||
FTC_Family family;
|
||||
FTC_Cache cache;
|
||||
FT_UInt index;
|
||||
FT_UInt link;
|
||||
|
||||
} FTC_FamilyEntryRec, *FTC_FamilyEntry;
|
||||
|
||||
|
||||
#define FTC_FAMILY_ENTRY_NONE ( (FT_UInt)-1 )
|
||||
|
||||
|
||||
typedef struct FTC_FamilyTableRec_
|
||||
{
|
||||
FT_UInt count;
|
||||
FT_UInt size;
|
||||
FTC_FamilyEntry entries;
|
||||
FT_UInt free;
|
||||
|
||||
} FTC_FamilyTableRec, *FTC_FamilyTable;
|
||||
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
ftc_family_table_alloc( FTC_FamilyTable table,
|
||||
FT_Memory memory,
|
||||
FTC_FamilyEntry *aentry );
|
||||
|
||||
FT_EXPORT( void )
|
||||
ftc_family_table_free( FTC_FamilyTable table,
|
||||
FT_UInt idx );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_ManagerRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The cache manager structure. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* library :: A handle to a FreeType library instance. */
|
||||
/* */
|
||||
/* faces_list :: The lru list of @FT_Face objects in the cache. */
|
||||
/* */
|
||||
/* sizes_list :: The lru list of @FT_Size objects in the cache. */
|
||||
/* */
|
||||
/* max_weight :: The maximum cache pool weight. */
|
||||
/* */
|
||||
/* cur_weight :: The current cache pool weight. */
|
||||
/* */
|
||||
/* num_nodes :: The current number of nodes in the manager. */
|
||||
/* */
|
||||
/* nodes_list :: The global lru list of all cache nodes. */
|
||||
/* */
|
||||
/* caches :: A table of installed/registered cache objects. */
|
||||
/* */
|
||||
/* request_data :: User-provided data passed to the requester. */
|
||||
/* */
|
||||
/* request_face :: User-provided function used to implement a mapping */
|
||||
/* between abstract @FTC_FaceID values and real */
|
||||
/* @FT_Face objects. */
|
||||
/* */
|
||||
/* families :: Global table of families. */
|
||||
/* */
|
||||
typedef struct FTC_ManagerRec_
|
||||
{
|
||||
FT_Library library;
|
||||
FT_LruList faces_list;
|
||||
FT_LruList sizes_list;
|
||||
FT_Memory memory;
|
||||
|
||||
FTC_Node nodes_list;
|
||||
FT_ULong max_weight;
|
||||
FT_ULong cur_weight;
|
||||
|
||||
FT_UInt num_nodes;
|
||||
FTC_Node nodes_list;
|
||||
|
||||
|
||||
FTC_Cache caches[FTC_MAX_CACHES];
|
||||
FT_UInt num_caches;
|
||||
|
||||
FTC_MruListRec faces;
|
||||
FTC_MruListRec sizes;
|
||||
|
||||
FT_Pointer request_data;
|
||||
FTC_Face_Requester request_face;
|
||||
|
||||
FTC_FamilyTableRec families;
|
||||
|
||||
} FTC_ManagerRec;
|
||||
|
||||
|
||||
|
@ -201,43 +135,40 @@ FT_BEGIN_HEADER
|
|||
FTC_Manager_Compress( FTC_Manager manager );
|
||||
|
||||
|
||||
/* try to flush `count' old nodes from the cache; return the number
|
||||
* of really flushed nodes
|
||||
*/
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_Manager_FlushN( FTC_Manager manager,
|
||||
FT_UInt count );
|
||||
|
||||
|
||||
/* this must be used internally for the moment */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Register_Cache( FTC_Manager manager,
|
||||
FTC_Cache_Class clazz,
|
||||
FTC_Cache *acache );
|
||||
FTC_Manager_RegisterCache( FTC_Manager manager,
|
||||
FTC_CacheClass clazz,
|
||||
FTC_Cache *acache );
|
||||
|
||||
/* */
|
||||
|
||||
/* can be called to increment a node's reference count */
|
||||
FT_EXPORT( void )
|
||||
FTC_Node_Ref( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
#define FTC_SCALER_COMPARE( a, b ) \
|
||||
( (a)->face_id == (b)->face_id && \
|
||||
(a)->width == (b)->width && \
|
||||
(a)->height == (b)->height && \
|
||||
((a)->pixel != 0) == ((b)->pixel != 0) && \
|
||||
( (a)->pixel || \
|
||||
( (a)->x_res == (b)->x_res && \
|
||||
(a)->y_res == (b)->y_res ) ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Node_Unref */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Decrement a cache node's internal reference count. When the count */
|
||||
/* reaches 0, it is not destroyed but becomes eligible for subsequent */
|
||||
/* cache flushes. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* node :: The cache node handle. */
|
||||
/* */
|
||||
/* manager :: The cache manager handle. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FTC_Node_Unref( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
#define FTC_SCALER_HASH( q ) \
|
||||
( FTC_FACE_ID_HASH( (q)->face_id ) + \
|
||||
(q)->width + (q)->height*7 + \
|
||||
( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) )
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCMANAG_H__ */
|
||||
|
||||
|
||||
|
|
246
reactos/lib/freetype/include/freetype/cache/ftcmru.h
vendored
Normal file
246
reactos/lib/freetype/include/freetype/cache/ftcmru.h
vendored
Normal file
|
@ -0,0 +1,246 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftcmru.h */
|
||||
/* */
|
||||
/* Simple MRU list-cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* An MRU is a list that cannot hold more than a certain number of */
|
||||
/* elements (`max_elements'). All elements in the list are sorted in */
|
||||
/* least-recently-used order, i.e., the `oldest' element is at the tail */
|
||||
/* of the list. */
|
||||
/* */
|
||||
/* When doing a lookup (either through `Lookup()' or `Lookup_Node()'), */
|
||||
/* the list is searched for an element with the corresponding key. If */
|
||||
/* it is found, the element is moved to the head of the list and is */
|
||||
/* returned. */
|
||||
/* */
|
||||
/* If no corresponding element is found, the lookup routine will try to */
|
||||
/* obtain a new element with the relevant key. If the list is already */
|
||||
/* full, the oldest element from the list is discarded and replaced by a */
|
||||
/* new one; a new element is added to the list otherwise. */
|
||||
/* */
|
||||
/* Note that it is possible to pre-allocate the element list nodes. */
|
||||
/* This is handy if `max_elements' is sufficiently small, as it saves */
|
||||
/* allocations/releases during the lookup process. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTCMRU_H__
|
||||
#define __FTCMRU_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
#define xxFT_DEBUG_ERROR
|
||||
#define FTC_INLINE
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
typedef struct FTC_MruNodeRec_* FTC_MruNode;
|
||||
|
||||
typedef struct FTC_MruNodeRec_
|
||||
{
|
||||
FTC_MruNode next;
|
||||
FTC_MruNode prev;
|
||||
|
||||
} FTC_MruNodeRec;
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Prepend( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Up( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruNode_Remove( FTC_MruNode *plist,
|
||||
FTC_MruNode node );
|
||||
|
||||
|
||||
typedef struct FTC_MruListRec_* FTC_MruList;
|
||||
|
||||
typedef struct FTC_MruListClassRec_ const * FTC_MruListClass;
|
||||
|
||||
|
||||
typedef FT_Int
|
||||
(*FTC_MruNode_CompareFunc)( FTC_MruNode node,
|
||||
FT_Pointer key );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_MruNode_InitFunc)( FTC_MruNode node,
|
||||
FT_Pointer key,
|
||||
FT_Pointer data );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_MruNode_ResetFunc)( FTC_MruNode node,
|
||||
FT_Pointer key,
|
||||
FT_Pointer data );
|
||||
|
||||
typedef void
|
||||
(*FTC_MruNode_DoneFunc)( FTC_MruNode node,
|
||||
FT_Pointer data );
|
||||
|
||||
|
||||
typedef struct FTC_MruListClassRec_
|
||||
{
|
||||
FT_UInt node_size;
|
||||
FTC_MruNode_CompareFunc node_compare;
|
||||
FTC_MruNode_InitFunc node_init;
|
||||
FTC_MruNode_ResetFunc node_reset;
|
||||
FTC_MruNode_DoneFunc node_done;
|
||||
|
||||
} FTC_MruListClassRec;
|
||||
|
||||
typedef struct FTC_MruListRec_
|
||||
{
|
||||
FT_UInt num_nodes;
|
||||
FT_UInt max_nodes;
|
||||
FTC_MruNode nodes;
|
||||
FT_Pointer data;
|
||||
FTC_MruListClassRec clazz;
|
||||
FT_Memory memory;
|
||||
|
||||
} FTC_MruListRec;
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Init( FTC_MruList list,
|
||||
FTC_MruListClass clazz,
|
||||
FT_UInt max_nodes,
|
||||
FT_Pointer data,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Reset( FTC_MruList list );
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Done( FTC_MruList list );
|
||||
|
||||
FT_EXPORT( FTC_MruNode )
|
||||
FTC_MruList_Find( FTC_MruList list,
|
||||
FT_Pointer key );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_MruList_New( FTC_MruList list,
|
||||
FT_Pointer key,
|
||||
FTC_MruNode *anode );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_MruList_Lookup( FTC_MruList list,
|
||||
FT_Pointer key,
|
||||
FTC_MruNode *pnode );
|
||||
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_Remove( FTC_MruList list,
|
||||
FTC_MruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FTC_MruList_RemoveSelection( FTC_MruList list,
|
||||
FTC_MruNode_CompareFunc selection,
|
||||
FT_Pointer key );
|
||||
|
||||
|
||||
#ifdef FTC_INLINE
|
||||
|
||||
#define FTC_MRULIST_LOOKUP_CMP( list, key, compare, node, error ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_MruNode* _pfirst = &(list)->nodes; \
|
||||
FTC_MruNode_CompareFunc _compare = (FTC_MruNode_CompareFunc)(compare); \
|
||||
FTC_MruNode _first, _node; \
|
||||
\
|
||||
\
|
||||
error = 0; \
|
||||
_first = *(_pfirst); \
|
||||
_node = NULL; \
|
||||
\
|
||||
if ( _first ) \
|
||||
{ \
|
||||
_node = _first; \
|
||||
do \
|
||||
{ \
|
||||
if ( _compare( _node, (key) ) ) \
|
||||
{ \
|
||||
if ( _node != _first ) \
|
||||
FTC_MruNode_Up( _pfirst, _node ); \
|
||||
\
|
||||
*(FTC_MruNode*)&(node) = _node; \
|
||||
goto _MruOk; \
|
||||
} \
|
||||
_node = _node->next; \
|
||||
\
|
||||
} while ( _node != _first) ; \
|
||||
} \
|
||||
\
|
||||
error = FTC_MruList_New( (list), (key), (FTC_MruNode*)&(node) ); \
|
||||
_MruOk: \
|
||||
; \
|
||||
FT_END_STMNT
|
||||
|
||||
#define FTC_MRULIST_LOOKUP( list, key, node, error ) \
|
||||
FTC_MRULIST_LOOKUP_CMP( list, key, (list)->clazz.node_compare, node, error )
|
||||
|
||||
#else /* !FTC_INLINE */
|
||||
|
||||
#define FTC_MRULIST_LOOKUP( list, key, node, error ) \
|
||||
error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) )
|
||||
|
||||
#endif /* !FTC_INLINE */
|
||||
|
||||
|
||||
#define FTC_MRULIST_LOOP( list, node ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FTC_MruNode _first = (list)->nodes; \
|
||||
\
|
||||
\
|
||||
if ( _first ) \
|
||||
{ \
|
||||
FTC_MruNode _node = _first; \
|
||||
\
|
||||
\
|
||||
do \
|
||||
{ \
|
||||
*(FTC_MruNode*)&(node) = _node;
|
||||
|
||||
|
||||
#define FTC_MRULIST_LOOP_END() \
|
||||
_node = _node->next; \
|
||||
\
|
||||
} while ( _node != _first ); \
|
||||
} \
|
||||
FT_END_STMNT
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTCMRU_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* A small-bitmap cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001, 2002 by */
|
||||
/* Copyright 2000-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -22,251 +22,72 @@
|
|||
|
||||
#include <ft2build.h>
|
||||
#include FT_CACHE_H
|
||||
#include FT_CACHE_IMAGE_H
|
||||
#include FT_CACHE_INTERNAL_GLYPH_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
#define FTC_SBIT_ITEMS_PER_NODE 16
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_SBit */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
|
||||
/* structure for details. */
|
||||
/* */
|
||||
typedef struct FTC_SBitRec_* FTC_SBit;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_SBitRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A very compact structure used to describe a small glyph bitmap. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* width :: The bitmap width in pixels. */
|
||||
/* */
|
||||
/* height :: The bitmap height in pixels. */
|
||||
/* */
|
||||
/* left :: The horizontal distance from the pen position to the */
|
||||
/* left bitmap border (a.k.a. `left side bearing', or */
|
||||
/* `lsb'). */
|
||||
/* */
|
||||
/* top :: The vertical distance from the pen position (on the */
|
||||
/* baseline) to the upper bitmap border (a.k.a. `top */
|
||||
/* side bearing'). The distance is positive for upwards */
|
||||
/* Y coordinates. */
|
||||
/* */
|
||||
/* format :: The format of the glyph bitmap (monochrome or gray). */
|
||||
/* */
|
||||
/* max_grays :: Maximum gray level value (in the range 1 to 255). */
|
||||
/* */
|
||||
/* pitch :: The number of bytes per bitmap line. May be positive */
|
||||
/* or negative. */
|
||||
/* */
|
||||
/* xadvance :: The horizontal advance width in pixels. */
|
||||
/* */
|
||||
/* yadvance :: The vertical advance height in pixels. */
|
||||
/* */
|
||||
/* buffer :: A pointer to the bitmap pixels. */
|
||||
/* */
|
||||
typedef struct FTC_SBitRec_
|
||||
typedef struct FTC_SNodeRec_
|
||||
{
|
||||
FT_Byte width;
|
||||
FT_Byte height;
|
||||
FT_Char left;
|
||||
FT_Char top;
|
||||
FTC_GNodeRec gnode;
|
||||
FT_UInt count;
|
||||
FTC_SBitRec sbits[FTC_SBIT_ITEMS_PER_NODE];
|
||||
|
||||
FT_Byte format;
|
||||
FT_Byte max_grays;
|
||||
FT_Short pitch;
|
||||
FT_Char xadvance;
|
||||
FT_Char yadvance;
|
||||
|
||||
FT_Byte* buffer;
|
||||
|
||||
} FTC_SBitRec;
|
||||
} FTC_SNodeRec, *FTC_SNode;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_SBitCache */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a small bitmap cache. These are special cache objects */
|
||||
/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
|
||||
/* much more efficient way than the traditional glyph image cache */
|
||||
/* implemented by @FTC_ImageCache. */
|
||||
/* */
|
||||
typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
|
||||
#define FTC_SNODE( x ) ( (FTC_SNode)( x ) )
|
||||
#define FTC_SNODE_GINDEX( x ) FTC_GNODE( x )->gindex
|
||||
#define FTC_SNODE_FAMILY( x ) FTC_GNODE( x )->family
|
||||
|
||||
typedef FT_UInt
|
||||
(*FTC_SFamily_GetCountFunc)( FTC_Family family,
|
||||
FTC_Manager manager );
|
||||
|
||||
typedef FT_Error
|
||||
(*FTC_SFamily_LoadGlyphFunc)( FTC_Family family,
|
||||
FT_UInt gindex,
|
||||
FTC_Manager manager,
|
||||
FT_Face *aface );
|
||||
|
||||
typedef struct FTC_SFamilyClassRec_
|
||||
{
|
||||
FTC_MruListClassRec clazz;
|
||||
FTC_SFamily_GetCountFunc family_get_count;
|
||||
FTC_SFamily_LoadGlyphFunc family_load_glyph;
|
||||
|
||||
} FTC_SFamilyClassRec;
|
||||
|
||||
typedef const FTC_SFamilyClassRec* FTC_SFamilyClass;
|
||||
|
||||
#define FTC_SFAMILY_CLASS( x ) ((FTC_SFamilyClass)(x))
|
||||
|
||||
#define FTC_CACHE__SFAMILY_CLASS( x ) \
|
||||
FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_SBit_Cache */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* DEPRECATED. Use @FTC_SBitCache instead. */
|
||||
/* */
|
||||
typedef FTC_SBitCache FTC_SBit_Cache;
|
||||
FT_EXPORT( void )
|
||||
FTC_SNode_Free( FTC_SNode snode,
|
||||
FTC_Cache cache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_SBitCache_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new cache to store small glyph bitmaps. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: A handle to the source cache manager. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* acache :: A handle to the new sbit cache. NULL in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBitCache_New( FTC_Manager manager,
|
||||
FTC_SBitCache *acache );
|
||||
FTC_SNode_New( FTC_SNode *psnode,
|
||||
FTC_GQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
FT_EXPORT( FT_ULong )
|
||||
FTC_SNode_Weight( FTC_SNode inode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_SBitCache_Lookup */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Looks up a given small glyph bitmap in a given sbit cache and */
|
||||
/* "lock" it to prevent its flushing from the cache until needed */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source sbit cache. */
|
||||
/* */
|
||||
/* type :: A pointer to the glyph image type descriptor. */
|
||||
/* */
|
||||
/* gindex :: The glyph index. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* sbit :: A handle to a small bitmap descriptor. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding cache */
|
||||
/* node after incrementing its reference count (see note */
|
||||
/* below). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The small bitmap descriptor and its bit buffer are owned by the */
|
||||
/* cache and should never be freed by the application. They might */
|
||||
/* as well disappear from memory on the next cache lookup, so don't */
|
||||
/* treat them as persistent data. */
|
||||
/* */
|
||||
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
|
||||
/* glyph bitmap. */
|
||||
/* */
|
||||
/* If "anode" is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the bitmap, after increasing its reference count. */
|
||||
/* This ensures that the node (as well as the image) will always be */
|
||||
/* kept in the cache until you call @FTC_Node_Unref to "release" it. */
|
||||
/* */
|
||||
/* If "anode" is NULL, the cache node is left unchanged, which means */
|
||||
/* that the bitmap could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBitCache_Lookup( FTC_SBitCache cache,
|
||||
FTC_ImageType type,
|
||||
FT_UInt gindex,
|
||||
FTC_SBit *sbit,
|
||||
FTC_Node *anode );
|
||||
|
||||
FT_EXPORT( FT_Bool )
|
||||
FTC_SNode_Compare( FTC_SNode snode,
|
||||
FTC_GQuery gquery,
|
||||
FTC_Cache cache );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_SBit_Cache_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* DEPRECATED. Use @FTC_SBitCache_New instead. */
|
||||
/* */
|
||||
/* Creates a new cache to store small glyph bitmaps. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: A handle to the source cache manager. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* acache :: A handle to the new sbit cache. NULL in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBit_Cache_New( FTC_Manager manager,
|
||||
FTC_SBit_Cache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_SBit_Cache_Lookup */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* DEPRECATED. Use @FTC_SBitCache_Lookup instead. */
|
||||
/* */
|
||||
/* Looks up a given small glyph bitmap in a given sbit cache. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source sbit cache. */
|
||||
/* */
|
||||
/* desc :: A pointer to the glyph image descriptor. */
|
||||
/* */
|
||||
/* gindex :: The glyph index. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* sbit :: A handle to a small bitmap descriptor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The small bitmap descriptor and its bit buffer are owned by the */
|
||||
/* cache and should never be freed by the application. They might */
|
||||
/* as well disappear from memory on the next cache lookup, so don't */
|
||||
/* treat them as persistent data. */
|
||||
/* */
|
||||
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
|
||||
/* glyph bitmap. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBit_Cache_Lookup( FTC_SBit_Cache cache,
|
||||
FTC_Image_Desc* desc,
|
||||
FT_UInt gindex,
|
||||
FTC_SBit *sbit );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCSBITS_H__ */
|
||||
|
|
202
reactos/lib/freetype/include/freetype/cache/ftlru.h
vendored
202
reactos/lib/freetype/include/freetype/cache/ftlru.h
vendored
|
@ -1,202 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftlru.h */
|
||||
/* */
|
||||
/* Simple LRU list-cache (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* An LRU is a list that cannot hold more than a certain number of */
|
||||
/* elements (`max_elements'). All elements in the list are sorted in */
|
||||
/* least-recently-used order, i.e., the `oldest' element is at the tail */
|
||||
/* of the list. */
|
||||
/* */
|
||||
/* When doing a lookup (either through `Lookup()' or `Lookup_Node()'), */
|
||||
/* the list is searched for an element with the corresponding key. If */
|
||||
/* it is found, the element is moved to the head of the list and is */
|
||||
/* returned. */
|
||||
/* */
|
||||
/* If no corresponding element is found, the lookup routine will try to */
|
||||
/* obtain a new element with the relevant key. If the list is already */
|
||||
/* full, the oldest element from the list is discarded and replaced by a */
|
||||
/* new one; a new element is added to the list otherwise. */
|
||||
/* */
|
||||
/* Note that it is possible to pre-allocate the element list nodes. */
|
||||
/* This is handy if `max_elements' is sufficiently small, as it saves */
|
||||
/* allocations/releases during the lookup process. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/********* *********/
|
||||
/********* WARNING, THIS IS BETA CODE. *********/
|
||||
/********* *********/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTLRU_H__
|
||||
#define __FTLRU_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* generic list key type */
|
||||
typedef FT_Pointer FT_LruKey;
|
||||
|
||||
/* a list list handle */
|
||||
typedef struct FT_LruListRec_* FT_LruList;
|
||||
|
||||
/* a list class handle */
|
||||
typedef const struct FT_LruList_ClassRec_* FT_LruList_Class;
|
||||
|
||||
/* a list node handle */
|
||||
typedef struct FT_LruNodeRec_* FT_LruNode;
|
||||
|
||||
/* the list node structure */
|
||||
typedef struct FT_LruNodeRec_
|
||||
{
|
||||
FT_LruNode next;
|
||||
FT_LruKey key;
|
||||
|
||||
} FT_LruNodeRec;
|
||||
|
||||
|
||||
/* the list structure */
|
||||
typedef struct FT_LruListRec_
|
||||
{
|
||||
FT_Memory memory;
|
||||
FT_LruList_Class clazz;
|
||||
FT_LruNode nodes;
|
||||
FT_UInt max_nodes;
|
||||
FT_UInt num_nodes;
|
||||
FT_Pointer data;
|
||||
|
||||
} FT_LruListRec;
|
||||
|
||||
|
||||
/* initialize a list list */
|
||||
typedef FT_Error
|
||||
(*FT_LruList_InitFunc)( FT_LruList list );
|
||||
|
||||
/* finalize a list list */
|
||||
typedef void
|
||||
(*FT_LruList_DoneFunc)( FT_LruList list );
|
||||
|
||||
/* this method is used to initialize a new list element node */
|
||||
typedef FT_Error
|
||||
(*FT_LruNode_InitFunc)( FT_LruNode node,
|
||||
FT_LruKey key,
|
||||
FT_Pointer data );
|
||||
|
||||
/* this method is used to finalize a given list element node */
|
||||
typedef void
|
||||
(*FT_LruNode_DoneFunc)( FT_LruNode node,
|
||||
FT_Pointer data );
|
||||
|
||||
/* If defined, this method is called when the list if full */
|
||||
/* during the lookup process -- it is used to change the contents */
|
||||
/* of a list element node instead of calling `done_element()', */
|
||||
/* then `init_element()'. Set it to 0 for default behaviour. */
|
||||
typedef FT_Error
|
||||
(*FT_LruNode_FlushFunc)( FT_LruNode node,
|
||||
FT_LruKey new_key,
|
||||
FT_Pointer data );
|
||||
|
||||
/* If defined, this method is used to compare a list element node */
|
||||
/* with a given key during a lookup. If set to 0, the `key' */
|
||||
/* fields will be directly compared instead. */
|
||||
typedef FT_Bool
|
||||
(*FT_LruNode_CompareFunc)( FT_LruNode node,
|
||||
FT_LruKey key,
|
||||
FT_Pointer data );
|
||||
|
||||
/* A selector is used to indicate whether a given list element node */
|
||||
/* is part of a selection for FT_LruList_Remove_Selection(). The */
|
||||
/* functrion must return true (i.e., non-null) to indicate that the */
|
||||
/* node is part of it. */
|
||||
typedef FT_Bool
|
||||
(*FT_LruNode_SelectFunc)( FT_LruNode node,
|
||||
FT_Pointer data,
|
||||
FT_Pointer list_data );
|
||||
|
||||
/* LRU class */
|
||||
typedef struct FT_LruList_ClassRec_
|
||||
{
|
||||
FT_UInt list_size;
|
||||
FT_LruList_InitFunc list_init; /* optional */
|
||||
FT_LruList_DoneFunc list_done; /* optional */
|
||||
|
||||
FT_UInt node_size;
|
||||
FT_LruNode_InitFunc node_init; /* MANDATORY */
|
||||
FT_LruNode_DoneFunc node_done; /* optional */
|
||||
FT_LruNode_FlushFunc node_flush; /* optional */
|
||||
FT_LruNode_CompareFunc node_compare; /* optional */
|
||||
|
||||
} FT_LruList_ClassRec;
|
||||
|
||||
|
||||
/* The following functions must be exported in the case where */
|
||||
/* applications would want to write their own cache classes. */
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_LruList_New( FT_LruList_Class clazz,
|
||||
FT_UInt max_elements,
|
||||
FT_Pointer user_data,
|
||||
FT_Memory memory,
|
||||
FT_LruList *alist );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FT_LruList_Reset( FT_LruList list );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FT_LruList_Destroy ( FT_LruList list );
|
||||
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_LruList_Lookup( FT_LruList list,
|
||||
FT_LruKey key,
|
||||
FT_LruNode *anode );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FT_LruList_Remove( FT_LruList list,
|
||||
FT_LruNode node );
|
||||
|
||||
FT_EXPORT( void )
|
||||
FT_LruList_Remove_Selection( FT_LruList list,
|
||||
FT_LruNode_SelectFunc select_func,
|
||||
FT_Pointer select_data );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __FTLRU_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* ANSI-specific configuration file (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -58,24 +58,37 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
/* The number of bytes in an `int' type. */
|
||||
#if FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT 4
|
||||
#elif FT_UINT_MAX == 0xFFFFU
|
||||
#define FT_SIZEOF_INT 2
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFU && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFU
|
||||
#define FT_SIZEOF_INT 8
|
||||
#else
|
||||
#error "Unsupported number of bytes in `int' type!"
|
||||
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
|
||||
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
|
||||
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
|
||||
/* is probably unexpected. */
|
||||
/* */
|
||||
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
|
||||
/* `char' type. */
|
||||
|
||||
#ifndef FT_CHAR_BIT
|
||||
#define FT_CHAR_BIT CHAR_BIT
|
||||
#endif
|
||||
|
||||
/* The number of bytes in a `long' type. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG 4
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFU && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
|
||||
#define FT_SIZEOF_LONG 8
|
||||
|
||||
/* The size of an `int' type. */
|
||||
#if FT_UINT_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_INT (32 / FT_CHAR_BIT)
|
||||
#elif FT_UINT_MAX == 0xFFFFU
|
||||
#define FT_SIZEOF_INT (16 / FT_CHAR_BIT)
|
||||
#elif FT_UINT_MAX > 0xFFFFFFFFU && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFU
|
||||
#define FT_SIZEOF_INT (64 / FT_CHAR_BIT)
|
||||
#else
|
||||
#error "Unsupported number of bytes in `long' type!"
|
||||
#error "Unsupported size of `int' type!"
|
||||
#endif
|
||||
|
||||
/* The size of a `long' type. */
|
||||
#if FT_ULONG_MAX == 0xFFFFFFFFUL
|
||||
#define FT_SIZEOF_LONG (32 / FT_CHAR_BIT)
|
||||
#elif FT_ULONG_MAX > 0xFFFFFFFFU && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
|
||||
#define FT_SIZEOF_LONG (64 / FT_CHAR_BIT)
|
||||
#else
|
||||
#error "Unsupported size of `long' type!"
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -123,12 +136,12 @@ FT_BEGIN_HEADER
|
|||
typedef signed short FT_Int16;
|
||||
typedef unsigned short FT_UInt16;
|
||||
|
||||
#if FT_SIZEOF_INT == 4
|
||||
#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef signed int FT_Int32;
|
||||
typedef unsigned int FT_UInt32;
|
||||
|
||||
#elif FT_SIZEOF_LONG == 4
|
||||
#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef signed long FT_Int32;
|
||||
typedef unsigned long FT_UInt32;
|
||||
|
@ -137,13 +150,13 @@ FT_BEGIN_HEADER
|
|||
#error "no 32bit type found -- please check your configuration files"
|
||||
#endif
|
||||
|
||||
/* now, lookup for an integer type that is at least 32 bits */
|
||||
#if FT_SIZEOF_INT >= 4
|
||||
/* look up an integer type that is at least 32 bits */
|
||||
#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef int FT_Fast;
|
||||
typedef unsigned int FT_UFast;
|
||||
|
||||
#elif FT_SIZEOF_LONG >= 4
|
||||
#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)
|
||||
|
||||
typedef long FT_Fast;
|
||||
typedef unsigned long FT_UFast;
|
||||
|
@ -153,7 +166,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* determine whether we have a 64-bit int type for platforms without */
|
||||
/* Autoconf */
|
||||
#if FT_SIZEOF_LONG == 8
|
||||
#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)
|
||||
|
||||
/* FT_LONG64 must be defined if a 64-bit type is available */
|
||||
#define FT_LONG64
|
||||
|
@ -189,7 +202,12 @@ FT_BEGIN_HEADER
|
|||
#define FT_LONG64
|
||||
#define FT_INT64 long long int
|
||||
|
||||
#endif /* FT_SIZEOF_LONG == 8 */
|
||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||
|
||||
|
||||
#define FT_BEGIN_STMNT do {
|
||||
#define FT_END_STMNT } while ( 0 )
|
||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Build macros of the FreeType 2 library. */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -150,6 +150,7 @@
|
|||
#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* public headers */
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -281,7 +282,7 @@
|
|||
/* A macro used in #include statements to name the file containing */
|
||||
/* the module management API of FreeType 2. */
|
||||
/* */
|
||||
#define FT_MODULE_H <freetype/ftmodule.h>
|
||||
#define FT_MODULE_H <freetype/ftmodapi.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -373,6 +374,18 @@
|
|||
#define FT_GZIP_H <freetype/ftgzip.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
/* FT_LZW_H */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* A macro used in #include statements to name the file containing */
|
||||
/* the definitions of an API to support for LZW-compressed files. */
|
||||
/* */
|
||||
#define FT_LZW_H <freetype/ftlzw.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
|
@ -384,6 +397,7 @@
|
|||
/* */
|
||||
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @macro: */
|
||||
|
@ -433,7 +447,10 @@
|
|||
/* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need */
|
||||
/* to store small glyph bitmaps, as it will use less memory. */
|
||||
/* */
|
||||
#define FT_CACHE_IMAGE_H <freetype/cache/ftcimage.h>
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* glyph image-related cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_IMAGE_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -450,7 +467,10 @@
|
|||
/* in @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, */
|
||||
/* including scalable outlines. */
|
||||
/* */
|
||||
#define FT_CACHE_SMALL_BITMAPS_H <freetype/cache/ftcsbits.h>
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* small bitmaps-related cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -462,7 +482,10 @@
|
|||
/* A macro used in #include statements to name the file containing */
|
||||
/* the `charmap' API of the FreeType 2 cache sub-system. */
|
||||
/* */
|
||||
#define FT_CACHE_CHARMAP_H <freetype/cache/ftccmap.h>
|
||||
/* This macro is deprecated. Simply include @FT_CACHE_H to have all */
|
||||
/* charmap-based cache declarations. */
|
||||
/* */
|
||||
#define FT_CACHE_CHARMAP_H FT_CACHE_H
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -508,26 +531,30 @@
|
|||
|
||||
/* */
|
||||
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
|
||||
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
|
||||
#define FT_STROKER_H <freetype/ftstroke.h>
|
||||
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
|
||||
#define FT_ERROR_DEFINITIONS_H <freetype/fterrdef.h>
|
||||
|
||||
#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
|
||||
#define FT_CACHE_INTERNAL_LRU_H <freetype/cache/ftlru.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/cache/ftccache.h>
|
||||
#define FT_CACHE_INTERNAL_MRU_H <freetype/cache/ftcmru.h>
|
||||
#define FT_CACHE_INTERNAL_MANAGER_H <freetype/cache/ftcmanag.h>
|
||||
#define FT_CACHE_INTERNAL_CACHE_H <freetype/cache/ftccache.h>
|
||||
#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h>
|
||||
#define FT_CACHE_INTERNAL_IMAGE_H <freetype/cache/ftcimage.h>
|
||||
#define FT_CACHE_INTERNAL_SBITS_H <freetype/cache/ftcsbits.h>
|
||||
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
#define FT_XFREE86_H <freetype/ftxf86.h>
|
||||
|
||||
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
|
||||
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
|
||||
|
||||
#define FT_TRUETYPE_UNPATENTED_H <freetype/ttunpat.h>
|
||||
|
||||
/* now include internal headers definitions from <freetype/internal/...> */
|
||||
|
||||
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
|
||||
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
|
||||
#include FT_INTERNAL_INTERNAL_H
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* User-selectable configuration macros (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -95,6 +95,21 @@ FT_BEGIN_HEADER
|
|||
#undef FT_CONFIG_OPTION_FORCE_INT64
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* LZW-compressed file support. */
|
||||
/* */
|
||||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'compress' program. This is mostly used to parse many of the PCF */
|
||||
/* files that come with various X11 distributions. The implementation */
|
||||
/* uses NetBSD's `zopen' to partially uncompress the file on the fly */
|
||||
/* (see src/lzw/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this `feature'. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_LZW
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Gzip-compressed file support. */
|
||||
|
@ -102,11 +117,10 @@ FT_BEGIN_HEADER
|
|||
/* FreeType now handles font files that have been compressed with the */
|
||||
/* 'gzip' program. This is mostly used to parse many of the PCF files */
|
||||
/* that come with XFree86. The implementation uses `zlib' to */
|
||||
/* partially uncompress the file on the fly (see src/base/ftgzip.c). */
|
||||
/* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */
|
||||
/* */
|
||||
/* Define this macro if you want to enable this "feature". Note that */
|
||||
/* this will however force you to link the zlib to any program that */
|
||||
/* also uses FreeType. */
|
||||
/* Define this macro if you want to enable this `feature'. See also */
|
||||
/* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */
|
||||
/* */
|
||||
#define FT_CONFIG_OPTION_USE_ZLIB
|
||||
|
||||
|
@ -116,7 +130,7 @@ FT_BEGIN_HEADER
|
|||
/* ZLib library selection */
|
||||
/* */
|
||||
/* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */
|
||||
/* It allows FreeType's "ftgzip" component to link to the system's */
|
||||
/* It allows FreeType's `ftgzip' component to link to the system's */
|
||||
/* installation of the ZLib library. This is useful on systems like */
|
||||
/* Unix or VMS where it generally is already available. */
|
||||
/* */
|
||||
|
@ -230,6 +244,29 @@ FT_BEGIN_HEADER
|
|||
#define FT_CONFIG_OPTION_MAC_FONTS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Guessing methods to access embedded resource forks */
|
||||
/* */
|
||||
/* Enable extra Mac fonts support on non-Mac platforms (e.g. */
|
||||
/* GNU/Linux). */
|
||||
/* */
|
||||
/* Resource forks which include fonts data are stored sometimes in */
|
||||
/* locations which users or developers don't expected. In some cases, */
|
||||
/* resource forks start with some offset from the head of a file. In */
|
||||
/* other cases, the actual resource fork is stored in file different */
|
||||
/* from what the user specifies. If this option is activated, */
|
||||
/* FreeType tries to guess whether such offsets or different file */
|
||||
/* names must be used. */
|
||||
/* */
|
||||
/* Note that normal, direct access of resource forks is controlled via */
|
||||
/* the FT_CONFIG_OPTION_MAC_FONTS option. */
|
||||
/* */
|
||||
#ifdef FT_CONFIG_OPTION_MAC_FONTS
|
||||
#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Allow the use of FT_Incremental_Interface to load typefaces that */
|
||||
|
@ -411,10 +448,7 @@ FT_BEGIN_HEADER
|
|||
/* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */
|
||||
/* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally actived */
|
||||
/* */
|
||||
/* XXX: WARNING: THIS DOESN'T WORK AS ADVERTISED YET. PLEASE DO NOT */
|
||||
/* DEFINE FOR THE MOMENT.. */
|
||||
/* */
|
||||
/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */
|
||||
#define TT_CONFIG_OPTION_UNPATENTED_HINTING
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* ANSI-specific library and header configuration file (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -73,24 +73,27 @@
|
|||
|
||||
#include <ctype.h>
|
||||
|
||||
#define ft_isalnum isalnum
|
||||
#define ft_isupper isupper
|
||||
#define ft_islower islower
|
||||
#define ft_xdigit isxdigit
|
||||
#define ft_isalnum isalnum
|
||||
#define ft_isupper isupper
|
||||
#define ft_islower islower
|
||||
#define ft_isdigit isdigit
|
||||
#define ft_isxdigit isxdigit
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define ft_strlen strlen
|
||||
#define ft_memcmp memcmp
|
||||
#define ft_memcpy memcpy
|
||||
#define ft_memmove memmove
|
||||
#define ft_memset memset
|
||||
#define ft_strcat strcat
|
||||
#define ft_strcmp strcmp
|
||||
#define ft_strncmp strncmp
|
||||
#define ft_memcpy memcpy
|
||||
#define ft_strcpy strcpy
|
||||
#define ft_strlen strlen
|
||||
#define ft_strncmp strncmp
|
||||
#define ft_strncpy strncpy
|
||||
#define ft_memset memset
|
||||
#define ft_memmove memmove
|
||||
#define ft_memcmp memcmp
|
||||
#define ft_strrchr strrchr
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -109,7 +112,7 @@
|
|||
#define ft_qsort qsort
|
||||
#define ft_exit exit /* only used to exit from unhandled exceptions */
|
||||
|
||||
#define ft_atoi atoi
|
||||
#define ft_atol atol
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType high-level API and common types (specification only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -16,6 +16,15 @@
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef FT_FREETYPE_H
|
||||
#error "`ft2build.h' hasn't been included yet!"
|
||||
#error "Please always use macros to include FreeType header files."
|
||||
#error "Example:"
|
||||
#error " #include <ft2build.h>"
|
||||
#error " #include FT_FREETYPE_H"
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __FREETYPE_H__
|
||||
#define __FREETYPE_H__
|
||||
|
||||
|
@ -35,7 +44,7 @@
|
|||
/* */
|
||||
#define FREETYPE_MAJOR 2
|
||||
#define FREETYPE_MINOR 1
|
||||
#define FREETYPE_PATCH 5
|
||||
#define FREETYPE_PATCH 8
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
|
@ -460,7 +469,7 @@ FT_BEGIN_HEADER
|
|||
/* should redefine this macro in case of problems to something like */
|
||||
/* this: */
|
||||
/* */
|
||||
/* #define FT_ENC_TAG( value, a, b, c, d ) (value) */
|
||||
/* #define FT_ENC_TAG( value, a, b, c, d ) value */
|
||||
/* */
|
||||
/* to get a simple enumeration without assigning special numbers. */
|
||||
/* */
|
||||
|
@ -581,6 +590,37 @@ FT_BEGIN_HEADER
|
|||
/* the font file, for the cases when they are needed, with the Adobe */
|
||||
/* values as well. */
|
||||
/* */
|
||||
/* FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap */
|
||||
/* is neither Unicode nor ISO-8859-1 (otherwise it is set to */
|
||||
/* FT_ENCODING_UNICODE). Use `FT_Get_BDF_Charset_ID' to find out */
|
||||
/* which encoding is really present. If, for example, the */
|
||||
/* `cs_registry' field is `KOI8' and the `cs_encoding' field is `R', */
|
||||
/* the font is encoded in KOI8-R. */
|
||||
/* */
|
||||
/* FT_ENCODING_NONE is always set (with a single exception) by the */
|
||||
/* winfonts driver. Use `FT_Get_WinFNT_Header' and examine the */
|
||||
/* `charset' field of the `FT_WinFNT_HeaderRec' structure to find out */
|
||||
/* which encoding is really present. For example, FT_WinFNT_ID_CP1251 */
|
||||
/* (204) means Windows code page 1251 (for Russian). */
|
||||
/* */
|
||||
/* FT_ENCODING_NONE is set if `platform_id' is `TT_PLATFORM_MACINTOSH' */
|
||||
/* and `encoding_id' is not `TT_MAC_ID_ROMAN' (otherwise it is set to */
|
||||
/* FT_ENCODING_APPLE_ROMAN). */
|
||||
/* */
|
||||
/* If `platform_id' is `TT_PLATFORM_MACINTOSH', use the function */
|
||||
/* `FT_Get_CMap_Language_ID' to query the Mac language ID which may be */
|
||||
/* needed to be able to distinguish Apple encoding variants. See */
|
||||
/* */
|
||||
/* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */
|
||||
/* */
|
||||
/* to get an idea how to do that. Basically, if the language ID is 0, */
|
||||
/* dont use it, otherwise subtract 1 from the language ID. Then */
|
||||
/* examine `encoding_id'. If, for example, `encoding_id' is */
|
||||
/* `TT_MAC_ID_ROMAN' and the language ID (minus 1) is */
|
||||
/* `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman. */
|
||||
/* `TT_MAC_ID_ARABIC' with `TT_MAC_LANGID_FARSI' means the Farsi */
|
||||
/* variant the Arabic encoding. */
|
||||
/* */
|
||||
typedef enum FT_Encoding_
|
||||
{
|
||||
FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
|
||||
|
@ -728,10 +768,12 @@ FT_BEGIN_HEADER
|
|||
/* collection (i.e., a file which embeds */
|
||||
/* several faces), this is the total number of */
|
||||
/* faces found in the resource. 1 by default. */
|
||||
/* Accessing non-existent face indices causes */
|
||||
/* an error. */
|
||||
/* */
|
||||
/* face_index :: The index of the face in its font file. */
|
||||
/* Usually, this is 0 for all normal font */
|
||||
/* formats. It can be more in the case of */
|
||||
/* formats. It can be > 0 in the case of */
|
||||
/* collections (which embed several fonts in a */
|
||||
/* single resource/file). */
|
||||
/* */
|
||||
|
@ -932,7 +974,7 @@ FT_BEGIN_HEADER
|
|||
/* FT_FACE_FLAG_XXX */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A list of bit flags used in the 'face_flags' field of the */
|
||||
/* A list of bit flags used in the `face_flags' field of the */
|
||||
/* @FT_FaceRec structure. They inform client applications of */
|
||||
/* properties of the corresponding face. */
|
||||
/* */
|
||||
|
@ -1709,6 +1751,7 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* face_index :: The index of the face within the resource. The */
|
||||
/* first face has index 0. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
/* */
|
||||
|
@ -1722,9 +1765,9 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* @FT_New_Face can be used to determine and/or check the font format */
|
||||
/* of a given font resource. If the `face_index' field is negative, */
|
||||
/* the function will _not_ return any face handle in `aface'. Its */
|
||||
/* return value should be 0 if the font format is recognized, or */
|
||||
/* non-zero otherwise. */
|
||||
/* the function will _not_ return any face handle in `aface'; the */
|
||||
/* return value is 0 if the font format is recognized, or non-zero */
|
||||
/* otherwise. */
|
||||
/* */
|
||||
/* Each new face object created with this function also owns a */
|
||||
/* default @FT_Size object, accessible as `face->size'. */
|
||||
|
@ -1755,6 +1798,7 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* face_index :: The index of the face within the resource. The */
|
||||
/* first face has index 0. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
/* */
|
||||
|
@ -1774,8 +1818,8 @@ FT_BEGIN_HEADER
|
|||
/* @FT_New_Memory_Face can be used to determine and/or check the font */
|
||||
/* format of a given font resource. If the `face_index' field is */
|
||||
/* negative, the function will _not_ return any face handle in */
|
||||
/* `aface'. Its return value should be 0 if the font format is */
|
||||
/* recognized, or non-zero otherwise. */
|
||||
/* `aface'; the return value is 0 if the font format is recognized, */
|
||||
/* or non-zero otherwise. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_New_Memory_Face( FT_Library library,
|
||||
|
@ -1804,6 +1848,7 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* face_index :: The index of the face within the resource. The */
|
||||
/* first face has index 0. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
/* */
|
||||
|
@ -1815,11 +1860,11 @@ FT_BEGIN_HEADER
|
|||
/* slot for the face object which can be accessed directly through */
|
||||
/* `face->glyph'. */
|
||||
/* */
|
||||
/* @FT_Open_Face can be used to determine and/or check the font */
|
||||
/* @FT_Open_Face can be used to determine and/or check the font */
|
||||
/* format of a given font resource. If the `face_index' field is */
|
||||
/* negative, the function will _not_ return any face handle in */
|
||||
/* `*face'. Its return value should be 0 if the font format is */
|
||||
/* recognized, or non-zero otherwise. */
|
||||
/* `*face'; the return value is 0 if the font format is recognized, */
|
||||
/* or non-zero otherwise. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Open_Face( FT_Library library,
|
||||
|
@ -2021,7 +2066,9 @@ FT_BEGIN_HEADER
|
|||
/* will be loaded. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* glyph_index :: The index of the glyph in the font file. */
|
||||
/* glyph_index :: The index of the glyph in the font file. For */
|
||||
/* CID-keyed fonts (either in PS or in CFF format) */
|
||||
/* this argument specifies the CID value. */
|
||||
/* */
|
||||
/* load_flags :: A flag indicating what to load for this glyph. The */
|
||||
/* @FT_LOAD_XXX constants can be used to control the */
|
||||
|
@ -2212,6 +2259,21 @@ FT_BEGIN_HEADER
|
|||
* outlines. This doesn't prevent native format-specific hinters from
|
||||
* being used. This can be important for certain fonts where unhinted
|
||||
* output is better than auto-hinted one.
|
||||
*
|
||||
* FT_LOAD_TARGET_NORMAL ::
|
||||
* Use hinting for @FT_RENDER_MODE_NORMAL.
|
||||
*
|
||||
* FT_LOAD_TARGET_LIGHT ::
|
||||
* Use hinting for @FT_RENDER_MODE_LIGHT.
|
||||
*
|
||||
* FT_LOAD_TARGET_MONO ::
|
||||
* Use hinting for @FT_RENDER_MODE_MONO.
|
||||
*
|
||||
* FT_LOAD_TARGET_LCD ::
|
||||
* Use hinting for @FT_RENDER_MODE_LCD.
|
||||
*
|
||||
* FT_LOAD_TARGET_LCD_V ::
|
||||
* Use hinting for @FT_RENDER_MODE_LCD_V.
|
||||
*/
|
||||
#define FT_LOAD_DEFAULT 0x0
|
||||
#define FT_LOAD_NO_SCALE 0x1
|
||||
|
@ -2234,36 +2296,9 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
|
||||
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
|
||||
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_LOAD_TARGET_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of load targets. XXX
|
||||
*
|
||||
* @values:
|
||||
* FT_LOAD_TARGET_NORMAL ::
|
||||
* XXX
|
||||
*
|
||||
* FT_LOAD_TARGET_LIGHT ::
|
||||
* XXX
|
||||
*
|
||||
* FT_LOAD_TARGET_MONO ::
|
||||
* XXX
|
||||
*
|
||||
* FT_LOAD_TARGET_LCD ::
|
||||
* XXX
|
||||
*
|
||||
* FT_LOAD_TARGET_LCD_V ::
|
||||
* XXX
|
||||
*/
|
||||
|
||||
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
|
||||
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
|
||||
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
|
||||
|
@ -2325,11 +2360,14 @@ FT_BEGIN_HEADER
|
|||
/* anti-aliased bitmaps, using 256 levels of opacity. */
|
||||
/* */
|
||||
/* FT_RENDER_MODE_LIGHT :: */
|
||||
/* This is similar to @FT_RENDER_MODE_NORMAL, except that this */
|
||||
/* changes the hinting to prevent stem width quantization. This */
|
||||
/* results in glyph shapes that are more similar to the original, */
|
||||
/* while being a bit more fuzzy ("better shapes", instead of */
|
||||
/* "better contrast" if you want :-). */
|
||||
/* This is similar to @FT_RENDER_MODE_NORMAL -- you have to use */
|
||||
/* @FT_LOAD_TARGET_LIGHT in calls to @FT_Load_Glyph to get any */
|
||||
/* effect since the rendering process no longer influences the */
|
||||
/* positioning of glyph outlines. */
|
||||
/* */
|
||||
/* The resulting glyph shapes are more similar to the original, */
|
||||
/* while being a bit more fuzzy (`better shapes' instead of `better */
|
||||
/* contrast', so to say. */
|
||||
/* */
|
||||
/* FT_RENDER_MODE_MONO :: */
|
||||
/* This mode corresponds to 1-bit bitmaps. */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType exact bbox computation (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -34,6 +34,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType Cache subsystem (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -63,8 +63,8 @@ FT_BEGIN_HEADER
|
|||
/* FTC_Face_Requester */
|
||||
/* */
|
||||
/* FTC_Manager_New */
|
||||
/* FTC_Manager_Lookup_Face */
|
||||
/* FTC_Manager_Lookup_Size */
|
||||
/* FTC_Manager_LookupFace */
|
||||
/* FTC_Manager_LookupSize */
|
||||
/* */
|
||||
/* FTC_Node */
|
||||
/* FTC_Node_Ref */
|
||||
|
@ -108,10 +108,10 @@ FT_BEGIN_HEADER
|
|||
/* FTC_FaceID */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A generic pointer type that is used to identity face objects. The */
|
||||
/* An opaque pointer type that is used to identity face objects. The */
|
||||
/* contents of such objects is application-dependent. */
|
||||
/* */
|
||||
typedef FT_Pointer FTC_FaceID;
|
||||
typedef struct FTC_FaceIDRec_* FTC_FaceID;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -257,22 +257,16 @@ FT_BEGIN_HEADER
|
|||
/* Creates a new cache manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: The parent FreeType library handle to use. */
|
||||
/* library :: The parent FreeType library handle to use. */
|
||||
/* */
|
||||
/* max_faces :: Maximum number of faces to keep alive in manager. */
|
||||
/* Use 0 for defaults. */
|
||||
/* max_bytes :: Maximum number of bytes to use for cached data. */
|
||||
/* Use 0 for defaults. */
|
||||
/* */
|
||||
/* max_sizes :: Maximum number of sizes to keep alive in manager. */
|
||||
/* Use 0 for defaults. */
|
||||
/* requester :: An application-provided callback used to translate */
|
||||
/* face IDs into real @FT_Face objects. */
|
||||
/* */
|
||||
/* max_bytes :: Maximum number of bytes to use for cached data. */
|
||||
/* Use 0 for defaults. */
|
||||
/* */
|
||||
/* requester :: An application-provided callback used to translate */
|
||||
/* face IDs into real @FT_Face objects. */
|
||||
/* */
|
||||
/* req_data :: A generic pointer that is passed to the requester */
|
||||
/* each time it is called (see @FTC_Face_Requester). */
|
||||
/* req_data :: A generic pointer that is passed to the requester */
|
||||
/* each time it is called (see @FTC_Face_Requester). */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* amanager :: A handle to a new manager object. 0 in case of */
|
||||
|
@ -325,7 +319,7 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Manager_Lookup_Face */
|
||||
/* FTC_Manager_LookupFace */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the @FT_Face object that corresponds to a given face ID */
|
||||
|
@ -348,64 +342,480 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/* The @FT_Face object doesn't necessarily have a current size object */
|
||||
/* (i.e., face->size can be 0). If you need a specific `font size', */
|
||||
/* use @FTC_Manager_Lookup_Size instead. */
|
||||
/* use @FTC_Manager_LookupSize instead. */
|
||||
/* */
|
||||
/* Never change the face's transformation matrix (i.e., never call */
|
||||
/* the @FT_Set_Transform function) on a returned face! If you need */
|
||||
/* to transform glyphs, do it yourself after glyph loading. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Face( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
FT_Face *aface );
|
||||
FTC_Manager_LookupFace( FTC_Manager manager,
|
||||
FTC_FaceID face_id,
|
||||
FT_Face *aface );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_ScalerRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to describe a given character size in either */
|
||||
/* pixels or points to the cache manager. See */
|
||||
/* @FTC_Manager_LookupSize. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* face_id :: The source face ID. */
|
||||
/* */
|
||||
/* width :: The character width. */
|
||||
/* */
|
||||
/* height :: The character height. */
|
||||
/* */
|
||||
/* pixel :: A Boolean. If TRUE, the `width' and `height' fields */
|
||||
/* are interpreted as integer pixel character sizes. */
|
||||
/* Otherwise, they are expressed as 1/64th of points. */
|
||||
/* */
|
||||
/* x_res :: Only used when `pixel' is FALSE to indicate the */
|
||||
/* horizontal resolution in dpi. */
|
||||
/* */
|
||||
/* y_res :: Only used when `pixel' is FALSE to indicate the */
|
||||
/* vertical resolution in dpi. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This type is mainly used to retrieve @FT_Size objects through the */
|
||||
/* cache manager. */
|
||||
/* */
|
||||
typedef struct FTC_ScalerRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_UInt width;
|
||||
FT_UInt height;
|
||||
FT_Int pixel;
|
||||
FT_UInt x_res;
|
||||
FT_UInt y_res;
|
||||
|
||||
} FTC_ScalerRec, *FTC_Scaler;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Manager_Lookup_Size */
|
||||
/* FTC_Manager_LookupSize */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves the @FT_Face and @FT_Size objects that correspond to a */
|
||||
/* given font. */
|
||||
/* Retrieve the @FT_Size object that corresponds to a given */
|
||||
/* @FTC_Scaler through a cache manager. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* font :: The font to use. */
|
||||
/* scaler :: A scaler handle. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aface :: A pointer to the handle of the face object. Set it to */
|
||||
/* zero if you don't need it. */
|
||||
/* */
|
||||
/* asize :: A pointer to the handle of the size object. Set it to */
|
||||
/* zero if you don't need it. */
|
||||
/* asize :: A handle to the size object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The returned @FT_Face object is always owned by the manager. You */
|
||||
/* should never try to discard it yourself. */
|
||||
/* The returned @FT_Size object is always owned by the manager. You */
|
||||
/* should never try to discard it by yourself. */
|
||||
/* */
|
||||
/* Never change the face's transformation matrix (i.e., never call */
|
||||
/* the @FT_Set_Transform function) on a returned face! If you need */
|
||||
/* to transform glyphs, do it yourself after glyph loading. */
|
||||
/* */
|
||||
/* Similarly, the returned @FT_Size object is always owned by the */
|
||||
/* manager. You should never try to discard it, and never change its */
|
||||
/* settings with @FT_Set_Pixel_Sizes or @FT_Set_Char_Size! */
|
||||
/* */
|
||||
/* The returned size object is the face's current size, which means */
|
||||
/* that you can call @FT_Load_Glyph with the face if you need to. */
|
||||
/* You can access the parent @FT_Face object simply as `size->face' */
|
||||
/* if you need it. Note that this object is also owned by the */
|
||||
/* manager. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_Manager_Lookup_Size( FTC_Manager manager,
|
||||
FTC_Font font,
|
||||
FT_Face *aface,
|
||||
FT_Size *asize );
|
||||
FTC_Manager_LookupSize( FTC_Manager manager,
|
||||
FTC_Scaler scaler,
|
||||
FT_Size *asize );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_Node_Unref */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Decrement a cache node's internal reference count. When the count */
|
||||
/* reaches 0, it is not destroyed but becomes eligible for subsequent */
|
||||
/* cache flushes. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* node :: The cache node handle. */
|
||||
/* */
|
||||
/* manager :: The cache manager handle. */
|
||||
/* */
|
||||
FT_EXPORT( void )
|
||||
FTC_Node_Unref( FTC_Node node,
|
||||
FTC_Manager manager );
|
||||
|
||||
|
||||
/* remove all nodes belonging to a given face_id */
|
||||
FT_EXPORT( void )
|
||||
FTC_Manager_RemoveFaceID( FTC_Manager manager,
|
||||
FTC_FaceID face_id );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FTC_CMapCache
|
||||
*
|
||||
* @description:
|
||||
* An opaque handle used to manager a charmap cache. This cache is
|
||||
* to hold character codes -> glyph indices mappings.
|
||||
*/
|
||||
typedef struct FTC_CMapCacheRec_* FTC_CMapCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_New */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Create a new charmap cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* manager :: A handle to the cache manager. */
|
||||
/* */
|
||||
/* @output: */
|
||||
/* acache :: A new cache handle. NULL in case of error. */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* @note: */
|
||||
/* Like all other caches, this one will be destroyed with the cache */
|
||||
/* manager. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_CMapCache_New( FTC_Manager manager,
|
||||
FTC_CMapCache *acache );
|
||||
|
||||
|
||||
/* retrieve the index of a given charmap */
|
||||
FT_EXPORT( FT_Int )
|
||||
FT_Get_CharMap_Index( FT_CharMap charmap );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* @function: */
|
||||
/* FTC_CMapCache_Lookup */
|
||||
/* */
|
||||
/* @description: */
|
||||
/* Translate a character code into a glyph index, using the charmap */
|
||||
/* cache. */
|
||||
/* */
|
||||
/* @input: */
|
||||
/* cache :: A charmap cache handle. */
|
||||
/* */
|
||||
/* face_id :: source face id */
|
||||
/* */
|
||||
/* cmap_index :: index of charmap in source face */
|
||||
/* */
|
||||
/* char_code :: The character code (in the corresponding charmap). */
|
||||
/* */
|
||||
/* @return: */
|
||||
/* Glyph index. 0 means `no glyph'. */
|
||||
/* */
|
||||
FT_EXPORT( FT_UInt )
|
||||
FTC_CMapCache_Lookup( FTC_CMapCache cache,
|
||||
FTC_FaceID face_id,
|
||||
FT_Int cmap_index,
|
||||
FT_UInt32 char_code );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* cache_subsystem */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** IMAGE CACHE OBJECT *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
typedef struct FTC_ImageTypeRec_
|
||||
{
|
||||
FTC_FaceID face_id;
|
||||
FT_Int width;
|
||||
FT_Int height;
|
||||
FT_Int32 flags;
|
||||
|
||||
} FTC_ImageTypeRec;
|
||||
|
||||
typedef struct FTC_ImageTypeRec_* FTC_ImageType;
|
||||
|
||||
/* */
|
||||
|
||||
#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
|
||||
( FTC_FONT_COMPARE( &(d1)->font, &(d2)->font ) && \
|
||||
(d1)->flags == (d2)->flags )
|
||||
|
||||
#define FTC_IMAGE_TYPE_HASH( d ) \
|
||||
(FT_UFast)( FTC_FONT_HASH( &(d)->font ) ^ \
|
||||
( (d)->flags << 4 ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_ImageCache */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to an glyph image cache object. They are designed to */
|
||||
/* hold many distinct glyph images while not exceeding a certain */
|
||||
/* memory threshold. */
|
||||
/* */
|
||||
typedef struct FTC_ImageCacheRec_* FTC_ImageCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_ImageCache_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new glyph image cache. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: The parent manager for the image cache. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* acache :: A handle to the new glyph image cache object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_ImageCache_New( FTC_Manager manager,
|
||||
FTC_ImageCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_ImageCache_Lookup */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Retrieves a given glyph image from a glyph image cache. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source glyph image cache. */
|
||||
/* */
|
||||
/* type :: A pointer to a glyph image type descriptor. */
|
||||
/* */
|
||||
/* gindex :: The glyph index to retrieve. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* aglyph :: The corresponding @FT_Glyph object. 0 in case of */
|
||||
/* failure. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding cache */
|
||||
/* node after incrementing its reference count (see note */
|
||||
/* below). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The returned glyph is owned and managed by the glyph image cache. */
|
||||
/* Never try to transform or discard it manually! You can however */
|
||||
/* create a copy with @FT_Glyph_Copy and modify the new one. */
|
||||
/* */
|
||||
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the glyph image, after increasing its reference */
|
||||
/* count. This ensures that the node (as well as the FT_Glyph) will */
|
||||
/* always be kept in the cache until you call @FTC_Node_Unref to */
|
||||
/* `release' it. */
|
||||
/* */
|
||||
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
||||
/* that the FT_Glyph could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_ImageCache_Lookup( FTC_ImageCache cache,
|
||||
FTC_ImageType type,
|
||||
FT_UInt gindex,
|
||||
FT_Glyph *aglyph,
|
||||
FTC_Node *anode );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_SBit */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a small bitmap descriptor. See the @FTC_SBitRec */
|
||||
/* structure for details. */
|
||||
/* */
|
||||
typedef struct FTC_SBitRec_* FTC_SBit;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FTC_SBitRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A very compact structure used to describe a small glyph bitmap. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* width :: The bitmap width in pixels. */
|
||||
/* */
|
||||
/* height :: The bitmap height in pixels. */
|
||||
/* */
|
||||
/* left :: The horizontal distance from the pen position to the */
|
||||
/* left bitmap border (a.k.a. `left side bearing', or */
|
||||
/* `lsb'). */
|
||||
/* */
|
||||
/* top :: The vertical distance from the pen position (on the */
|
||||
/* baseline) to the upper bitmap border (a.k.a. `top */
|
||||
/* side bearing'). The distance is positive for upwards */
|
||||
/* Y coordinates. */
|
||||
/* */
|
||||
/* format :: The format of the glyph bitmap (monochrome or gray). */
|
||||
/* */
|
||||
/* max_grays :: Maximum gray level value (in the range 1 to 255). */
|
||||
/* */
|
||||
/* pitch :: The number of bytes per bitmap line. May be positive */
|
||||
/* or negative. */
|
||||
/* */
|
||||
/* xadvance :: The horizontal advance width in pixels. */
|
||||
/* */
|
||||
/* yadvance :: The vertical advance height in pixels. */
|
||||
/* */
|
||||
/* buffer :: A pointer to the bitmap pixels. */
|
||||
/* */
|
||||
typedef struct FTC_SBitRec_
|
||||
{
|
||||
FT_Byte width;
|
||||
FT_Byte height;
|
||||
FT_Char left;
|
||||
FT_Char top;
|
||||
|
||||
FT_Byte format;
|
||||
FT_Byte max_grays;
|
||||
FT_Short pitch;
|
||||
FT_Char xadvance;
|
||||
FT_Char yadvance;
|
||||
|
||||
FT_Byte* buffer;
|
||||
|
||||
} FTC_SBitRec;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* FTC_SBitCache */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle to a small bitmap cache. These are special cache objects */
|
||||
/* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */
|
||||
/* much more efficient way than the traditional glyph image cache */
|
||||
/* implemented by @FTC_ImageCache. */
|
||||
/* */
|
||||
typedef struct FTC_SBitCacheRec_* FTC_SBitCache;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_SBitCache_New */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new cache to store small glyph bitmaps. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* manager :: A handle to the source cache manager. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* acache :: A handle to the new sbit cache. NULL in case of error. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBitCache_New( FTC_Manager manager,
|
||||
FTC_SBitCache *acache );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FTC_SBitCache_Lookup */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Looks up a given small glyph bitmap in a given sbit cache and */
|
||||
/* `lock' it to prevent its flushing from the cache until needed. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* cache :: A handle to the source sbit cache. */
|
||||
/* */
|
||||
/* type :: A pointer to the glyph image type descriptor. */
|
||||
/* */
|
||||
/* gindex :: The glyph index. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* sbit :: A handle to a small bitmap descriptor. */
|
||||
/* */
|
||||
/* anode :: Used to return the address of of the corresponding cache */
|
||||
/* node after incrementing its reference count (see note */
|
||||
/* below). */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The small bitmap descriptor and its bit buffer are owned by the */
|
||||
/* cache and should never be freed by the application. They might */
|
||||
/* as well disappear from memory on the next cache lookup, so don't */
|
||||
/* treat them as persistent data. */
|
||||
/* */
|
||||
/* The descriptor's `buffer' field is set to 0 to indicate a missing */
|
||||
/* glyph bitmap. */
|
||||
/* */
|
||||
/* If `anode' is _not_ NULL, it receives the address of the cache */
|
||||
/* node containing the bitmap, after increasing its reference count. */
|
||||
/* This ensures that the node (as well as the image) will always be */
|
||||
/* kept in the cache until you call @FTC_Node_Unref to `release' it. */
|
||||
/* */
|
||||
/* If `anode' is NULL, the cache node is left unchanged, which means */
|
||||
/* that the bitmap could be flushed out of the cache on the next */
|
||||
/* call to one of the caching sub-system APIs. Don't assume that it */
|
||||
/* is persistent! */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FTC_SBitCache_Lookup( FTC_SBitCache cache,
|
||||
FTC_ImageType type,
|
||||
FT_UInt gindex,
|
||||
FTC_SBit *sbit,
|
||||
FTC_Node *anode );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTCACHE_H__ */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType error codes (specification). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -207,6 +207,8 @@
|
|||
"opcode syntax error" )
|
||||
FT_ERRORDEF_( Stack_Underflow, 0xA1, \
|
||||
"argument stack underflow" )
|
||||
FT_ERRORDEF_( Ignore, 0xA2, \
|
||||
"ignore" )
|
||||
|
||||
/* BDF errors */
|
||||
|
||||
|
|
|
@ -36,6 +36,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -235,7 +241,8 @@ FT_BEGIN_HEADER
|
|||
/* FT_Glyph_Copy */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A function used to copy a glyph image. */
|
||||
/* A function used to copy a glyph image. Note that the created */
|
||||
/* @FT_Glyph object must be released with @FT_Done_Glyph. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* source :: A handle to the source glyph object. */
|
||||
|
@ -472,8 +479,7 @@ FT_BEGIN_HEADER
|
|||
/* } */
|
||||
/* */
|
||||
/* */
|
||||
/* This function will always fail if the glyph's format isn't */
|
||||
/* scalable. */
|
||||
/* This function does nothing if the glyph format isn't scalable. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
|
||||
|
|
|
@ -22,6 +22,13 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* FreeType glyph image formats and default raster interface */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -53,8 +53,8 @@ FT_BEGIN_HEADER
|
|||
/* <Description> */
|
||||
/* The type FT_Pos is a 32-bit integer used to store vectorial */
|
||||
/* coordinates. Depending on the context, these can represent */
|
||||
/* distances in integer font units, or 26.6 fixed float pixel */
|
||||
/* coordinates. */
|
||||
/* distances in integer font units, or 16,16, or 26.6 fixed float */
|
||||
/* pixel coordinates. */
|
||||
/* */
|
||||
typedef signed long FT_Pos;
|
||||
|
||||
|
@ -657,7 +657,7 @@ FT_BEGIN_HEADER
|
|||
/* should redefine this macro in case of problems to something like */
|
||||
/* this: */
|
||||
/* */
|
||||
/* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) (value) */
|
||||
/* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
|
||||
/* */
|
||||
/* to get a simple enumeration without assigning special numbers. */
|
||||
/* */
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Generic list support for FreeType (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -31,6 +31,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
99
reactos/lib/freetype/include/freetype/ftlzw.h
Normal file
99
reactos/lib/freetype/include/freetype/ftlzw.h
Normal file
|
@ -0,0 +1,99 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftlzw.h */
|
||||
/* */
|
||||
/* LZW-compressed stream support. */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTLZW_H__
|
||||
#define __FTLZW_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
/* lzw */
|
||||
/* */
|
||||
/* <Title> */
|
||||
/* LZW Streams */
|
||||
/* */
|
||||
/* <Abstract> */
|
||||
/* Using LZW-compressed font files */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* This section contains the declaration of LZW-specific functions. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stream_OpenLZW
|
||||
*
|
||||
* @description:
|
||||
* Open a new stream to parse LZW-compressed font files. This is
|
||||
* mainly used to support the compressed *.pcf.Z fonts that come
|
||||
* with XFree86.
|
||||
*
|
||||
* @input:
|
||||
* stream :: The target embedding stream.
|
||||
*
|
||||
* source :: The source stream.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The source stream must be opened _before_ calling this function.
|
||||
*
|
||||
* Calling the internal function FT_Stream_Close on the new stream will
|
||||
* *not* call FT_Stream_Close on the source stream. None of the stream
|
||||
* objects will be released to the heap.
|
||||
*
|
||||
* The stream implementation is very basic and resets the decompression
|
||||
* process each time seeking backwards is needed within the stream
|
||||
*
|
||||
* In certain builds of the library, LZW compression recognition is
|
||||
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
|
||||
* This means that if no font driver is capable of handling the raw
|
||||
* compressed file, the library will try to open a LZW stream from it
|
||||
* and re-open the face with it.
|
||||
*
|
||||
* This function may return "FT_Err_Unimplemented" if your build of
|
||||
* FreeType was not compiled with LZW support.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stream_OpenLZW( FT_Stream stream,
|
||||
FT_Stream source );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTLZW_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Additional Mac-specific API. */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2004 by */
|
||||
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -111,10 +111,44 @@ FT_BEGIN_HEADER
|
|||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_GetFile_From_Mac_Name( char* fontName,
|
||||
FSSpec* pathSpec,
|
||||
FT_Long* face_index );
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_GetFile_From_Mac_Name( const char* fontName,
|
||||
FSSpec* pathSpec,
|
||||
FT_Long* face_index );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_New_Face_From_FSSpec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Creates a new face object from a given resource and typeface index */
|
||||
/* using an FSSpec to the font file. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* library :: A handle to the library resource. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* spec :: FSSpec to the font file. */
|
||||
/* */
|
||||
/* face_index :: The index of the face within the resource. The */
|
||||
/* first face has index 0. */
|
||||
/* <Output> */
|
||||
/* aface :: A handle to a new face object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
|
||||
/* it accepts an FSSpec instead of a path. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_New_Face_From_FSSpec( FT_Library library,
|
||||
const FSSpec *spec,
|
||||
FT_Long face_index,
|
||||
FT_Face *aface );
|
||||
|
||||
/* */
|
||||
|
||||
|
|
|
@ -100,21 +100,6 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Get_MM_Func)( FT_Face face,
|
||||
FT_Multi_Master* master );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Set_MM_Design_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Set_MM_Blend_Func)( FT_Face face,
|
||||
FT_UInt num_coords,
|
||||
FT_Long* coords );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftmodule.h */
|
||||
/* ftmodapi.h */
|
||||
/* */
|
||||
/* FreeType modules public interface (specification). */
|
||||
/* */
|
||||
|
@ -16,13 +16,19 @@
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTMODULE_H__
|
||||
#define __FTMODULE_H__
|
||||
#ifndef __FTMODAPI_H__
|
||||
#define __FTMODAPI_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -70,8 +76,7 @@ FT_BEGIN_HEADER
|
|||
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
|
||||
|
||||
|
||||
typedef void
|
||||
(*FT_Module_Interface)( void );
|
||||
typedef FT_Pointer FT_Module_Interface;
|
||||
|
||||
typedef FT_Error
|
||||
(*FT_Module_Constructor)( FT_Module module );
|
||||
|
@ -79,7 +84,7 @@ FT_BEGIN_HEADER
|
|||
typedef void
|
||||
(*FT_Module_Destructor)( FT_Module module );
|
||||
|
||||
typedef FT_Module_Interface
|
||||
typedef FT_Module_Interface
|
||||
(*FT_Module_Requester)( FT_Module module,
|
||||
const char* name );
|
||||
|
||||
|
@ -308,7 +313,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTMODULE_H__ */
|
||||
#endif /* __FTMODAPI_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType module error offsets (specification). */
|
||||
/* */
|
||||
/* Copyright 2001, 2002, 2003 by */
|
||||
/* Copyright 2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -23,8 +23,8 @@
|
|||
/* The lower byte gives the error code, the higher byte gives the */
|
||||
/* module. The base module has error offset 0. For example, the error */
|
||||
/* `FT_Err_Invalid_File_Format' has value 0x003, the error */
|
||||
/* `TT_Err_Invalid_File_Format' has value 0xF03, the error */
|
||||
/* `T1_Err_Invalid_File_Format' has value 0x1003, etc. */
|
||||
/* `TT_Err_Invalid_File_Format' has value 0x1003, the error */
|
||||
/* `T1_Err_Invalid_File_Format' has value 0x1103, etc. */
|
||||
/* */
|
||||
/* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
|
||||
/* to make the higher byte always zero (disabling the module error */
|
||||
|
@ -109,18 +109,19 @@
|
|||
FT_MODERRDEF( CFF, 0x400, "CFF module" )
|
||||
FT_MODERRDEF( CID, 0x500, "CID module" )
|
||||
FT_MODERRDEF( Gzip, 0x600, "Gzip module" )
|
||||
FT_MODERRDEF( PCF, 0x700, "PCF module" )
|
||||
FT_MODERRDEF( PFR, 0x800, "PFR module" )
|
||||
FT_MODERRDEF( PSaux, 0x900, "PS auxiliary module" )
|
||||
FT_MODERRDEF( PShinter, 0xA00, "PS hinter module" )
|
||||
FT_MODERRDEF( PSnames, 0xB00, "PS names module" )
|
||||
FT_MODERRDEF( Raster, 0xC00, "raster module" )
|
||||
FT_MODERRDEF( SFNT, 0xD00, "SFNT module" )
|
||||
FT_MODERRDEF( Smooth, 0xE00, "smooth raster module" )
|
||||
FT_MODERRDEF( TrueType, 0xF00, "TrueType module" )
|
||||
FT_MODERRDEF( Type1, 0x1000, "Type 1 module" )
|
||||
FT_MODERRDEF( Type42, 0x1100, "Type 42 module" )
|
||||
FT_MODERRDEF( Winfonts, 0x1200, "Windows FON/FNT module" )
|
||||
FT_MODERRDEF( LZW, 0x700, "LZW module" )
|
||||
FT_MODERRDEF( PCF, 0x800, "PCF module" )
|
||||
FT_MODERRDEF( PFR, 0x900, "PFR module" )
|
||||
FT_MODERRDEF( PSaux, 0xA00, "PS auxiliary module" )
|
||||
FT_MODERRDEF( PShinter, 0xB00, "PS hinter module" )
|
||||
FT_MODERRDEF( PSnames, 0xC00, "PS names module" )
|
||||
FT_MODERRDEF( Raster, 0xD00, "raster module" )
|
||||
FT_MODERRDEF( SFNT, 0xE00, "SFNT module" )
|
||||
FT_MODERRDEF( Smooth, 0xF00, "smooth raster module" )
|
||||
FT_MODERRDEF( TrueType, 0x1000, "TrueType module" )
|
||||
FT_MODERRDEF( Type1, 0x1100, "Type 1 module" )
|
||||
FT_MODERRDEF( Type42, 0x1200, "Type 42 module" )
|
||||
FT_MODERRDEF( Winfonts, 0x1300, "Windows FON/FNT module" )
|
||||
|
||||
|
||||
#ifdef FT_MODERR_END_LIST
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* Support for the FT_Outline type used to store glyph shapes of */
|
||||
/* most scalable font formats (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -24,6 +24,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -389,6 +395,72 @@ FT_BEGIN_HEADER
|
|||
FT_Raster_Params* params );
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_Orientation
|
||||
*
|
||||
* @description:
|
||||
* A list of values used to describe an outline's contour orientation.
|
||||
*
|
||||
* The TrueType and Postscript specifications use different conventions
|
||||
* to determine whether outline contours should be filled or unfilled.
|
||||
*
|
||||
* @values:
|
||||
* FT_ORIENTATION_TRUETYPE ::
|
||||
* According to the TrueType specification, clockwise contours must
|
||||
* be filled, and counter-clockwise ones must be unfilled.
|
||||
*
|
||||
* FT_ORIENTATION_POSTSCRIPT ::
|
||||
* According to the Postscript specification, counter-clockwise contours
|
||||
* must be filled, and clockwise ones must be unfilled.
|
||||
*
|
||||
* FT_ORIENTATION_FILL_RIGHT ::
|
||||
* This is identical to @FT_ORIENTATION_TRUETYPE, but is used to
|
||||
* remember that in TrueType, everything that is to the right of
|
||||
* the drawing direction of a contour must be filled.
|
||||
*
|
||||
* FT_ORIENTATION_FILL_LEFT ::
|
||||
* This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to
|
||||
* remember that in Postscript, everything that is to the left of
|
||||
* the drawing direction of a contour must be filled.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_ORIENTATION_TRUETYPE = 0,
|
||||
FT_ORIENTATION_POSTSCRIPT = 1,
|
||||
FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,
|
||||
FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT
|
||||
|
||||
} FT_Orientation;
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Outline_Get_Orientation
|
||||
*
|
||||
* @description:
|
||||
* This function analyzes a glyph outline and tries to compute its
|
||||
* fill orientation (see @FT_Orientation). This is done by computing
|
||||
* the direction of each global horizontal and/or vertical extrema
|
||||
* within the outline.
|
||||
*
|
||||
* Note that this will return @FT_ORIENTATION_TRUETYPE for empty
|
||||
* outlines.
|
||||
*
|
||||
* @input:
|
||||
* outline ::
|
||||
* A handle to the source outline.
|
||||
*
|
||||
* @return:
|
||||
* The orientation.
|
||||
*
|
||||
*/
|
||||
FT_EXPORT( FT_Orientation )
|
||||
FT_Outline_Get_Orientation( FT_Outline* outline );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType size objects management (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -32,6 +32,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -101,7 +107,9 @@ FT_BEGIN_HEADER
|
|||
/* FT_Done_Size */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Discards a given size object. */
|
||||
/* Discards a given size object. Note that @FT_Done_Face */
|
||||
/* automatically discards all size objects allocated with */
|
||||
/* @FT_New_Size. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* size :: A handle to a target size object. */
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
/* */
|
||||
/* This is _not_ used to retrieve glyph names! */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -26,6 +26,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType path stroker (specification). */
|
||||
/* */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -21,42 +21,45 @@
|
|||
|
||||
#include <ft2build.h>
|
||||
#include FT_OUTLINE_H
|
||||
#include FT_GLYPH_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @type: FT_Stroker
|
||||
*
|
||||
* @description:
|
||||
* opaque handler to a path stroker object
|
||||
*/
|
||||
typedef struct FT_StrokerRec_* FT_Stroker;
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @type:
|
||||
* FT_Stroker
|
||||
*
|
||||
* @description:
|
||||
* Opaque handler to a path stroker object.
|
||||
*/
|
||||
typedef struct FT_StrokerRec_* FT_Stroker;
|
||||
|
||||
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @enum: FT_Stroker_LineJoin
|
||||
*
|
||||
* @description:
|
||||
* these values determine how two joining lines are rendered
|
||||
* in a stroker.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_LINEJOIN_ROUND ::
|
||||
* used to render rounded line joins. circular arcs are used
|
||||
* to join two lines smoothly
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_BEVEL ::
|
||||
* used to render beveled line joins; i.e. the two joining lines
|
||||
* are extended until they intersect
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_MITER ::
|
||||
* same as beveled rendering, except that an additional line
|
||||
* break is added if the angle between the two joining lines
|
||||
* is too closed (this is useful to avoid unpleasant spikes
|
||||
* in beveled rendering).
|
||||
*/
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_Stroker_LineJoin
|
||||
*
|
||||
* @description:
|
||||
* These values determine how two joining lines are rendered
|
||||
* in a stroker.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_LINEJOIN_ROUND ::
|
||||
* Used to render rounded line joins. Circular arcs are used
|
||||
* to join two lines smoothly.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_BEVEL ::
|
||||
* Used to render beveled line joins; i.e., the two joining lines
|
||||
* are extended until they intersect.
|
||||
*
|
||||
* FT_STROKER_LINEJOIN_MITER ::
|
||||
* Same as beveled rendering, except that an additional line
|
||||
* break is added if the angle between the two joining lines
|
||||
* is too closed (this is useful to avoid unpleasant spikes
|
||||
* in beveled rendering).
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_STROKER_LINEJOIN_ROUND = 0,
|
||||
|
@ -66,27 +69,28 @@ FT_BEGIN_HEADER
|
|||
} FT_Stroker_LineJoin;
|
||||
|
||||
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @enum: FT_Stroker_LineCap
|
||||
*
|
||||
* @description:
|
||||
* these values determine how the end of opened sub-paths are
|
||||
* rendered in a stroke
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_LINECAP_BUTT ::
|
||||
* the end of lines is rendered as a full stop on the last
|
||||
* point itself
|
||||
*
|
||||
* FT_STROKER_LINECAP_ROUND ::
|
||||
* the end of lines is rendered as a half-circle around the
|
||||
* last point
|
||||
*
|
||||
* FT_STROKER_LINECAP_SQUARE ::
|
||||
* the end of lines is rendered as a square around the
|
||||
* last point
|
||||
*/
|
||||
/*@*************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_Stroker_LineCap
|
||||
*
|
||||
* @description:
|
||||
* These values determine how the end of opened sub-paths are
|
||||
* rendered in a stroke.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_LINECAP_BUTT ::
|
||||
* The end of lines is rendered as a full stop on the last
|
||||
* point itself.
|
||||
*
|
||||
* FT_STROKER_LINECAP_ROUND ::
|
||||
* The end of lines is rendered as a half-circle around the
|
||||
* last point.
|
||||
*
|
||||
* FT_STROKER_LINECAP_SQUARE ::
|
||||
* The end of lines is rendered as a square around the
|
||||
* last point.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_STROKER_LINECAP_BUTT = 0,
|
||||
|
@ -95,12 +99,134 @@ FT_BEGIN_HEADER
|
|||
|
||||
} FT_Stroker_LineCap;
|
||||
|
||||
/* */
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_StrokerBorder
|
||||
*
|
||||
* @description:
|
||||
* These values are used to select a given stroke border
|
||||
* in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
|
||||
*
|
||||
* @values:
|
||||
* FT_STROKER_BORDER_LEFT ::
|
||||
* Select the left border, relative to the drawing direction.
|
||||
*
|
||||
* FT_STROKER_BORDER_RIGHT ::
|
||||
* Select the right border, relative to the drawing direction.
|
||||
*
|
||||
* @note:
|
||||
* Applications are generally interested in the `inside' and `outside'
|
||||
* borders. However, there is no direct mapping between these and
|
||||
* the `left' / `right' ones, since this really depends on the glyph's
|
||||
* drawing orientation, which varies between font formats.
|
||||
*
|
||||
* You can however use @FT_Outline_GetInsideBorder and
|
||||
* @FT_Outline_GetOutsideBorder to get these.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
FT_STROKER_BORDER_LEFT = 0,
|
||||
FT_STROKER_BORDER_RIGHT
|
||||
|
||||
} FT_StrokerBorder;
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Outline_GetInsideBorder
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the @FT_StrokerBorder value corresponding to the
|
||||
* `inside' borders of a given outline.
|
||||
*
|
||||
* @input:
|
||||
* outline ::
|
||||
* The source outline handle.
|
||||
*
|
||||
* @return:
|
||||
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
||||
* outlines.
|
||||
*/
|
||||
FT_EXPORT( FT_StrokerBorder )
|
||||
FT_Outline_GetInsideBorder( FT_Outline* outline );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Outline_GetOutsideBorder
|
||||
*
|
||||
* @description:
|
||||
* Retrieve the @FT_StrokerBorder value corresponding to the
|
||||
* `outside' borders of a given outline.
|
||||
*
|
||||
* @input:
|
||||
* outline ::
|
||||
* The source outline handle.
|
||||
*
|
||||
* @return:
|
||||
* The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
||||
* outlines.
|
||||
*/
|
||||
FT_EXPORT( FT_StrokerBorder )
|
||||
FT_Outline_GetOutsideBorder( FT_Outline* outline );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_New
|
||||
*
|
||||
* @description:
|
||||
* Create a new stroker object.
|
||||
*
|
||||
* @input:
|
||||
* memory ::
|
||||
* The memory manager handle.
|
||||
*
|
||||
* @output:
|
||||
* A new stroker object handle. NULL in case of error.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_New( FT_Memory memory,
|
||||
FT_Stroker *astroker );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_Set
|
||||
*
|
||||
* @description:
|
||||
* Reset a stroker object's attributes.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* radius ::
|
||||
* The border radius.
|
||||
*
|
||||
* line_cap ::
|
||||
* The line cap style.
|
||||
*
|
||||
* line_join ::
|
||||
* The line join style.
|
||||
*
|
||||
* miter_limit ::
|
||||
* The miter limit for the FT_STROKER_LINEJOIN_MITER style,
|
||||
* expressed as 16.16 fixed point value.
|
||||
*
|
||||
* @note:
|
||||
* The radius is expressed in the same units that the outline
|
||||
* coordinates.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Set( FT_Stroker stroker,
|
||||
FT_Fixed radius,
|
||||
|
@ -109,29 +235,208 @@ FT_BEGIN_HEADER
|
|||
FT_Fixed miter_limit );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_Rewind
|
||||
*
|
||||
* @description:
|
||||
* Reset a stroker object without changing its attributes.
|
||||
* You should call this function before beginning a new
|
||||
* series of calls to @FT_Stroker_BeginSubPath or
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Rewind( FT_Stroker stroker );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_ParseOutline
|
||||
*
|
||||
* @description:
|
||||
* A convenience function used to parse a whole outline with
|
||||
* the stroker. The resulting outline(s) can be retrieved
|
||||
* later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* outline ::
|
||||
* The source outline.
|
||||
*
|
||||
* opened ::
|
||||
* A boolean. If TRUE, the outline is treated as an open path
|
||||
* instead of a closed one.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* If `opened' is 0 (the default), the outline is treated as a closed
|
||||
* path, and the stroker will generate two distinct `border' outlines.
|
||||
*
|
||||
* If `opened' is 1, the outline is processed as an open path, and the
|
||||
* stroker will generate a single `stroke' outline.
|
||||
*
|
||||
* This function calls @FT_Stroker_Rewind automatically.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_ParseOutline( FT_Stroker stroker,
|
||||
FT_Outline* outline,
|
||||
FT_Bool opened );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_BeginSubPath
|
||||
*
|
||||
* @description:
|
||||
* Start a new sub-path in the stroker.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the start vector.
|
||||
*
|
||||
* open ::
|
||||
* A boolean. If TRUE, the sub-path is treated as an open one.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* This function is useful when you need to stroke a path that is
|
||||
* not stored as a @FT_Outline object.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_BeginSubPath( FT_Stroker stroker,
|
||||
FT_Vector* to,
|
||||
FT_Bool open );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_EndSubPath
|
||||
*
|
||||
* @description:
|
||||
* Close the current sub-path in the stroker.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* You should call this function after @FT_Stroker_BeginSubPath.
|
||||
* If the subpath was not `opened', this function will `draw' a
|
||||
* single line segment to the start position when needed.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_EndSubPath( FT_Stroker stroker );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_LineTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw' a single line segment in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* You should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_LineTo( FT_Stroker stroker,
|
||||
FT_Vector* to );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_ConicTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw; a single quadratic bezier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control ::
|
||||
* A pointer to a Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* You should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_ConicTo( FT_Stroker stroker,
|
||||
FT_Vector* control,
|
||||
FT_Vector* to );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_CubicTo
|
||||
*
|
||||
* @description:
|
||||
* `Draw' a single cubic Bézier in the stroker's current sub-path,
|
||||
* from the last position.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* control1 ::
|
||||
* A pointer to the first Bézier control point.
|
||||
*
|
||||
* control2 ::
|
||||
* A pointer to second Bézier control point.
|
||||
*
|
||||
* to ::
|
||||
* A pointer to the destination point.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* You should call this function between @FT_Stroker_BeginSubPath and
|
||||
* @FT_Stroker_EndSubPath.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_CubicTo( FT_Stroker stroker,
|
||||
FT_Vector* control1,
|
||||
|
@ -139,19 +444,240 @@ FT_BEGIN_HEADER
|
|||
FT_Vector* to );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_GetBorderCounts
|
||||
*
|
||||
* @description:
|
||||
* Vall this function once you have finished parsing your paths
|
||||
* with the stroker. It will return the number of points and
|
||||
* contours necessary to export one of the `border' or `stroke'
|
||||
* outlines generated by the stroker.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* border ::
|
||||
* The border index.
|
||||
*
|
||||
* @output:
|
||||
* anum_points ::
|
||||
* The number of points.
|
||||
*
|
||||
* anum_contours ::
|
||||
* The number of contours.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* When an outline, or a sub-path, is `closed', the stroker generates
|
||||
* two independent `border' outlines, named `left' and `right'.
|
||||
*
|
||||
* When the outline, or a sub-path, is `opened', the stroker merges
|
||||
* the `border' outlines with caps. The `left' border receives all
|
||||
* points, while the `right' border becomes empty.
|
||||
*
|
||||
* Use the function @FT_Stroker_GetCounts instead if you want to
|
||||
* retrieve the counts associated to both borders.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_GetBorderCounts( FT_Stroker stroker,
|
||||
FT_StrokerBorder border,
|
||||
FT_UInt *anum_points,
|
||||
FT_UInt *anum_contours );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_ExportBorder
|
||||
*
|
||||
* @description:
|
||||
* Call this function after @FT_Stroker_GetBorderCounts to
|
||||
* export the corresponding border to your own @FT_Outline
|
||||
* structure.
|
||||
*
|
||||
* Note that this function will append the border points and
|
||||
* contours to your outline, but will not try to resize its
|
||||
* arrays.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* border ::
|
||||
* The border index.
|
||||
*
|
||||
* outline ::
|
||||
* The target outline handle.
|
||||
*
|
||||
* @note:
|
||||
* Always call this function after @FT_Stroker_GetBorderCounts to
|
||||
* get sure that there is enough room in your @FT_Outline object to
|
||||
* receive all new data.
|
||||
*
|
||||
* When an outline, or a sub-path, is `closed', the stroker generates
|
||||
* two independent `border' outlines, named `left' and `right'
|
||||
*
|
||||
* When the outline, or a sub-path, is `opened', the stroker merges
|
||||
* the `border' outlines with caps. The `left' border receives all
|
||||
* points, while the `right' border becomes empty.
|
||||
*
|
||||
* Use the function @FT_Stroker_Export instead if you want to
|
||||
* retrieve all borders at once.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_ExportBorder( FT_Stroker stroker,
|
||||
FT_StrokerBorder border,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_GetCounts
|
||||
*
|
||||
* @description:
|
||||
* Call this function once you have finished parsing your paths
|
||||
* with the stroker. It returns the number of points and
|
||||
* contours necessary to export all points/borders from the stroked
|
||||
* outline/path.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* @output:
|
||||
* anum_points ::
|
||||
* The number of points.
|
||||
*
|
||||
* anum_contours ::
|
||||
* The number of contours.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Stroker_GetCounts( FT_Stroker stroker,
|
||||
FT_UInt *anum_points,
|
||||
FT_UInt *anum_contours );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_Export
|
||||
*
|
||||
* @description:
|
||||
* Call this function after @FT_Stroker_GetBorderCounts to
|
||||
* export the all borders to your own @FT_Outline structure.
|
||||
*
|
||||
* Note that this function will append the border points and
|
||||
* contours to your outline, but will not try to resize its
|
||||
* arrays.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* The target stroker handle.
|
||||
*
|
||||
* outline ::
|
||||
* The target outline handle.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Export( FT_Stroker stroker,
|
||||
FT_Outline* outline );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Stroker_Done
|
||||
*
|
||||
* @description:
|
||||
* Destroy a stroker object.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* A stroker handle. Can be NULL.
|
||||
*/
|
||||
FT_EXPORT( void )
|
||||
FT_Stroker_Done( FT_Stroker stroker );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Glyph_Stroke
|
||||
*
|
||||
* @description:
|
||||
* Stroke a given outline glyph object with a given stroker.
|
||||
*
|
||||
* @inout:
|
||||
* pglyph :: Source glyph handle on input, new glyph handle
|
||||
* on output.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* A stroker handle.
|
||||
*
|
||||
* destroy ::
|
||||
* A Boolean. If TRUE, the source glyph object is destroyed
|
||||
* on success.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The source glyph is untouched in case of error.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Glyph_Stroke( FT_Glyph *pglyph,
|
||||
FT_Stroker stroker,
|
||||
FT_Bool destroy );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function:
|
||||
* FT_Glyph_StrokeBorder
|
||||
*
|
||||
* @description:
|
||||
* Stroke a given outline glyph object with a given stroker, but
|
||||
* only return either its inside or outside border.
|
||||
*
|
||||
* @inout:
|
||||
* pglyph ::
|
||||
* Source glyph handle on input, new glyph handle on output.
|
||||
*
|
||||
* @input:
|
||||
* stroker ::
|
||||
* A stroker handle.
|
||||
*
|
||||
* inside ::
|
||||
* A Boolean. If TRUE, return the inside border, otherwise
|
||||
* the outside border.
|
||||
*
|
||||
* destroy ::
|
||||
* A Boolean. If TRUE, the source glyph object is destroyed
|
||||
* on success.
|
||||
*
|
||||
* @return:
|
||||
* FreeType error code. 0 means success.
|
||||
*
|
||||
* @note:
|
||||
* The source glyph is untouched in case of error.
|
||||
*/
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
|
||||
FT_Stroker stroker,
|
||||
FT_Bool inside,
|
||||
FT_Bool destroy );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_STROKE_H__ */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* FreeType synthesizing code for emboldening and slanting */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 2000-2001 by */
|
||||
/* Copyright 2000-2001, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -41,6 +41,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -21,6 +21,12 @@
|
|||
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
|
|
@ -22,6 +22,12 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
@ -43,10 +49,132 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
*
|
||||
* @enum:
|
||||
* FT_WinFNT_ID_XXX
|
||||
*
|
||||
* @description:
|
||||
* A list of valid values for the `charset' byte in
|
||||
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
|
||||
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org
|
||||
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
|
||||
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
|
||||
*
|
||||
* @values:
|
||||
* FT_WinFNT_ID_DEFAULT ::
|
||||
* This is used for font enumeration and font creation as a
|
||||
* `don't care' value. Valid font files don't contain this value.
|
||||
* When querying for information about the character set of the font
|
||||
* that is currently selected into a specified device context, this
|
||||
* return value (of the related Windows API) simply denotes failure.
|
||||
*
|
||||
* FT_WinFNT_ID_SYMBOL ::
|
||||
* There is no known mapping table available.
|
||||
*
|
||||
* FT_WinFNT_ID_MAC ::
|
||||
* Mac Roman encoding.
|
||||
*
|
||||
* FT_WinFNT_ID_OEM ::
|
||||
* From Michael Pöttgen <michael@poettgen.de>:
|
||||
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
|
||||
* is used for the charset of vector fonts, like `modern.fon',
|
||||
* `roman.fon', and `script.fon' on Windows.
|
||||
*
|
||||
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
|
||||
* specifies a character set that is operating-system dependent.
|
||||
*
|
||||
* The `IFIMETRICS' documentation from the `Windows Driver
|
||||
* Development Kit' says: This font supports an OEM-specific
|
||||
* character set. The OEM character set is system dependent.
|
||||
*
|
||||
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
|
||||
* second default codepage that most international versions of
|
||||
* Windows have. It is one of the OEM codepages from
|
||||
*
|
||||
* http://www.microsoft.com/globaldev/reference/cphome.mspx,
|
||||
*
|
||||
* and is used for the `DOS boxes', to support legacy applications.
|
||||
* A German Windows version for example usually uses ANSI codepage
|
||||
* 1252 and OEM codepage 850.
|
||||
*
|
||||
* FT_WinFNT_ID_CP874 ::
|
||||
* A superset of Thai TIS 620 and ISO 8859-11.
|
||||
*
|
||||
* FT_WinFNT_ID_CP932 ::
|
||||
* A superset of Japanese Shift-JIS (with minor deviations).
|
||||
*
|
||||
* FT_WinFNT_ID_CP936 ::
|
||||
* A superset of simplified Chinese GB 2312-1980 (with different
|
||||
* ordering and minor deviations).
|
||||
*
|
||||
* FT_WinFNT_ID_CP949 ::
|
||||
* A superset of Korean Hangul KS C 5601-1987 (with different
|
||||
* ordering and minor deviations).
|
||||
*
|
||||
* FT_WinFNT_ID_CP950 ::
|
||||
* A superset of traditional Chinese Big 5 ETen (with different
|
||||
* ordering and minor deviations).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1250 ::
|
||||
* A superset of East European ISO 8859-2 (with slightly different
|
||||
* ordering).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1251 ::
|
||||
* A superset of Russian ISO 8859-5 (with different ordering).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1252 ::
|
||||
* ANSI encoding. A superset of ISO 8859-1.
|
||||
*
|
||||
* FT_WinFNT_ID_CP1253 ::
|
||||
* A superset of Greek ISO 8859-7 (with minor modifications).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1254 ::
|
||||
* A superset of Turkish ISO 8859-9.
|
||||
*
|
||||
* FT_WinFNT_ID_CP1255 ::
|
||||
* A superset of Hebrew ISO 8859-8 (with some modifications).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1256 ::
|
||||
* A superset of Arabic ISO 8859-6 (with different ordering).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1257 ::
|
||||
* A superset of Baltic ISO 8859-13 (with some deviations).
|
||||
*
|
||||
* FT_WinFNT_ID_CP1258 ::
|
||||
* For Vietnamese. This encoding doesn't cover all necessary
|
||||
* characters.
|
||||
*
|
||||
* FT_WinFNT_ID_CP1361 ::
|
||||
* Korean (Johab).
|
||||
*/
|
||||
|
||||
#define FT_WinFNT_ID_CP1252 0
|
||||
#define FT_WinFNT_ID_DEFAULT 1
|
||||
#define FT_WinFNT_ID_SYMBOL 2
|
||||
#define FT_WinFNT_ID_MAC 77
|
||||
#define FT_WinFNT_ID_CP932 128
|
||||
#define FT_WinFNT_ID_CP949 129
|
||||
#define FT_WinFNT_ID_CP1361 130
|
||||
#define FT_WinFNT_ID_CP936 134
|
||||
#define FT_WinFNT_ID_CP950 136
|
||||
#define FT_WinFNT_ID_CP1253 161
|
||||
#define FT_WinFNT_ID_CP1254 162
|
||||
#define FT_WinFNT_ID_CP1258 163
|
||||
#define FT_WinFNT_ID_CP1255 177
|
||||
#define FT_WinFNT_ID_CP1256 178
|
||||
#define FT_WinFNT_ID_CP1257 186
|
||||
#define FT_WinFNT_ID_CP1251 204
|
||||
#define FT_WinFNT_ID_CP874 222
|
||||
#define FT_WinFNT_ID_CP1250 238
|
||||
#define FT_WinFNT_ID_OEM 255
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* FT_WinFNT_HeaderRec_ */
|
||||
/* FT_WinFNT_HeaderRec */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Windows FNT Header info. */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Support functions for X11. */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -22,6 +22,13 @@
|
|||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#ifdef FREETYPE_H
|
||||
#error "freetype.h of FreeType 1 has been loaded!"
|
||||
#error "Please fix the directory search order for header files"
|
||||
#error "so that freetype.h of FreeType 2 is found first."
|
||||
#endif
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/* this comment is intentionally disabled for now, to prevent this */
|
||||
|
@ -43,7 +50,7 @@ FT_BEGIN_HEADER
|
|||
/* <Return> */
|
||||
/* Font format string. NULL in case of error. */
|
||||
/* */
|
||||
FT_EXPORT_DEF( const char* )
|
||||
FT_EXPORT( const char* )
|
||||
FT_Get_X11_Font_Format( FT_Face face );
|
||||
|
||||
/* */
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/* bdftypes.h
|
||||
|
||||
FreeType font driver for bdf fonts
|
||||
|
||||
Copyright (C) 2001, 2002 by
|
||||
Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef __BDFTYPES_H__
|
||||
#define __BDFTYPES_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_BDF_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct BDF_Public_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
|
||||
char* charset_encoding;
|
||||
char* charset_registry;
|
||||
|
||||
} BDF_Public_FaceRec, *BDF_Public_Face;
|
||||
|
||||
|
||||
typedef FT_Error (*BDF_GetPropertyFunc)( FT_Face face,
|
||||
const char* prop_name,
|
||||
BDF_PropertyRec *aproperty );
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* __BDFTYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -1,104 +0,0 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* fnttypes.h */
|
||||
/* */
|
||||
/* Basic Windows FNT/FON type definitions and interface (specification */
|
||||
/* only). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FNTTYPES_H__
|
||||
#define __FNTTYPES_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_WINFONTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
typedef struct WinMZ_HeaderRec_
|
||||
{
|
||||
FT_UShort magic;
|
||||
/* skipped content */
|
||||
FT_UShort lfanew;
|
||||
|
||||
} WinMZ_HeaderRec;
|
||||
|
||||
|
||||
typedef struct WinNE_HeaderRec_
|
||||
{
|
||||
FT_UShort magic;
|
||||
/* skipped content */
|
||||
FT_UShort resource_tab_offset;
|
||||
FT_UShort rname_tab_offset;
|
||||
|
||||
} WinNE_HeaderRec;
|
||||
|
||||
|
||||
typedef struct WinNameInfoRec_
|
||||
{
|
||||
FT_UShort offset;
|
||||
FT_UShort length;
|
||||
FT_UShort flags;
|
||||
FT_UShort id;
|
||||
FT_UShort handle;
|
||||
FT_UShort usage;
|
||||
|
||||
} WinNameInfoRec;
|
||||
|
||||
|
||||
typedef struct WinResourceInfoRec_
|
||||
{
|
||||
FT_UShort type_id;
|
||||
FT_UShort count;
|
||||
|
||||
} WinResourceInfoRec;
|
||||
|
||||
|
||||
#define WINFNT_MZ_MAGIC 0x5A4D
|
||||
#define WINFNT_NE_MAGIC 0x454E
|
||||
|
||||
|
||||
typedef struct FNT_FontRec_
|
||||
{
|
||||
FT_ULong offset;
|
||||
FT_Int size_shift;
|
||||
|
||||
FT_WinFNT_HeaderRec header;
|
||||
|
||||
FT_Byte* fnt_frame;
|
||||
FT_ULong fnt_size;
|
||||
|
||||
} FNT_FontRec, *FNT_Font;
|
||||
|
||||
|
||||
typedef struct FNT_FaceRec_
|
||||
{
|
||||
FT_FaceRec root;
|
||||
FNT_Font font;
|
||||
|
||||
FT_CharMap charmap_handle;
|
||||
FT_CharMapRec charmap; /* a single charmap per face */
|
||||
|
||||
} FNT_FaceRec, *FNT_Face;
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FNTTYPES_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Arithmetic computations (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -27,7 +27,8 @@
|
|||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
FT_EXPORT( FT_Int32 ) FT_SqrtFixed( FT_Int32 x );
|
||||
FT_EXPORT( FT_Int32 )
|
||||
FT_SqrtFixed( FT_Int32 x );
|
||||
|
||||
|
||||
#define SQRT_32( x ) FT_Sqrt32( x )
|
||||
|
@ -59,6 +60,39 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_MulDiv_No_Round */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A very simple function used to perform the computation `(a*b)/c' */
|
||||
/* (without rounding) with maximal accuracy (it uses a 64-bit */
|
||||
/* intermediate integer whenever necessary). */
|
||||
/* */
|
||||
/* This function isn't necessarily as fast as some processor specific */
|
||||
/* operations, but is at least completely portable. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* a :: The first multiplier. */
|
||||
/* b :: The second multiplier. */
|
||||
/* c :: The divisor. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The result of `(a*b)/c'. This function never traps when trying to */
|
||||
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
|
||||
/* on the signs of `a' and `b'. */
|
||||
/* */
|
||||
FT_BASE( FT_Long )
|
||||
FT_MulDiv_No_Round( FT_Long a,
|
||||
FT_Long b,
|
||||
FT_Long c );
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
|
||||
|
||||
|
||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
|
||||
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
|
||||
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
|
||||
|
|
|
@ -1,185 +0,0 @@
|
|||
#ifndef __FT_CORE_H__
|
||||
#define __FT_CORE_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_TYPES_H
|
||||
#include FT_SYSTEM_MEMORY_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
/***** *****/
|
||||
/***** C L E A N U P S T A C K *****/
|
||||
/***** *****/
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @functype: FT_CleanupFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to cleanup a given item on the cleanup stack
|
||||
*
|
||||
* @input:
|
||||
* item :: target item pointer
|
||||
* item_data :: optional argument to cleanup routine
|
||||
*/
|
||||
typedef void (*FT_CleanupFunc)( FT_Pointer item,
|
||||
FT_Pointer item_data );
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @type: FT_XHandler
|
||||
*
|
||||
* @description:
|
||||
* handle to an exception-handler structure for the FreeType
|
||||
* exception sub-system
|
||||
*
|
||||
* @note:
|
||||
* exception handlers are allocated on the stack within a
|
||||
* @FT_XTRY macro. Do not try to access them directly.
|
||||
*/
|
||||
typedef struct FT_XHandlerRec_* FT_XHandler;
|
||||
|
||||
|
||||
/* the size of a cleanup chunk in bytes is FT_CLEANUP_CHUNK_SIZE*12 + 4 */
|
||||
/* this must be a small power of 2 whenever possible.. */
|
||||
/* */
|
||||
/* with a value of 5, we have a byte size of 64 bytes per chunk.. */
|
||||
/* */
|
||||
#define FT_CLEANUP_CHUNK_SIZE 5
|
||||
|
||||
|
||||
|
||||
typedef struct FT_CleanupItemRec_
|
||||
{
|
||||
FT_Pointer item;
|
||||
FT_CleanupFunc item_func;
|
||||
FT_Pointer item_data;
|
||||
|
||||
} FT_CleanupItemRec;
|
||||
|
||||
|
||||
typedef struct FT_CleanupChunkRec_* FT_CleanupChunk;
|
||||
|
||||
typedef struct FT_CleanupChunkRec_
|
||||
{
|
||||
FT_CleanupChunk link;
|
||||
FT_CleanupItemRec items[ FT_CLEANUP_CHUNK_SIZE ];
|
||||
|
||||
} FT_CleanupChunkRec;
|
||||
|
||||
|
||||
typedef struct FT_CleanupStackRec_
|
||||
{
|
||||
FT_CleanupItem top;
|
||||
FT_CleanupItem limit;
|
||||
FT_CleanupChunk chunk;
|
||||
FT_CleanupChunkRec chunk_0; /* avoids stupid dynamic allocation */
|
||||
FT_Memory memory;
|
||||
|
||||
} FT_CleanupStackRec, *FT_CleanupStack;
|
||||
|
||||
|
||||
FT_BASE( void )
|
||||
ft_cleanup_stack_push( FT_CleanupStack stack,
|
||||
FT_Pointer item,
|
||||
FT_CleanupFunc item_func,
|
||||
FT_Pointer item_data );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_cleanup_stack_pop( FT_CleanupStack stack,
|
||||
FT_Int destroy );
|
||||
|
||||
FT_BASE( FT_CleanupItem )
|
||||
ft_cleanup_stack_peek( FT_CleanupStack stack );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_cleanup_throw( FT_CleanupStack stack,
|
||||
FT_Error error );
|
||||
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
/***** *****/
|
||||
/***** M E M O R Y M A N A G E R *****/
|
||||
/***** *****/
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
|
||||
typedef struct FT_MemoryRec_
|
||||
{
|
||||
FT_Memory_AllocFunc mem_alloc; /* shortcut to funcs->mem_alloc */
|
||||
FT_Memory_FreeFunc mem_free; /* shortcut to funcs->mem_free */
|
||||
FT_Pointer mem_data;
|
||||
const FT_Memory_Funcs mem_funcs;
|
||||
|
||||
FT_CleanupStackRec cleanup_stack;
|
||||
FT_Pointer meta_class;
|
||||
|
||||
} FT_MemoryRec;
|
||||
|
||||
|
||||
#define FT_MEMORY(x) ((FT_Memory)(x))
|
||||
#define FT_MEMORY__ALLOC(x) FT_MEMORY(x)->mem_alloc
|
||||
#define FT_MEMORY__FREE(x) FT_MEMORY(x)->mem_free
|
||||
#define FT_MEMORY__REALLOC(x) FT_MEMORY(x)->mem_funcs->mem_realloc
|
||||
#define FT_MEMORY__CLEANUP(x) (&FT_MEMORY(x)->cleanup_stack)
|
||||
#define FT_MEMORY__META_CLASS(x) ((FT_MetaClass)(FT_MEMORY(x)->meta_class))
|
||||
|
||||
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
/***** *****/
|
||||
/***** E X C E P T I O N H A N D L I N G *****/
|
||||
/***** *****/
|
||||
/**************************************************************************/
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* @struct: FT_XHandlerRec
|
||||
*
|
||||
* @description:
|
||||
* exception handler structure
|
||||
*
|
||||
* @fields:
|
||||
* previous :: previous handler in chain.
|
||||
* jum_buffer :: processor state used by setjmp/longjmp to implement
|
||||
* exception control transfer
|
||||
* error :: exception error code
|
||||
* mark :: top of cleanup stack when @FT_XTRY is used
|
||||
*/
|
||||
typedef struct FT_XHandlerRec_
|
||||
{
|
||||
FT_XHandler previous;
|
||||
ft_jmp_buf jump_buffer;
|
||||
volatile FT_Error error;
|
||||
FT_Pointer mark;
|
||||
|
||||
} FT_XHandlerRec;
|
||||
|
||||
FT_BASE( void )
|
||||
ft_xhandler_enter( FT_XHandler xhandler,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_xhandler_exit( FT_XHandler xhandler );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_CORE_H__ */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Debugging and logging component (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <ft2build.h>
|
||||
#include FT_CONFIG_CONFIG_H
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
@ -96,6 +97,53 @@ FT_BEGIN_HEADER
|
|||
#endif /* !FT_DEBUG_LEVEL_TRACE */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Trace_Get_Count */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return the number of available trace components. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The number of trace components. 0 if FreeType 2 is not built with */
|
||||
/* FT_DEBUG_LEVEL_TRACE definition. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function may be useful if you want to access elements of */
|
||||
/* the internal `ft_trace_levels' array by an index. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Int )
|
||||
FT_Trace_Get_Count( void );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Trace_Get_Name */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Return the name of a trace component. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* The index of the trace component. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The name of the trace component. This is a statically allocated */
|
||||
/* C string, so do not free it after use. NULL if FreeType 2 is not */
|
||||
/* built with FT_DEBUG_LEVEL_TRACE definition. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Use @FT_Trace_Get_Count to get the number of available trace */
|
||||
/* components. */
|
||||
/* */
|
||||
/* This function may be useful if you want to control FreeType 2's */
|
||||
/* debug level in your appliaciton. */
|
||||
/* */
|
||||
FT_EXPORT( const char * )
|
||||
FT_Trace_Get_Name( FT_Int idx );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* You need two opening resp. closing parentheses! */
|
||||
|
|
|
@ -155,11 +155,15 @@ FT_BEGIN_HEADER
|
|||
/* add data from AFM or PFM files on a Type 1 */
|
||||
/* face, or a CIDMap on a CID-keyed face. */
|
||||
/* */
|
||||
/* get_advances :: A function handle used to return the advances */
|
||||
/* of 'count' glyphs, starting at `index'. the */
|
||||
/* `vertical' flags must be set when vertical */
|
||||
/* advances are queried. The advances buffer is */
|
||||
/* caller-allocated. */
|
||||
/* get_advances :: A function handle used to return advance */
|
||||
/* widths of 'count' glyphs (in font units), */
|
||||
/* starting at `first'. The `vertical' flag must */
|
||||
/* be set to get vertical advance heights. The */
|
||||
/* `advances' buffer is caller-allocated. */
|
||||
/* Currently not implemented. The idea of this */
|
||||
/* function is to be able to perform */
|
||||
/* device-independent text layout without loading */
|
||||
/* a single glyph image. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Most function pointers, with the exception of `load_glyph' and */
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
#ifndef __FT_EXCEPT_H__
|
||||
#define __FT_EXCEPT_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
|
||||
/* I can't find a better place for this for now */
|
||||
|
||||
<<<<<<< ftexcept.h
|
||||
=======
|
||||
|
||||
/* the size of a cleanup chunk in bytes is FT_CLEANUP_CHUNK_SIZE*12 + 4 */
|
||||
/* this must be a small power of 2 whenever possible.. */
|
||||
/* */
|
||||
/* with a value of 5, we have a byte size of 64 bytes per chunk.. */
|
||||
/* */
|
||||
#define FT_CLEANUP_CHUNK_SIZE 5
|
||||
|
||||
|
||||
|
||||
typedef struct FT_CleanupItemRec_
|
||||
{
|
||||
FT_Pointer item;
|
||||
FT_CleanupFunc item_func;
|
||||
FT_Pointer item_data;
|
||||
|
||||
} FT_CleanupItemRec;
|
||||
|
||||
typedef struct FT_CleanupChunkRec_* FT_CleanupChunk;
|
||||
|
||||
typedef struct FT_CleanupChunkRec_
|
||||
{
|
||||
FT_CleanupChunk link;
|
||||
FT_CleanupItemRec items[ FT_CLEANUP_CHUNK_SIZE ];
|
||||
|
||||
} FT_CleanupChunkRec;
|
||||
|
||||
|
||||
typedef struct FT_CleanupStackRec_
|
||||
{
|
||||
FT_CleanupItem top;
|
||||
FT_CleanupItem limit;
|
||||
FT_CleanupChunk chunk;
|
||||
FT_CleanupChunkRec chunk_0; /* avoids stupid dynamic allocation */
|
||||
FT_Memory memory;
|
||||
|
||||
} FT_CleanupStackRec, *FT_CleanupStack;
|
||||
|
||||
|
||||
FT_BASE( void )
|
||||
ft_cleanup_stack_push( FT_CleanupStack stack,
|
||||
FT_Pointer item,
|
||||
FT_CleanupFunc item_func,
|
||||
FT_Pointer item_data );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_cleanup_stack_pop( FT_CleanupStack stack,
|
||||
FT_Int destroy );
|
||||
|
||||
FT_BASE( FT_CleanupItem )
|
||||
ft_cleanup_stack_peek( FT_CleanupStack stack );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_xhandler_enter( FT_XHandler xhandler,
|
||||
FT_Memory memory );
|
||||
|
||||
FT_BASE( void )
|
||||
ft_xhandler_exit( FT_XHandler xhandler );
|
||||
|
||||
|
||||
FT_BASE( void )
|
||||
ft_cleanup_throw( FT_CleanupStack stack,
|
||||
FT_Error error );
|
||||
|
||||
>>>>>>> 1.2
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_EXCEPT_H__ */
|
|
@ -110,15 +110,15 @@ FT_BEGIN_HEADER
|
|||
FT_BASE( void )
|
||||
FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
|
||||
|
||||
/* check that there is enough room to add 'n_points' and 'n_contours' */
|
||||
/* to the glyph loader */
|
||||
/* check that there is enough space to add `n_points' and `n_contours' */
|
||||
/* to the glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
|
||||
FT_UInt n_points,
|
||||
FT_UInt n_contours );
|
||||
|
||||
/* check that there is enough room to add 'n_subs' sub-glyphs to */
|
||||
/* a glyph loader */
|
||||
/* check that there is enough space to add `n_subs' sub-glyphs to */
|
||||
/* a glyph loader */
|
||||
FT_BASE( FT_Error )
|
||||
FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
|
||||
FT_UInt n_subs );
|
||||
|
|
|
@ -1,502 +0,0 @@
|
|||
/******************************************************************
|
||||
*
|
||||
* fthash.h - fast dynamic hash tables
|
||||
*
|
||||
* Copyright 2002 by
|
||||
* David Turner, Robert Wilhelm, and Werner Lemberg
|
||||
*
|
||||
* This file is part of the FreeType project, and may only be used,
|
||||
* modified, and distributed under the terms of the FreeType project
|
||||
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
||||
* this file you indicate that you have read the license and
|
||||
* understand and accept it fully.
|
||||
*
|
||||
*
|
||||
* This header is used to define dynamic hash tables as described
|
||||
* by the article "Main-Memory Linear Hashing - Some Enhancements
|
||||
* of Larson's Algorithm" by Mikael Petterson.
|
||||
*
|
||||
* Basically, linear hashing prevents big "stalls" during
|
||||
* resizes of the buckets array by only splitting one bucket
|
||||
* at a time. This ensures excellent response time even when
|
||||
* the table is frequently resized..
|
||||
*
|
||||
*
|
||||
* Note that the use of the FT_Hash type is rather unusual in order
|
||||
* to be as generic and efficient as possible. See the comments in the
|
||||
* following definitions for more details.
|
||||
*/
|
||||
|
||||
#ifndef __FT_HASH_H__
|
||||
#define __FT_HASH_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_TYPES_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* @type: FT_Hash
|
||||
*
|
||||
* @description:
|
||||
* handle to a @FT_HashRec structure used to model a
|
||||
* dynamic hash table
|
||||
*/
|
||||
typedef struct FT_HashRec_* FT_Hash;
|
||||
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* @type: FT_HashNode
|
||||
*
|
||||
* @description:
|
||||
* handle to a @FT_HashNodeRec structure used to model a
|
||||
* single node of a hash table
|
||||
*/
|
||||
typedef struct FT_HashNodeRec_* FT_HashNode;
|
||||
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* @type: FT_HashLookup
|
||||
*
|
||||
* @description:
|
||||
* handle to a @FT_HashNode pointer. This is returned by
|
||||
* the @ft_hash_lookup function and can later be used by
|
||||
* @ft_hash_add or @ft_hash_remove
|
||||
*/
|
||||
typedef FT_HashNode* FT_HashLookup;
|
||||
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* @type: FT_Hash_EqualFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to compare two nodes of the hash table
|
||||
*
|
||||
* @input:
|
||||
* node1 :: handle to first node
|
||||
* node2 :: handle to second node
|
||||
*
|
||||
* @return:
|
||||
* 1 iff the 'keys' in 'node1' and 'node2' are identical.
|
||||
* 0 otherwise.
|
||||
*/
|
||||
typedef FT_Int (*FT_Hash_EqualFunc)( FT_HashNode node1,
|
||||
FT_HashNode node2 );
|
||||
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* @struct: FT_HashRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to model a dynamic hash table.
|
||||
*
|
||||
* @fields:
|
||||
* memory :: memory manager used to allocate
|
||||
* the buckets array and the hash nodes
|
||||
*
|
||||
* buckets :: array of hash buckets
|
||||
*
|
||||
* node_size :: size of node in bytes
|
||||
* node_compare :: a function used to compare two nodes
|
||||
* node_hash :: a function used to compute the hash
|
||||
* value of a given node
|
||||
* p ::
|
||||
* mask ::
|
||||
* slack ::
|
||||
*
|
||||
* @note:
|
||||
* 'p', 'mask' and 'slack' are control values managed by
|
||||
* the hash table. Do not try to interpret them directly.
|
||||
*
|
||||
* You can grab the hash table size by calling
|
||||
* '@ft_hash_get_size'.
|
||||
*/
|
||||
typedef struct FT_HashRec_
|
||||
{
|
||||
FT_HashNode* buckets;
|
||||
FT_UInt p;
|
||||
FT_UInt mask; /* really maxp-1 */
|
||||
FT_Long slack;
|
||||
FT_Hash_EqualFunc node_equal;
|
||||
FT_Memory memory;
|
||||
|
||||
} FT_HashRec;
|
||||
|
||||
|
||||
/***********************************************************
|
||||
*
|
||||
* @struct: FT_HashNodeRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to model the root fields of a dynamic
|
||||
* hash table node.
|
||||
*
|
||||
* it's up to client applications to "sub-class" this
|
||||
* structure to add relevant (key,value) definitions
|
||||
*
|
||||
* @fields:
|
||||
* link :: pointer to next node in bucket's collision list
|
||||
* hash :: 32-bit hash value for this node
|
||||
*
|
||||
* @note:
|
||||
* it's up to client applications to "sub-class" this structure
|
||||
* to add relevant (key,value) type definitions. For example,
|
||||
* if we want to build a "string -> int" mapping, we could use
|
||||
* something like:
|
||||
*
|
||||
* {
|
||||
* typedef struct MyNodeRec_
|
||||
* {
|
||||
* FT_HashNodeRec hnode;
|
||||
* const char* key;
|
||||
* int value;
|
||||
*
|
||||
* } MyNodeRec, *MyNode;
|
||||
* }
|
||||
*
|
||||
*/
|
||||
typedef struct FT_HashNodeRec_
|
||||
{
|
||||
FT_HashNode link;
|
||||
FT_UInt32 hash;
|
||||
|
||||
} FT_HashNodeRec;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_init
|
||||
*
|
||||
* @description:
|
||||
* initialize a dynamic hash table
|
||||
*
|
||||
* @input:
|
||||
* table :: handle to target hash table structure
|
||||
* node_equal :: node comparison function
|
||||
* memory :: memory manager handle used to allocate the
|
||||
* buckets array within the hash table
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* the node comparison function should only compare node _keys_
|
||||
* and ignore values !! with good hashing computation (which the
|
||||
* user must perform itself), the comparison function should be
|
||||
* pretty seldom called.
|
||||
*
|
||||
* here is a simple example:
|
||||
*
|
||||
* {
|
||||
* static int my_equal( MyNode node1,
|
||||
* MyNode node2 )
|
||||
* {
|
||||
* // compare keys of 'node1' and 'node2'
|
||||
* return (strcmp( node1->key, node2->key ) == 0);
|
||||
* }
|
||||
*
|
||||
* ....
|
||||
*
|
||||
* ft_hash_init( &hash, (FT_Hash_EqualFunc) my_compare, memory );
|
||||
* ....
|
||||
* }
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
ft_hash_init( FT_Hash table,
|
||||
FT_Hash_EqualFunc compare,
|
||||
FT_Memory memory );
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_lookup
|
||||
*
|
||||
* @description:
|
||||
* search a hash table to find a node corresponding to a given
|
||||
* key.
|
||||
*
|
||||
* @input:
|
||||
* table :: handle to target hash table structure
|
||||
* keynode :: handle to a reference hash node that will be
|
||||
* only used for key comparisons with the table's
|
||||
* elements
|
||||
*
|
||||
* @return:
|
||||
* a pointer-to-hash-node value, which must be used as followed:
|
||||
*
|
||||
* - if '*result' is NULL, the key wasn't found in the hash
|
||||
* table. The value of 'result' can be used to add new elements
|
||||
* through @ft_hash_add however..
|
||||
*
|
||||
* - if '*result' is not NULL, it's a handle to the first table
|
||||
* node that corresponds to the search key. The value of 'result'
|
||||
* can be used to remove this element through @ft_hash_remove
|
||||
*
|
||||
* @note:
|
||||
* here is an example:
|
||||
*
|
||||
* {
|
||||
* // maps a string to an integer with a hash table
|
||||
* // returns -1 in case of failure
|
||||
* //
|
||||
* int my_lookup( FT_Hash table,
|
||||
* const char* key )
|
||||
* {
|
||||
* MyNode* pnode;
|
||||
* MyNodeRec noderec;
|
||||
*
|
||||
* // set-up key node. It's 'hash' and 'key' fields must
|
||||
* // be set correctly.. we ignore 'link' and 'value'
|
||||
* //
|
||||
* noderec.hnode.hash = strhash( key );
|
||||
* noderec.key = key;
|
||||
*
|
||||
* // perform search - return value
|
||||
* //
|
||||
* pnode = (MyNode) ft_hash_lookup( table, &noderec );
|
||||
* if ( *pnode )
|
||||
* {
|
||||
* // we found it
|
||||
* return (*pnode)->value;
|
||||
* }
|
||||
* return -1;
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
FT_BASE_DEF( FT_HashLookup )
|
||||
ft_hash_lookup( FT_Hash table,
|
||||
FT_HashNode keynode );
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_add
|
||||
*
|
||||
* @description:
|
||||
* add a new node to a dynamic hash table. the user must
|
||||
* call @ft_hash_lookup and allocate a new node before calling
|
||||
* this function.
|
||||
*
|
||||
* @input:
|
||||
* table :: hash table handle
|
||||
* lookup :: pointer-to-hash-node value returned by @ft_hash_lookup
|
||||
* new_node :: handle to new hash node. All its fields must be correctly
|
||||
* set, including 'hash'.
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* this function should always be used _after_ a call to @ft_hash_lookup
|
||||
* that returns a pointer to a NULL handle. Here's an example:
|
||||
*
|
||||
* {
|
||||
* // sets the value corresponding to a given string key
|
||||
* //
|
||||
* void my_set( FT_Hash table,
|
||||
* const char* key,
|
||||
* int value )
|
||||
* {
|
||||
* MyNode* pnode;
|
||||
* MyNodeRec noderec;
|
||||
* MyNode node;
|
||||
*
|
||||
* // set-up key node. It's 'hash' and 'key' fields must
|
||||
* // be set correctly..
|
||||
* noderec.hnode.hash = strhash( key );
|
||||
* noderec.key = key;
|
||||
*
|
||||
* // perform search - return value
|
||||
* pnode = (MyNode) ft_hash_lookup( table, &noderec );
|
||||
* if ( *pnode )
|
||||
* {
|
||||
* // we found it, simply replace the value in the node
|
||||
* (*pnode)->value = value;
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* // allocate a new node - and set it up
|
||||
* node = (MyNode) malloc( sizeof(*node) );
|
||||
* if ( node == NULL ) .....
|
||||
*
|
||||
* node->hnode.hash = noderec.hnode.hash;
|
||||
* node->key = key;
|
||||
* node->value = value;
|
||||
*
|
||||
* // add it to the hash table
|
||||
* error = ft_hash_add( table, pnode, node );
|
||||
* if (error) ....
|
||||
* }
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
ft_hash_add( FT_Hash table,
|
||||
FT_HashLookup lookup,
|
||||
FT_HashNode new_node );
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_remove
|
||||
*
|
||||
* @description:
|
||||
* try to remove the node corresponding to a given key from
|
||||
* a hash table. This must be called after @ft_hash_lookup
|
||||
*
|
||||
* @input:
|
||||
* table :: hash table handle
|
||||
* lookup :: pointer-to-hash-node value returned by @ft_hash_lookup
|
||||
*
|
||||
* @note:
|
||||
* this function doesn't free the node itself !! Here's an example:
|
||||
*
|
||||
* {
|
||||
* // sets the value corresponding to a given string key
|
||||
* //
|
||||
* void my_remove( FT_Hash table,
|
||||
* const char* key )
|
||||
* {
|
||||
* MyNodeRec noderec;
|
||||
* MyNode node;
|
||||
*
|
||||
* noderec.hnode.hash = strhash(key);
|
||||
* noderec.key = key;
|
||||
* node = &noderec;
|
||||
*
|
||||
* pnode = ft_hash_lookup( table, &noderec );
|
||||
* node = *pnode;
|
||||
* if ( node != NULL )
|
||||
* {
|
||||
* error = ft_hash_remove( table, pnode );
|
||||
* if ( !error )
|
||||
* free( node );
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
ft_hash_remove( FT_Hash table,
|
||||
FT_HashLookup lookup );
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_get_size
|
||||
*
|
||||
* @description:
|
||||
* return the number of elements in a given hash table
|
||||
*
|
||||
* @input:
|
||||
* table :: handle to target hash table structure
|
||||
*
|
||||
* @return:
|
||||
* number of elements. 0 if empty
|
||||
*/
|
||||
FT_BASE( FT_UInt )
|
||||
ft_hash_get_size( FT_Hash table );
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @functype: FT_Hash_ForeachFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to iterate over all elements of a given
|
||||
* hash table
|
||||
*
|
||||
* @input:
|
||||
* node :: handle to target @FT_HashNodeRec node structure
|
||||
* data :: optional argument to iteration routine
|
||||
*
|
||||
* @also: @ft_hash_foreach
|
||||
*/
|
||||
typedef void (*FT_Hash_ForeachFunc)( const FT_HashNode node,
|
||||
const FT_Pointer data );
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_foreach
|
||||
*
|
||||
* @description:
|
||||
* parse over all elements in a hash table
|
||||
*
|
||||
* @input:
|
||||
* table :: handle to target hash table structure
|
||||
* foreach_func :: iteration routine called for each element
|
||||
* foreach_data :: optional argument to the iteration routine
|
||||
*
|
||||
* @note:
|
||||
* this function is often used to release all elements from a
|
||||
* hash table. See the example given for @ft_hash_done
|
||||
*/
|
||||
FT_BASE( void )
|
||||
ft_hash_foreach( FT_Hash table,
|
||||
FT_Hash_ForeachFunc foreach_func,
|
||||
const FT_Pointer foreach_data );
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* @function: ft_hash_done
|
||||
*
|
||||
* @description:
|
||||
* finalize a given hash table
|
||||
*
|
||||
* @input:
|
||||
* table :: handle to target hash table structure
|
||||
* node_func :: optional iteration function pointer. this
|
||||
* can be used to destroy all nodes explicitely
|
||||
* node_data :: optional argument to the node iterator
|
||||
*
|
||||
* @note:
|
||||
* this function simply frees the hash table's buckets.
|
||||
* you probably will need to call @ft_hash_foreach to
|
||||
* destroy all its elements before @ft_hash_done, as in
|
||||
* the following example:
|
||||
*
|
||||
* {
|
||||
* static void my_node_clear( const MyNode node )
|
||||
* {
|
||||
* free( node );
|
||||
* }
|
||||
*
|
||||
* static void my_done( FT_Hash table )
|
||||
* {
|
||||
* ft_hash_done( table, (FT_Hash_ForeachFunc) my_node_clear, NULL );
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
FT_BASE( void )
|
||||
ft_hash_done( FT_Hash table,
|
||||
FT_Hash_ForeachFunc item_func,
|
||||
const FT_Pointer item_data );
|
||||
|
||||
/* */
|
||||
|
||||
/* compute bucket index from hash value in a dynamic hash table */
|
||||
/* this is only used to break encapsulation to speed lookups in */
|
||||
/* the FreeType cache manager !! */
|
||||
/* */
|
||||
|
||||
#define FT_HASH_COMPUTE_INDEX(_table,_hash,_index) \
|
||||
{ \
|
||||
FT_UInt _mask = (_table)->mask; \
|
||||
FT_UInt _hash0 = (_hash); \
|
||||
\
|
||||
(_index) = (FT_UInt)( (_hash0) & _mask ) ); \
|
||||
if ( (_index) < (_table)->p ) \
|
||||
(_index) = (FT_uInt)( (_hash0) & ( 2*_mask+1 ) ); \
|
||||
}
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_HASH_H__ */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType memory management macros (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -180,6 +180,12 @@ FT_BEGIN_HEADER
|
|||
|
||||
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
|
||||
|
||||
#define FT_ARRAY_COPY( dest, source, count ) \
|
||||
FT_MEM_COPY( dest, source, (count) * sizeof( *(dest) ) )
|
||||
|
||||
#define FT_ARRAY_MOVE( dest, source, count ) \
|
||||
FT_MEM_MOVE( dest, source, (count) * sizeof( *(dest) ) )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
|
|
|
@ -1,533 +0,0 @@
|
|||
#ifndef __FT_OBJECT_H__
|
||||
#define __FT_OBJECT_H__
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @type: FT_Object
|
||||
*
|
||||
* @description:
|
||||
* handle to a FreeType Object. See @FT_ObjectRec
|
||||
*/
|
||||
typedef struct FT_ObjectRec_* FT_Object;
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @type: FT_Class
|
||||
*
|
||||
* @description:
|
||||
* handle to a constant class handle to a FreeType Object.
|
||||
*
|
||||
* Note that a class is itself a @FT_Object and are dynamically
|
||||
* allocated on the heap.
|
||||
*
|
||||
* @also:
|
||||
* @FT_ClassRec, @FT_Object, @FT_ObjectRec, @FT_Type, @FT_TypeRec
|
||||
*/
|
||||
typedef const struct FT_ClassRec_* FT_Class;
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @type: FT_Type
|
||||
*
|
||||
* @description:
|
||||
* handle to a constant structure (of type @FT_TypeRec) used
|
||||
* to describe a given @FT_Class type to the FreeType object
|
||||
* sub-system.
|
||||
*/
|
||||
typedef const struct FT_TypeRec_* FT_Type;
|
||||
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @struct: FT_ObjectRec
|
||||
*
|
||||
* @description:
|
||||
* a structure describing the root fields of all @FT_Object
|
||||
* class instances in FreeType
|
||||
*
|
||||
* @fields:
|
||||
* clazz :: handle to the object's class
|
||||
* ref_count :: object's reference count. Starts at 1
|
||||
*/
|
||||
typedef struct FT_ObjectRec_
|
||||
{
|
||||
FT_Class clazz;
|
||||
FT_Int ref_count;
|
||||
|
||||
} FT_ObjectRec;
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_OBJECT (x)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to type-cast anything to a @FT_Object
|
||||
* handle. No check performed..
|
||||
*/
|
||||
#define FT_OBJECT(x) ((FT_Object)(x))
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_OBJECT_P (x)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to type-cast anything to a pointer to
|
||||
* @FT_Object handle.
|
||||
*/
|
||||
#define FT_OBJECT_P(x) ((FT_Object*)(x))
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_OBJECT__CLASS (obj)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return the class of any object
|
||||
*/
|
||||
#define FT_OBJECT__CLASS(x) FT_OBJECT(x)->clazz
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_OBJECT__REF_COUNT (obj)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return the reference count of any object
|
||||
*/
|
||||
#define FT_OBJECT__REF_COUNT(x) FT_OBJECT(x)->ref_count
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_OBJECT__MEMORY (obj)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return a handle to the memory manager
|
||||
* used to allocate a given object
|
||||
*/
|
||||
#define FT_OBJECT__MEMORY(x) FT_CLASS__MEMORY(FT_OBJECT(x)->clazz)
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_OBJECT__LIBRARY (obj)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return a handle to the library handle
|
||||
* that owns the object
|
||||
*/
|
||||
#define FT_OBJECT__LIBRARY(x) FT_CLASS__LIBRARY(FT_OBJECT(x)->clazz)
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @functype: FT_Object_InitFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to initialize a new object
|
||||
*
|
||||
* @input:
|
||||
* object :: target object handle
|
||||
* init_data :: optional pointer to initialization data
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*/
|
||||
typedef FT_Error (*FT_Object_InitFunc)( FT_Object object,
|
||||
FT_Pointer init_data );
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @functype: FT_Object_DoneFunc
|
||||
*
|
||||
* @description:
|
||||
* a function used to finalize a given object
|
||||
*
|
||||
* @input:
|
||||
* object :: handle to target object
|
||||
*/
|
||||
typedef void (*FT_Object_DoneFunc)( FT_Object object );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @struct: FT_ClassRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to describe a given object class within
|
||||
* FreeType
|
||||
*
|
||||
* @fields:
|
||||
* object :: root @FT_ObjectRec fields, since each class is
|
||||
* itself an object. (it's an instance of the
|
||||
* "metaclass", a special object of the FreeType
|
||||
* object sub-system.)
|
||||
*
|
||||
* magic :: a 32-bit magic number used for decoding
|
||||
* super :: pointer to super class
|
||||
* type :: the @FT_Type descriptor of this class
|
||||
* memory :: the current memory manager handle
|
||||
* library :: the current library handle
|
||||
* info :: an opaque pointer to class-specific information
|
||||
* managed by the FreeType object sub-system
|
||||
*
|
||||
* class_done :: the class destructor function
|
||||
*
|
||||
* obj_size :: size of class instances in bytes
|
||||
* obj_init :: class instance constructor
|
||||
* obj_done :: class instance destructor
|
||||
*/
|
||||
typedef struct FT_ClassRec_
|
||||
{
|
||||
FT_ObjectRec object;
|
||||
FT_UInt32 magic;
|
||||
FT_Class super;
|
||||
FT_Type type;
|
||||
FT_Memory memory;
|
||||
FT_Library library;
|
||||
FT_Pointer info;
|
||||
|
||||
FT_Object_DoneFunc class_done;
|
||||
|
||||
FT_UInt obj_size;
|
||||
FT_Object_InitFunc obj_init;
|
||||
FT_Object_DoneFunc obj_done;
|
||||
|
||||
} FT_ClassRec;
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_CLASS (x)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to convert anything to a class handle
|
||||
* without checks
|
||||
*/
|
||||
#define FT_CLASS(x) ((FT_Class)(x))
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_CLASS_P (x)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to convert anything to a pointer to a class
|
||||
* handle without checks
|
||||
*/
|
||||
#define FT_CLASS_P(x) ((FT_Class*)(x))
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_CLASS__MEMORY (clazz)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return the memory manager handle of a
|
||||
* given class
|
||||
*/
|
||||
#define FT_CLASS__MEMORY(x) FT_CLASS(x)->memory
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_CLASS__LIBRARY (clazz)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return the library handle of a
|
||||
* given class
|
||||
*/
|
||||
#define FT_CLASS__LIBRARY(x) FT_CLASS(x)->library
|
||||
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_CLASS__TYPE (clazz)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to return the type of a given class
|
||||
* given class
|
||||
*/
|
||||
#define FT_CLASS__TYPE(x) FT_CLASS(x)->type
|
||||
|
||||
/* */
|
||||
#define FT_CLASS__INFO(x) FT_CLASS(x)->info
|
||||
#define FT_CLASS__MAGIC(x) FT_CLASS(x)->magic
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @struct: FT_TypeRec
|
||||
*
|
||||
* @description:
|
||||
* a structure used to describe a given class to the FreeType
|
||||
* object sub-system.
|
||||
*
|
||||
* @fields:
|
||||
* name :: class name. only used for debugging
|
||||
* super :: type of super-class. NULL if none
|
||||
*
|
||||
* class_size :: size of class structure in bytes
|
||||
* class_init :: class constructor
|
||||
* class_done :: class finalizer
|
||||
*
|
||||
* obj_size :: instance size in bytes
|
||||
* obj_init :: instance constructor. can be NULL
|
||||
* obj_done :: instance destructor. can be NULL
|
||||
*
|
||||
* @note:
|
||||
* if 'obj_init' is NULL, the class will use it's parent
|
||||
* constructor, if any
|
||||
*
|
||||
* if 'obj_done' is NULL, the class will use it's parent
|
||||
* finalizer, if any
|
||||
*
|
||||
* the object sub-system allocates a new class, copies
|
||||
* the content of its super-class into the new structure,
|
||||
* _then_ calls 'clazz_init'.
|
||||
*
|
||||
* 'class_init' and 'class_done' can be NULL, in which case
|
||||
* the parent's class constructor and destructor wil be used
|
||||
*/
|
||||
typedef struct FT_TypeRec_
|
||||
{
|
||||
const char* name;
|
||||
FT_Type super;
|
||||
|
||||
FT_UInt class_size;
|
||||
FT_Object_InitFunc class_init;
|
||||
FT_Object_DoneFunc class_done;
|
||||
|
||||
FT_UInt obj_size;
|
||||
FT_Object_InitFunc obj_init;
|
||||
FT_Object_DoneFunc obj_done;
|
||||
|
||||
} FT_TypeRec;
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro: FT_TYPE (x)
|
||||
*
|
||||
* @description:
|
||||
* a useful macro to convert anything to a class type handle
|
||||
* without checks
|
||||
*/
|
||||
#define FT_TYPE(x) ((FT_Type)(x))
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: ft_object_check
|
||||
*
|
||||
* @description:
|
||||
* checks that a handle points to a valid @FT_Object
|
||||
*
|
||||
* @input:
|
||||
* obj :: handle/pointer
|
||||
*
|
||||
* @return:
|
||||
* 1 iff the handle points to a valid object. 0 otherwise
|
||||
*/
|
||||
FT_BASE( FT_Int )
|
||||
ft_object_check( FT_Pointer obj );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: ft_object_is_a
|
||||
*
|
||||
* @description:
|
||||
* checks that a handle points to a valid @FT_Object that
|
||||
* is an instance of a given class (or of any of its sub-classes)
|
||||
*
|
||||
* @input:
|
||||
* obj :: handle/pointer
|
||||
* clazz :: class handle to check
|
||||
*
|
||||
* @return:
|
||||
* 1 iff the handle points to a valid 'clazz' instance. 0
|
||||
* otherwise.
|
||||
*/
|
||||
FT_BASE( FT_Int )
|
||||
ft_object_is_a( FT_Pointer obj,
|
||||
FT_Class clazz );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: ft_object_create
|
||||
*
|
||||
* @description:
|
||||
* create a new object (class instance)
|
||||
*
|
||||
* @output:
|
||||
* aobject :: new object handle. NULL in case of error
|
||||
*
|
||||
* @input:
|
||||
* clazz :: object's class pointer
|
||||
* init_data :: optional pointer to initialization data
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
ft_object_create( FT_Object *aobject,
|
||||
FT_Class clazz,
|
||||
FT_Pointer init_data );
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: ft_object_create_from_type
|
||||
*
|
||||
* @description:
|
||||
* create a new object (class instance) from a @FT_Type
|
||||
*
|
||||
* @output:
|
||||
* aobject :: new object handle. NULL in case of error
|
||||
*
|
||||
* @input:
|
||||
* type :: object's type descriptor
|
||||
* init_data :: optional pointer to initialization data
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*
|
||||
* @note:
|
||||
* this function is slower than @ft_object_create
|
||||
*
|
||||
* this is equivalent to calling @ft_class_from_type followed by
|
||||
* @ft_object_create
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
ft_object_create_from_type( FT_Object *aobject,
|
||||
FT_Type type,
|
||||
FT_Pointer init_data,
|
||||
FT_Library library );
|
||||
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro FT_OBJ_CREATE (object,class,init)
|
||||
*
|
||||
* @description:
|
||||
* a convenient macro used to create new objects. see
|
||||
* @ft_object_create for details
|
||||
*/
|
||||
#define FT_OBJ_CREATE( _obj, _clazz, _init ) \
|
||||
ft_object_create( FT_OBJECT_P(&(_obj)), _clazz, _init )
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro FT_CREATE (object,class,init)
|
||||
*
|
||||
* @description:
|
||||
* a convenient macro used to create new objects. It also
|
||||
* sets an _implicit_ local variable named "error" to the error
|
||||
* code returned by the object constructor.
|
||||
*/
|
||||
#define FT_CREATE( _obj, _clazz, _init ) \
|
||||
FT_SET_ERROR( FT_OBJ_CREATE( _obj, _clazz, _init ) )
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro FT_OBJ_CREATE_FROM_TYPE (object,type,init)
|
||||
*
|
||||
* @description:
|
||||
* a convenient macro used to create new objects. see
|
||||
* @ft_object_create_from_type for details
|
||||
*/
|
||||
#define FT_OBJ_CREATE_FROM_TYPE( _obj, _type, _init, _lib ) \
|
||||
ft_object_create_from_type( FT_OBJECT_P(&(_obj)), _type, _init, _lib )
|
||||
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @macro FT_CREATE_FROM_TYPE (object,type,init)
|
||||
*
|
||||
* @description:
|
||||
* a convenient macro used to create new objects. It also
|
||||
* sets an _implicit_ local variable named "error" to the error
|
||||
* code returned by the object constructor.
|
||||
*/
|
||||
#define FT_CREATE_FROM_TYPE( _obj, _type, _init, _lib ) \
|
||||
FT_SET_ERROR( FT_OBJ_CREATE_FROM_TYPE( _obj, _type, _init, _lib ) )
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* @function: ft_class_from_type
|
||||
*
|
||||
* @description:
|
||||
* retrieves the class object corresponding to a given type
|
||||
* descriptor. The class is created when needed
|
||||
*
|
||||
* @output:
|
||||
* aclass :: handle to corresponding class object. NULL in
|
||||
* case of error
|
||||
*
|
||||
* @input:
|
||||
* type :: type descriptor handle
|
||||
* library :: library handle
|
||||
*
|
||||
* @return:
|
||||
* error code. 0 means success
|
||||
*/
|
||||
FT_BASE( FT_Error )
|
||||
ft_class_from_type( FT_Class *aclass,
|
||||
FT_Type type,
|
||||
FT_Library library );
|
||||
|
||||
|
||||
/* */
|
||||
|
||||
#include FT_INTERNAL_HASH_H
|
||||
|
||||
typedef struct FT_ClassHNodeRec_* FT_ClassHNode;
|
||||
|
||||
typedef struct FT_ClassHNodeRec_
|
||||
{
|
||||
FT_HashNodeRec hnode;
|
||||
FT_Type type;
|
||||
FT_Class clazz;
|
||||
|
||||
} FT_ClassHNodeRec;
|
||||
|
||||
typedef struct FT_MetaClassRec_
|
||||
{
|
||||
FT_ClassRec clazz; /* the meta-class is a class itself */
|
||||
FT_HashRec type_to_class; /* the type => class hash table */
|
||||
|
||||
} FT_MetaClassRec, *FT_MetaClass;
|
||||
|
||||
|
||||
/* initialize meta class */
|
||||
FT_BASE( FT_Error )
|
||||
ft_metaclass_init( FT_MetaClass meta,
|
||||
FT_Library library );
|
||||
|
||||
/* finalize meta class - destroy all registered class objects */
|
||||
FT_BASE( void )
|
||||
ft_metaclass_done( FT_MetaClass meta );
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FT_OBJECT_H__ */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType private base classes (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002, 2003 by */
|
||||
/* Copyright 1996-2001, 2002, 2003, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -34,7 +34,7 @@
|
|||
#include FT_INTERNAL_GLYPH_LOADER_H
|
||||
#include FT_INTERNAL_DRIVER_H
|
||||
#include FT_INTERNAL_AUTOHINT_H
|
||||
#include FT_INTERNAL_OBJECT_H
|
||||
#include FT_INTERNAL_SERVICE_H
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_INCREMENTAL
|
||||
#include FT_INCREMENTAL_H
|
||||
|
@ -64,19 +64,21 @@ FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
/* */
|
||||
/* The min and max functions missing in C. As usual, be careful not to */
|
||||
/* write things like MIN( a++, b++ ) to avoid side effects. */
|
||||
/* write things like FT_MIN( a++, b++ ) to avoid side effects. */
|
||||
/* */
|
||||
#ifndef MIN
|
||||
#define MIN( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||
#endif
|
||||
#define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
|
||||
#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX( a, b ) ( (a) > (b) ? (a) : (b) )
|
||||
#endif
|
||||
#define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS( a ) ( (a) < 0 ? -(a) : (a) )
|
||||
#endif
|
||||
|
||||
#define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
|
||||
#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
|
||||
#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
|
||||
|
||||
#define FT_PIX_FLOOR( x ) ( (x) & ~63 )
|
||||
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
|
||||
#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
|
@ -271,51 +273,52 @@ FT_BEGIN_HEADER
|
|||
/* FreeType. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* max_points :: The maximal number of points used to store the */
|
||||
/* vectorial outline of any glyph in this face. */
|
||||
/* If this value cannot be known in advance, or */
|
||||
/* if the face isn't scalable, this should be set */
|
||||
/* to 0. Only relevant for scalable formats. */
|
||||
/* max_points :: */
|
||||
/* The maximal number of points used to store the vectorial outline */
|
||||
/* of any glyph in this face. If this value cannot be known in */
|
||||
/* advance, or if the face isn't scalable, this should be set to 0. */
|
||||
/* Only relevant for scalable formats. */
|
||||
/* */
|
||||
/* max_contours :: The maximal number of contours used to store */
|
||||
/* the vectorial outline of any glyph in this */
|
||||
/* face. If this value cannot be known in */
|
||||
/* advance, or if the face isn't scalable, this */
|
||||
/* should be set to 0. Only relevant for */
|
||||
/* scalable formats. */
|
||||
/* max_contours :: */
|
||||
/* The maximal number of contours used to store the vectorial */
|
||||
/* outline of any glyph in this face. If this value cannot be */
|
||||
/* known in advance, or if the face isn't scalable, this should be */
|
||||
/* set to 0. Only relevant for scalable formats. */
|
||||
/* */
|
||||
/* transform_matrix :: A 2x2 matrix of 16.16 coefficients used to */
|
||||
/* transform glyph outlines after they are loaded */
|
||||
/* from the font. Only used by the convenience */
|
||||
/* functions. */
|
||||
/* transform_matrix :: */
|
||||
/* A 2x2 matrix of 16.16 coefficients used to transform glyph */
|
||||
/* outlines after they are loaded from the font. Only used by the */
|
||||
/* convenience functions. */
|
||||
/* */
|
||||
/* transform_delta :: A translation vector used to transform glyph */
|
||||
/* outlines after they are loaded from the font. */
|
||||
/* Only used by the convenience functions. */
|
||||
/* transform_delta :: */
|
||||
/* A translation vector used to transform glyph outlines after they */
|
||||
/* are loaded from the font. Only used by the convenience */
|
||||
/* functions. */
|
||||
/* */
|
||||
/* transform_flags :: Some flags used to classify the transform. */
|
||||
/* Only used by the convenience functions. */
|
||||
/* transform_flags :: */
|
||||
/* Some flags used to classify the transform. Only used by the */
|
||||
/* convenience functions. */
|
||||
/* */
|
||||
/* postscript_name :: Postscript font name for this face. */
|
||||
/* services :: */
|
||||
/* A cache for frequently used services. It should be only */
|
||||
/* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */
|
||||
/* */
|
||||
/* incremental_interface :: */
|
||||
/* If non-null, the interface through */
|
||||
/* which glyph data and metrics are loaded */
|
||||
/* incrementally for faces that do not provide */
|
||||
/* all of this data when first opened. */
|
||||
/* This field exists only if */
|
||||
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
|
||||
/* If non-null, the interface through which glyph data and metrics */
|
||||
/* are loaded incrementally for faces that do not provide all of */
|
||||
/* this data when first opened. This field exists only if */
|
||||
/* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
|
||||
/* */
|
||||
typedef struct FT_Face_InternalRec_
|
||||
{
|
||||
FT_UShort max_points;
|
||||
FT_Short max_contours;
|
||||
FT_UShort max_points;
|
||||
FT_Short max_contours;
|
||||
|
||||
FT_Matrix transform_matrix;
|
||||
FT_Vector transform_delta;
|
||||
FT_Int transform_flags;
|
||||
FT_Matrix transform_matrix;
|
||||
FT_Vector transform_delta;
|
||||
FT_Int transform_flags;
|
||||
|
||||
const char* postscript_name;
|
||||
FT_ServiceCacheRec services;
|
||||
|
||||
#ifdef FT_CONFIG_OPTION_INCREMENTAL
|
||||
FT_Incremental_InterfaceRec* incremental_interface;
|
||||
|
@ -466,6 +469,10 @@ FT_BEGIN_HEADER
|
|||
FT_Get_Module_Interface( FT_Library library,
|
||||
const char* mod_name );
|
||||
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_module_get_service( FT_Module module,
|
||||
const char* service_id );
|
||||
|
||||
/* */
|
||||
|
||||
|
||||
|
@ -704,6 +711,12 @@ FT_BEGIN_HEADER
|
|||
/* generic :: Client data variable. Used to extend the */
|
||||
/* Library class by higher levels and clients. */
|
||||
/* */
|
||||
/* version_major :: The major version number of the library. */
|
||||
/* */
|
||||
/* version_minor :: The minor version number of the library. */
|
||||
/* */
|
||||
/* version_patch :: The current patch level of the library. */
|
||||
/* */
|
||||
/* num_modules :: The number of modules currently registered */
|
||||
/* within this library. This is set to 0 for new */
|
||||
/* libraries. New modules are added through the */
|
||||
|
@ -754,8 +767,6 @@ FT_BEGIN_HEADER
|
|||
|
||||
FT_DebugHook_Func debug_hooks[4];
|
||||
|
||||
FT_MetaClassRec meta_class;
|
||||
|
||||
} FT_LibraryRec;
|
||||
|
||||
|
||||
|
|
184
reactos/lib/freetype/include/freetype/internal/ftrfork.h
Normal file
184
reactos/lib/freetype/include/freetype/internal/ftrfork.h
Normal file
|
@ -0,0 +1,184 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftrfork.h */
|
||||
/* */
|
||||
/* Embedded resource forks accessor (specification). */
|
||||
/* */
|
||||
/* Copyright 2004 by */
|
||||
/* Masatake YAMATO and Redhat K.K. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/***************************************************************************/
|
||||
/* Development of the code in this file is support of */
|
||||
/* Information-technology Promotion Agency, Japan. */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTRFORK_H__
|
||||
#define __FTRFORK_H__
|
||||
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_INTERNAL_OBJECTS_H
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* Number of guessing rules supported in `FT_Raccess_Guess'. */
|
||||
/* Don't forget to increment the number if you add a new guessing rule. */
|
||||
#define FT_RACCESS_N_RULES 8
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Raccess_Guess */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Guess a file name and offset where the actual resource fork is */
|
||||
/* stored. The macro FT_RACCESS_N_RULES holds the number of */
|
||||
/* guessing rules; the guessed result for the Nth rule is */
|
||||
/* represented as a triplet: a new file name (new_names[N]), a file */
|
||||
/* offset (offsets[N]), and an error code (errors[N]). */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: */
|
||||
/* A FreeType library instance. */
|
||||
/* */
|
||||
/* stream :: */
|
||||
/* A file stream containing the resource fork. */
|
||||
/* */
|
||||
/* base_name :: */
|
||||
/* The (base) file name of the resource fork used for some */
|
||||
/* guessing rules. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* new_names :: */
|
||||
/* An array of guessed file names in which the resource forks may */
|
||||
/* exist. If `new_names[N]' is NULL, the guessed file name is */
|
||||
/* equal to `base_name'. */
|
||||
/* */
|
||||
/* offsets :: */
|
||||
/* An array of guessed file offsets. `offsets[N]' holds the file */
|
||||
/* offset of the possible start of the resource fork in file */
|
||||
/* `new_names[N]'. */
|
||||
/* */
|
||||
/* errors :: */
|
||||
/* An array of FreeType error codes. `errors[N]' is the error */
|
||||
/* code of Nth guessing rule function. If `errors[N]' is not */
|
||||
/* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
FT_Raccess_Guess( FT_Library library,
|
||||
FT_Stream stream,
|
||||
char* base_name,
|
||||
char** new_names,
|
||||
FT_Long* offsets,
|
||||
FT_Error* errors );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Raccess_Get_HeaderInfo */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Get the information from the header of resource fork. The */
|
||||
/* information includes the file offset where the resource map */
|
||||
/* starts, and the file offset where the resource data starts. */
|
||||
/* `FT_Raccess_Get_DataOffsets' requires these two data. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: */
|
||||
/* A FreeType library instance. */
|
||||
/* */
|
||||
/* stream :: */
|
||||
/* A file stream containing the resource fork. */
|
||||
/* */
|
||||
/* rfork_offset :: */
|
||||
/* The file offset where the resource fork starts. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* map_offset :: */
|
||||
/* The file offset where the resource map starts. */
|
||||
/* */
|
||||
/* rdata_pos :: */
|
||||
/* The file offset where the resource data starts. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. FT_Err_Ok means success. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Raccess_Get_HeaderInfo( FT_Library library,
|
||||
FT_Stream stream,
|
||||
FT_Long rfork_offset,
|
||||
FT_Long *map_offset,
|
||||
FT_Long *rdata_pos );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Raccess_Get_DataOffsets */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Get the data offsets for a tag in a resource fork. Offsets are */
|
||||
/* stored in an array because, in some cases, resources in a resource */
|
||||
/* fork have the same tag. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* library :: */
|
||||
/* A FreeType library instance. */
|
||||
/* */
|
||||
/* stream :: */
|
||||
/* A file stream containing the resource fork. */
|
||||
/* */
|
||||
/* map_offset :: */
|
||||
/* The file offset where the resource map starts. */
|
||||
/* */
|
||||
/* rdata_pos :: */
|
||||
/* The file offset where the resource data starts. */
|
||||
/* */
|
||||
/* tag :: */
|
||||
/* The resource tag. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
/* offsets :: */
|
||||
/* The stream offsets for the resource data specified by `tag'. */
|
||||
/* This array is allocated by the function, so you have to call */
|
||||
/* @FT_Free after use. */
|
||||
/* */
|
||||
/* count :: */
|
||||
/* The length of offsets array. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. FT_Err_Ok means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
|
||||
/* value for `map_offset' and `rdata_pos'. */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Raccess_Get_DataOffsets( FT_Library library,
|
||||
FT_Stream stream,
|
||||
FT_Long map_offset,
|
||||
FT_Long rdata_pos,
|
||||
FT_Long tag,
|
||||
FT_Long **offsets,
|
||||
FT_Long *count );
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTRFORK_H__ */
|
||||
|
||||
|
||||
/* END */
|
260
reactos/lib/freetype/include/freetype/internal/ftserv.h
Normal file
260
reactos/lib/freetype/include/freetype/internal/ftserv.h
Normal file
|
@ -0,0 +1,260 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftserv.h */
|
||||
/* */
|
||||
/* The FreeType services (specification only). */
|
||||
/* */
|
||||
/* Copyright 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Each module can export one or more `services'. Each service is */
|
||||
/* identified by a constant string and modeled by a pointer; the latter */
|
||||
/* generally corresponds to a structure containing function pointers. */
|
||||
/* */
|
||||
/* Note that a service's data cannot be a mere function pointer because */
|
||||
/* in C it is possible that function pointers might be implemented */
|
||||
/* differently than data pointers (e.g. 48 bits instead of 32). */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#ifndef __FTSERV_H__
|
||||
#define __FTSERV_H__
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/*
|
||||
* @macro:
|
||||
* FT_FACE_FIND_SERVICE
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to look up a service from a face's driver module.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source face handle.
|
||||
*
|
||||
* id ::
|
||||
* A string describing the service as defined in the service's
|
||||
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
||||
* `multi-masters'). It is automatically prefixed with
|
||||
* `FT_SERVICE_ID_'.
|
||||
*
|
||||
* @output:
|
||||
* ptr ::
|
||||
* A variable that receives the service pointer. Will be NULL
|
||||
* if not found.
|
||||
*/
|
||||
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \
|
||||
/* the strange cast is to allow C++ compilation */ \
|
||||
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \
|
||||
\
|
||||
\
|
||||
*Pptr = NULL; \
|
||||
if ( module->clazz->get_interface ) \
|
||||
*Pptr = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
|
||||
FT_END_STMNT
|
||||
|
||||
|
||||
/*
|
||||
* @macro:
|
||||
* FT_FACE_FIND_GLOBAL_SERVICE
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to look up a service from all modules.
|
||||
*
|
||||
* @input:
|
||||
* face ::
|
||||
* The source face handle.
|
||||
*
|
||||
* id ::
|
||||
* A string describing the service as defined in the service's
|
||||
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
|
||||
* `multi-masters'). It is automatically prefixed with
|
||||
* `FT_SERVICE_ID_'.
|
||||
*
|
||||
* @output:
|
||||
* ptr ::
|
||||
* A variable that receives the service pointer. Will be NULL
|
||||
* if not found.
|
||||
*/
|
||||
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \
|
||||
/* the strange cast is to allow C++ compilation */ \
|
||||
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \
|
||||
\
|
||||
\
|
||||
*Pptr = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
|
||||
FT_END_STMNT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S E R V I C E D E S C R I P T O R S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* The following structure is used to _describe_ a given service
|
||||
* to the library. This is useful to build simple static service lists.
|
||||
*/
|
||||
typedef struct FT_ServiceDescRec_
|
||||
{
|
||||
const char* serv_id; /* service name */
|
||||
const void* serv_data; /* service pointer/data */
|
||||
|
||||
} FT_ServiceDescRec;
|
||||
|
||||
typedef const FT_ServiceDescRec* FT_ServiceDesc;
|
||||
|
||||
|
||||
/*
|
||||
* Parse a list of FT_ServiceDescRec descriptors and look for
|
||||
* a specific service by ID. Note that the last element in the
|
||||
* array must be { NULL, NULL }, and that the function should
|
||||
* return NULL if the service isn't available.
|
||||
*
|
||||
* This function can be used by modules to implement their
|
||||
* `get_service' method.
|
||||
*/
|
||||
FT_BASE( FT_Pointer )
|
||||
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
|
||||
const char* service_id );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** S E R V I C E S C A C H E *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/*
|
||||
* This structure is used to store a cache for several frequently used
|
||||
* services. It is the type of `face->internal->services'. You
|
||||
* should only use FT_FACE_LOOKUP_SERVICE to access it.
|
||||
*
|
||||
* All fields should have the type FT_Pointer to relax compilation
|
||||
* dependencies. We assume the developer isn't completely stupid.
|
||||
*
|
||||
* Each field must be named `service_XXXX' where `XXX' corresponds to
|
||||
* the correct FT_SERVICE_ID_XXXX macro. See the definition of
|
||||
* FT_FACE_LOOKUP_SERVICE below how this is implemented.
|
||||
*
|
||||
*/
|
||||
typedef struct FT_ServiceCacheRec_
|
||||
{
|
||||
FT_Pointer service_POSTSCRIPT_FONT_NAME;
|
||||
FT_Pointer service_MULTI_MASTERS;
|
||||
FT_Pointer service_GLYPH_DICT;
|
||||
FT_Pointer service_PFR_METRICS;
|
||||
FT_Pointer service_WINFNT;
|
||||
|
||||
} FT_ServiceCacheRec, *FT_ServiceCache;
|
||||
|
||||
|
||||
/*
|
||||
* A magic number used within the services cache.
|
||||
*/
|
||||
#define FT_SERVICE_UNAVAILABLE ((FT_Pointer)-2) /* magic number */
|
||||
|
||||
|
||||
/*
|
||||
* @macro:
|
||||
* FT_FACE_LOOKUP_SERVICE
|
||||
*
|
||||
* @description:
|
||||
* This macro is used to lookup a service from a face's driver module
|
||||
* using its cache.
|
||||
*
|
||||
* @input:
|
||||
* face::
|
||||
* The source face handle containing the cache.
|
||||
*
|
||||
* field ::
|
||||
* The field name in the cache.
|
||||
*
|
||||
* id ::
|
||||
* The service ID.
|
||||
*
|
||||
* @output:
|
||||
* ptr ::
|
||||
* A variable receiving the service data. NULL if not available.
|
||||
*/
|
||||
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \
|
||||
FT_BEGIN_STMNT \
|
||||
/* the strange cast is to allow C++ compilation */ \
|
||||
FT_Pointer* pptr = (FT_Pointer*)&(ptr); \
|
||||
FT_Pointer svc; \
|
||||
\
|
||||
\
|
||||
svc = FT_FACE(face)->internal->services. service_ ## id ; \
|
||||
if ( svc == FT_SERVICE_UNAVAILABLE ) \
|
||||
svc = NULL; \
|
||||
else if ( svc == NULL ) \
|
||||
{ \
|
||||
FT_FACE_FIND_SERVICE( face, svc, id ); \
|
||||
\
|
||||
FT_FACE(face)->internal->services. service_ ## id = \
|
||||
(FT_Pointer)( svc != NULL ? svc \
|
||||
: FT_SERVICE_UNAVAILABLE ); \
|
||||
} \
|
||||
*pptr = svc; \
|
||||
FT_END_STMNT
|
||||
|
||||
|
||||
/*
|
||||
* A macro used to define new service structure types.
|
||||
*/
|
||||
|
||||
#define FT_DEFINE_SERVICE( name ) \
|
||||
typedef struct FT_Service_ ## name ## Rec_ \
|
||||
FT_Service_ ## name ## Rec ; \
|
||||
typedef struct FT_Service_ ## name ## Rec_ \
|
||||
const * FT_Service_ ## name ; \
|
||||
struct FT_Service_ ## name ## Rec_
|
||||
|
||||
/* */
|
||||
|
||||
/*
|
||||
* The header files containing the services.
|
||||
*/
|
||||
|
||||
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h>
|
||||
#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
|
||||
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
|
||||
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
|
||||
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
|
||||
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
|
||||
#define FT_SERVICE_PFR_H <freetype/internal/services/svpfr.h>
|
||||
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
|
||||
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
#endif /* __FTSERV_H__ */
|
||||
|
||||
|
||||
/* END */
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Stream handling (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* Copyright 1996-2001, 2002, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -315,6 +315,17 @@ FT_BEGIN_HEADER
|
|||
#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
||||
|
||||
/* create a new (input) stream from an FT_Open_Args structure */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_New( FT_Library library,
|
||||
const FT_Open_Args* args,
|
||||
FT_Stream *astream );
|
||||
|
||||
/* free a stream */
|
||||
FT_BASE( void )
|
||||
FT_Stream_Free( FT_Stream stream,
|
||||
FT_Int external );
|
||||
|
||||
/* initialize a stream for reading in-memory data */
|
||||
FT_BASE( void )
|
||||
FT_Stream_OpenMemory( FT_Stream stream,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Tracing handling (specification only). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2004 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -16,12 +16,12 @@
|
|||
/***************************************************************************/
|
||||
|
||||
|
||||
/* definitions of trace levels for FreeType 2 */
|
||||
/* definitions of trace levels for FreeType 2 */
|
||||
|
||||
/* the first level must always be `trace_any' */
|
||||
/* the first level must always be `trace_any' */
|
||||
FT_TRACE_DEF( any )
|
||||
|
||||
/* base components */
|
||||
/* base components */
|
||||
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
|
||||
FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
|
||||
FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
|
||||
|
@ -35,14 +35,15 @@ FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
|
|||
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
|
||||
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
|
||||
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
|
||||
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
|
||||
|
||||
/* Cache sub-system */
|
||||
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc..) */
|
||||
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
|
||||
|
||||
/* SFNT driver components */
|
||||
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
|
||||
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
||||
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
||||
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
|
||||
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
||||
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
||||
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
|
||||
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue