ref: e17484e9d82ce7db8472e6abfa71144ddc184ce4
parent: 7975eec3e602fd5bc3e93c78f4166259190f2fe9
author: henesy <devnull@localhost>
date: Sun Nov 4 12:37:54 EST 2018
include Nt
--- /dev/null
+++ b/CHANGES
@@ -1,0 +1,956 @@
+20140525
+ implement & in replacement text in sed
+20140524
+ utflen in styx.b (probably ought to be in Sys) supporting 21-bit unicode (issue 314)
+ allow slashes in anames [fixed by kristofwyzc, issue 312]
+20140518
+ sh(2): exec -> run [issue 311]
+20140501
+ add -s option to dns in cs(8) [issue 310]
+ don't send nil soa to dnscache [issue 309]
+20140302
+ utils/cc/funct.c - remove out-of-bounds reference
+ os/ipaq1110, ip/ipaux.c, os/sa1110 - add default cases to keep compiler happy
+20140223
+ /dis/sig: use raise not exit for errors
+20140105
+ incorrect check on keyname in getauthinfo [issue 306]
+20130906
+ remove redundant code
+20130529
+ appl/cmd/cpu.b: use Dial, and neither test /dev/draw/new nor bind #d (which is wrong anyway, it's #i for drawing now)
+20130423
+ mkfiles/mkfile-MacOSX-386: set 32-bit mode, and macosx-version-min to 10.6 [via http://debu.gs/entries/interlude-inferno-at-work]
+20121210
+ utils/awk/run.c - prevent free of pointer still in use [cinap]
+20121205
+ appl/cmd/mk/mksubdirs [issue 290 change suggested by powerman]
+20120918
+ remove unused/unusable debug/setdebug from appl/lib/auth9.b and replace Keyring by Crypt
+20120820
+ emu/port/devip.c reset headers flag in Conv
+20120725
+ increase KSTACK for Linux/arm
+20120615
+ add configuration emu/FreeBSD/emu-g [powerman]
+20120509
+ utils/libmach: add missing user stack top initialisers, minor changes to sync with 9
+20120507
+ mkfiles/mkfile-MacOSX-386 change cc to gcc
+ emu/MacOSX/win.c null out drawcursor
+20120424
+ utils/cc/Posix.c and utils/c2l/Posix.c: correct definition of mydup for POSIX dup/dup2
+ libbio/bprint.c error handling if flush or print fails
+20120305
+ add -I$ROOT/(Plan9|Inferno)/include to CFLAGS in mkfiles/^(mkfile-Plan9* mkfile-Inferno*)
+ change specific object type to $OBJTYPE in the same
+ libmath/fdlibm/fdlibm.h and libmath/dtoa.c, if USE_FPdbleword defined, use FPdbleword to crack doubles into integers
+20120304
+ rabin(2) added (preliminary)
+20120213
+ styxservers: add .error operation (preliminary)
+20120116
+ lib9.h: internally rename qsort as infqsort to avoid C library clash
+ lib9/qsort.c: include lib9.h
+ lib9/mkfile: move qsort to IMPORTFILES from COMMONFILES
+20120103
+ avoid re-defining isnan; use isNaN instead
+20111231
+ Linux/*/include/emu.h adjustments for USE_PTHREADS for non-x86 processors
+20111221
+ add `...` uninterpreted string literals to limbo/lex.c, appl/cmd/limbo/lex.b
+20111215
+ liblogfs,libnandfs: use logfsos.h (added to include) to make library source independent of os
+ add fonts/vera
+ add fonts/courier
+20111214
+ change Linux port to use pthreads instead of clone directly
+ emu/Linux: rename os.c to os-clone.c; rename osp.c to os.c
+ emu/Linux/mkfile: remove -lrt, add kproc-pthreads.$O
+ Linux/*/include: define USE_PTHREADS
+ Linux/386/include/emu.h: increase KSTACK to 32k for Linux gethost* functions
+20111003
+ libinterp/heap.c:/^dtype discount size of map [issue 258]
+20110820
+ emu/*/devfs.c, emu/port/devfs-posix.c - stubs for osdisksize, Linux implementation of osdisksize
+ emu/port/devfs-posix.c - also try SOCK_DGRAM for AF_UNIX [issue 269]
+20110819
+ appl/cmd/mk/mk.b - use raise "fail:..." for exit status [issue 268]
+20110629
+ change x86 getcallerpc to avoid use of %ebp [issue 266]
+ change type of getcallerpc to uintptr from ulong
+20110619
+ emu/port/devfs-posix.c: put major/minor st_dev into path without mapping (with luck)
+ emu/port/kproc-pthreads.c: ensure pthread stack is at least PTHREAD_STACK_MIN (plus slop)
+20110526
+ change osyield in Windows to use SwitchToThread instead of sleep(0) [e-mail list]
+20110525
+ utils/[5678kqv]c/mkfile - include -I. before $CFLAGS to ensure right gc.h [issue 264]
+20110516
+ merge changes from vac branch of mechiel-inferno-os (googlecode)
+20110426
+ emu/Linux/asm-arm.S linux system call interface changed [issue 215, mechiel]
+20110419
+ libinterp/tk.c:/^Tk_rect shouldn't return non-canonical rectangles
+ /appl/wm/mand.b handle reshape to empty rectangles
+20110408
+ appl/lib/json.b - have writeval produce same (correct) form as .text for Real [issue 230]
+20110407
+ fix embarrassingly broken Lists->delete; add Lists->find [issue 257]
+ add some extra explanation to sys-dup(2) about fildes
+20110404
+ update Nt/386/bin
+ /limbo/com.c - count constants in qualifiers, not qualifiers [issue 212, mechiel]
+ /appl/cmd/limbo/com.b [also issue 212]
+20110403
+ secstore(2) and secstore(1) updated to implement writing [issue 256, mechiel]
+20110402
+ revision to devsrv.c change [issue 244] to avoid two calls to delwaiting
+20110330
+ call strtol not atoi for hex numbers [issue 255, mechiel]
+20110329
+ utils/mkdir/mkdir.c - add -p option [mechiel, issue 250]
+ emu/Linux/mkfile - try searching -lpthread after -lrt for sem_* [issue 247]
+ emu/port/devfs-posix.c - treat unix domain sockets as files (open/read/write/close) [npe, rsc, issue 254]
+ emu/port/devfs-posix.c - use volatile correctly; slight code tidy
+ emu/lib9/errstr-posix.c replace EINTR's error string by Eintr's text
+20110315
+ libtk/textw.c - fix mysterious control characters for editing (D and K) [issue 253, fix from mechiel]
+20110225
+ split emu.h from lib9.h for all platforms
+ kproc in emu is now a void type as in os
+20110224
+ move private mem flag to Progs [issue 240, mechiel]
+20110224
+20110208
+ emu/Linux/os.c - use -lrt's semaphores instead of signals
+ emu/Linux/mkfile - add -lrt to library list, and push out separation of X11LIBS from SYSLIBS for emu-g done ages ago
+20110126
+ emu/MacOSX/os.c - move a free to a more sensible place
+20110117
+ emu/Nt/ipif.c changed to work with ipv6 interface changes
+20110116
+ add Plan9/arm support [provided by richard miller]
+20110110
+ utils/libmach/qdb.c [issue 245] restore renaming of qdiv as qmuldiv
+20110104
+ emu/MacOSX/win.c detect double clicks [issue 232, jas]
+ emu/MacOSX/os.c replace erendezvous by a per-kproc semaphore for osblock/osready
+20101220
+ changes to srv(3) to notify client when server vanishes [issue 244, thanks to powerman and roger]
+20101205
+ change a few types in ipif-posix.c to appease the gods
+ emu/MacOSX/mkfile - include portmkfile at correct point for LIBFILES to work (and other, minor, changes) [issue 24]
+20101127
+ emu/port/*ip*.[ch] and emu/Nt/ipif*.c updated with new interface for ipv6 support [mechiel] [issue 193]
+ emu/Linux/os.c address compilation warnings (setfcr etc still to do)
+20101125
+ asm/assem.c don't attempt to use missing src (issue 243)
+20100925
+ appl/lib/w3c/uris.b - handle existing Unicode characters if they happen not to have been encoded into string
+ appl/svc/httpd/parser.b - similar [response to issue 233]
+20100914
+ emu/Nt/os.c - replace trap handling
+20100822
+ correct handling of mouse focus in sub-widgets of widget windowed in text [issue 241]
+ add various warnings to mkfile-Linux-386
+20100821
+ correct handling of mouse focus in sub-widgets of widget windowed in canvas [issue 241]
+20100819
+ failed to push Solaris/sparc/include/lib9.h with u64int change [issue 151]
+ appl/cmd/ar.b eliminate false error return
+20100810
+ initial introduction of crypt-*(2) and ipints(2)
+ replace keyring.m in module/runt.m by ipints.m and crypt.m; compensate in libinterp and libkeyring by using keyringif.m to generate Keyring's interface
+20100802
+ various changes held back by accident, notably stackv in stack(1), better diagnostics by cat(1)
+20100801
+ libtk/coval.c - simplify vlong expression for some compilers [issue 216, mechiel]
+20100727
+ on Linux and MacOSX, look at faulting address to decide if it's dereference of nil
+20100722
+ include/bio.h add varargck and repair resulting diagnostics in utils and limbo/ [issue 237, mechiel]
+20100719
+ appl/cmd/disk/mkfs.b change getname/getpath to cope with missing newline [issue 236]
+20100715
+ appl/wm/toolbar.b changed not to create new /chan/snarf if one exists, unless -p (private) option given [toolbar(1)]
+ utils/cc/macbody - add overlooked change to implement __VA_ARGS__
+ other minor updates to the compilers to resync
+20100714
+ correctly initialise types in utils/cc/sub.c
+20100504
+ change lib9/strtoull.c for MS
+20100503
+ updated libmach/8db.c to avoid [] initialisers
+20100501
+ update libmach to compensate for MS compiler
+20100426
+ updated libmach
+ updated compiler suites (continuing)
+20100425
+ appl/wm/wm.b shorten processing of wmctl close if client hadn't started
+20100406
+ fix handling of boundary case in libtk/utils.c
+20100402
+ add new option OPTflags to libtk for later use
+20100325
+ more swizzling of libtk for later use. revised radio and check buttons.
+20100322
+ a few tweaks to Tk for later use
+20100320
+ appl/lib/json.b dis/lib/json.dis - use %f not string <real-value> to ensure json value acceptable [issue 230, powerman]
+20100310
+ stop tabs(2) from issuing pointless tk cmd that produces diagnostics
+20100305
+ add emu/Linux/audio-oss.c from saoret.one [issue 226]
+20100226
+ mention -n nvram option in keyfs(4)
+20100220
+ appl/cmd/keyfs.b wasn't clunking fids on error in remove [issue 225]
+20100213
+ apply saoret.one's changes for thumb [issue 155]
+20100205
+ update man pages to replace most references to Styx by 9P
+ update man pages to replace references to sys-dial(2) by dial(2)
+ add DragonFly files (from fgudin and extrudedaluminiu, issue 181); possibly should automatically keep aligned with FreeBSD
+ fpe handling in OpenBSD and FreeBSD [mechiel, issue 190]
+ appl/cmd/vacfs.b apply fix from mechiel [issue 204]
+20100203
+ appl/lib/cfg.b treat \r as white space [issue 69, issue 70]
+ add u64int to lib9.h files that needed it
+ add sha2.c sha256block.c sha512block.c to libsec/port and include/libsec.h [issue 185, mechiel]
+ add new sha functions to module/keyring.m and libinterp/keyring.c
+20100115
+ appl/cmd/tarfs.b man/4/tarfs changes to permission handling from mechiel [issue 220]
+ appl/spree/mkfile add explicit -I$ROOT/module [issue 209, powerman]
+20100110
+ appl/cmd/tcs.b [issue 12, arvindht]: process unconverted bytes next cycle, flush conversion state; improve error checking
+20091219
+ change default roots in Nt utils to c:\inferno
+20091215
+ factotum(2) updated to include keyspec in signature
+ appl/cmd/mount.b uses -k value as keyspec if -9 selected [not to much purpose with current factotum's p9any]
+ bind(1) [for mount] updated to describe -k used for keyspec if -9 selected
+20091214
+ switch more commands to use dial(2)
+ change emu/Linux/emu-g not to require X11 libs (again)
+20091213
+ temper the tendancy of port/dis.c to yield during idle gc: it's compensating for os scheduling, but yield less often
+20091208
+ add mkdir -p to makemk.sh to ensure output directories exist [issue 213]
+20091127
+ problems fixed in styxconv(2), which can now convert both ways [rog]
+20091119
+ emu/port/devfs-posix.c missing waserror in dirread (obscure but possible failure)
+20091007
+ remove intermediate exception-raising function from charon implementation
+20091004
+ restore "keyring" to lib section of emu/Plan9/emu
+20090930
+ emu/*/ipif*.c make "hangup" act as in native Inferno; also delete unused so_setsockopt
+ provide correct version of devmnt.c
+20090928
+ update import(4) to remove the restriction to Plan 9 (can use Inferno's own factotum)
+ (emu os)^/port/devmnt.c fix from plan 9 (don't access vanished data)
+20090830
+ check subexp length in ed [cmbrannon79]
+20090825
+ add netmkaddr call to /appl/cmd/ftpfs.b; send errors to standard error
+20090824
+ delete unused (and somewhat incomplete) pin support
+20090822
+ in the what were we thinking dept: appl/cmd/touch.b and dis/touch.dis updated to avoid using an Arg after nil'ing it [thanks to cmbrannon]
+ make progmode propagate to pgrps; recover from exceptions in pgrp creation
+20090821
+ emu/Nt/^(os.c ie-os.c) add #include <excpt.h>
+20090819
+ appl/cmd/mk/mk.b replace maketmp/mktemp (issue 202, mechiel); also old change: don't persist with bulkmtime on non-directories
+20090816
+ registry(4) Event.post increased rootvers when entries are written or removed (issue 179, powerman)
+20090809
+ bring mkfs(8) up to date (issue 176)
+ remove -q options from mkfs and mkext (-q was a transitional option to suppress quoting of file names)
+20090806
+ increase `backlog' value in all listen calls in hosted Inferno (emu/*/ipif*.c) [powerman]
+20090805
+ further checking added to libinterp/keyring.c: rejects incorrect states and out of bounds values of f->n
+ add lib/emptydirs and mkdirs target to /mkfile (utils/mkdir needs to be changed for Windows use)
+20090730
+ improve the error checking in strtosk and strtopk to help detect mangled or inappropriate keys
+20090728
+ emu/port/main.c: put host's working directory name as emuwdir
+ document initial environment variables in emu(1)
+ appl/lib/bufio.b dis/lib/bufio.dis [issue 199] don't lose track of actual file seek offset (following second suggestion of mjl)
+ issue 196: after general apologies for appl/svc/httpd/cache.b (don't look if you don't need it, not one of ours, etc. etc.) will patch as suggested by extrudedaluminiu(!) [vs]
+20090719
+ correct order of operands to memset(!), eg in ipif [mjl]
+20090718
+ fix appl/cmd/stream.b error exits to include fail: [mjl]
+20090717
+ fix appl/lib/ip.b (see issue 186) [mjl]
+ re-enable XK_ keys in port/win-x11a.c [mjl]
+20090716
+ add segflush calls to comp-386.c [probably need different name eventually to avoid time wasting when not needed]
+20090630
+ add sig (see man(1)) [via p9p and caerwyn]
+20090627
+ push changes described for arm in 20090330 (but not previously pushed)
+ begin change of inferno-os.googlecode.com from svn to mercurial
+200090612
+ added support for Linux-power (ericvh; and further simplified)
+20090605
+ appl/cmd/disk/kfs.b dis/disk/kfs.dis - don't try to update super block if readonly(!) [issue 175]
+20090526
+ emu/Nt/os.c allow /dev/hoststdin input on file or pipe (thanks to caerwyn, issue 173)
+ emu/port/devfs-posix.c correct handling of error return from pread (issue 172, but goes beyond that)
+ emu/port/exportfs.c os/port/exportfs.c use vlong for offset
+20090524
+ appl/cmd/tarfs.b dis/tarfs.dis - remove accidentally small limit on file size in tar file (issue 172)
+20090521
+ module/vac.m appl/cmd/vacfs.b appl/lib/vac.b [issue 152] (Mecchiel)
+20090505
+ add -h/-t header/trailer options to man2html
+20090430
+ filter-deflate(2), appl/lib/^(inflate.b deflate.b): changes from mjl to support zlib headers for deflate streams as well as gzip's
+20090417
+ add m4(1) in its initial form (might split the macro processing proper off into a library module)
+20090409
+ tools/odbc/odbc.c data read should return 0 if no columns or rows (issue 170)
+20090408
+ tools/odbc/odbc.c use strecpy and more care in allocation (issue 169)
+20090403
+ change ,2 to ,#function in Solaris sparc assembler files (apparently works in gcc and sun's)
+ make appl/wm/brutus.b pass input to its widgets (issue 105)
+ enable fullscreen mode in MacOSX (issue 148)
+20090402
+ add missing emu/Linux/segflush-*.c files and remove ARM segflush from os.c
+20090402
+ ramfile and logfile shouldn't set Sys->MCREATE (issue 137)
+20090401
+ appl/cmd/limbo/typecheck.b check correctly for function prevented from inline expansion
+20090330
+ use (low, high) order for words in vlong and fp on arm: libinterp/comp-arm.c, Inferno/arm/include/^(lib9.h u.h)
+ also os/*/fpi.h (for arm platforms), exchanging order of ulongs in Double
+ also libkern/^(vlrt-arm.c vlop-arm.s vlop-thumb.s frexp-arm.c frexp-thumb.c)
+ include changes from richard miller for little-endian mips (spim) and Linux/spim hosted
+ libmath/dtoa.c: use simpler code to avoid gcc bug on mips and perhaps other platforms (rmiller)
+20090330-branches/forse
+ include appl/cmd/ssh source (won't compile here because it needs the keyring changes)
+20090325-branches/forse
+ emu/* adopt changes to Chan (Dev* dev pointer instead of int type)
+20090320
+ emu/port/win-x11a.c: unintuitively use xdisplay not xkbdcon to send to kbdproc (with big stack) to change cursor
+ (the big stack is needed because XCreateBitmapFromData and XPutImage pass control to theme-related code that uses lots of stack space)
+ use uname not aname for user name in libstyx and set aname to "" by default
+ make odbc's new file have mode 666 so others can open it
+ add styxsetowner function to styxserver.h to set default owner (eve)
+ move styxserver.h to inferno's include directory
+20090222
+ appl/cmd/ndb/registry.b and dis/registry.dis - implement flush for event file (issue 162)
+20090217
+ appl/cmd/limbo/stubs.b limbo/stubs.c - include length parameter to builtinmod (could just be 0 in most cases)
+ change f->ret/destroy code in stubs.c/stubs.b to destroy correctly in case of exceptions
+20090202
+ emu/port/win-x11a.c: might as well try this everywhere now
+20090127
+ libinterp/xec.c: fix gc problem with self
+20090122
+ libinterp/string.c: slicer can return H for empty slice after bounds check (brucee)
+20081119
+ os/pc/^(main.c fns.h) more idle idlehands
+20081112
+ emu/Linux/asm-arm.S old failure to use different regs for swp finally changed here
+ libmath/blas.c compensate for gcc bug on arm
+20081107
+ replace calls to calloc by malloc
+20081106
+ os/port/dis.c prevent new spawns during killgrp
+ also synchronise two killgrps of the same group
+20081105
+ emu/port/dis.c prevent new spawns during killgrp [#117]
+20081022
+ sh: ignore leading white space in fail: strings, and change empty tail to "failed"
+ /emu/port/devfs-posix.c don't call readdir after it has returned end of file
+20081021
+ /appl/cmd/auth/ai2key.b new command to convert authinfo files to factotum keys
+ /appl/cmd/auth/factotum/proto/infauth.b allow new key format
+20081019
+ /appl/cmd/man2html.b implement "\ " => " "
+ /man/3/prog change way a literal " was formatted
+ /man/8/srv deleted (obsolete)
+ removed reference to srv(8) from sys-pctl(2)
+20080909
+ /appl/cmd/puttar.b add extra empty block at end of archive as required by format
+20080907
+ include some changes from acme-sac in emu/Nt/devfs.c; need further control of usesec (or discard it)
+20080723
+ rename Inferno's yacc to iyacc to avoid clash with system's own (now that Linux and others distribute it)
+20080707
+ update emu/port/win-x11a.c (fix someone's earlier patch to stop using undefined value)
+ emu/port/main.c mark obsolete options and remove from usage
+20080705
+ update utils/sed, eliminating anonymous unions (just by commenting them out, to keep source in step with 9)
+ and several other changes for portability
+20080703
+ remove anonymous unions (and unused structs) from unpacking structures in emu/Nt/vlrt.c, not that it's used
+20080617
+ win-x11a.c add sqweek's change to pass on KeyRelease values (but perhaps 1-byte values are no longer enough?)
+20080614
+ change os/port/devcons.c to use error not panic in sysfatal
+20080612
+ change several libmp/port functions to use sysfatal not abort
+ change emu/port/main.c to have sysfatal call error not exit
+20080611
+ Keyring->dhparams to use DSAprimes in special case
+ IPint.random now ignores minint (will go next revision)
+ BigInt -> mpint*
+ checkIPint in libinterp/ipint.c
+ default keys in auth/createsignerkey are 1024 not 512 bits
+ update os/boot/pc
+20080610
+ push sh-mload(1) and changes to sh-expr(1)
+20080609
+ _tas type changed from ulong to int
+20080530
+ issue 91: _declspec changed to __declspec in Nt files
+ issue 92: argv0 declaration changed to extern from static in emu/Nt/win.c
+20080529
+ limbo/stubs.c: allow pick adt types
+20080528
+ emu/port/win-x11a.c screen depth checks from drawterm via tim@nop.cx
+20080524
+ add missing NetBSD files
+20080522
+ dis/lib/msgio.dis appl/lib/msgio.b - fix incorrect check for 16rFF
+ add OpenBSD changes from tim@nop.cx (more changes to follow shortly that cause changes elsewhere)
+20080416
+ fix emu/Nt/os.c use of wrong name for null value
+ move win/win-x11a references to emu/*/emu config files from emu/*/mkfile
+20080415
+ googlecode update with correct dis files for acme
+ tidier code for hoststderr
+ emu/port/win-x11a.c changes that attempt to satisfy libxcb's locking requirements
+20080322
+ enable hoststderr, following acme-sac
+20080319
+ ip/sntp neither read nor set the time correctly
+20080311
+ in appl/lib/names.b define "" as valid prefix for anything
+20080304
+ auth/secstore uses dial module
+20080210
+ add auth/dsagen
+20080204
+ emu/*/*ipif*.c and devip.c: try to allow local address to be set (changes so_bind signature in emu/ip.h)
+20080201
+ change foldbranch in limbo/gen.c to prevent loss of `no return value' diagnostics
+20080131
+ update emu/Nt/^(os.c ie-os.c ie-win.c ie emu), but properly this time [issue 81]
+ remove _USE_32BIT_TIME_T from Nt/386/include/lib9.h, and time() def'n from emu/Nt/*.c [issue 81]
+20080130
+ failed to return nil from Jvalue.get in appl/lib/json.b if member name didn't match
+ similar problem in appl/lib/ubfa.b
+ add msgio(2)
+20080124
+ fix emu/port/devssl.c os/port/devssl.c not to keep the directory numbers(!)
+20080122
+ update appl/lib/db.b: allow for split i/o on pipes or tcp/ip; eliminate lock process
+ eliminate more unused identifier warnings (courtesy acme-sac)
+20080121
+ skip trailing '=' in b64 rep of IPint
+20080120
+ forgot to push updated appl/lib/x509.b during keyring changes
+20080116
+ add rsa to factotum
+ set but not used changes from Acme-sac
+ mdb(1) changes from Acme-sac
+ ftpfs uses new dial(2)
+ add qbypass to emu/port/qio.c
+ sed fix issue 49
+ add blowfish to keyring-crypt(2)
+ add challenge/response to factotum(2)
+20080115
+ add blowfish to keyring (not yet documented)
+ add explicit public and private key types to keyring (in development: not yet documented)
+ add IPint.mod, IPint.iptob64z
+20080111
+ add newuser to newns(2)
+20080109
+ Sys->iounit should accept any valid file descriptor, not just ORDWR
+20071227
+ add styxflush(2) etc.
+ add NetBSD, emu/NetBSD
+20071217
+ emu/port/devmnt.c needs volatile for alloc
+20071213
+ emu/port/dev.c needs volatile for alloc
+20071129
+ emu/port/devip.c: moan about bad IP addresses
+20071127
+ added /module/dial.m and /appl/lib/dial.b
+20071031
+ module/keyring.m and libinterp/keyring.c: add algorithm-specific adts for public key systems
+ appl/lib/spki/spki.b: correct names for dsa parameters
+20071030
+ libkeyring/rsaalg.c should call rsaprivfree not free
+20071027
+ appl/lib/names.b correction for "/" as prefix
+20071019
+ change emu/port/devfs-posix.c to update uid/gid map incrementally
+20071015
+ add cap creation to infauth in server role in factotum
+20071011
+ remove obsolete references to sh-exception(2)
+20071010
+ add abhey's changes for cmd key as unicode compose key for MacOS X to emu/MacOSX/win.c
+20071008
+ nemo's change to emu/port/random.c; really the file needs a little rewriting for clarity (too many overlapping states)
+20071002
+ ensure fmtdef.h included by some lib9 functions so that va_copy is defined on older systems that lack that needless notion
+ <{} and >{} added to sh(1)
+20070929
+ move emu/MacOSX/mkfile to .../mkfile-x11 and replace it by the variant that builds for Carbon, now the default
+20070927
+ add working drawcursor to emu/MacOSX/win.c, based on mirtchovski's changes (but mapping general cursor images to Mac's form)
+20070910
+ update spki(2) [change handling of hashes, add signature functions] appl/lib/spki/spki.b module/spki.m, updated for GSoC
+20070906
+ add toreal to string(2)
+20070905
+ /appl/cmd/ed.b (caerwyn's fix for g/.../d)
+ also /appl/lib/ecmascript/builtin.b (toupper fix)
+20070902
+ make /appl/lib/daytime.b accept Daytime->text's output; add string2tm to man page (issue 59)
+20070901
+ add andrey's changes to emu/MacOSX/win.c (used by emu/MacOSX/mkfile-a)
+ add saoret's changes to dis/lookman, dis/man (issue 58)
+ add micah.stetson's change to /appl/cmd/src.b (issue 57)
+20070817
+ two old changes that weren't in the distribution...
+ libkeyring/rsaalg.c: previously failed to ensure the output key was the right length (really rsagen should do that)
+ libinterp/alt.c: use a better random number generator
+20070814
+ bufio.b didn't update the buffer pointers correctly on write errors
+20070807
+ libinterp/keyring.c don't include owner= if owner is nil or ""
+ add auth/rsagen
+20070806
+ /module/lists.m add PATH(!), also simplify concat implementation
+20070725
+ /dis/man initialise fils correctly to empty list and remove hack (issue 56)
+20070720
+ utils/5l/asm.c: ensure SBZ field in MOV is regarded as MBZ (ie, force to zero)
+20070714
+ add Sys->readn, update sys-read(2)
+ copy two repairs from emu/port/inferno.c to os/port/inferno.c
+ remove readn implementation from several commands
+ print correct diagnostic in appl/cmd/crypt.b
+ prevent window titlebars from being dragged out of the main window in wm/wm.b
+20070619
+ remembered to include /appl/cmd/trfs.b /dis/trfs.dis
+20070614
+ /appl/lib/venti.b bug fixes, a few more errstrs, remove prints to stderr
+ add initial module/vac.m appl/lib/vac.b from mjl (gsoc project ventivac)
+ add initial /appl/cmd/^(vacfs.b vacget.b vacput.b) /man/4/vacfs /man/1/vacget from mjl (gsoc:ventivac)
+ include omitted man/mkfile man/lib
+20070608
+ update /lib9 functions to use silly va_copy (and then va_end) instead of just assigning, to account for silly C implementations
+ change /appl/cmd/mc.b not to require Draw or Env (so lc works on smaller systems)
+ update acme to include the font size data (eg, for use by mc(1))
+20070607
+ /appl/wm/man.b /appl/lib/man.b to allow 10.1 etc as section references
+20070605
+ add another xopen #define to lib9.h includes for Linux
+ copy plan9 acme's colormix
+20070601
+ /appl/cmd/ls.b /dis/ls.dis /man/1/ls: document new -F option and -T option
+ /appl/cmd/auth/factotum/factotum.b: ignore empty writes, don't fail; make a few diagnostics match plan 9
+ rename /appl/cmd/mc.b to /appl/cmd/calc.b; also /man/1/mc to /man/1/calc; /dis/mc.dis to /dis/calc.dis
+ add /appl/cmd/mc.b (initial version)
+ replace /dis/lc.dis by /dis/lc; remove /appl/cmd/lc.b
+ remove /appl/cmd/mathcalc.b /dis/mathcalc.dis /man/1/mathcalc
+20070510
+ quickly remove references to udp's "oldheaders" because plan 9 removed it
+ remove obootpd completely
+20070418
+ add scan code to X11 (issue 45)
+20070411
+ if mkconfig has been changed from the distribution, use it to set parameters in makemk.sh (issue 41)
+ add iso8859-15 (what? will the line stretch on to the crack of doom?) (issue 43)
+20070410
+ fix some porting errors in /appl/cmd/look.b
+ document look's -r option in look(1)
+20070407
+ /os/port/^(portdat.h lib.h portfns.h xalloc.c) compatiblity changes with plan 9
+ /os/pc ether drivers updated to match plan 9, and os/ip (and a few files in /os/port) also updated, including removing some unreachable code
+ /os/ip/tcp.c changes from plan 9 for out-of-sequence segments
+20070319
+ emu/port/devsrv.c and os/port/devsrv.c delete wc at correct time
+20070312
+ rename -D and -k options to plumb (old ones still accepted); add -i option to take data from standard input; update man page
+ enable 64-bit seeks in /emu/Nt/devfs.c
+20070302
+ change /mkfile to build yacc earlier, mainly to make bootstrap of a new host easier (makemk.sh and mk install)
+ change /utils/mkfile not to build k[acl] and q[acl] on Plan 9, since the system ones are the same
+20070228
+ make array bounds checking the default for on-the-fly compilers (emu/port/main.c)
+ improve wording in security-ssl(2) and ssl(3)
+20070227
+ /include/fcall.h: ensure unsigned promotion to counter ansi sign-extending rules for GBIT64
+ /libmemdraw/draw.c: copy fix to memfillcolor
+20070220
+ add 0x92 as chip ID for ether91c111.c
+20070217
+ repair /appl/lib/libc.b and /appl/lib/libc0.b strncmp implementations (used only by c2l output) [inferno-os issue 9]
+ /emu/port/devip.c, get socket fd on reopen of ctl
+ /appl/acme/exec.b, trim string correctly [inferno-os issue 11]
+20070216
+ add /module/lists.m, /appl/lib/lists.b, and lists(2)
+20070209
+ remove debugging -d option to exportfs call in emu/Plan9/devsrv9.c(!)
+20070206
+ /appl/svc/auth.sh: replace exit by raise
+ /man/2/styxservers: document replychan and replydirect
+20070201
+ update US timezone files to save energy
+20070131
+ add /appl/lib/convcs/utf16_btos.b, utf16_stob.b etc [rog]
+20070130
+ fix wording in some of the licence files (eg, remove references to old liberal licence)
+20070123
+ check lengths properly in devenv.c
+ move all of doc into lib/proto/inferno from lib/proto/src
+20070122
+ add doc/port.ms, doc/port.pdf to src proto. add brief instructions for source rebuild to port.ms
+20070118
+ add json(2) {/appl/lib/json.b, /module/json.m, /dis/lib/json.dis} for RFC4627 notation [json(6)]
+20070117
+ remove duplicate libmp/libsec reference from /mkfile (i assume it wasn't necessary to visit them twice!)
+20070116
+ move Man from /dis/man.dis (which vanished a few changes ago) to /dis/lib/man.dis. honestly. wm/man works again.
+20070114
+ remove some unused static declarations in /utils/mk/shprint.c
+20070111
+ delete drawxflush from devdraw.c (call drawq(un)?lock instead)
+20070107
+ have emu (/emu/port/main.c) check environment variables INFERNO and ROOT before EMU and -r, for inferno root directory
+ (haven't yet changed the build system and mkfiles to match)
+ remove /include/libcrypt_o.h since the library isn't used
+ add complete(2)
+20070103
+ replace man.dis by Salva Peiró's sh version of plan 9's man script
+20061221
+ add data2c to Irix package prototype
+ remove unwanted .dis/.sbl files from /appl packages
+ change liblogfs to GPLv2 from proprietary, to fit google code
+ correct cmd(3) to account for new stderr file
+20061219
+ cmd(3) and thus os(1) change to separate standard output and error streams
+ all /emu/*/cmd.c change to account for that (original changes to devcmd.c and MacOSX/cmd.c courtesy Cibernet)
+20061215
+ replaced things like <???> because gcc annoyingly whines even with 1950's trigraphs off
+ libtk/textu.c: uninitialised field in boundary case
+ libtk/textw.c: possibly uninitialised value; leave unchanged
+ utils/ql/l.h: uchar as to ushort, because of extra ops
+20061214
+ added fopen to xml.m to allow bufio->sopen and others to be used
+20061213
+ added MacOSX/386 components
+20061013
+ updated /os/ip/lookbackmedium.c and /os/ip/rudp.c
+20061021
+ change /os/port/exportfs.c to allow negotiating up to 64k msize
+ (matching /emu/port/exportfs.c)
+20060809
+ /appl/lib/newns.b uses String->unquoted, if it can load it
+20060803
+ /libtk/textw.c: default page up/down scrolls 0.75 of a page (to give context); also allows fractional value
+20060801
+ /utils/data2s/data2s.c: allocate at least one linker byte to empty files to avoid complaints
+20060715
+ /appl/lib/pop3.b remove defaultserver(); update pop3(2) to remove references to /services
+ similarly update smtp(2)
+ avoid some boundary cases in /appl/charon/^(build.b layout.b)
+20060625
+ added caerwynj@gmail.com changes to /appl/acme/acme/mail/src/Mailpop3.b
+20060622
+ /appl/lib/sets*.b: correct op's implementation of 2r1101
+20060613
+ added csv(2), /module/csv.m, /appl/lib/csv.b
+20060608
+ preliminary rfc822(2), /appl/lib/rfc822.b
+20060605
+ /appl/lib/chanfill.b: remove alt => *
+20060601
+ fix /appl/lib/dis.b to save the real array once read in
+20060526
+ /appl/lib/venti.b: fix g64's byte ordering [not that it is, or can be called yet]
+20060524
+ copy end fix to lib*/utfecpy.c
+20060523
+ w3c-uris(2): add a .copy() operation
+20060518
+ /Nt/386/include/lib9.h define _USE_32BIT_TIME_T and deprecate `deprecated' warnings
+20060504
+ remove use of HEAP_ALIGN from /*/port/devprof.c; change Heap.pad to Heap.hprof in /include/interp.h
+20060426
+ correct text and selection colours in wm/sh for loss-of-focus and holding modes
+20060423
+ add /appl/lib/w3c/uris.b w3c-uris(2) /module/uris.m
+20060419
+ /emu/port/devcmd.c: correct wakeup state for started command
+20060412
+ /appl/svc/webget include caerwyn's changes
+20060411
+ put `|| exit 1' after each (command-list) in the mkfiles, just for bash
+20060410
+ /appl/cmd/limbo/typecheck.b /limbo/typecheck.c - stop wrong warning wrt use of ref fn
+20060313
+ remembered to install cddb port from last year... cddb(7)
+20060312
+ /emu/Nt/win.c; #define windows names out of the way to remove IPoint etc
+ /emu/Nt/os.c, simplify osblock/osready and eliminate erendezvous
+ /emu/port/devcons.c, tug into line with /os/port, to prepare for single-window changes
+ echo ^U on CAN (ctrl-U)
+20060311
+ replace Limbo version of shutdown by sh script; it's still a bit silly
+20060309
+ /*/port/inferno.c: 0 or -1 return value from dial functions
+ /os/port/portmkfile: remove reference to ../kfs
+ /man/8/httpd document -a; /appl/svc/httpd/httpd.b
+ /libmp/port/mptouv.c sign extension fix from 9
+ /module/keyring.m, /libinterp/ipint.c: add some bitwise operators
+ change (undocumented) /appl/cmd/test.b so that `host' mkfiles will work in Inferno
+ should probably change the mkfiles to replace it
+20060303
+ /emu/Plan9/win.c replace ldepthof
+20060302
+ add KPX11 flag to hosted kproc to boost the stack for silly x11 & co.
+ put keyboard and cursor processing into a separate kproc with big stack in /emu/port/win-x11a.c
+ change various os.c to match
+20060301
+ /appl/cmd/rioimport.b fix initialisation race
+20060227
+ fix /utils/ql/l.h: oprange should be [ALAST] (with extra 405xx opcodes), also AEND->ALIST elsewhere
+ put faster gethunk in ql and kl (mimic other compilers)
+20060226
+ enable /emu/port/devpointer.c, with changes to /emu/*/win*.c to call mousetrack, /emu/port/main.c to bind #m,
+ and code for pointer and cursor removed from devcons.c
+ update Nt/win.c and port/win-x11a.c from drawterm to get/put host snarf buffer
+ change devmem.c from #m to #% not to clash with pointer
+20060225
+ add /emu/port/devsnarf.c (#^) and put clipread from drawterm in /emu/Nt/win.c
+20060224
+ modify /appl/lib/secstore.b, /module/secstore.m, secstore(2) [add dial, auth, mkseckey, mkfilekey, remove]
+ add /appl/cmd/auth/secstore.b, secstore(1)
+ remove strange exception handling in /appl/cmd/dd.b
+ add dhcpclient(2)
+20060223
+ add /appl/cmd/auth/aescbc.c
+ add /appl/cmd/crypt.b [rog]
+ add crypt(1)
+ add /appl/lib/secstore.b /module/secstore.m secstore(2)
+20060221
+ /libsec/port/hmac.c: treat existing but not seeded digest correctly
+ /libinterp/ipint.c, /module/keyring.m, add new operator `invert'
+20060220
+ add ida(2), /appl/lib/ida, /module/ida.m
+20060216
+ add ubfa(2), ubfa(6), /module/ubfa.m, /appl/lib/ubfa.b
+20060214
+ [rog] add cursor changing support to tk, wm, wmlib (eg, for acme)
+20060213
+ remove libcrypt_o from distribution
+20060211
+ add /man/1/9win [rog]
+ change /appl/cmd/auth/keyfs.b to confirm key only when creating the file [rog]
+ punt floating-point conversions in powerpc jit on macos for time being
+ (have particular values in certain FP registers when native)
+20060210
+ update /libmemdraw/draw.c to include 9's changes for concurrent use
+ remove canlock as assembly language interface, replaced by _tas
+ replace native use of tas by _tas; make declarations all agree
+ add holdon/holdoff ctl request to wm/sh
+ wmproxy in appl/lib/wmlib.b does not create new pgrp
+20060206
+ update /appl/cmd/cp.b with digbyt's changes (mode/uid/gid correct on copied directories)
+20060203
+ update /appl/cmd/ip/dhcp.b /appl/cmd/lib/dhcpclient.b
+ update /os/init/i4e.b to use it
+ add /man/8/dhcp
+20060118
+ add ksize(10.1), kstrip(10.1), /utils/kstrip
+ new _MAGIC definitions in utils/libmach/a.out.h
+20060114
+ change /os/boot/arm1110 mkfile to work on unix and windows; add to /lib/proto/os
+20060111
+ -s (exportonly) -x/-y (geometry) options to 9win (TODO: rog, manual page!)
+ wm/sh.b: correct hold mode; remove little-used and undocumented history file
+20060109
+ delete #pragma from flate.h
+ ensure lib9 compiles replacement sbrk for MacOSX
+20060106
+ update compilers
+ update compilers' manual page
+ fix os/port/portmkfile for Plan 9: don't use $OBJDIR but Inferno/$OBJTYPE
+ have os/port/portmkfile check for i$CONF.p9 and use that not i$CONF for acid
+ add srclist(10.1)
+20060105
+ account for new definition of rendezvous (void* not ulong)
+ add dummy setmalloctag to utils where needed (for Plan 9)
+ set profileflg only for ATEXT in utils/?c/txt.c
+ update /os/boot/pc
+20060103
+ /os/ip updated from Plan 9
+ /os/ip/^(bootp.c dhcp.c ihbootp.c) changed to use announce not connect for udp
+20051215
+ /man/6/keytext added
+20051207
+ /tools/odbc.c portability changes, and fix modes on several files
+20051202
+ /emu/Plan9/devfs.c strip Inferno root from file system diagnostics
+20051130
+ change /appl/svc/httpd to use lock(2) not lockprocs
+20051123
+ /appl/cmd/bind.b changed not to use arg.dis, implement -q, and diagnostic change
+ /appl/cmd/mount.b acquired a -q option as well
+20051114
+ avoid limit==0 in wm/memory.b
+20051108
+ have poolmaxsize return 0 for pool of size 0
+ remove /os/*/u.h (in favour of /$SYSTARG/$OBJTYPE/include/u.h)
+ update mkfiles accordingly
+ adjust mkfiles for libsec and libmp compilation for native kernels
+20051107
+ added /os/manga
+20051101
+ fixed /os/port/devloopback.c
+ updated netif.c netif.h
+20051028
+ updated gettar(1) and /appl/cmd/gettar.b
+20051025
+ fix British Summer Time in locales
+20051021
+ updated /appl/lib/newns.b and namespace(6) for environment variable substitution
+20051018
+ moved in changes from home to os/port: cis.c devbridge.c ethermii.c portclock.c devuart.c devbench.c random.c portfns.h tod.c uart.h
+ - mainly for changes to implement fasttick and timers
+20051017
+ /limbo/ecom.c and /appl/cmd/limbo/ecom.c: ensure src set in temporary Node to avoid `no file specified' in sbl.[bc]
+20050925
+ added format(2)
+20050922
+ iostats(4) added
+20050919
+ improve behaviour in wm/sh when in raw mode
+20050916
+ /appl/lib/styx.b: return value for Rmsg.unpack for Rstat didn't include len[2]
+20050912
+ update /appl/lib/disks.b, disks(2)
+ update /appl/cmd/disk/format.b
+ add /appl/cmd/disk/prep, /appl/cmd/disk/mbr.b
+ replace format(8) by prep(8)
+ delete undocumented /appl/cmd/disk/part.b
+20050908
+ added disks(2) and scsiio(2)
+20050906
+ os/port/devsrv.c and emu/port/devsrv.c to allow setting length by wstat (also DMAPPEND)
+ appl/cmd/dossrv.b fix to interpret aname:offset
+ usb updated to support current native uhci drivers
+ /appl/lib/usb/usbmass.b changed to work with new driver and more devices
+20050901
+ new /appl/cmd/ip/sntp.b, sntp(8)
+20050824
+ cp(1): added -gux options
+20050810
+ mangaload(8): new
+20050812
+ /appl/cmd/limbo/nodes.b didn't always initialise n.c (eg, a != a)
+20050712
+ updated utils/[12][acl] to match Plan 9's
+20050627
+ added streamcp (renamed fcp since that's what plan 9 calls a similar thing)
+20050626
+ added write lock to emu/port/devip.c to stop Linux (and perhaps others) splitting socket writes by different processes
+20050620
+ added w3c-xpointers(2) [/module/xpointers.m; /appl/lib/w3c/xpointers.b]
+20050617
+ fixed qid array reference in /appl/cmd/lockfs.b [cjones83]
+20050610
+ updated lib/ndb/dns
+ fixed count < 0 when reading beyond end of file in disk/kfs
+20050526
+ fixed factotum's p9any to use user= attribute in key not /dev/user
+ fix /appl/lib/daytime.b's handling of dlpairs; also read /env/timezone if that's there
+ update /appl/lib/w3c/css.b to read CSS2.1
+ add w3c-css(2); possibly should move module file to w3c/css.m?
+20050518
+ added GPL/LGPL notice files
+ made single mk.b from many included source files
+ added MIT-template or LGPL NOTICE files to lib* directories
+ updated doc/port.ms
+ included libmp and libsec in lib/proto/src (Lucent Public License), not yet used
+ fix bug in cmd(3) introduced by killonclose
+20050425
+ add sexprs(6)
+ add truerand/ntruerand and nsec[defined as osnsec] to lib9.h
+ redefine fmax and log2 in lib9.h
+ some/all FreeBSD-5.x-y don't initialise rfork_thread's procmask from parent (contrary to docs); compensate in FreeBSD/os.c
+ finally copy last year's changes to 1c from home
+ call logs->init in applylog
+ changed /appl/cmd/cmp.b to work correctly for differing buffer sizes, errors, etc.
+ included /os/pc/sd53c8xx.[in] and added /utils/na [not compiled by default]
+ mask off OEXCL in (emu/port os/port)^/sysfile.c:/^kcreate's openmode
+ wm/sh.b: keep menuitem 0 if noscroll selected
+ added units(1)
+20050413
+ licence following MIT-template replaces `free for all' instances
+ "-N nice" option in os(1)
+ geodesy(2) is new
+ ebook(1) is newly released (Open Ebook browser)
+ wm-sh(1) has a rearranged menu, with scroll/noscroll option added
+ /doc/asm.ms has been updated
+ section 10 has been updated
+ limbo compiler will make simple functions inline if possible
+ limbo compiler supports `ref fn' type
+ /doc/limbo/addendum.ms [also .ps .pdf] updated to reflect `ref fn' and other changes
+ keyring-ipint(2) has a few new operations (shl, shr, copy)
+ DigestState has new copy operation replacing cloneDigestState
+ Keyring has new functions certtoattr, pktoattr and sktoattr each returning
+ a string containing attr=value ... representations of certificates and keys
+ u.h has been updated for all platforms, hosted and native
+ new ptrint, u8int, u16int, u64int, FPdbleword, and more accurate varargs for < 4 byte values
+ lib9.h has extra encode/decode functions moved from libcrypt
+ string.m has new quotec function [TODO: man page]
+ crypt/ssl3.b handles a particular certificate type better
+ charon has several bug fixes in javascript, notably parsing of certain expressions
+ /doc/descent/* `Descent into Limbo' updated
+ internally libinterp uses a different representation for parts of the linkage table
+ /doc/lprof.ms [also .ps and .pdf] gives overview of Limbo profiling
+ /doc/ebookimp.ms [also .ps and .pdf] discusses implementation of its XML browsing
+ /doc/compiler.ms has been updated
+ /doc/dis.ms eclr has been removed
+ emu(1) -b enables bounds checking in JIT
+ cs(8) handles general query (!attr=val ...)
+ mkfs/mkext(8) handles big archives
+ emuinit tries sh -c on command if not immediately dis
+ /appl/lib/string.b: rewritten unquoted for correct handling of embedded quotes
+ limbo warns about unused local variables
+ limbo: -F enables new implementation of function ref
+ limbo: -O runs optimiser
+ mount -9 uses 9fs not styx as service address
+ cmd(3) adds "killonclose" and parameter to "nice"
+ TODO: group check in styxserver
+ styxlisten accumulates algs correctly
+ os/port/mkdevc builds vgacursor table
+ touch uses OEXCL
+ /appl/lib/debug knows about ref fn
+ ecmascript: for(... in ...) parsed correctly
+ getuserpasswd added to factotum(2)
+ /appl/lib/print reincorporated
+ wm/clock
+ ftpfs calls factotum (getuserpasswd)
+ hoststdin/hoststdout/hoststderr [preliminary]
+ /os/boot/pc updated, as is its shipping list
+20041217
+ base point
--- /dev/null
+++ b/DragonFly/386/include/emu.h
@@ -1,0 +1,30 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+#define KSTACK (32 * 1024)
+
+static __inline Proc *getup(void) {
+ Proc *p;
+ __asm__( "movl %%esp, %%eax\n\t"
+ : "=a" (p)
+ );
+ return *(Proc **)((unsigned long)p & ~(KSTACK - 1));
+};
+
+#define up (getup())
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
--- /dev/null
+++ b/DragonFly/386/include/fpuctl.h
@@ -1,0 +1,76 @@
+/*
+ * Linux 386 fpu support
+ * Mimic Plan9 floating point support
+ */
+
+static void
+setfcr(ulong fcr)
+{
+ __asm__( "xorb $0x3f, %%al\n\t"
+ "pushw %%ax\n\t"
+ "fwait\n\t"
+ "fldcw (%%esp)\n\t"
+ "popw %%ax\n\t"
+ : /* no output */
+ : "al" (fcr)
+ );
+}
+
+static ulong
+getfcr(void)
+{
+ ulong fcr = 0;
+
+ __asm__( "pushl %%eax\n\t"
+ "fwait\n\t"
+ "fstcw (%%esp)\n\t"
+ "popl %%eax\n\t"
+ "xorb $0x3f, %%al\n\t"
+ : "=a" (fcr)
+ : "eax" (fcr)
+ );
+ return fcr;
+}
+
+static ulong
+getfsr(void)
+{
+ ulong fsr = -1;
+
+ __asm__( "fwait\n\t"
+ "fstsw (%%eax)\n\t"
+ "movl (%%eax), %%eax\n\t"
+ "andl $0xffff, %%eax\n\t"
+ : "=a" (fsr)
+ : "eax" (&fsr)
+ );
+ return fsr;
+}
+
+static void
+setfsr(ulong fsr)
+{
+ __asm__("fclex\n\t");
+}
+
+/* FCR */
+#define FPINEX (1<<5)
+#define FPUNFL ((1<<4)|(1<<1))
+#define FPOVFL (1<<3)
+#define FPZDIV (1<<2)
+#define FPINVAL (1<<0)
+#define FPRNR (0<<10)
+#define FPRZ (3<<10)
+#define FPRPINF (2<<10)
+#define FPRNINF (1<<10)
+#define FPRMASK (3<<10)
+#define FPPEXT (3<<8)
+#define FPPSGL (0<<8)
+#define FPPDBL (2<<8)
+#define FPPMASK (3<<8)
+/* FSR */
+#define FPAINEX FPINEX
+#define FPAOVFL FPOVFL
+#define FPAUNFL FPUNFL
+#define FPAZDIV FPZDIV
+#define FPAINVAL FPINVAL
--- /dev/null
+++ b/DragonFly/386/include/lib9.h
@@ -1,0 +1,474 @@
+/* define _BSD_SOURCE to use ISO C, POSIX, and 4.3BSD things. */
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+/* these aren't really needed because FreeBSD does the right thing and makes off_t 64 bits, full stop */
+#define _LARGEFILE64_SOURCE 1
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include "math.h"
+#include <fcntl.h>
+#include <setjmp.h>
+#include <float.h>
+#include <time.h>
+
+#define getwd infgetwd
+
+#define round infround
+#define fmax inffmax
+#define log2 inflog2
+
+#ifndef EMU
+typedef struct Proc Proc;
+#endif
+
+/*
+ * math module dtoa
+ */
+#define __LITTLE_ENDIAN
+
+#define nil ((void*)0)
+
+typedef unsigned char uchar;
+typedef signed char schar;
+typedef unsigned long ulong;
+typedef unsigned int Rune;
+typedef long long int vlong;
+typedef unsigned long long int uvlong;
+typedef unsigned int u32int;
+typedef uvlong u64int;
+typedef unsigned int mpdigit; /* for /sys/include/mp.h */
+typedef unsigned short u16int;
+typedef unsigned char u8int;
+typedef unsigned long uintptr;
+
+typedef signed char int8;
+typedef unsigned char uint8;
+typedef short int16;
+typedef unsigned short uint16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+
+#define USED(x) if(x){}else{}
+#define SET(x)
+
+#undef nelem
+#define nelem(x) (sizeof(x)/sizeof((x)[0]))
+#undef offsetof
+#define offsetof(s, m) (ulong)(&(((s*)0)->m))
+#undef assert
+#define assert(x) if(x){}else _assert("x")
+
+/*
+ * most mem and string routines are declared by ANSI/POSIX files above
+ */
+
+extern char* strecpy(char*, char*, char*);
+extern char* strdup(const char*);
+extern int cistrncmp(char*, char*, int);
+extern int cistrcmp(char*, char*);
+extern char* cistrstr(char*, char*);
+extern int tokenize(char*, char**, int);
+
+enum
+{
+ UTFmax = 4, /* maximum bytes per rune */
+ Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
+ Runeself = 0x80, /* rune and UTF sequences are the same (<) */
+ Runeerror = 0xFFFD, /* decoding error in UTF */
+ Runemax = 0x10FFFF, /* 21-bit rune */
+ Runemask = 0x1FFFFF, /* bits used by runes (see grep) */
+};
+
+/*
+ * rune routines
+ */
+extern int runetochar(char*, Rune*);
+extern int chartorune(Rune*, char*);
+extern int runelen(long);
+extern int runenlen(Rune*, int);
+extern int fullrune(char*, int);
+extern int utflen(char*);
+extern int utfnlen(char*, long);
+extern char* utfrune(char*, long);
+extern char* utfrrune(char*, long);
+extern char* utfutf(char*, char*);
+extern char* utfecpy(char*, char*, char*);
+
+extern Rune* runestrcat(Rune*, Rune*);
+extern Rune* runestrchr(Rune*, Rune);
+extern int runestrcmp(Rune*, Rune*);
+extern Rune* runestrcpy(Rune*, Rune*);
+extern Rune* runestrncpy(Rune*, Rune*, long);
+extern Rune* runestrecpy(Rune*, Rune*, Rune*);
+extern Rune* runestrdup(Rune*);
+extern Rune* runestrncat(Rune*, Rune*, long);
+extern int runestrncmp(Rune*, Rune*, long);
+extern Rune* runestrrchr(Rune*, Rune);
+extern long runestrlen(Rune*);
+extern Rune* runestrstr(Rune*, Rune*);
+
+extern Rune tolowerrune(Rune);
+extern Rune totitlerune(Rune);
+extern Rune toupperrune(Rune);
+extern int isalpharune(Rune);
+extern int islowerrune(Rune);
+extern int isspacerune(Rune);
+extern int istitlerune(Rune);
+extern int isupperrune(Rune);
+
+/*
+ * malloc
+ */
+extern void* malloc(size_t);
+extern void* mallocz(ulong, int);
+extern void free(void*);
+extern ulong msize(void*);
+extern void* calloc(size_t, size_t);
+extern void* realloc(void*, size_t);
+extern void setmalloctag(void*, ulong);
+extern void setrealloctag(void*, ulong);
+extern ulong getmalloctag(void*);
+extern ulong getrealloctag(void*);
+extern void* malloctopoolblock(void*);
+
+/*
+ * print routines
+ */
+typedef struct Fmt Fmt;
+struct Fmt{
+ uchar runes; /* output buffer is runes or chars? */
+ void *start; /* of buffer */
+ void *to; /* current place in the buffer */
+ void *stop; /* end of the buffer; overwritten if flush fails */
+ int (*flush)(Fmt *); /* called when to == stop */
+ void *farg; /* to make flush a closure */
+ int nfmt; /* num chars formatted so far */
+ va_list args; /* args passed to dofmt */
+ int r; /* % format Rune */
+ int width;
+ int prec;
+ ulong flags;
+};
+
+enum{
+ FmtWidth = 1,
+ FmtLeft = FmtWidth << 1,
+ FmtPrec = FmtLeft << 1,
+ FmtSharp = FmtPrec << 1,
+ FmtSpace = FmtSharp << 1,
+ FmtSign = FmtSpace << 1,
+ FmtZero = FmtSign << 1,
+ FmtUnsigned = FmtZero << 1,
+ FmtShort = FmtUnsigned << 1,
+ FmtLong = FmtShort << 1,
+ FmtVLong = FmtLong << 1,
+ FmtComma = FmtVLong << 1,
+ FmtByte = FmtComma << 1,
+
+ FmtFlag = FmtByte << 1
+};
+
+extern int print(char*, ...);
+extern char* seprint(char*, char*, char*, ...);
+extern char* vseprint(char*, char*, char*, va_list);
+extern int snprint(char*, int, char*, ...);
+extern int vsnprint(char*, int, char*, va_list);
+extern char* smprint(char*, ...);
+extern char* vsmprint(char*, va_list);
+extern int sprint(char*, char*, ...);
+extern int fprint(int, char*, ...);
+extern int vfprint(int, char*, va_list);
+
+extern int runesprint(Rune*, char*, ...);
+extern int runesnprint(Rune*, int, char*, ...);
+extern int runevsnprint(Rune*, int, char*, va_list);
+extern Rune* runeseprint(Rune*, Rune*, char*, ...);
+extern Rune* runevseprint(Rune*, Rune*, char*, va_list);
+extern Rune* runesmprint(char*, ...);
+extern Rune* runevsmprint(char*, va_list);
+
+extern int fmtfdinit(Fmt*, int, char*, int);
+extern int fmtfdflush(Fmt*);
+extern int fmtstrinit(Fmt*);
+extern char* fmtstrflush(Fmt*);
+extern int runefmtstrinit(Fmt*);
+extern Rune* runefmtstrflush(Fmt*);
+
+extern int fmtinstall(int, int (*)(Fmt*));
+extern int dofmt(Fmt*, char*);
+extern int dorfmt(Fmt*, Rune*);
+extern int fmtprint(Fmt*, char*, ...);
+extern int fmtvprint(Fmt*, char*, va_list);
+extern int fmtrune(Fmt*, int);
+extern int fmtstrcpy(Fmt*, char*);
+extern int fmtrunestrcpy(Fmt*, Rune*);
+/*
+ * error string for %r
+ * supplied on per os basis, not part of fmt library
+ */
+extern int errfmt(Fmt *f);
+
+/*
+ * quoted strings
+ */
+extern char *unquotestrdup(char*);
+extern Rune *unquoterunestrdup(Rune*);
+extern char *quotestrdup(char*);
+extern Rune *quoterunestrdup(Rune*);
+extern int quotestrfmt(Fmt*);
+extern int quoterunestrfmt(Fmt*);
+extern void quotefmtinstall(void);
+extern int (*doquote)(int);
+
+/*
+ * random number
+ */
+extern int nrand(int);
+extern ulong truerand(void);
+extern ulong ntruerand(ulong);
+
+/*
+ * math
+ */
+extern int isNaN(double);
+extern int isInf(double, int);
+extern double pow(double, double);
+
+/*
+ * Time-of-day
+ */
+
+typedef struct Tm Tm;
+struct Tm {
+ int sec;
+ int min;
+ int hour;
+ int mday;
+ int mon;
+ int year;
+ int wday;
+ int yday;
+ char zone[4];
+ int tzoff;
+};
+extern vlong osnsec(void);
+#define nsec osnsec
+
+/*
+ * one-of-a-kind
+ */
+extern void _assert(char*);
+extern double charstod(int(*)(void*), void*);
+extern char* cleanname(char*);
+extern double frexp(double, int*);
+extern uintptr getcallerpc(void*);
+extern int getfields(char*, char**, int, int, char*);
+extern char* getuser(void);
+extern char* getwd(char*, int);
+extern double ipow10(int);
+extern double ldexp(double, int);
+extern double modf(double, double*);
+#define pow10 infpow10
+extern double pow10(int);
+extern vlong strtoll(const char*, char**, int);
+#define qsort infqsort
+extern void qsort(void*, long, long, int (*)(void*, void*));
+extern uvlong strtoull(const char*, char**, int);
+extern void sysfatal(char*, ...);
+extern int dec64(uchar*, int, char*, int);
+extern int enc64(char*, int, uchar*, int);
+extern int dec32(uchar*, int, char*, int);
+extern int enc32(char*, int, uchar*, int);
+extern int dec16(uchar*, int, char*, int);
+extern int enc16(char*, int, uchar*, int);
+extern int encodefmt(Fmt*);
+
+/*
+ * synchronization
+ */
+typedef
+struct Lock {
+ int val;
+ int pid;
+} Lock;
+
+extern int _tas(int*);
+
+extern void lock(Lock*);
+extern void unlock(Lock*);
+extern int canlock(Lock*);
+
+typedef struct QLock QLock;
+struct QLock
+{
+ Lock use; /* to access Qlock structure */
+ Proc *head; /* next process waiting for object */
+ Proc *tail; /* last process waiting for object */
+ int locked; /* flag */
+};
+
+extern void qlock(QLock*);
+extern void qunlock(QLock*);
+extern int canqlock(QLock*);
+extern void _qlockinit(ulong (*)(ulong, ulong)); /* called only by the thread library */
+
+typedef
+struct RWLock
+{
+ Lock l; /* Lock modify lock */
+ QLock x; /* Mutual exclusion lock */
+ QLock k; /* Lock for waiting writers */
+ int readers; /* Count of readers in lock */
+} RWLock;
+
+extern int canrlock(RWLock*);
+extern int canwlock(RWLock*);
+extern void rlock(RWLock*);
+extern void runlock(RWLock*);
+extern void wlock(RWLock*);
+extern void wunlock(RWLock*);
+
+/*
+ * network dialing
+ */
+#define NETPATHLEN 40
+
+/*
+ * system calls
+ *
+ */
+#define STATMAX 65535U /* max length of machine-independent stat structure */
+#define DIRMAX (sizeof(Dir)+STATMAX) /* max length of Dir structure */
+#define ERRMAX 128 /* max length of error string */
+
+#define MORDER 0x0003 /* mask for bits defining order of mounting */
+#define MREPL 0x0000 /* mount replaces object */
+#define MBEFORE 0x0001 /* mount goes before others in union directory */
+#define MAFTER 0x0002 /* mount goes after others in union directory */
+#define MCREATE 0x0004 /* permit creation in mounted directory */
+#define MCACHE 0x0010 /* cache some data */
+#define MMASK 0x0017 /* all bits on */
+
+#define OREAD 0 /* open for read */
+#define OWRITE 1 /* write */
+#define ORDWR 2 /* read and write */
+#define OEXEC 3 /* execute, == read but check execute permission */
+#define OTRUNC 16 /* or'ed in (except for exec), truncate file first */
+#define OCEXEC 32 /* or'ed in, close on exec */
+#define ORCLOSE 64 /* or'ed in, remove on close */
+#define OEXCL 0x1000 /* or'ed in, exclusive use (create only) */
+
+#define AEXIST 0 /* accessible: exists */
+#define AEXEC 1 /* execute access */
+#define AWRITE 2 /* write access */
+#define AREAD 4 /* read access */
+
+/* bits in Qid.type */
+#define QTDIR 0x80 /* type bit for directories */
+#define QTAPPEND 0x40 /* type bit for append only files */
+#define QTEXCL 0x20 /* type bit for exclusive use files */
+#define QTMOUNT 0x10 /* type bit for mounted channel */
+#define QTAUTH 0x08 /* type bit for authentication file */
+#define QTFILE 0x00 /* plain file */
+
+/* bits in Dir.mode */
+#define DMDIR 0x80000000 /* mode bit for directories */
+#define DMAPPEND 0x40000000 /* mode bit for append only files */
+#define DMEXCL 0x20000000 /* mode bit for exclusive use files */
+#define DMMOUNT 0x10000000 /* mode bit for mounted channel */
+#define DMAUTH 0x08000000 /* mode bit for authentication file */
+#define DMREAD 0x4 /* mode bit for read permission */
+#define DMWRITE 0x2 /* mode bit for write permission */
+#define DMEXEC 0x1 /* mode bit for execute permission */
+
+typedef
+struct Qid
+{
+ uvlong path;
+ ulong vers;
+ uchar type;
+} Qid;
+
+typedef
+struct Dir {
+ /* system-modified data */
+ ushort type; /* server type */
+ uint dev; /* server subtype */
+ /* file data */
+ Qid qid; /* unique id from server */
+ ulong mode; /* permissions */
+ ulong atime; /* last read time */
+ ulong mtime; /* last write time */
+ vlong length; /* file length */
+ char *name; /* last element of path */
+ char *uid; /* owner name */
+ char *gid; /* group name */
+ char *muid; /* last modifier name */
+} Dir;
+
+extern Dir* dirstat(char*);
+extern Dir* dirfstat(int);
+extern int dirwstat(char*, Dir*);
+extern int dirfwstat(int, Dir*);
+extern long dirread(int, Dir**);
+extern void nulldir(Dir*);
+extern long dirreadall(int, Dir**);
+
+typedef
+struct Waitmsg
+{
+ int pid; /* of loved one */
+ ulong time[3]; /* of loved one & descendants */
+ char *msg;
+} Waitmsg;
+
+extern void _exits(char*);
+
+extern void exits(char*);
+extern int create(char*, int, int);
+extern int errstr(char*, uint);
+
+extern void perror(const char*);
+extern long readn(int, void*, long);
+extern int remove(const char*);
+extern void rerrstr(char*, uint);
+extern vlong seek(int, vlong, int);
+extern int segflush(void*, ulong);
+extern void werrstr(char*, ...);
+
+extern char *argv0;
+#define ARGBEGIN for((argv0||(argv0=*argv)),argv++,argc--;\
+ argv[0] && argv[0][0]=='-' && argv[0][1];\
+ argc--, argv++) {\
+ char *_args, *_argt;\
+ Rune _argc;\
+ _args = &argv[0][1];\
+ if(_args[0]=='-' && _args[1]==0){\
+ argc--; argv++; break;\
+ }\
+ _argc = 0;\
+ while(*_args && (_args += chartorune(&_argc, _args)))\
+ switch(_argc)
+#define ARGEND SET(_argt);USED(_argt);USED(_argc); USED(_args);}USED(argv); USED(argc);
+#define ARGF() (_argt=_args, _args="",\
+ (*_argt? _argt: argv[1]? (argc--, *++argv): 0))
+#define EARGF(x) (_argt=_args, _args="",\
+ (*_argt? _argt: argv[1]? (argc--, *++argv): ((x), abort(), (char*)0)))
+
+#define ARGC() _argc
+
+/*
+ * Extensions for Inferno to basic libc.h
+ */
+
+#define setbinmode()
+
binary files /dev/null b/Irix/mips/bin/awk differ
binary files /dev/null b/Irix/mips/bin/data2c differ
binary files /dev/null b/Irix/mips/bin/iyacc differ
binary files /dev/null b/Irix/mips/bin/mk differ
binary files /dev/null b/Irix/mips/bin/mkext differ
--- /dev/null
+++ b/Irix/mips/include/emu.h
@@ -1,0 +1,22 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+extern Proc** Xup;
+#define up (*Xup)
+
+typedef struct FPU FPU;
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+struct FPU
+{
+ ulong fcr31;
+};
+
+typedef sigjmp_buf osjmpbuf;
+#define ossetjmp(buf) sigsetjmp(buf, 1)
+
--- /dev/null
+++ b/Irix/mips/include/lib9.h
@@ -1,0 +1,456 @@
+#define _LARGEFILE64_SOURCE 1
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+#include <sys/stat.h>
+#define _POSIX_SOURCE
+#include <stdlib.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include "math.h"
+#include <fcntl.h>
+#include <setjmp.h>
+#include <float.h>
+#include <sys/bsd_types.h>
+#include <time.h>
+
+#define getwd infgetwd
+
+#ifndef EMU
+typedef struct Proc Proc;
+#endif
+
+#define nil ((void*)0)
+
+typedef unsigned char uchar;
+typedef signed char schar;
+typedef unsigned int Rune;
+typedef long long int vlong;
+typedef unsigned long long int uvlong;
+typedef unsigned int u32int;
+typedef uvlong u64int;
+
+typedef unsigned int mpdigit; /* for /sys/include/mp.h */
+typedef unsigned short u16int;
+typedef unsigned char u8int;
+typedef unsigned long uintptr;
+
+typedef signed char int8;
+typedef unsigned char uint8;
+typedef short int16;
+typedef unsigned short uint16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+
+#define USED(x) if(x){}else{}
+#define SET(x)
+
+#undef nelem
+#define nelem(x) (sizeof(x)/sizeof((x)[0]))
+#undef offsetof
+#define offsetof(s, m) (ulong)(&(((s*)0)->m))
+#undef assert
+#define assert(x) if(x){}else _assert("x")
+
+/*
+ * most mem and string routines are declared by ANSI/POSIX files above
+ */
+
+extern char* strecpy(char*, char*, char*);
+extern char* strdup(const char*);
+extern int cistrncmp(char*, char*, int);
+extern int cistrcmp(char*, char*);
+extern char* cistrstr(char*, char*);
+extern int tokenize(char*, char**, int);
+
+enum
+{
+ UTFmax = 4, /* maximum bytes per rune */
+ Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
+ Runeself = 0x80, /* rune and UTF sequences are the same (<) */
+ Runeerror = 0xFFFD, /* decoding error in UTF */
+ Runemax = 0x10FFFF, /* 21-bit rune */
+ Runemask = 0x1FFFFF, /* bits used by runes (see grep) */
+};
+
+/*
+ * rune routines
+ */
+extern int runetochar(char*, Rune*);
+extern int chartorune(Rune*, char*);
+extern int runelen(long);
+extern int runenlen(Rune*, int);
+extern int fullrune(char*, int);
+extern int utflen(char*);
+extern int utfnlen(char*, long);
+extern char* utfrune(char*, long);
+extern char* utfrrune(char*, long);
+extern char* utfutf(char*, char*);
+extern char* utfecpy(char*, char*, char*);
+
+extern Rune* runestrcat(Rune*, Rune*);
+extern Rune* runestrchr(Rune*, Rune);
+extern int runestrcmp(Rune*, Rune*);
+extern Rune* runestrcpy(Rune*, Rune*);
+extern Rune* runestrncpy(Rune*, Rune*, long);
+extern Rune* runestrecpy(Rune*, Rune*, Rune*);
+extern Rune* runestrdup(Rune*);
+extern Rune* runestrncat(Rune*, Rune*, long);
+extern int runestrncmp(Rune*, Rune*, long);
+extern Rune* runestrrchr(Rune*, Rune);
+extern long runestrlen(Rune*);
+extern Rune* runestrstr(Rune*, Rune*);
+
+extern Rune tolowerrune(Rune);
+extern Rune totitlerune(Rune);
+extern Rune toupperrune(Rune);
+extern int isalpharune(Rune);
+extern int islowerrune(Rune);
+extern int isspacerune(Rune);
+extern int istitlerune(Rune);
+extern int isupperrune(Rune);
+
+/*
+ * malloc
+ */
+extern void* malloc(size_t);
+extern void* mallocz(ulong, int);
+extern void free(void*);
+extern ulong msize(void*);
+extern void* calloc(size_t, size_t);
+extern void* realloc(void*, size_t);
+extern void setmalloctag(void*, ulong);
+extern void setrealloctag(void*, ulong);
+extern ulong getmalloctag(void*);
+extern ulong getrealloctag(void*);
+extern void* malloctopoolblock(void*);
+
+/*
+ * print routines
+ */
+typedef struct Fmt Fmt;
+struct Fmt{
+ uchar runes; /* output buffer is runes or chars? */
+ void *start; /* of buffer */
+ void *to; /* current place in the buffer */
+ void *stop; /* end of the buffer; overwritten if flush fails */
+ int (*flush)(Fmt *); /* called when to == stop */
+ void *farg; /* to make flush a closure */
+ int nfmt; /* num chars formatted so far */
+ va_list args; /* args passed to dofmt */
+ int r; /* % format Rune */
+ int width;
+ int prec;
+ ulong flags;
+};
+extern vlong osnsec(void);
+#define nsec osnsec
+
+enum{
+ FmtWidth = 1,
+ FmtLeft = FmtWidth << 1,
+ FmtPrec = FmtLeft << 1,
+ FmtSharp = FmtPrec << 1,
+ FmtSpace = FmtSharp << 1,
+ FmtSign = FmtSpace << 1,
+ FmtZero = FmtSign << 1,
+ FmtUnsigned = FmtZero << 1,
+ FmtShort = FmtUnsigned << 1,
+ FmtLong = FmtShort << 1,
+ FmtVLong = FmtLong << 1,
+ FmtComma = FmtVLong << 1,
+ FmtByte = FmtComma << 1,
+
+ FmtFlag = FmtByte << 1
+};
+
+extern int print(char*, ...);
+extern char* seprint(char*, char*, char*, ...);
+extern char* vseprint(char*, char*, char*, va_list);
+extern int snprint(char*, int, char*, ...);
+extern int vsnprint(char*, int, char*, va_list);
+extern char* smprint(char*, ...);
+extern char* vsmprint(char*, va_list);
+extern int sprint(char*, char*, ...);
+extern int fprint(int, char*, ...);
+extern int vfprint(int, char*, va_list);
+
+extern int runesprint(Rune*, char*, ...);
+extern int runesnprint(Rune*, int, char*, ...);
+extern int runevsnprint(Rune*, int, char*, va_list);
+extern Rune* runeseprint(Rune*, Rune*, char*, ...);
+extern Rune* runevseprint(Rune*, Rune*, char*, va_list);
+extern Rune* runesmprint(char*, ...);
+extern Rune* runevsmprint(char*, va_list);
+
+extern int fmtfdinit(Fmt*, int, char*, int);
+extern int fmtfdflush(Fmt*);
+extern int fmtstrinit(Fmt*);
+extern char* fmtstrflush(Fmt*);
+extern int runefmtstrinit(Fmt*);
+extern Rune* runefmtstrflush(Fmt*);
+
+extern int fmtinstall(int, int (*)(Fmt*));
+extern int dofmt(Fmt*, char*);
+extern int dorfmt(Fmt*, Rune*);
+extern int fmtprint(Fmt*, char*, ...);
+extern int fmtvprint(Fmt*, char*, va_list);
+extern int fmtrune(Fmt*, int);
+extern int fmtstrcpy(Fmt*, char*);
+extern int fmtrunestrcpy(Fmt*, Rune*);
+/*
+ * error string for %r
+ * supplied on per os basis, not part of fmt library
+ */
+extern int errfmt(Fmt *f);
+
+/*
+ * quoted strings
+ */
+extern char *unquotestrdup(char*);
+extern Rune *unquoterunestrdup(Rune*);
+extern char *quotestrdup(char*);
+extern Rune *quoterunestrdup(Rune*);
+extern int quotestrfmt(Fmt*);
+extern int quoterunestrfmt(Fmt*);
+extern void quotefmtinstall(void);
+extern int (*doquote)(int);
+
+/*
+ * random number
+ */
+extern ulong truerand(void);
+extern ulong ntruerand(ulong);
+
+/*
+ * math
+ */
+extern int isNaN(double);
+extern int isInf(double, int);
+
+/*
+ * Time-of-day
+ */
+
+typedef struct Tm Tm;
+struct Tm {
+ int sec;
+ int min;
+ int hour;
+ int mday;
+ int mon;
+ int year;
+ int wday;
+ int yday;
+ char zone[4];
+ int tzoff;
+};
+
+/*
+ * one-of-a-kind
+ */
+extern void _assert(char*);
+extern double charstod(int(*)(void*), void*);
+extern char* cleanname(char*);
+extern uintptr getcallerpc(void*);
+extern int getfields(char*, char**, int, int, char*);
+extern char* getuser(void);
+extern char* getwd(char*, int);
+extern double ipow10(int);
+#define pow10 infpow10
+extern double pow10(int);
+extern vlong strtoll(const char*, char**, int);
+#define qsort infqsort
+extern void qsort(void*, long, long, int (*)(void*, void*));
+extern uvlong strtoull(const char*, char**, int);
+extern void sysfatal(char*, ...);
+extern int dec64(uchar*, int, char*, int);
+extern int enc64(char*, int, uchar*, int);
+extern int dec32(uchar*, int, char*, int);
+extern int enc32(char*, int, uchar*, int);
+extern int dec16(uchar*, int, char*, int);
+extern int enc16(char*, int, uchar*, int);
+extern int encodefmt(Fmt*);
+
+/*
+ * synchronization
+ */
+typedef
+struct Lock {
+ int val;
+ int pid;
+} Lock;
+
+extern int _tas(int*);
+
+extern void lock(Lock*);
+extern void unlock(Lock*);
+extern int canlock(Lock*);
+
+typedef struct QLock QLock;
+struct QLock
+{
+ Lock use; /* to access Qlock structure */
+ Proc *head; /* next process waiting for object */
+ Proc *tail; /* last process waiting for object */
+ int locked; /* flag */
+};
+
+extern void qlock(QLock*);
+extern void qunlock(QLock*);
+extern int canqlock(QLock*);
+extern void _qlockinit(ulong (*)(ulong, ulong)); /* called only by the thread library */
+
+typedef
+struct RWLock
+{
+ Lock l; /* Lock modify lock */
+ QLock x; /* Mutual exclusion lock */
+ QLock k; /* Lock for waiting writers */
+ int readers; /* Count of readers in lock */
+} RWLock;
+
+extern int canrlock(RWLock*);
+extern int canwlock(RWLock*);
+extern void rlock(RWLock*);
+extern void runlock(RWLock*);
+extern void wlock(RWLock*);
+extern void wunlock(RWLock*);
+
+/*
+ * network dialing
+ */
+#define NETPATHLEN 40
+
+/*
+ * system calls
+ *
+ */
+#define STATMAX 65535U /* max length of machine-independent stat structure */
+#define DIRMAX (sizeof(Dir)+STATMAX) /* max length of Dir structure */
+#define ERRMAX 128 /* max length of error string */
+
+#define MORDER 0x0003 /* mask for bits defining order of mounting */
+#define MREPL 0x0000 /* mount replaces object */
+#define MBEFORE 0x0001 /* mount goes before others in union directory */
+#define MAFTER 0x0002 /* mount goes after others in union directory */
+#define MCREATE 0x0004 /* permit creation in mounted directory */
+#define MCACHE 0x0010 /* cache some data */
+#define MMASK 0x0017 /* all bits on */
+
+#define OREAD 0 /* open for read */
+#define OWRITE 1 /* write */
+#define ORDWR 2 /* read and write */
+#define OEXEC 3 /* execute, == read but check execute permission */
+#define OTRUNC 16 /* or'ed in (except for exec), truncate file first */
+#define OCEXEC 32 /* or'ed in, close on exec */
+#define ORCLOSE 64 /* or'ed in, remove on close */
+#define OEXCL 0x1000 /* or'ed in, exclusive use (create only) */
+
+#define AEXIST 0 /* accessible: exists */
+#define AEXEC 1 /* execute access */
+#define AWRITE 2 /* write access */
+#define AREAD 4 /* read access */
+
+/* bits in Qid.type */
+#define QTDIR 0x80 /* type bit for directories */
+#define QTAPPEND 0x40 /* type bit for append only files */
+#define QTEXCL 0x20 /* type bit for exclusive use files */
+#define QTMOUNT 0x10 /* type bit for mounted channel */
+#define QTAUTH 0x08 /* type bit for authentication file */
+#define QTFILE 0x00 /* plain file */
+
+/* bits in Dir.mode */
+#define DMDIR 0x80000000 /* mode bit for directories */
+#define DMAPPEND 0x40000000 /* mode bit for append only files */
+#define DMEXCL 0x20000000 /* mode bit for exclusive use files */
+#define DMMOUNT 0x10000000 /* mode bit for mounted channel */
+#define DMAUTH 0x08000000 /* mode bit for authentication file */
+#define DMREAD 0x4 /* mode bit for read permission */
+#define DMWRITE 0x2 /* mode bit for write permission */
+#define DMEXEC 0x1 /* mode bit for execute permission */
+
+typedef
+struct Qid
+{
+ uvlong path;
+ ulong vers;
+ uchar type;
+} Qid;
+
+typedef
+struct Dir {
+ /* system-modified data */
+ ushort type; /* server type */
+ uint dev; /* server subtype */
+ /* file data */
+ Qid qid; /* unique id from server */
+ ulong mode; /* permissions */
+ ulong atime; /* last read time */
+ ulong mtime; /* last write time */
+ vlong length; /* file length */
+ char *name; /* last element of path */
+ char *uid; /* owner name */
+ char *gid; /* group name */
+ char *muid; /* last modifier name */
+} Dir;
+
+extern Dir* dirstat(char*);
+extern Dir* dirfstat(int);
+extern int dirwstat(char*, Dir*);
+extern int dirfwstat(int, Dir*);
+extern long dirread(int, Dir**);
+extern void nulldir(Dir*);
+extern long dirreadall(int, Dir**);
+
+typedef
+struct Waitmsg
+{
+ int pid; /* of loved one */
+ ulong time[3]; /* of loved one & descendants */
+ char *msg;
+} Waitmsg;
+
+extern void _exits(char*);
+
+extern void exits(char*);
+extern int create(char*, int, int);
+extern int errstr(char*, uint);
+
+extern void perror(const char*);
+extern long readn(int, void*, long);
+extern int remove(const char*);
+extern void rerrstr(char*, uint);
+extern vlong seek(int, vlong, int);
+extern void werrstr(char*, ...);
+
+extern char *argv0;
+#define ARGBEGIN for((argv0||(argv0=*argv)),argv++,argc--;\
+ argv[0] && argv[0][0]=='-' && argv[0][1];\
+ argc--, argv++) {\
+ char *_args, *_argt;\
+ Rune _argc;\
+ _args = &argv[0][1];\
+ if(_args[0]=='-' && _args[1]==0){\
+ argc--; argv++; break;\
+ }\
+ _argc = 0;\
+ while(*_args && (_args += chartorune(&_argc, _args)))\
+ switch(_argc)
+#define ARGEND SET(_argt);USED(_argt);USED(_argc); USED(_args);}USED(argv); USED(argc);
+#define ARGF() (_argt=_args, _args="",\
+ (*_argt? _argt: argv[1]? (argc--, *++argv): 0))
+#define EARGF(x) (_argt=_args, _args="",\
+ (*_argt? _argt: argv[1]? (argc--, *++argv): ((x), abort(), (char*)0)))
+
+#define ARGC() _argc
+
+/*
+ * Extensions for Inferno to basic libc.h
+ */
+
+#define setbinmode()
+
--- /dev/null
+++ b/NOTICE
@@ -1,0 +1,32 @@
+This Inferno® distribution includes software from various sources and
+different portions are therefore subject to different licence terms.
+The most stringent is the GNU Public License (version 2), which governs the collection.
+Individual components might have their own NOTICE and licence files (LICENCE
+or COPYING) that cover their content. All of them allow modification and redistribution.
+They are all compatible with the GPLv2.
+
+The following copyright notice covers the contents of this
+distribution unless otherwise specified by a given file, directory, or
+directory tree:
+
+Inferno® Copyright © 1996-1999 Lucent Technologies Inc. All rights reserved.
+Inferno revisions Copyright © 1997-1999 Vita Nuova Limited. All rights reserved.
+Inferno revisions Copyright © 2000-2015 Vita Nuova Holdings Limited. All rights reserved.
+Inferno new material Copyright © 2000-2015 Vita Nuova Holdings Limited. All rights reserved.
+
+Inferno, Styx, Dis and Limbo are registered trademarks of Vita Nuova Holdings Limited in the USA and other countries.
+Plan 9 is a registered trademark of Lucent Technologies Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License (`GPL') as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
binary files /dev/null b/Nt/386/bin/awk.exe differ
binary files /dev/null b/Nt/386/bin/c2l.exe differ
binary files /dev/null b/Nt/386/bin/cat.exe differ
binary files /dev/null b/Nt/386/bin/cp.exe differ
binary files /dev/null b/Nt/386/bin/data2c.exe differ
binary files /dev/null b/Nt/386/bin/echo.exe differ
binary files /dev/null b/Nt/386/bin/format.exe differ
binary files /dev/null b/Nt/386/bin/gzip.exe differ
binary files /dev/null b/Nt/386/bin/infdb.exe differ
binary files /dev/null b/Nt/386/bin/iyacc.exe differ
binary files /dev/null b/Nt/386/bin/mk.exe differ
binary files /dev/null b/Nt/386/bin/mkdir.exe differ
binary files /dev/null b/Nt/386/bin/mkext.exe differ
binary files /dev/null b/Nt/386/bin/mv.exe differ
binary files /dev/null b/Nt/386/bin/rcsh.exe differ
binary files /dev/null b/Nt/386/bin/rm.exe differ
binary files /dev/null b/Nt/386/bin/sed.exe differ
binary files /dev/null b/Nt/386/bin/test.exe differ
binary files /dev/null b/Nt/386/bin/tr.exe differ
--- /dev/null
+++ b/Nt/386/include/emu.h
@@ -1,0 +1,24 @@
+/*
+ * system- and machine-specific declarations for emu:
+ * floating-point save and restore, signal handling primitive, and
+ * implementation of the current-process variable `up'.
+ */
+
+/*
+ * This structure must agree with FPsave and FPrestore asm routines
+ */
+typedef struct FPU FPU;
+struct FPU
+{
+ uchar env[28];
+};
+
+extern void sleep(int);
+
+/* Set up private thread space */
+extern __declspec(thread) Proc* up;
+#define Sleep NTsleep
+
+typedef jmp_buf osjmpbuf;
+#define ossetjmp(buf) setjmp(buf)
+
--- /dev/null
+++ b/Nt/386/include/lib9.h
@@ -1,0 +1,496 @@
+#define _POSIX_SOURCE
+#include <stdlib.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <string.h>
+#include "math.h"
+#include <fcntl.h>
+#include <setjmp.h>
+#include <float.h>
+#include <time.h>
+#include <process.h>
+#include <io.h>
+#include <direct.h>
+
+#define getwd infgetwd
+#define strtod infstrtod
+#define strtoll infstrtoll
+#define strtoull infstrtoull
+#ifndef INFERNO_KEEPENVIRON
+/* environ is perfectly legal as the name of a local, field name or struct, but windows redefines it */
+/* the extern char** environ is only needed by two programs, so #undef it for everything else */
+#undef environ
+#endif
+
+/* do-it-yourself isinf and isnan */
+#ifndef isnan
+#define isnan(x) _isnan(x)
+#endif
+#ifndef isinf
+#define isinf(x) (!_finite(x))
+#endif
+
+#ifndef EMU
+typedef struct Proc Proc;
+#endif
+
+/*
+ * math module dtoa
+ */
+#define __LITTLE_ENDIAN
+
+ /* there must be a Win32 header macro for endian-ness!!! */
+
+/*
+ * disable various silly warnings
+ * 4018 signed/unsigned comparison
+ * 4245 signed/unsigned conversion
+ * 4244 long to char conversion
+ * 4068 unknown pragma
+ * 4090 different volatile quals
+ * 4554 operator precedence
+ * 4146 unary - on unsigned type
+ * 4996 `deprecated' functions: they often suggest non-portable replacements
+ */
+#pragma warning( disable : 4305 4244 4102 4761 4018 4245 4244 4068 4090 4554 4146 4996)
+
+#define nil ((void*)0)
+
+typedef unsigned char uchar;
+typedef unsigned int uint;
+typedef unsigned long ulong;
+typedef signed char schar;
+typedef unsigned short ushort;
+typedef unsigned int Rune;
+typedef __int64 vlong;
+typedef unsigned __int64 uvlong;
+typedef unsigned int u32int;
+typedef uvlong u64int;
+
+typedef unsigned int mpdigit; /* for /sys/include/mp.h */
+typedef unsigned short u16int;
+typedef unsigned char u8int;
+typedef unsigned long uintptr;
+
+typedef signed char int8;
+typedef unsigned char uint8;
+typedef short int16;
+typedef unsigned short uint16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+
+#define USED(x) if(x){}else{}
+#define SET(x)
+
+#undef nelem
+#define nelem(x) (sizeof(x)/sizeof((x)[0]))
+#undef offsetof
+#define offsetof(s, m) (ulong)(&(((s*)0)->m))
+#undef assert
+#define assert(x) if(x){}else _assert("x")
+
+/*
+ * most mem and string routines are declared by ANSI/POSIX files above
+ */
+
+extern char* strecpy(char*, char*, char*);
+extern char* strdup(const char*);
+extern int cistrncmp(char*, char*, int);
+extern int cistrcmp(char*, char*);
+extern char* cistrstr(char*, char*);
+extern int tokenize(char*, char**, int);
+extern double strtod(const char*, char**);
+extern vlong strtoll(const char*, char**, int);
+#define qsort infqsort
+extern void qsort(void*, long, long, int (*)(void*, void*));
+extern uvlong strtoull(const char*, char**, int);
+
+enum
+{
+ UTFmax = 4, /* maximum bytes per rune */
+ Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
+ Runeself = 0x80, /* rune and UTF sequences are the same (<) */
+ Runeerror = 0xFFFD, /* decoding error in UTF */
+ Runemax = 0x10FFFF, /* 21-bit rune */
+ Runemask = 0x1FFFFF, /* bits used by runes (see grep) */
+};
+
+/*
+ * rune routines
+ */
+extern int runetochar(char*, Rune*);
+extern int chartorune(Rune*, char*);
+extern int runelen(long);
+extern int runenlen(Rune*, int);
+extern int fullrune(char*, int);
+extern int utflen(char*);
+extern int utfnlen(char*, long);
+extern char* utfrune(char*, long);
+extern char* utfrrune(char*, long);
+extern char* utfutf(char*, char*);
+extern char* utfecpy(char*, char*, char*);
+
+extern Rune* runestrcat(Rune*, Rune*);
+extern Rune* runestrchr(Rune*, Rune);
+extern int runestrcmp(Rune*, Rune*);
+extern Rune* runestrcpy(Rune*, Rune*);
+extern Rune* runestrncpy(Rune*, Rune*, long);
+extern Rune* runestrecpy(Rune*, Rune*, Rune*);
+extern Rune* runestrdup(Rune*);
+extern Rune* runestrncat(Rune*, Rune*, long);
+extern int runestrncmp(Rune*, Rune*, long);
+extern Rune* runestrrchr(Rune*, Rune);
+extern long runestrlen(Rune*);
+extern Rune* runestrstr(Rune*, Rune*);
+
+extern Rune tolowerrune(Rune);
+extern Rune totitlerune(Rune);
+extern Rune toupperrune(Rune);
+extern int isalpharune(Rune);
+extern int islowerrune(Rune);
+extern int isspacerune(Rune);
+extern int istitlerune(Rune);
+extern int isupperrune(Rune);
+
+/*
+ * malloc
+ */
+extern void* malloc(size_t);
+extern void* mallocz(ulong, int);
+extern void free(void*);
+extern ulong msize(void*);
+extern void* calloc(size_t, size_t);
+extern void* realloc(void*, size_t);
+extern void setmalloctag(void*, ulong);
+extern void setrealloctag(void*, ulong);
+extern ulong getmalloctag(void*);
+extern ulong getrealloctag(void*);
+extern void* malloctopoolblock(void*);
+
+/*
+ * print routines
+ */
+typedef struct Fmt Fmt;
+struct Fmt{
+ uchar runes; /* output buffer is runes or chars? */
+ void *start; /* of buffer */
+ void *to; /* current place in the buffer */
+ void *stop; /* end of the buffer; overwritten if flush fails */
+ int (*flush)(Fmt *); /* called when to == stop */
+ void *farg; /* to make flush a closure */
+ int nfmt; /* num chars formatted so far */
+ va_list args; /* args passed to dofmt */
+ int r; /* % format Rune */
+ int width;
+ int prec;
+ ulong flags;
+};
+
+enum{
+ FmtWidth = 1,
+ FmtLeft = FmtWidth << 1,
+ FmtPrec = FmtLeft << 1,
+ FmtSharp = FmtPrec << 1,
+ FmtSpace = FmtSharp << 1,
+ FmtSign = FmtSpace << 1,
+ FmtZero = FmtSign << 1,
+ FmtUnsigned = FmtZero << 1,
+ FmtShort = FmtUnsigned << 1,
+ FmtLong = FmtShort << 1,
+ FmtVLong = FmtLong << 1,
+ FmtComma = FmtVLong << 1,
+ FmtByte = FmtComma << 1,
+
+ FmtFlag = FmtByte << 1
+};
+
+extern int print(char*, ...);
+extern char* seprint(char*, char*, char*, ...);
+extern char* vseprint(char*, char*, char*, va_list);
+extern int snprint(char*, int, char*, ...);
+extern int vsnprint(char*, int, char*, va_list);
+extern char* smprint(char*, ...);
+extern char* vsmprint(char*, va_list);
+extern int sprint(char*, char*, ...);
+extern int fprint(int, char*, ...);
+extern int vfprint(int, char*, va_list);
+
+extern int runesprint(Rune*, char*, ...);
+extern int runesnprint(Rune*, int, char*, ...);
+extern int runevsnprint(Rune*, int, char*, va_list);
+extern Rune* runeseprint(Rune*, Rune*, char*, ...);
+extern Rune* runevseprint(Rune*, Rune*, char*, va_list);
+extern Rune* runesmprint(char*, ...);
+extern Rune* runevsmprint(char*, va_list);
+
+extern int fmtfdinit(Fmt*, int, char*, int);
+extern int fmtfdflush(Fmt*);
+extern int fmtstrinit(Fmt*);
+extern char* fmtstrflush(Fmt*);
+extern int runefmtstrinit(Fmt*);
+extern Rune* runefmtstrflush(Fmt*);
+
+extern int fmtinstall(int, int (*)(Fmt*));
+extern int dofmt(Fmt*, char*);
+extern int dorfmt(Fmt*, Rune*);
+extern int fmtprint(Fmt*, char*, ...);
+extern int fmtvprint(Fmt*, char*, va_list);
+extern int fmtrune(Fmt*, int);
+extern int fmtstrcpy(Fmt*, char*);
+extern int fmtrunestrcpy(Fmt*, Rune*);
+/*
+ * error string for %r
+ * supplied on per os basis, not part of fmt library
+ */
+extern int errfmt(Fmt *f);
+
+/*
+ * quoted strings
+ */
+extern char *unquotestrdup(char*);
+extern Rune *unquoterunestrdup(Rune*);
+extern char *quotestrdup(char*);
+extern Rune *quoterunestrdup(Rune*);
+extern int quotestrfmt(Fmt*);
+extern int quoterunestrfmt(Fmt*);
+extern void quotefmtinstall(void);
+extern int (*doquote)(int);
+
+/*
+ * random number
+ */
+extern ulong truerand(void);
+extern ulong ntruerand(ulong);
+
+/*
+ * math
+ */
+extern int isNaN(double);
+extern int isInf(double, int);
+
+#define PIO2 1.570796326794896619231e0
+#define PI (PIO2+PIO2)
+
+/*
+ * Time-of-day
+ */
+
+typedef struct Tm Tm;
+struct Tm {
+ int sec;
+ int min;
+ int hour;
+ int mday;
+ int mon;
+ int year;
+ int wday;
+ int yday;
+ char zone[4];
+ int tzoff;
+};
+extern vlong osnsec(void);
+#define nsec osnsec
+
+/*
+ * one-of-a-kind
+ */
+extern void _assert(char*);
+extern double charstod(int(*)(void*), void*);
+extern char* cleanname(char*);
+extern uintptr getcallerpc(void*);
+extern int getfields(char*, char**, int, int, char*);
+extern char* getuser(void);
+extern char* getuser(void);
+extern char* getwd(char*, int);
+extern char* getwd(char*, int);
+extern double ipow10(int);
+extern double pow10(int);
+extern void sysfatal(char*, ...);
+extern int dec64(uchar*, int, char*, int);
+extern int enc64(char*, int, uchar*, int);
+extern int dec32(uchar*, int, char*, int);
+extern int enc32(char*, int, uchar*, int);
+extern int dec16(uchar*, int, char*, int);
+extern int enc16(char*, int, uchar*, int);
+extern int encodefmt(Fmt*);
+
+/*
+ * synchronization
+ */
+typedef
+struct Lock {
+ int val;
+ int pid;
+} Lock;
+
+extern int _tas(int*);
+
+extern void lock(Lock*);
+extern void unlock(Lock*);
+extern int canlock(Lock*);
+
+typedef struct QLock QLock;
+struct QLock
+{
+ Lock use; /* to access Qlock structure */
+ Proc *head; /* next process waiting for object */
+ Proc *tail; /* last process waiting for object */
+ int locked; /* flag */
+};
+
+extern void qlock(QLock*);
+extern void qunlock(QLock*);
+extern int canqlock(QLock*);
+extern void _qlockinit(ulong (*)(ulong, ulong)); /* called only by the thread library */
+
+typedef
+struct RWLock
+{
+ Lock l; /* Lock modify lock */
+ QLock x; /* Mutual exclusion lock */
+ QLock k; /* Lock for waiting writers */
+ int readers; /* Count of readers in lock */
+} RWLock;
+
+extern int canrlock(RWLock*);
+extern int canwlock(RWLock*);
+extern void rlock(RWLock*);
+extern void runlock(RWLock*);
+extern void wlock(RWLock*);
+extern void wunlock(RWLock*);
+
+/*
+ * network dialing
+ */
+#define NETPATHLEN 40
+
+/*
+ * system calls
+ *
+ */
+#define STATMAX 65535U /* max length of machine-independent stat structure */
+#define DIRMAX (sizeof(Dir)+STATMAX) /* max length of Dir structure */
+#define ERRMAX 128 /* max length of error string */
+
+#define MORDER 0x0003 /* mask for bits defining order of mounting */
+#define MREPL 0x0000 /* mount replaces object */
+#define MBEFORE 0x0001 /* mount goes before others in union directory */
+#define MAFTER 0x0002 /* mount goes after others in union directory */
+#define MCREATE 0x0004 /* permit creation in mounted directory */
+#define MCACHE 0x0010 /* cache some data */
+#define MMASK 0x0017 /* all bits on */
+
+#define OREAD 0 /* open for read */
+#define OWRITE 1 /* write */
+#define ORDWR 2 /* read and write */
+#define OEXEC 3 /* execute, == read but check execute permission */
+#define OTRUNC 16 /* or'ed in (except for exec), truncate file first */
+#define OCEXEC 32 /* or'ed in, close on exec */
+#define ORCLOSE 64 /* or'ed in, remove on close */
+#define OEXCL 0x1000 /* or'ed in, exclusive use (create only) */
+
+#define AEXIST 0 /* accessible: exists */
+#define AEXEC 1 /* execute access */
+#define AWRITE 2 /* write access */
+#define AREAD 4 /* read access */
+
+/* bits in Qid.type */
+#define QTDIR 0x80 /* type bit for directories */
+#define QTAPPEND 0x40 /* type bit for append only files */
+#define QTEXCL 0x20 /* type bit for exclusive use files */
+#define QTMOUNT 0x10 /* type bit for mounted channel */
+#define QTAUTH 0x08 /* type bit for authentication file */
+#define QTFILE 0x00 /* plain file */
+
+/* bits in Dir.mode */
+#define DMDIR 0x80000000 /* mode bit for directories */
+#define DMAPPEND 0x40000000 /* mode bit for append only files */
+#define DMEXCL 0x20000000 /* mode bit for exclusive use files */
+#define DMMOUNT 0x10000000 /* mode bit for mounted channel */
+#define DMAUTH 0x08000000 /* mode bit for authentication file */
+#define DMREAD 0x4 /* mode bit for read permission */
+#define DMWRITE 0x2 /* mode bit for write permission */
+#define DMEXEC 0x1 /* mode bit for execute permission */
+
+typedef
+struct Qid
+{
+ uvlong path;
+ ulong vers;
+ uchar type;
+} Qid;
+
+typedef
+struct Dir {
+ /* system-modified data */
+ ushort type; /* server type */
+ uint dev; /* server subtype */
+ /* file data */
+ Qid qid; /* unique id from server */
+ ulong mode; /* permissions */
+ ulong atime; /* last read time */
+ ulong mtime; /* last write time */
+ vlong length; /* file length */
+ char *name; /* last element of path */
+ char *uid; /* owner name */
+ char *gid; /* group name */
+ char *muid; /* last modifier name */
+} Dir;
+
+extern Dir* dirstat(char*);
+extern Dir* dirfstat(int);
+extern int dirwstat(char*, Dir*);
+extern int dirfwstat(int, Dir*);
+extern long dirread(int, Dir**);
+extern void nulldir(Dir*);
+extern long dirreadall(int, Dir**);
+
+typedef
+struct Waitmsg
+{
+ int pid; /* of loved one */
+ ulong time[3]; /* of loved one & descendants */
+ char *msg;
+} Waitmsg;
+
+extern void _exits(char*);
+
+extern void exits(char*);
+extern int create(char*, int, int);
+extern int errstr(char*, uint);
+
+extern long readn(int, void*, long);
+extern void rerrstr(char*, uint);
+extern vlong seek(int, vlong, int);
+extern int segflush(void*, ulong);
+extern void werrstr(char*, ...);
+
+extern char *argv0;
+#define ARGBEGIN for((argv0||(argv0=*argv)),argv++,argc--;\
+ argv[0] && argv[0][0]=='-' && argv[0][1];\
+ argc--, argv++) {\
+ char *_args, *_argt;\
+ Rune _argc;\
+ _args = &argv[0][1];\
+ if(_args[0]=='-' && _args[1]==0){\
+ argc--; argv++; break;\
+ }\
+ _argc = 0;\
+ while(*_args && (_args += chartorune(&_argc, _args)))\
+ switch(_argc)
+#define ARGEND (_argt=0);USED(_argt);USED(_argc); USED(_args);}USED(argv); USED(argc);
+#define ARGF() (_argt=_args, _args="",\
+ (*_argt? _argt: argv[1]? (argc--, *++argv): 0))
+#define EARGF(x) (_argt=_args, _args="",\
+ (*_argt? _argt: argv[1]? (argc--, *++argv): ((x), abort(), (char*)0)))
+
+#define ARGC() _argc
+
+/*
+ * Extensions for Inferno to basic libc.h
+ */
+
+extern void setbinmode(void);
+extern void* sbrk(int);
--- /dev/null
+++ b/bitbucket-pipelines.yml
@@ -1,0 +1,10 @@
+image: i386/gcc:6.1
+
+pipelines:
+ default:
+ - step:
+ script:
+ - PATH=$PATH:$PWD/Linux/386/bin MKFLAGS='SYSHOST=Linux OBJTYPE=386 ROOT='$PWD
+ - mk $MKFLAGS mkdirs
+ - mk $MKFLAGS emuinstall
+ - emu cat /dev/sysctl || echo ' -' exited with status $? '(ignored)'
--- /dev/null
+++ b/include/NOTICE
@@ -1,0 +1,29 @@
+This copyright NOTICE applies to all files in this directory and
+subdirectories, unless another copyright notice appears in a given
+file or subdirectory. If you take substantial code from this software to use in
+other programs, you must somehow include with it an appropriate
+copyright notice that includes the copyright notice and the other
+notices below. It is fine (and often tidier) to do that in a separate
+file such as NOTICE, LICENCE or COPYING.
+
+ Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
+ Revisions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved.
+
+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.
+
--- /dev/null
+++ b/include/a.out.h
@@ -1,0 +1,1 @@
+#include "../utils/include/a.out.h"
--- /dev/null
+++ b/include/bio.h
@@ -1,0 +1,69 @@
+#pragma src "/usr/inferno/libbio"
+
+typedef struct Biobuf Biobuf;
+
+enum
+{
+ Bsize = 8*1024,
+ Bungetsize = UTFmax+1, /* space for ungetc */
+ Bmagic = 0x314159,
+ Beof = -1,
+ Bbad = -2,
+
+ Binactive = 0, /* states */
+ Bractive,
+ Bwactive,
+ Bracteof,
+
+ Bend
+};
+
+struct Biobuf
+{
+ int icount; /* neg num of bytes at eob */
+ int ocount; /* num of bytes at bob */
+ int rdline; /* num of bytes after rdline */
+ int runesize; /* num of bytes of last getrune */
+ int state; /* r/w/inactive */
+ int fid; /* open file */
+ int flag; /* magic if malloc'ed */
+ vlong offset; /* offset of buffer in file */
+ int bsize; /* size of buffer */
+ uchar* bbuf; /* pointer to beginning of buffer */
+ uchar* ebuf; /* pointer to end of buffer */
+ uchar* gbuf; /* pointer to good data in buf */
+ uchar b[Bungetsize+Bsize];
+};
+
+/* Dregs, redefined as functions for backwards compatibility */
+#define BGETC(bp) Bgetc(bp)
+#define BPUTC(bp,c) Bputc(bp,c)
+#define BOFFSET(bp) Boffset(bp)
+#define BLINELEN(bp) Blinelen(bp)
+#define BFILDES(bp) Bfildes(bp)
+
+int Bbuffered(Biobuf*);
+int Bfildes(Biobuf*);
+int Bflush(Biobuf*);
+int Bgetc(Biobuf*);
+int Bgetd(Biobuf*, double*);
+long Bgetrune(Biobuf*);
+int Binit(Biobuf*, int, int);
+int Binits(Biobuf*, int, int, uchar*, int);
+int Blinelen(Biobuf*);
+vlong Boffset(Biobuf*);
+Biobuf* Bopen(char*, int);
+int Bprint(Biobuf*, char*, ...);
+int Bvprint(Biobuf*, char*, va_list);
+int Bputc(Biobuf*, int);
+int Bputrune(Biobuf*, long);
+void* Brdline(Biobuf*, int);
+char* Brdstr(Biobuf*, int, int);
+long Bread(Biobuf*, void*, long);
+vlong Bseek(Biobuf*, vlong, int);
+int Bterm(Biobuf*);
+int Bungetc(Biobuf*);
+int Bungetrune(Biobuf*);
+long Bwrite(Biobuf*, void*, long);
+
+#pragma varargck argpos Bprint 2
--- /dev/null
+++ b/include/cursor.h
@@ -1,0 +1,19 @@
+/*
+ * This is a separate file because image.h cannot be
+ * included in many of the graphics drivers due to
+ * name conflicts
+ */
+
+typedef struct Drawcursor Drawcursor;
+struct Drawcursor
+{
+ int hotx;
+ int hoty;
+ int minx;
+ int miny;
+ int maxx;
+ int maxy;
+ uchar* data;
+};
+
+void drawcursor(Drawcursor*);
--- /dev/null
+++ b/include/draw.h
@@ -1,0 +1,552 @@
+#pragma src "/usr/inferno/libdraw"
+
+#pragma varargck argpos _drawprint 2
+
+typedef struct Cachefont Cachefont;
+typedef struct Cacheinfo Cacheinfo;
+typedef struct Cachesubf Cachesubf;
+typedef struct Display Display;
+typedef struct Font Font;
+typedef struct Fontchar Fontchar;
+typedef struct Image Image;
+typedef struct Mouse Mouse;
+typedef struct Point Point;
+typedef struct Rectangle Rectangle;
+typedef struct RGB RGB;
+typedef struct Refreshq Refreshq;
+typedef struct Screen Screen;
+typedef struct Subfont Subfont;
+
+#pragma varargck type "R" Rectangle
+#pragma varargck type "P" Point
+extern int Rfmt(Fmt*);
+extern int Pfmt(Fmt*);
+
+enum
+{
+ DOpaque = 0xFFFFFFFF,
+ DTransparent = 0x00000000, /* only useful for allocimage, memfillcolor */
+ DBlack = 0x000000FF,
+ DWhite = 0xFFFFFFFF,
+ DRed = 0xFF0000FF,
+ DGreen = 0x00FF00FF,
+ DBlue = 0x0000FFFF,
+ DCyan = 0x00FFFFFF,
+ DMagenta = 0xFF00FFFF,
+ DYellow = 0xFFFF00FF,
+ DPaleyellow = 0xFFFFAAFF,
+ DDarkyellow = 0xEEEE9EFF,
+ DDarkgreen = 0x448844FF,
+ DPalegreen = 0xAAFFAAFF,
+ DMedgreen = 0x88CC88FF,
+ DDarkblue = 0x000055FF,
+ DPalebluegreen= 0xAAFFFFFF,
+ DPaleblue = 0x0000BBFF,
+ DBluegreen = 0x008888FF,
+ DGreygreen = 0x55AAAAFF,
+ DPalegreygreen = 0x9EEEEEFF,
+ DYellowgreen = 0x99994CFF,
+ DMedblue = 0x000099FF,
+ DGreyblue = 0x005DBBFF,
+ DPalegreyblue = 0x4993DDFF,
+ DPurpleblue = 0x8888CCFF,
+
+ DNotacolor = 0xFFFFFF00,
+ DNofill = DNotacolor,
+
+};
+
+enum
+{
+ Displaybufsize = 8000,
+ ICOSSCALE = 1024,
+ Borderwidth = 4,
+};
+
+enum
+{
+ /* refresh methods */
+ Refbackup = 0,
+ Refnone = 1,
+ Refmesg = 2
+};
+#define NOREFRESH ((void*)-1)
+
+enum
+{
+ /* line ends */
+ Endsquare = 0,
+ Enddisc = 1,
+ Endarrow = 2,
+ Endmask = 0x1F
+};
+
+#define ARROW(a, b, c) (Endarrow|((a)<<5)|((b)<<14)|((c)<<23))
+
+/*
+ * image channel descriptors
+ */
+enum {
+ CRed = 0,
+ CGreen,
+ CBlue,
+ CGrey,
+ CAlpha,
+ CMap,
+ CIgnore,
+ NChan,
+};
+
+#define __DC(type, nbits) ((((type)&15)<<4)|((nbits)&15))
+#define CHAN1(a,b) __DC(a,b)
+#define CHAN2(a,b,c,d) (CHAN1((a),(b))<<8|__DC((c),(d)))
+#define CHAN3(a,b,c,d,e,f) (CHAN2((a),(b),(c),(d))<<8|__DC((e),(f)))
+#define CHAN4(a,b,c,d,e,f,g,h) (CHAN3((a),(b),(c),(d),(e),(f))<<8|__DC((g),(h)))
+
+#define NBITS(c) ((c)&15)
+#define TYPE(c) (((c)>>4)&15)
+
+enum {
+ GREY1 = CHAN1(CGrey, 1),
+ GREY2 = CHAN1(CGrey, 2),
+ GREY4 = CHAN1(CGrey, 4),
+ GREY8 = CHAN1(CGrey, 8),
+ CMAP8 = CHAN1(CMap, 8),
+ RGB15 = CHAN4(CIgnore, 1, CRed, 5, CGreen, 5, CBlue, 5),
+ RGB16 = CHAN3(CRed, 5, CGreen, 6, CBlue, 5),
+ RGB24 = CHAN3(CRed, 8, CGreen, 8, CBlue, 8),
+ RGBA32 = CHAN4(CRed, 8, CGreen, 8, CBlue, 8, CAlpha, 8),
+ ARGB32 = CHAN4(CAlpha, 8, CRed, 8, CGreen, 8, CBlue, 8), /* stupid VGAs */
+ XRGB32 = CHAN4(CIgnore, 8, CRed, 8, CGreen, 8, CBlue, 8),
+ BGR24 = CHAN3(CBlue, 8, CGreen, 8, CRed, 8),
+ ABGR32 = CHAN4(CAlpha, 8, CBlue, 8, CGreen, 8, CRed, 8),
+ XBGR32 = CHAN4(CIgnore, 8, CBlue, 8, CGreen, 8, CRed, 8),
+};
+
+/* compositing operators */
+
+typedef enum
+{
+ SinD = 1<<3,
+ DinS = 1<<2,
+ SoutD = 1<<1,
+ DoutS = 1 <<0,
+
+ S = SinD|SoutD,
+ SoverD = SinD|SoutD|DoutS,
+ SatopD = SinD|DoutS,
+ SxorD = SoutD|DoutS,
+
+ D = DinS|DoutS,
+ DoverS = DinS|DoutS|SoutD,
+ DatopS = DinS|SoutD,
+ DxorS = DoutS|SoutD,
+
+ Clear = 0,
+
+ Ncomp = 12,
+} Drawop;
+
+extern char* chantostr(char*, ulong);
+extern ulong strtochan(char*);
+extern int chantodepth(ulong);
+
+struct Point
+{
+ int x;
+ int y;
+};
+
+struct Rectangle
+{
+ Point min;
+ Point max;
+};
+
+typedef void (*Reffn)(Image*, Rectangle, void*);
+
+struct Screen
+{
+ Display *display; /* display holding data */
+ int id; /* id of system-held Screen */
+ Image *image; /* unused; for reference only */
+ Image *fill; /* color to paint behind windows */
+};
+
+struct Refreshq
+{
+ Reffn reffn;
+ void *refptr;
+ Rectangle r;
+ Refreshq *next;
+};
+
+struct Display
+{
+ void* qlock;
+ int locking; /*program is using lockdisplay */
+ int dirno;
+ void *datachan;
+ void *refchan;
+ void *ctlchan;
+ int imageid;
+ int local;
+ int depth;
+ ulong chan;
+ void (*error)(Display*, char*);
+ char *devdir;
+ char *windir;
+ char oldlabel[64];
+ ulong dataqid;
+ Image *white;
+ Image *black;
+ Image *image;
+ Image *opaque;
+ Image *transparent;
+ uchar buf[Displaybufsize+1]; /* +1 for flush message */
+ int bufsize;
+ uchar *bufp;
+ Font *defaultfont;
+ Subfont *defaultsubfont;
+ Image *windows;
+ void *limbo;
+ Refreshq *refhead;
+ Refreshq *reftail;
+};
+
+struct Image
+{
+ Display *display; /* display holding data */
+ int id; /* id of system-held Image */
+ Rectangle r; /* rectangle in data area, local coords */
+ Rectangle clipr; /* clipping region */
+ int depth; /* number of bits per pixel */
+ ulong chan;
+ int repl; /* flag: data replicates to tile clipr */
+ Screen *screen; /* 0 if not a window */
+ Image *next; /* next in list of windows */
+ Reffn reffn;
+ void *refptr;
+};
+
+struct RGB
+{
+ ulong red;
+ ulong green;
+ ulong blue;
+};
+
+/*
+ * Subfonts
+ *
+ * given char c, Subfont *f, Fontchar *i, and Point p, one says
+ * i = f->info+c;
+ * draw(b, Rect(p.x+i->left, p.y+i->top,
+ * p.x+i->left+((i+1)->x-i->x), p.y+i->bottom),
+ * color, f->bits, Pt(i->x, i->top));
+ * p.x += i->width;
+ * to draw characters in the specified color (itself an Image) in Image b.
+ */
+
+struct Fontchar
+{
+ int x; /* left edge of bits */
+ uchar top; /* first non-zero scan-line */
+ uchar bottom; /* last non-zero scan-line + 1 */
+ char left; /* offset of baseline */
+ uchar width; /* width of baseline */
+};
+
+struct Subfont
+{
+ char *name;
+ short n; /* number of chars in font */
+ uchar height; /* height of image */
+ char ascent; /* top of image to baseline */
+ Fontchar *info; /* n+1 character descriptors */
+ Image *bits; /* of font */
+ int ref;
+};
+
+enum
+{
+ /* starting values */
+ LOG2NFCACHE = 6,
+ NFCACHE = (1<<LOG2NFCACHE), /* #chars cached */
+ NFLOOK = 5, /* #chars to scan in cache */
+ NFSUBF = 2, /* #subfonts to cache */
+ /* max value */
+ MAXFCACHE = 1024+NFLOOK, /* upper limit */
+ MAXSUBF = 50, /* generous upper limit */
+ /* deltas */
+ DSUBF = 4,
+ /* expiry ages */
+ SUBFAGE = 10000,
+ CACHEAGE = 10000
+};
+
+struct Cachefont
+{
+ Rune min; /* lowest rune value to be taken from subfont */
+ Rune max; /* highest rune value+1 to be taken from subfont */
+ int offset; /* position in subfont of character at min */
+ char *name; /* stored in font */
+ char *subfontname; /* to access subfont */
+};
+
+struct Cacheinfo
+{
+ ushort x; /* left edge of bits */
+ uchar width; /* width of baseline */
+ schar left; /* offset of baseline */
+ Rune value; /* value of character at this slot in cache */
+ ushort age;
+};
+
+struct Cachesubf
+{
+ ulong age; /* for replacement */
+ Cachefont *cf; /* font info that owns us */
+ Subfont *f; /* attached subfont */
+};
+
+struct Font
+{
+ char *name;
+ Display *display;
+ short height; /* max height of image, interline spacing */
+ short ascent; /* top of image to baseline */
+ short width; /* widest so far; used in caching only */
+ short nsub; /* number of subfonts */
+ ulong age; /* increasing counter; used for LRU */
+ int maxdepth; /* maximum depth of all loaded subfonts */
+ int ncache; /* size of cache */
+ int nsubf; /* size of subfont list */
+ Cacheinfo *cache;
+ Cachesubf *subf;
+ Cachefont **sub; /* as read from file */
+ Image *cacheimage;
+};
+
+#define Dx(r) ((r).max.x-(r).min.x)
+#define Dy(r) ((r).max.y-(r).min.y)
+
+/*
+ * Image management
+ */
+extern Image* _allocimage(Image*, Display*, Rectangle, ulong, int, ulong, int, int);
+extern Image* allocimage(Display*, Rectangle, ulong, int, ulong);
+extern uchar* bufimage(Display*, int);
+extern int bytesperline(Rectangle, int);
+extern void closedisplay(Display*);
+extern void drawerror(Display*, char*);
+extern int _drawprint(int, char*, ...);
+extern int flushimage(Display*, int);
+extern int freeimage(Image*);
+extern int _freeimage1(Image*);
+extern int geninitdraw(char*, void(*)(Display*, char*), char*, char*, char*, int);
+extern int initdraw(void(*)(Display*, char*), char*, char*);
+extern Display* initdisplay(char*, char*, void(*)(Display*, char*));
+extern int loadimage(Image*, Rectangle, uchar*, int);
+extern int cloadimage(Image*, Rectangle, uchar*, int);
+extern int getwindow(Display*, int);
+extern int gengetwindow(Display*, char*, Image**, Screen**, int);
+extern Image* readimage(Display*, int, int);
+extern Image* creadimage(Display*, int, int);
+extern int unloadimage(Image*, Rectangle, uchar*, int);
+extern int wordsperline(Rectangle, int);
+extern int writeimage(int, Image*, int);
+extern Image* namedimage(Display*, char*);
+extern int nameimage(Image*, char*, int);
+extern Image* allocimagemix(Display*, ulong, ulong);
+
+/*
+ * Colors
+ */
+extern void readcolmap(Display*, RGB*);
+extern void writecolmap(Display*, RGB*);
+extern ulong setalpha(ulong, uchar);
+
+/*
+ * Windows
+ */
+extern Screen* allocscreen(Image*, Image*, int);
+extern Image* _allocwindow(Image*, Screen*, Rectangle, int, ulong);
+extern Image* allocwindow(Screen*, Rectangle, int, ulong);
+extern void bottomnwindows(Image**, int);
+extern void bottomwindow(Image*);
+extern int freescreen(Screen*);
+extern Screen* publicscreen(Display*, int, ulong);
+extern void topnwindows(Image**, int);
+extern void topwindow(Image*);
+extern int originwindow(Image*, Point, Point);
+
+/*
+ * Geometry
+ */
+extern Point Pt(int, int);
+extern Rectangle Rect(int, int, int, int);
+extern Rectangle Rpt(Point, Point);
+extern Point addpt(Point, Point);
+extern Point subpt(Point, Point);
+extern Point divpt(Point, int);
+extern Point mulpt(Point, int);
+extern int eqpt(Point, Point);
+extern int eqrect(Rectangle, Rectangle);
+extern Rectangle insetrect(Rectangle, int);
+extern Rectangle rectaddpt(Rectangle, Point);
+extern Rectangle rectsubpt(Rectangle, Point);
+extern Rectangle canonrect(Rectangle);
+extern int rectXrect(Rectangle, Rectangle);
+extern int rectinrect(Rectangle, Rectangle);
+extern void combinerect(Rectangle*, Rectangle);
+extern int rectclip(Rectangle*, Rectangle);
+extern int ptinrect(Point, Rectangle);
+extern void replclipr(Image*, int, Rectangle);
+extern int drawreplxy(int, int, int); /* used to be drawsetxy */
+extern Point drawrepl(Rectangle, Point);
+extern int rgb2cmap(int, int, int);
+extern int cmap2rgb(int);
+extern int cmap2rgba(int);
+extern void icossin(int, int*, int*);
+extern void icossin2(int, int, int*, int*);
+
+/*
+ * Graphics
+ */
+extern void draw(Image*, Rectangle, Image*, Image*, Point);
+extern void drawop(Image*, Rectangle, Image*, Image*, Point, Drawop);
+extern void gendraw(Image*, Rectangle, Image*, Point, Image*, Point);
+extern void gendrawop(Image*, Rectangle, Image*, Point, Image*, Point, Drawop);
+extern void line(Image*, Point, Point, int, int, int, Image*, Point);
+extern void lineop(Image*, Point, Point, int, int, int, Image*, Point, Drawop);
+extern void poly(Image*, Point*, int, int, int, int, Image*, Point);
+extern void polyop(Image*, Point*, int, int, int, int, Image*, Point, Drawop);
+extern void fillpoly(Image*, Point*, int, int, Image*, Point);
+extern void fillpolyop(Image*, Point*, int, int, Image*, Point, Drawop);
+extern Point string(Image*, Point, Image*, Point, Font*, char*);
+extern Point stringop(Image*, Point, Image*, Point, Font*, char*, Drawop);
+extern Point stringn(Image*, Point, Image*, Point, Font*, char*, int);
+extern Point stringnop(Image*, Point, Image*, Point, Font*, char*, int, Drawop);
+extern Point runestring(Image*, Point, Image*, Point, Font*, Rune*);
+extern Point runestringop(Image*, Point, Image*, Point, Font*, Rune*, Drawop);
+extern Point runestringn(Image*, Point, Image*, Point, Font*, Rune*, int);
+extern Point runestringnop(Image*, Point, Image*, Point, Font*, Rune*, int, Drawop);
+extern Point stringbg(Image*, Point, Image*, Point, Font*, char*, Image*, Point);
+extern Point stringbgop(Image*, Point, Image*, Point, Font*, char*, Image*, Point, Drawop);
+extern Point stringnbg(Image*, Point, Image*, Point, Font*, char*, int, Image*, Point);
+extern Point stringnbgop(Image*, Point, Image*, Point, Font*, char*, int, Image*, Point, Drawop);
+extern Point runestringbg(Image*, Point, Image*, Point, Font*, Rune*, Image*, Point);
+extern Point runestringbgop(Image*, Point, Image*, Point, Font*, Rune*, Image*, Point, Drawop);
+extern Point runestringnbg(Image*, Point, Image*, Point, Font*, Rune*, int, Image*, Point);
+extern Point runestringnbgop(Image*, Point, Image*, Point, Font*, Rune*, int, Image*, Point, Drawop);
+extern Point _string(Image*, Point, Image*, Point, Font*, char*, Rune*, int, Rectangle, Image*, Point, Drawop);
+extern Point stringsubfont(Image*, Point, Image*, Subfont*, char*);
+extern int bezier(Image*, Point, Point, Point, Point, int, int, int, Image*, Point);
+extern int bezierop(Image*, Point, Point, Point, Point, int, int, int, Image*, Point, Drawop);
+extern int bezspline(Image*, Point*, int, int, int, int, Image*, Point);
+extern int bezsplineop(Image*, Point*, int, int, int, int, Image*, Point, Drawop);
+extern int getbezsplinepts(Point*, int, Point**);
+extern int fillbezier(Image*, Point, Point, Point, Point, int, Image*, Point);
+extern int fillbezierop(Image*, Point, Point, Point, Point, int, Image*, Point, Drawop);
+extern int fillbezspline(Image*, Point*, int, int, Image*, Point);
+extern int fillbezsplineop(Image*, Point*, int, int, Image*, Point, Drawop);
+extern void ellipse(Image*, Point, int, int, int, Image*, Point);
+extern void ellipseop(Image*, Point, int, int, int, Image*, Point, Drawop);
+extern void fillellipse(Image*, Point, int, int, Image*, Point);
+extern void fillellipseop(Image*, Point, int, int, Image*, Point, Drawop);
+extern void arc(Image*, Point, int, int, int, Image*, Point, int, int);
+extern void arcop(Image*, Point, int, int, int, Image*, Point, int, int, Drawop);
+extern void fillarc(Image*, Point, int, int, Image*, Point, int, int);
+extern void fillarcop(Image*, Point, int, int, Image*, Point, int, int, Drawop);
+extern void border(Image*, Rectangle, int, Image*, Point);
+extern void borderop(Image*, Rectangle, int, Image*, Point, Drawop);
+
+/*
+ * Font management
+ */
+extern Font* openfont(Display*, char*);
+extern Font* buildfont(Display*, char*, char*);
+extern void freefont(Font*);
+extern Font* mkfont(Subfont*, Rune);
+extern int cachechars(Font*, char**, Rune**, ushort*, int, int*, char**);
+extern void agefont(Font*);
+extern Subfont* allocsubfont(char*, int, int, int, Fontchar*, Image*);
+extern Subfont* lookupsubfont(Display*, char*);
+extern void installsubfont(char*, Subfont*);
+extern void uninstallsubfont(Subfont*);
+extern void freesubfont(Subfont*);
+extern Subfont* readsubfont(Display*, char*, int, int);
+extern Subfont* readsubfonti(Display*, char*, int, Image*, int);
+extern int writesubfont(int, Subfont*);
+extern void _unpackinfo(Fontchar*, uchar*, int);
+extern Point stringsize(Font*, char*);
+extern int stringwidth(Font*, char*);
+extern int stringnwidth(Font*, char*, int);
+extern Point runestringsize(Font*, Rune*);
+extern int runestringwidth(Font*, Rune*);
+extern int runestringnwidth(Font*, Rune*, int);
+extern Point strsubfontwidth(Subfont*, char*);
+extern int loadchar(Font*, Rune, Cacheinfo*, int, int, char**);
+extern char* subfontname(char*, char*, int);
+extern Subfont* _getsubfont(Display*, char*);
+extern Subfont* getdefont(Display*);
+extern int lockdisplay(Display*);
+extern void unlockdisplay(Display*);
+extern int drawlsetrefresh(ulong, int, void*, void*);
+
+/* Compositing operator utility */
+extern void _setdrawop(Display*, Drawop);
+
+/*
+ * Predefined
+ */
+extern uchar defontdata[];
+extern int sizeofdefont;
+extern Point ZP;
+extern Rectangle ZR;
+
+/*
+ * Set up by initdraw()
+ */
+extern int _cursorfd;
+extern int _drawdebug; /* set to 1 to see errors from flushimage */
+
+#define BGSHORT(p) (((p)[0]<<0) | ((p)[1]<<8))
+#define BGLONG(p) ((BGSHORT(p)<<0) | (BGSHORT(p+2)<<16))
+#define BPSHORT(p, v) ((p)[0]=(v), (p)[1]=((v)>>8))
+#define BPLONG(p, v) (BPSHORT(p, (v)), BPSHORT(p+2, (v)>>16))
+
+/*
+ * Compressed image file parameters
+ */
+#define NMATCH 3 /* shortest match possible */
+#define NRUN (NMATCH+31) /* longest match possible */
+#define NMEM 1024 /* window size */
+#define NDUMP 128 /* maximum length of dump */
+#define NCBLOCK 6000 /* size of compressed blocks */
+extern void _twiddlecompressed(uchar*, int);
+extern int _compblocksize(Rectangle, int);
+
+/* XXX backwards helps; should go */
+extern ulong drawld2chan[];
+extern void drawsetdebug(int);
+
+/*
+ * Inferno interface
+ */
+extern Font* font_open(Display*, char*);
+extern void font_close(Font*);
+
+/*
+ * Macros to convert between C and Limbo types
+ */
+#define IRECT(r) (*(Rectangle*)&(r))
+#define DRECT(r) (*(Draw_Rect*)&(r))
+#define IPOINT(p) (*(Point*)&(p))
+#define DPOINT(p) (*(Draw_Point*)&(p))
+
+#define P2P(p1, p2) (p1).x = (p2).x, (p1).y = (p2).y
+#define R2R(r1, r2) (r1).min.x = (r2).min.x, (r1).min.y = (r2).min.y,\
+ (r1).max.x = (r2).max.x, (r1).max.y = (r2).max.y
+extern Image* display_open(Display*, char*);
--- /dev/null
+++ b/include/drawif.h
@@ -1,0 +1,12 @@
+extern Font* checkfont(Draw_Font*);
+extern Image* checkimage(Draw_Image*);
+extern Screen* checkscreen(Draw_Screen*);
+extern Display* checkdisplay(Draw_Display*);
+extern void freedrawdisplay(Heap*, int);
+extern void freedrawfont(Heap*, int);
+extern void freedrawimage(Heap*, int);
+extern void freedrawscreen(Heap*, int);
+extern Font* lookupfont(Draw_Font*);
+extern Image* lookupimage(Draw_Image*);
+extern Screen* lookupscreen(Draw_Screen*);
+extern Draw_Image* mkdrawimage(Image*, Draw_Screen*, Draw_Display*, void*);
--- /dev/null
+++ b/include/dynld.h
@@ -1,0 +1,44 @@
+/* uncomment these lines when installed in /sys/include */
+/*
+#pragma src "/sys/src/libdynld"
+#pragma lib "libdynld.a"
+*/
+
+typedef struct Dynobj Dynobj;
+typedef struct Dynsym Dynsym;
+
+struct Dynobj
+{
+ ulong size; /* total size in bytes */
+ ulong text; /* bytes of text */
+ ulong data; /* bytes of data */
+ ulong bss; /* bytes of bss */
+ uchar* base; /* start of text, data, bss */
+ int nexport;
+ Dynsym* export; /* export table */
+ int nimport;
+ Dynsym** import; /* import table */
+};
+
+/*
+ * this structure is known to the linkers
+ */
+struct Dynsym
+{
+ ulong sig;
+ ulong addr;
+ char *name;
+};
+
+extern Dynsym* dynfindsym(char*, Dynsym*, int);
+extern void dynfreeimport(Dynobj*);
+extern void* dynimport(Dynobj*, char*, ulong);
+extern int dynloadable(void*, long (*r)(void*,void*,long), vlong(*sk)(void*,vlong,int));
+extern Dynobj* dynloadfd(int, Dynsym*, int, ulong);
+extern Dynobj* dynloadgen(void*, long (*r)(void*,void*,long), vlong (*s)(void*,vlong,int), void (*e)(char*), Dynsym*, int, ulong);
+extern long dynmagic(void);
+extern void dynobjfree(Dynobj*);
+extern char* dynreloc(uchar*, ulong, int, Dynsym**, int);
+extern int dyntabsize(Dynsym*);
+
+extern Dynsym _exporttab[]; /* created by linker -x (when desired) */
--- /dev/null
+++ b/include/fcall.h
@@ -1,0 +1,140 @@
+#pragma src "/usr/inferno/lib9"
+#pragma lib "libc.a"
+
+#define VERSION9P "9P2000"
+
+#define MAXWELEM 16
+
+typedef
+struct Fcall
+{
+ uchar type;
+ u32int fid;
+ ushort tag;
+ /* union { */
+ /* struct { */
+ u32int msize; /* Tversion, Rversion */
+ char *version; /* Tversion, Rversion */
+ /* }; */
+ /* struct { */
+ ushort oldtag; /* Tflush */
+ /* }; */
+ /* struct { */
+ char *ename; /* Rerror */
+ /* }; */
+ /* struct { */
+ Qid qid; /* Rattach, Ropen, Rcreate */
+ u32int iounit; /* Ropen, Rcreate */
+ /* }; */
+ /* struct { */
+ Qid aqid; /* Rauth */
+ /* }; */
+ /* struct { */
+ u32int afid; /* Tauth, Tattach */
+ char *uname; /* Tauth, Tattach */
+ char *aname; /* Tauth, Tattach */
+ /* }; */
+ /* struct { */
+ u32int perm; /* Tcreate */
+ char *name; /* Tcreate */
+ uchar mode; /* Tcreate, Topen */
+ /* }; */
+ /* struct { */
+ u32int newfid; /* Twalk */
+ ushort nwname; /* Twalk */
+ char *wname[MAXWELEM]; /* Twalk */
+ /* }; */
+ /* struct { */
+ ushort nwqid; /* Rwalk */
+ Qid wqid[MAXWELEM]; /* Rwalk */
+ /* }; */
+ /* struct { */
+ vlong offset; /* Tread, Twrite */
+ u32int count; /* Tread, Twrite, Rread */
+ char *data; /* Twrite, Rread */
+ /* }; */
+ /* struct { */
+ ushort nstat; /* Twstat, Rstat */
+ uchar *stat; /* Twstat, Rstat */
+ /* }; */
+ /* }; */
+} Fcall;
+
+
+#define GBIT8(p) ((p)[0])
+#define GBIT16(p) ((p)[0]|((p)[1]<<8))
+#define GBIT32(p) ((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)))
+#define GBIT64(p) ((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
+ ((vlong)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
+
+#define PBIT8(p,v) (p)[0]=(v)
+#define PBIT16(p,v) (p)[0]=(v);(p)[1]=(v)>>8
+#define PBIT32(p,v) (p)[0]=(v);(p)[1]=(v)>>8;(p)[2]=(v)>>16;(p)[3]=(v)>>24
+#define PBIT64(p,v) (p)[0]=(v);(p)[1]=(v)>>8;(p)[2]=(v)>>16;(p)[3]=(v)>>24;\
+ (p)[4]=(v)>>32;(p)[5]=(v)>>40;(p)[6]=(v)>>48;(p)[7]=(v)>>56
+
+#define BIT8SZ 1
+#define BIT16SZ 2
+#define BIT32SZ 4
+#define BIT64SZ 8
+#define QIDSZ (BIT8SZ+BIT32SZ+BIT64SZ)
+
+/* STATFIXLEN includes leading 16-bit count */
+/* The count, however, excludes itself; total size is BIT16SZ+count */
+#define STATFIXLEN (BIT16SZ+QIDSZ+5*BIT16SZ+4*BIT32SZ+1*BIT64SZ) /* amount of fixed length data in a stat buffer */
+
+#define NOTAG (ushort)~0U /* Dummy tag */
+#define NOFID (u32int)~0U /* Dummy fid */
+#define IOHDRSZ 24 /* ample room for Twrite/Rread header (iounit) */
+
+enum
+{
+ Tversion = 100,
+ Rversion,
+ Tauth = 102,
+ Rauth,
+ Tattach = 104,
+ Rattach,
+ Terror = 106, /* illegal */
+ Rerror,
+ Tflush = 108,
+ Rflush,
+ Twalk = 110,
+ Rwalk,
+ Topen = 112,
+ Ropen,
+ Tcreate = 114,
+ Rcreate,
+ Tread = 116,
+ Rread,
+ Twrite = 118,
+ Rwrite,
+ Tclunk = 120,
+ Rclunk,
+ Tremove = 122,
+ Rremove,
+ Tstat = 124,
+ Rstat,
+ Twstat = 126,
+ Rwstat,
+ Tmax,
+};
+
+uint convM2S(uchar*, uint, Fcall*);
+uint convS2M(Fcall*, uchar*, uint);
+uint sizeS2M(Fcall*);
+
+int statcheck(uchar *abuf, uint nbuf);
+uint convM2D(uchar*, uint, Dir*, char*);
+uint convD2M(Dir*, uchar*, uint);
+uint sizeD2M(Dir*);
+
+int fcallfmt(Fmt*);
+int dirfmt(Fmt*);
+int dirmodefmt(Fmt*);
+
+int read9pmsg(int, void*, uint);
+
+#pragma varargck type "F" Fcall*
+#pragma varargck type "M" ulong
+#pragma varargck type "D" Dir*
--- /dev/null
+++ b/include/flate.h
@@ -1,0 +1,36 @@
+/*
+ * errors from deflate, deflateinit, deflateblock,
+ * inflate, inflateinit, inflateblock.
+ * convertable to a string by flateerr
+ */
+enum
+{
+ FlateOk = 0,
+ FlateNoMem = -1,
+ FlateInputFail = -2,
+ FlateOutputFail = -3,
+ FlateCorrupted = -4,
+ FlateInternal = -5,
+};
+
+int deflateinit(void);
+int deflate(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
+
+int inflateinit(void);
+int inflate(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
+
+int inflateblock(uchar *dst, int dsize, uchar *src, int ssize);
+int deflateblock(uchar *dst, int dsize, uchar *src, int ssize, int level, int debug);
+
+int deflatezlib(void *wr, int (*w)(void*, void*, int), void *rr, int (*r)(void*, void*, int), int level, int debug);
+int inflatezlib(void *wr, int (*w)(void*, void*, int), void *getr, int (*get)(void*));
+
+int inflatezlibblock(uchar *dst, int dsize, uchar *src, int ssize);
+int deflatezlibblock(uchar *dst, int dsize, uchar *src, int ssize, int level, int debug);
+
+char *flateerr(int err);
+
+ulong *mkcrctab(ulong);
+ulong blockcrc(ulong *tab, ulong crc, void *buf, int n);
+
+ulong adler32(ulong adler, void *buf, int n);
--- /dev/null
+++ b/include/freetype.h
@@ -1,0 +1,55 @@
+/*
+ * interface to libfreetype without recourse to the real freetype headers
+ * which would otherwise require full-blown CPP
+ */
+
+typedef struct FTfaceinfo FTfaceinfo;
+struct FTfaceinfo {
+ int nfaces;
+ int index;
+ int style;
+ int height;
+ int ascent;
+ char* familyname;
+ char* stylename;
+};
+
+typedef struct FTface FTface;
+struct FTface {
+ void* ft_lib;
+ void* ft_face;
+};
+
+typedef struct FTglyph FTglyph;
+struct FTglyph {
+ int top;
+ int left;
+ int advx;
+ int advy;
+ int height;
+ int width;
+ int bpr;
+ uchar* bitmap;
+};
+
+typedef struct FTmatrix FTmatrix;
+struct FTmatrix {
+ int a;
+ int b;
+ int c;
+ int d;
+};
+
+typedef struct FTvector FTvector;
+struct FTvector {
+ int dx;
+ int dy;
+};
+
+extern char* ftnewface(char *, int, FTface*, FTfaceinfo*);
+extern char* ftloadmemface(void*, int, int, FTface*, FTfaceinfo*);
+extern char* ftsetcharsize(FTface, int, int, int, FTfaceinfo*);
+extern void ftsettransform(FTface, FTmatrix*, FTvector*);
+extern int fthaschar(FTface,int);
+extern char* ftloadglyph(FTface, int, FTglyph*);
+extern void ftdoneface(FTface);
--- /dev/null
+++ b/include/freetype/cache/ftccache.h
@@ -1,0 +1,304 @@
+/***************************************************************************/
+/* */
+/* ftccache.h */
+/* */
+/* FreeType internal cache interface (specification). */
+/* */
+/* Copyright 2000-2001, 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCCACHE_H__
+#define __FTCCACHE_H__
+
+
+/* define to allow cache lookup inlining */
+#define FTC_CACHE_USE_INLINE
+
+
+FT_BEGIN_HEADER
+
+ /* handle to cache object */
+ 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;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** CACHE NODE DEFINITIONS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Each cache controls one or more cache nodes. Each node is part of */
+ /* the global_lru list of the manager. Its `data' field however is used */
+ /* as a reference count for now. */
+ /* */
+ /* A node can be anything, depending on the type of information held by */
+ /* the cache. It can be an individual glyph image, a set of bitmaps */
+ /* glyphs for a given size, some metrics, etc. */
+ /* */
+ /*************************************************************************/
+
+ /* 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_NodeRec;
+
+
+#define FTC_NODE( x ) ( (FTC_Node)(x) )
+#define FTC_NODE_P( x ) ( (FTC_Node*)(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. */
+ /* */
+
+ /* 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 );
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** CACHE DEFINITIONS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /* 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 );
+
+ /* compute the weight of a given cache node */
+ typedef FT_ULong
+ (*FTC_Node_WeightFunc)( FTC_Node node,
+ FTC_Cache cache );
+
+ /* compare a node to a given key pair */
+ typedef FT_Bool
+ (*FTC_Node_CompareFunc)( FTC_Node node,
+ FT_Pointer key,
+ FTC_Cache cache );
+
+ /* finalize a given cache node */
+ typedef void
+ (*FTC_Node_DoneFunc)( FTC_Node node,
+ FTC_Cache cache );
+
+
+ typedef struct FTC_Cache_ClassRec_
+ {
+ FT_UInt cache_size;
+ FTC_Cache_InitFunc cache_init;
+ FTC_Cache_ClearFunc cache_clear;
+ FTC_Cache_DoneFunc cache_done;
+
+ FT_UInt family_size;
+ FTC_Family_InitFunc family_init;
+ FTC_Family_CompareFunc family_compare;
+ FTC_Family_DoneFunc family_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;
+
+
+ /* */
+
+
+ /*************************************************************************/
+ /* */
+ /* 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. */
+ /* */
+
+ /* 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 */
+ FT_EXPORT( FT_Error )
+ ftc_cache_init( FTC_Cache cache );
+
+ /* can be called when the key's hash value has been computed */
+ FT_EXPORT( FT_Error )
+ ftc_cache_lookup( FTC_Cache cache,
+ FTC_Query query,
+ FTC_Node *anode );
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTCCACHE_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/cache/ftccmap.h
@@ -1,0 +1,216 @@
+/***************************************************************************/
+/* */
+/* ftccmap.h */
+/* */
+/* FreeType charmap 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCCMAP_H__
+#define __FTCCMAP_H__
+
+#include <ft2build.h>
+#include FT_CACHE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <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;
+
+
+ /*************************************************************************/
+ /* */
+ /* @type: */
+ /* FTC_CMapDesc */
+ /* */
+ /* @description: */
+ /* A handle to an @FTC_CMapDescRec structure used to describe a given */
+ /* charmap in a charmap cache. */
+ /* */
+ /* Each @FTC_CMapDesc describes which charmap (of which @FTC_Face) we */
+ /* want to use in @FTC_CMapCache_Lookup. */
+ /* */
+ typedef struct FTC_CMapDescRec_* FTC_CMapDesc;
+
+
+ /*************************************************************************/
+ /* */
+ /* @enum: */
+ /* FTC_CMapType */
+ /* */
+ /* @description: */
+ /* The list of valid @FTC_CMap types. They indicate how we want to */
+ /* address a charmap within an @FTC_FaceID. */
+ /* */
+ /* @values: */
+ /* FTC_CMAP_BY_INDEX :: */
+ /* Address a charmap by its index in the corresponding @FT_Face. */
+ /* */
+ /* FTC_CMAP_BY_ENCODING :: */
+ /* Use a @FT_Face charmap that corresponds to a given encoding. */
+ /* */
+ /* FTC_CMAP_BY_ID :: */
+ /* Use an @FT_Face charmap that corresponds to a given */
+ /* (platform,encoding) ID. See @FTC_CMapIdRec. */
+ /* */
+ typedef enum FTC_CMapType_
+ {
+ FTC_CMAP_BY_INDEX = 0,
+ FTC_CMAP_BY_ENCODING = 1,
+ FTC_CMAP_BY_ID = 2
+
+ } FTC_CMapType;
+
+
+ /*************************************************************************/
+ /* */
+ /* @struct: */
+ /* FTC_CMapIdRec */
+ /* */
+ /* @description: */
+ /* A short structure to identify a charmap by a (platform,encoding) */
+ /* pair of values. */
+ /* */
+ /* @fields: */
+ /* platform :: The platform ID. */
+ /* */
+ /* encoding :: The encoding ID. */
+ /* */
+ typedef struct FTC_CMapIdRec_
+ {
+ FT_UInt platform;
+ FT_UInt encoding;
+
+ } FTC_CMapIdRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* @struct: */
+ /* FTC_CMapDescRec */
+ /* */
+ /* @description: */
+ /* A structure to describe a given charmap to @FTC_CMapCache. */
+ /* */
+ /* @fields: */
+ /* face_id :: @FTC_FaceID of the face this charmap belongs to. */
+ /* */
+ /* type :: The type of charmap, see @FTC_CMapType. */
+ /* */
+ /* u.index :: For @FTC_CMAP_BY_INDEX types, this is the charmap */
+ /* index (within a @FT_Face) we want to use. */
+ /* */
+ /* u.encoding :: For @FTC_CMAP_BY_ENCODING types, this is the charmap */
+ /* encoding we want to use. see @FT_Encoding. */
+ /* */
+ /* u.id :: For @FTC_CMAP_BY_ID types, this is the */
+ /* (platform,encoding) pair we want to use. see */
+ /* @FTC_CMapIdRec and @FT_CharMapRec. */
+ /* */
+ typedef struct FTC_CMapDescRec_
+ {
+ FTC_FaceID face_id;
+ FTC_CMapType type;
+
+ union
+ {
+ FT_UInt index;
+ FT_Encoding encoding;
+ FTC_CMapIdRec id;
+
+ } u;
+
+ } FTC_CMapDescRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* @function: */
+ /* FTC_CMapCache_New */
+ /* */
+ /* @description: */
+ /* Creates 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 );
+
+
+ /*************************************************************************/
+ /* */
+ /* @function: */
+ /* FTC_CMapCache_Lookup */
+ /* */
+ /* @description: */
+ /* Translates a character code into a glyph index, using the charmap */
+ /* cache. */
+ /* */
+ /* @input: */
+ /* cache :: A charmap cache handle. */
+ /* */
+ /* cmap_desc :: A charmap descriptor handle. */
+ /* */
+ /* char_code :: The character code (in the corresponding charmap). */
+ /* */
+ /* @return: */
+ /* Glyph index. 0 means "no glyph". */
+ /* */
+ /* @note: */
+ /* This function doesn't return @FTC_Node handles, since there is no */
+ /* real use for them with typical uses of charmaps. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FTC_CMapCache_Lookup( FTC_CMapCache cache,
+ FTC_CMapDesc cmap_desc,
+ FT_UInt32 char_code );
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTCCMAP_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/cache/ftcglyph.h
@@ -1,0 +1,193 @@
+/***************************************************************************/
+/* */
+/* ftcglyph.h */
+/* */
+/* FreeType abstract glyph 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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* 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. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /********* *********/
+ /********* WARNING, THIS IS BETA CODE. *********/
+ /********* *********/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+#ifndef __FTCGLYPH_H__
+#define __FTCGLYPH_H__
+
+
+#include <ft2build.h>
+#include FT_CACHE_H
+#include FT_CACHE_MANAGER_H
+
+#include <stddef.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;
+
+ /* 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_
+ {
+ FTC_NodeRec node;
+ FT_UShort item_count;
+ FT_UShort item_start;
+
+ } FTC_GlyphNodeRec;
+
+
+#define FTC_GLYPH_NODE( x ) ( (FTC_GlyphNode)(x) )
+#define FTC_GLYPH_NODE_P( x ) ( (FTC_GlyphNode*)(x) )
+
+
+ typedef struct FTC_GlyphQueryRec_
+ {
+ FTC_QueryRec query;
+ FT_UInt gindex;
+
+ } FTC_GlyphQueryRec, *FTC_GlyphQuery;
+
+
+#define FTC_GLYPH_QUERY( x ) ( (FTC_GlyphQuery)(x) )
+
+
+ /* a glyph set is used to categorize glyphs of a given type */
+ typedef struct FTC_GlyphFamilyRec_
+ {
+ 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 */
+
+ } FTC_GlyphFamilyRec;
+
+
+#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 ) & 0xFFFF ) ) )
+
+ /* 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 & 0xFFFF ) )
+
+
+ /*************************************************************************/
+ /* */
+ /* 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 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 );
+
+ /* 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 );
+
+ /* must be called by derived FTC_Node_DoneFunc routines */
+ FT_EXPORT( void )
+ ftc_glyph_node_done( FTC_GlyphNode 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 );
+
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTCGLYPH_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/cache/ftcimage.h
@@ -1,0 +1,312 @@
+/***************************************************************************/
+/* */
+/* ftcimage.h */
+/* */
+/* FreeType Image cache (specification). */
+/* */
+/* Copyright 2000-2001, 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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Each image cache really manages FT_Glyph objects. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTCIMAGE_H__
+#define __FTCIMAGE_H__
+
+
+#include <ft2build.h>
+#include FT_CACHE_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_
+ {
+ FTC_FontRec font;
+ 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 );
+
+ /* */
+
+#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_ImageDesc instead. */
+ /* */
+ /* A simple structure used to describe a given glyph image category. */
+ /* */
+ /* <Fields> */
+ /* size :: An @FTC_SizeRec used to describe the glyph's face */
+ /* and size. */
+ /* */
+ /* image_type :: The glyph image's type. */
+ /* */
+ typedef struct FTC_Image_Desc_
+ {
+ FTC_FontRec font;
+ FT_UInt image_type;
+
+ } FTC_Image_Desc;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_Image_Cache */
+ /* */
+ /* <Description> */
+ /* THIS TYPE IS DEPRECATED. Use @FTC_ImageCache instead. */
+ /* */
+ typedef FTC_ImageCache FTC_Image_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. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_Image_Cache_New( FTC_Manager manager,
+ FTC_Image_Cache *acache );
+
+
+ /*************************************************************************/
+ /* */
+ /* <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 );
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTCIMAGE_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/cache/ftcmanag.h
@@ -1,0 +1,244 @@
+/***************************************************************************/
+/* */
+/* ftcmanag.h */
+/* */
+/* FreeType Cache Manager (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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* A cache manager is in charge of the following: */
+ /* */
+ /* - Maintain a mapping between generic FTC_FaceIDs and live FT_Face */
+ /* objects. The mapping itself is performed through a user-provided */
+ /* callback. However, the manager maintains a small cache of FT_Face */
+ /* and FT_Size objects in order to speed up things considerably. */
+ /* */
+ /* - Manage one or more cache objects. Each cache is in charge of */
+ /* holding a varying number of `cache nodes'. Each cache node */
+ /* represents a minimal amount of individually accessible cached */
+ /* data. For example, a cache node can be an FT_Glyph image */
+ /* containing a vector outline, or some glyph metrics, or anything */
+ /* else. */
+ /* */
+ /* Each cache node has a certain size in bytes that is added to the */
+ /* total amount of `cache memory' within the manager. */
+ /* */
+ /* All cache nodes are located in a global LRU list, where the oldest */
+ /* node is at the tail of the list. */
+ /* */
+ /* Each node belongs to a single cache, and includes a reference */
+ /* count to avoid destroying it (due to caching). */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /********* *********/
+ /********* WARNING, THIS IS BETA CODE. *********/
+ /********* *********/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+#ifndef __FTCMANAG_H__
+#define __FTCMANAG_H__
+
+
+#include <ft2build.h>
+#include FT_CACHE_H
+#include FT_CACHE_INTERNAL_LRU_H
+#include FT_CACHE_INTERNAL_CACHE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* cache_subsystem */
+ /* */
+ /*************************************************************************/
+
+
+#define FTC_MAX_FACES_DEFAULT 2
+#define FTC_MAX_SIZES_DEFAULT 4
+#define FTC_MAX_BYTES_DEFAULT 200000L /* ~200kByte by default */
+
+ /* maximum number of caches registered in a single manager */
+#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_ULong max_weight;
+ FT_ULong cur_weight;
+
+ FT_UInt num_nodes;
+ FTC_Node nodes_list;
+
+ FTC_Cache caches[FTC_MAX_CACHES];
+
+ FT_Pointer request_data;
+ FTC_Face_Requester request_face;
+
+ FTC_FamilyTableRec families;
+
+ } FTC_ManagerRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Compress */
+ /* */
+ /* <Description> */
+ /* This function is used to check the state of the cache manager if */
+ /* its `num_bytes' field is greater than its `max_bytes' field. It */
+ /* will flush as many old cache nodes as possible (ignoring cache */
+ /* nodes with a non-zero reference count). */
+ /* */
+ /* <InOut> */
+ /* manager :: A handle to the cache manager. */
+ /* */
+ /* <Note> */
+ /* Client applications should not call this function directly. It is */
+ /* normally invoked by specific cache implementations. */
+ /* */
+ /* The reason this function is exported is to allow client-specific */
+ /* cache classes. */
+ /* */
+ FT_EXPORT( void )
+ FTC_Manager_Compress( FTC_Manager manager );
+
+
+ /* 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 );
+
+
+ /* can be called to increment a node's reference count */
+ FT_EXPORT( void )
+ FTC_Node_Ref( FTC_Node node,
+ FTC_Manager manager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <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 );
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTCMANAG_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/cache/ftcsbits.h
@@ -1,0 +1,275 @@
+/***************************************************************************/
+/* */
+/* ftcsbits.h */
+/* */
+/* A small-bitmap cache (specification). */
+/* */
+/* Copyright 2000-2001, 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTCSBITS_H__
+#define __FTCSBITS_H__
+
+
+#include <ft2build.h>
+#include FT_CACHE_H
+#include FT_CACHE_IMAGE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <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_
+ {
+ 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;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_SBit_Cache */
+ /* */
+ /* <Description> */
+ /* DEPRECATED. Use @FTC_SBitCache instead. */
+ /* */
+ typedef FTC_SBitCache FTC_SBit_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 );
+
+
+ /*************************************************************************/
+ /* */
+ /* <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 );
+
+
+ /* */
+
+
+ /*************************************************************************/
+ /* */
+ /* <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__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/cache/ftlru.h
@@ -1,0 +1,202 @@
+/***************************************************************************/
+/* */
+/* 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 */
--- /dev/null
+++ b/include/freetype/config/ftconfig.h
@@ -1,0 +1,334 @@
+/***************************************************************************/
+/* */
+/* ftconfig.h */
+/* */
+/* ANSI-specific configuration file (specification only). */
+/* */
+/* Copyright 1996-2001, 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 file contains a number of macro definitions that are used */
+ /* by the rest of the engine. Most of the macros here are automatically */
+ /* determined at compile time, and you should not need to change it to */
+ /* port FreeType, except to compile the library with a non-ANSI */
+ /* compiler. */
+ /* */
+ /* Note however that if some specific modifications are needed, we */
+ /* advise you to place a modified copy in your build directory. */
+ /* */
+ /* The build directory is usually `freetype/builds/<system>', and */
+ /* contains system-specific files that are always included first when */
+ /* building the library. */
+ /* */
+ /* This ANSI version should stay in `include/freetype/config'. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTCONFIG_H__
+#define __FTCONFIG_H__
+
+#include <ft2build.h>
+#include FT_CONFIG_OPTIONS_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
+ /* */
+ /* These macros can be toggled to suit a specific system. The current */
+ /* ones are defaults used to compile FreeType in an ANSI C environment */
+ /* (16bit compilers are also supported). Copy this file to your own */
+ /* `freetype/builds/<system>' directory, and edit it to port the engine. */
+ /* */
+ /*************************************************************************/
+
+
+ /* 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!"
+#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
+#else
+#error "Unsupported number of bytes in `long' type!"
+#endif
+
+
+ /* Preferred alignment of data */
+#define FT_ALIGNMENT 8
+
+
+ /* FT_UNUSED is a macro used to indicate that a given parameter is not */
+ /* used -- this is only used to get rid of unpleasant compiler warnings */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* AUTOMATIC CONFIGURATION MACROS */
+ /* */
+ /* These macros are computed from the ones defined above. Don't touch */
+ /* their definition, unless you know precisely what you are doing. No */
+ /* porter should need to mess with them. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Mac support (not MacOS X) */
+ /* */
+ /* This is the only necessary change, so it is defined here instead */
+ /* providing a new configuration file. */
+ /* */
+#if (defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )) && !defined(__MACH__)
+#define FT_MACINTOSH 1
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* IntN types */
+ /* */
+ /* Used to guarantee the size of some specific integers. */
+ /* */
+ typedef signed short FT_Int16;
+ typedef unsigned short FT_UInt16;
+
+#if FT_SIZEOF_INT == 4
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_UInt32;
+
+#elif FT_SIZEOF_LONG == 4
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#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
+
+ 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
+
+#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( __MWKS__ ) /* Metrowerks CodeWarrior */
+
+ /* I don't know if it provides 64-bit data types, any suggestion */
+ /* is welcome. */
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the "long long" type */
+#define FT_LONG64
+#define FT_INT64 long long int
+
+#endif /* FT_SIZEOF_LONG == 8 */
+
+
+ /*************************************************************************/
+ /* */
+ /* 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. */
+ /* */
+#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#ifdef __STDC__
+
+ /* undefine the 64-bit macros in strict ANSI compilation mode */
+#undef FT_LONG64
+#undef FT_INT64
+
+#endif /* __STDC__ */
+
+#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
+
+
+#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
+
+#define FT_LOCAL( x ) static x
+#define FT_LOCAL_DEF( x ) static x
+
+#else
+
+#ifdef __cplusplus
+#define FT_LOCAL( x ) extern "C" x
+#define FT_LOCAL_DEF( x ) extern "C" x
+#else
+#define FT_LOCAL( x ) extern x
+#define FT_LOCAL_DEF( x ) x
+#endif
+
+#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
+
+
+#ifndef FT_BASE
+
+#ifdef __cplusplus
+#define FT_BASE( x ) extern "C" x
+#else
+#define FT_BASE( x ) extern x
+#endif
+
+#endif /* !FT_BASE */
+
+
+#ifndef FT_BASE_DEF
+
+#ifdef __cplusplus
+#define FT_BASE_DEF( x ) extern "C" x
+#else
+#define FT_BASE_DEF( x ) extern x
+#endif
+
+#endif /* !FT_BASE_DEF */
+
+
+#ifndef FT_EXPORT
+
+#ifdef __cplusplus
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT */
+
+
+#ifndef FT_EXPORT_DEF
+
+#ifdef __cplusplus
+#define FT_EXPORT_DEF( x ) extern "C" x
+#else
+#define FT_EXPORT_DEF( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_DEF */
+
+
+#ifndef FT_EXPORT_VAR
+
+#ifdef __cplusplus
+#define FT_EXPORT_VAR( x ) extern "C" x
+#else
+#define FT_EXPORT_VAR( x ) extern x
+#endif
+
+#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 */
+ /* must do that for structures which contain function pointers to */
+ /* 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
+#else
+#define FT_CALLBACK_DEF( x ) static x
+#endif
+#endif /* FT_CALLBACK_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 */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTCONFIG_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/config/ftconfig.h.orig
@@ -1,0 +1,334 @@
+/***************************************************************************/
+/* */
+/* ftconfig.h */
+/* */
+/* ANSI-specific configuration file (specification only). */
+/* */
+/* Copyright 1996-2001, 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 file contains a number of macro definitions that are used */
+ /* by the rest of the engine. Most of the macros here are automatically */
+ /* determined at compile time, and you should not need to change it to */
+ /* port FreeType, except to compile the library with a non-ANSI */
+ /* compiler. */
+ /* */
+ /* Note however that if some specific modifications are needed, we */
+ /* advise you to place a modified copy in your build directory. */
+ /* */
+ /* The build directory is usually `freetype/builds/<system>', and */
+ /* contains system-specific files that are always included first when */
+ /* building the library. */
+ /* */
+ /* This ANSI version should stay in `include/freetype/config'. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTCONFIG_H__
+#define __FTCONFIG_H__
+
+#include <ft2build.h>
+#include FT_CONFIG_OPTIONS_H
+#include FT_CONFIG_STANDARD_LIBRARY_H
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* PLATFORM-SPECIFIC CONFIGURATION MACROS */
+ /* */
+ /* These macros can be toggled to suit a specific system. The current */
+ /* ones are defaults used to compile FreeType in an ANSI C environment */
+ /* (16bit compilers are also supported). Copy this file to your own */
+ /* `freetype/builds/<system>' directory, and edit it to port the engine. */
+ /* */
+ /*************************************************************************/
+
+
+ /* 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!"
+#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
+#else
+#error "Unsupported number of bytes in `long' type!"
+#endif
+
+
+ /* Preferred alignment of data */
+#define FT_ALIGNMENT 8
+
+
+ /* FT_UNUSED is a macro used to indicate that a given parameter is not */
+ /* used -- this is only used to get rid of unpleasant compiler warnings */
+#ifndef FT_UNUSED
+#define FT_UNUSED( arg ) ( (arg) = (arg) )
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* AUTOMATIC CONFIGURATION MACROS */
+ /* */
+ /* These macros are computed from the ones defined above. Don't touch */
+ /* their definition, unless you know precisely what you are doing. No */
+ /* porter should need to mess with them. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Mac support */
+ /* */
+ /* This is the only necessary change, so it is defined here instead */
+ /* providing a new configuration file. */
+ /* */
+#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
+#define FT_MACINTOSH 1
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* IntN types */
+ /* */
+ /* Used to guarantee the size of some specific integers. */
+ /* */
+ typedef signed short FT_Int16;
+ typedef unsigned short FT_UInt16;
+
+#if FT_SIZEOF_INT == 4
+
+ typedef signed int FT_Int32;
+ typedef unsigned int FT_UInt32;
+
+#elif FT_SIZEOF_LONG == 4
+
+ typedef signed long FT_Int32;
+ typedef unsigned long FT_UInt32;
+
+#else
+#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
+
+ 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
+
+#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( __MWKS__ ) /* Metrowerks CodeWarrior */
+
+ /* I don't know if it provides 64-bit data types, any suggestion */
+ /* is welcome. */
+
+#elif defined( __GNUC__ )
+
+ /* GCC provides the "long long" type */
+#define FT_LONG64
+#define FT_INT64 long long int
+
+#endif /* FT_SIZEOF_LONG == 8 */
+
+
+ /*************************************************************************/
+ /* */
+ /* 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. */
+ /* */
+#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )
+
+#ifdef __STDC__
+
+ /* undefine the 64-bit macros in strict ANSI compilation mode */
+#undef FT_LONG64
+#undef FT_INT64
+
+#endif /* __STDC__ */
+
+#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */
+
+
+#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
+
+#define FT_LOCAL( x ) static x
+#define FT_LOCAL_DEF( x ) static x
+
+#else
+
+#ifdef __cplusplus
+#define FT_LOCAL( x ) extern "C" x
+#define FT_LOCAL_DEF( x ) extern "C" x
+#else
+#define FT_LOCAL( x ) extern x
+#define FT_LOCAL_DEF( x ) x
+#endif
+
+#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */
+
+
+#ifndef FT_BASE
+
+#ifdef __cplusplus
+#define FT_BASE( x ) extern "C" x
+#else
+#define FT_BASE( x ) extern x
+#endif
+
+#endif /* !FT_BASE */
+
+
+#ifndef FT_BASE_DEF
+
+#ifdef __cplusplus
+#define FT_BASE_DEF( x ) extern "C" x
+#else
+#define FT_BASE_DEF( x ) extern x
+#endif
+
+#endif /* !FT_BASE_DEF */
+
+
+#ifndef FT_EXPORT
+
+#ifdef __cplusplus
+#define FT_EXPORT( x ) extern "C" x
+#else
+#define FT_EXPORT( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT */
+
+
+#ifndef FT_EXPORT_DEF
+
+#ifdef __cplusplus
+#define FT_EXPORT_DEF( x ) extern "C" x
+#else
+#define FT_EXPORT_DEF( x ) extern x
+#endif
+
+#endif /* !FT_EXPORT_DEF */
+
+
+#ifndef FT_EXPORT_VAR
+
+#ifdef __cplusplus
+#define FT_EXPORT_VAR( x ) extern "C" x
+#else
+#define FT_EXPORT_VAR( x ) extern x
+#endif
+
+#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 */
+ /* must do that for structures which contain function pointers to */
+ /* 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
+#else
+#define FT_CALLBACK_DEF( x ) static x
+#endif
+#endif /* FT_CALLBACK_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 */
+
+
+FT_END_HEADER
+
+
+#endif /* __FTCONFIG_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/config/ftheader.h
@@ -1,0 +1,524 @@
+/***************************************************************************/
+/* */
+/* ftheader.h */
+/* */
+/* Build macros of the FreeType 2 library. */
+/* */
+/* Copyright 1996-2001, 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. */
+/* */
+/***************************************************************************/
+
+#ifndef __FT_HEADER_H__
+#define __FT_HEADER_H__
+
+ /*@***********************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_BEGIN_HEADER */
+ /* */
+ /* <Description> */
+ /* This macro is used in association with @FT_END_HEADER in header */
+ /* files to ensure that the declarations within are properly */
+ /* encapsulated in an `extern "C" { .. }' block when included from a */
+ /* C++ compiler. */
+ /* */
+#ifdef __cplusplus
+#define FT_BEGIN_HEADER extern "C" {
+#else
+#define FT_BEGIN_HEADER /* nothing */
+#endif
+
+
+ /*@***********************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_END_HEADER */
+ /* */
+ /* <Description> */
+ /* This macro is used in association with @FT_BEGIN_HEADER in header */
+ /* files to ensure that the declarations within are properly */
+ /* encapsulated in an `extern "C" { .. }' block when included from a */
+ /* C++ compiler. */
+ /* */
+#ifdef __cplusplus
+#define FT_END_HEADER }
+#else
+#define FT_END_HEADER /* nothing */
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* Aliases for the FreeType 2 public and configuration files. */
+ /* */
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* header_file_macros */
+ /* */
+ /* <Title> */
+ /* Header File Macros */
+ /* */
+ /* <Abstract> */
+ /* Macro definitions used to #include specific header files. */
+ /* */
+ /* <Description> */
+ /* The following macros are defined to the name of specific */
+ /* FreeType 2 header files. They can be used directly in #include */
+ /* statements as in: */
+ /* */
+ /* { */
+ /* #include FT_FREETYPE_H */
+ /* #include FT_MULTIPLE_MASTERS_H */
+ /* #include FT_GLYPH_H */
+ /* } */
+ /* */
+ /* There are several reasons why we are now using macros to name */
+ /* public header files. The first one is that such macros are not */
+ /* limited to the infamous 8.3 naming rule required by DOS (and */
+ /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
+ /* */
+ /* The second reason is that is allows for more flexibility in the */
+ /* way FreeType 2 is installed on a given system. */
+ /* */
+ /*************************************************************************/
+
+ /* configuration files */
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CONFIG_CONFIG_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* FreeType 2 configuration data. */
+ /* */
+#ifndef FT_CONFIG_CONFIG_H
+#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h>
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CONFIG_STANDARD_LIBRARY_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* FreeType 2 configuration data. */
+ /* */
+#ifndef FT_CONFIG_STANDARD_LIBRARY_H
+#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CONFIG_OPTIONS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* FreeType 2 project-specific configuration options. */
+ /* */
+#ifndef FT_CONFIG_OPTIONS_H
+#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CONFIG_MODULES_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the list of FreeType 2 modules that are statically linked to new */
+ /* library instances in @FT_Init_FreeType. */
+ /* */
+#ifndef FT_CONFIG_MODULES_H
+#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h>
+#endif
+
+ /* public headers */
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_FREETYPE_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the base FreeType 2 API. */
+ /* */
+#define FT_FREETYPE_H <freetype/freetype.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_ERRORS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the list of FreeType 2 error codes (and messages). */
+ /* */
+ /* It is included by @FT_FREETYPE_H. */
+ /* */
+#define FT_ERRORS_H <freetype/fterrors.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_MODULE_ERRORS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the list of FreeType 2 module error offsets (and messages). */
+ /* */
+#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_SYSTEM_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the FreeType 2 interface to low-level operations (i.e. memory */
+ /* management and stream i/o). */
+ /* */
+ /* It is included by @FT_FREETYPE_H. */
+ /* */
+#define FT_SYSTEM_H <freetype/ftsystem.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_IMAGE_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* types definitions related to glyph images (i.e. bitmaps, outlines, */
+ /* scan-converter parameters). */
+ /* */
+ /* It is included by @FT_FREETYPE_H. */
+ /* */
+#define FT_IMAGE_H <freetype/ftimage.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_TYPES_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the basic data types defined by FreeType 2. */
+ /* */
+ /* It is included by @FT_FREETYPE_H. */
+ /* */
+#define FT_TYPES_H <freetype/fttypes.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_LIST_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the list management API of FreeType 2. */
+ /* */
+ /* (Most applications will never need to include this file.) */
+ /* */
+#define FT_LIST_H <freetype/ftlist.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_OUTLINE_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the scalable outline management API of FreeType 2. */
+ /* */
+#define FT_OUTLINE_H <freetype/ftoutln.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_SIZES_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the API used to manage multiple @FT_Size objects per face. */
+ /* */
+#define FT_SIZES_H <freetype/ftsizes.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_MODULE_H */
+ /* */
+ /* @description: */
+ /* 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>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_RENDER_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the renderer module management API of FreeType 2. */
+ /* */
+#define FT_RENDER_H <freetype/ftrender.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_TYPE1_TABLES_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the types and API specific to the Type 1 format. */
+ /* */
+#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_TRUETYPE_IDS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the enumeration values used to identify name strings, languages, */
+ /* encodings, etc. This file really contains a _large_ set of */
+ /* constant macro definitions, taken from the TrueType and OpenType */
+ /* specifications. */
+ /* */
+#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_TRUETYPE_TABLES_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the types and API specific to the TrueType (as well as OpenType) */
+ /* format. */
+ /* */
+#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_TRUETYPE_TAGS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the definitions of TrueType 4-byte `tags' used to identify blocks */
+ /* in SFNT-based font formats (i.e. TrueType and OpenType). */
+ /* */
+#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_BDF_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the definitions of an API to access BDF-specific strings from a */
+ /* face. */
+ /* */
+#define FT_BDF_H <freetype/ftbdf.h>
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_GZIP_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the definitions of an API to support for gzip-compressed files. */
+ /* */
+#define FT_GZIP_H <freetype/ftgzip.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_GLYPH_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the API of the optional glyph management component. */
+ /* */
+#define FT_GLYPH_H <freetype/ftglyph.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_BBOX_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the API of the optional exact bounding box computation routines. */
+ /* */
+#define FT_BBOX_H <freetype/ftbbox.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CACHE_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the API of the optional FreeType 2 cache sub-system. */
+ /* */
+#define FT_CACHE_H <freetype/ftcache.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CACHE_IMAGE_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the `glyph image' API of the FreeType 2 cache sub-system. */
+ /* */
+ /* It is used to define a cache for @FT_Glyph elements. You can also */
+ /* 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>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CACHE_SMALL_BITMAPS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the `small bitmaps' API of the FreeType 2 cache sub-system. */
+ /* */
+ /* It is used to define a cache for small glyph bitmaps in a */
+ /* relatively memory-efficient way. You can also use the API defined */
+ /* 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>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_CACHE_CHARMAP_H */
+ /* */
+ /* @description: */
+ /* 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>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_MAC_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the Macintosh-specific FreeType 2 API. The latter is used to */
+ /* access fonts embedded in resource forks. */
+ /* */
+ /* This header file must be explicitly included by client */
+ /* applications compiled on the Mac (note that the base API still */
+ /* works though). */
+ /* */
+#define FT_MAC_H <freetype/ftmac.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_MULTIPLE_MASTERS_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the optional multiple-masters management API of FreeType 2. */
+ /* */
+#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_SFNT_NAMES_H */
+ /* */
+ /* @description: */
+ /* A macro used in #include statements to name the file containing */
+ /* the optional FreeType 2 API used to access embedded `name' strings */
+ /* in SFNT-based font formats (i.e. TrueType and OpenType). */
+ /* */
+#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
+
+ /* */
+
+#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
+#define FT_STROKER_H <freetype/ftstroker.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_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_XFREE86_H <freetype/ftxf86.h>
+
+#define FT_INCREMENTAL_H <freetype/ftincrem.h>
+
+ /* now include internal headers definitions from <freetype/internal/...> */
+
+#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>
+#include FT_INTERNAL_INTERNAL_H
+
+
+#endif /* __FT2_BUILD_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/config/ftmodule.h
@@ -1,0 +1,19 @@
+FT_USE_MODULE(autohint_module_class)
+FT_USE_MODULE(cff_driver_class)
+/*FT_USE_MODULE(t1cid_driver_class)*/
+/*FT_USE_MODULE(pcf_driver_class)*/
+/*FT_USE_MODULE(bdf_driver_class)*/
+FT_USE_MODULE(psaux_module_class)
+FT_USE_MODULE(psnames_module_class)
+FT_USE_MODULE(pshinter_module_class)
+FT_USE_MODULE(ft_raster1_renderer_class)
+FT_USE_MODULE(sfnt_module_class)
+FT_USE_MODULE(ft_smooth_renderer_class)
+FT_USE_MODULE(ft_smooth_lcd_renderer_class)
+FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
+FT_USE_MODULE(tt_driver_class)
+FT_USE_MODULE(t1_driver_class)
+FT_USE_MODULE(t42_driver_class)
+FT_USE_MODULE(pfr_driver_class)
+/*FT_USE_MODULE(winfnt_driver_class)*/
+
--- /dev/null
+++ b/include/freetype/config/ftmodule.h.orig
@@ -1,0 +1,19 @@
+FT_USE_MODULE(autohint_module_class)
+FT_USE_MODULE(cff_driver_class)
+FT_USE_MODULE(t1cid_driver_class)
+FT_USE_MODULE(pcf_driver_class)
+FT_USE_MODULE(bdf_driver_class)
+FT_USE_MODULE(psaux_module_class)
+FT_USE_MODULE(psnames_module_class)
+FT_USE_MODULE(pshinter_module_class)
+FT_USE_MODULE(ft_raster1_renderer_class)
+FT_USE_MODULE(sfnt_module_class)
+FT_USE_MODULE(ft_smooth_renderer_class)
+FT_USE_MODULE(ft_smooth_lcd_renderer_class)
+FT_USE_MODULE(ft_smooth_lcdv_renderer_class)
+FT_USE_MODULE(tt_driver_class)
+FT_USE_MODULE(t1_driver_class)
+FT_USE_MODULE(t42_driver_class)
+FT_USE_MODULE(pfr_driver_class)
+FT_USE_MODULE(winfnt_driver_class)
+
--- /dev/null
+++ b/include/freetype/config/ftoption.h
@@ -1,0 +1,478 @@
+/***************************************************************************/
+/* */
+/* ftoption.h */
+/* */
+/* User-selectable configuration macros (specification only). */
+/* */
+/* Copyright 1996-2001, 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTOPTION_H__
+#define __FTOPTION_H__
+
+
+#include <ft2build.h>
+
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* USER-SELECTABLE CONFIGURATION MACROS */
+ /* */
+ /* This file contains the default configuration macro definitions for */
+ /* a standard build of the FreeType library. There are three ways to */
+ /* use this file to build project-specific versions of the library: */
+ /* */
+ /* - You can modify this file by hand, but this is not recommended in */
+ /* cases where you would like to build several versions of the */
+ /* library from a single source directory. */
+ /* */
+ /* - You can put a copy of this file in your build directory, more */
+ /* precisely in "$BUILD/freetype/config/ftoption.h", where "$BUILD" */
+ /* is the name of a directory that is included _before_ the FreeType */
+ /* include path during compilation. */
+ /* */
+ /* The default FreeType Makefiles and Jamfiles use the build */
+ /* directory "builds/<system>" by default, but you can easily change */
+ /* that for your own projects. */
+ /* */
+ /* - Copy the file <ft2build.h> to "$BUILD/ft2build.h" and modify it */
+ /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */
+ /* locate this file during the build. For example, */
+ /* */
+ /* #define FT_CONFIG_OPTIONS_H <myftoptions.h> */
+ /* #include <freetype/config/ftheader.h> */
+ /* */
+ /* will use "$BUILD/myftoptions.h" instead of this file for macro */
+ /* definitions. */
+ /* */
+ /* Note also that you can similarly pre-define the macro */
+ /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */
+ /* that are statically linked to the library at compile time. By */
+ /* default, this file is <freetype/config/ftmodule.h>. */
+ /* */
+ /* We highly recommend using the third method whenever possible. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Many compilers provide a non-ANSI 64-bit data type that can be used */
+ /* by FreeType to speed up some computations. However, this will create */
+ /* some problems when compiling the library in strict ANSI mode. */
+ /* */
+ /* For this reason, the use of 64-bit ints is normally disabled when */
+ /* the __STDC__ macro is defined. You can however disable this by */
+ /* defining here the macro FT_CONFIG_OPTION_FORCE_INT64. */
+ /* */
+ /* For most compilers, this will only create compilation warnings */
+ /* when building the library. */
+ /* */
+ /* ObNote: The compiler-specific 64-bit integers are detected in the */
+ /* file "ftconfig.h" either statically, or through Autoconf */
+ /* on platforms that support it. */
+ /* */
+#undef FT_CONFIG_OPTION_FORCE_INT64
+
+
+ /*************************************************************************/
+ /* */
+ /* Gzip-compressed file support. */
+ /* */
+ /* 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). */
+ /* */
+ /* 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 FT_CONFIG_OPTION_USE_ZLIB
+
+
+ /*************************************************************************/
+ /* */
+ /* 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 */
+ /* installation of the ZLib library. This is useful on systems like */
+ /* Unix or VMS where it generally is already available. */
+ /* */
+ /* If you let it undefined, the component will use its own copy */
+ /* of the zlib sources instead. These have been modified to be */
+ /* included directly within the component and *not* export external */
+ /* function names. This allows you to link any program with FreeType */
+ /* _and_ ZLib without linking conflicts. */
+ /* */
+ /* do not #undef this macro here, since the build system might */
+ /* define for certain configurations */
+ /* */
+/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
+
+
+ /*************************************************************************/
+ /* */
+ /* DLL export compilation */
+ /* */
+ /* When compiling FreeType as a DLL, some systems/compilers need a */
+ /* special keyword in front OR after the return type of function */
+ /* declarations. */
+ /* */
+ /* Two macros are used within the FreeType source code to define */
+ /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
+ /* */
+ /* FT_EXPORT( return_type ) */
+ /* */
+ /* is used in a function declaration, as in */
+ /* */
+ /* FT_EXPORT( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ); */
+ /* */
+ /* */
+ /* FT_EXPORT_DEF( return_type ) */
+ /* */
+ /* is used in a function definition, as in */
+ /* */
+ /* FT_EXPORT_DEF( FT_Error ) */
+ /* FT_Init_FreeType( FT_Library* alibrary ) */
+ /* { */
+ /* ... some code ... */
+ /* return FT_Err_Ok; */
+ /* } */
+ /* */
+ /* You can provide your own implementation of FT_EXPORT and */
+ /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */
+ /* will be later automatically defined as `extern return_type' to */
+ /* allow normal compilation. */
+ /* */
+/* #define FT_EXPORT(x) extern x */
+/* #define FT_EXPORT_DEF(x) x */
+
+
+ /*************************************************************************/
+ /* */
+ /* Glyph Postscript Names handling */
+ /* */
+ /* By default, FreeType 2 is compiled with the `PSNames' module. This */
+ /* module is in charge of converting a glyph name string into a */
+ /* Unicode value, or return a Macintosh standard glyph name for the */
+ /* use with the TrueType `post' table. */
+ /* */
+ /* Undefine this macro if you do not want `PSNames' compiled in your */
+ /* build of FreeType. This has the following effects: */
+ /* */
+ /* - The TrueType driver will provide its own set of glyph names, */
+ /* if you build it to support postscript names in the TrueType */
+ /* `post' table. */
+ /* */
+ /* - The Type 1 driver will not be able to synthetize a Unicode */
+ /* charmap out of the glyphs found in the fonts. */
+ /* */
+ /* You would normally undefine this configuration macro when building */
+ /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */
+ /* */
+#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* Postscript Names to Unicode Values support */
+ /* */
+ /* By default, FreeType 2 is built with the `PSNames' module compiled */
+ /* in. Among other things, the module is used to convert a glyph name */
+ /* into a Unicode value. This is especially useful in order to */
+ /* synthetize on the fly a Unicode charmap from the CFF/Type 1 driver */
+ /* through a big table named the `Adobe Glyph List' (AGL). */
+ /* */
+ /* Undefine this macro if you do not want the Adobe Glyph List */
+ /* compiled in your `PSNames' module. The Type 1 driver will not be */
+ /* able to synthetize a Unicode charmap out of the glyphs found in the */
+ /* fonts. */
+ /* */
+#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
+
+
+ /*************************************************************************/
+ /* */
+ /* Allow the use of FT_Incremental_Interface to load typefaces that */
+ /* contain no glyph data, but supply it via a callback function. */
+ /* This allows FreeType to be used with the PostScript language, using */
+ /* the GhostScript interpreter. */
+ /* */
+/* #define FT_CONFIG_OPTION_INCREMENTAL */
+
+
+ /*************************************************************************/
+ /* */
+ /* The size in bytes of the render pool used by the scan-line converter */
+ /* to do all of its work. */
+ /* */
+ /* This must be greater than 4kByte. */
+ /* */
+#define FT_RENDER_POOL_SIZE 16384L
+
+
+ /*************************************************************************/
+ /* */
+ /* FT_MAX_MODULES */
+ /* */
+ /* The maximum number of modules that can be registered in a single */
+ /* FreeType library object. 32 is the default. */
+ /* */
+#define FT_MAX_MODULES 32
+
+
+ /*************************************************************************/
+ /* */
+ /* Debug level */
+ /* */
+ /* FreeType can be compiled in debug or trace mode. In debug mode, */
+ /* errors are reported through the `ftdebug' component. In trace */
+ /* mode, additional messages are sent to the standard output during */
+ /* execution. */
+ /* */
+ /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */
+ /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */
+ /* */
+ /* Don't define any of these macros to compile in `release' mode! */
+ /* */
+/* #define FT_DEBUG_LEVEL_ERROR */
+/* #define FT_DEBUG_LEVEL_TRACE */
+
+
+ /*************************************************************************/
+ /* */
+ /* Memory Debugging */
+ /* */
+ /* FreeType now comes with an integrated memory debugger that is */
+ /* capable of detecting simple errors like memory leaks or double */
+ /* deletes. To compile it within your build of the library, you */
+ /* should define FT_DEBUG_MEMORY here. */
+ /* */
+ /* Note that the memory debugger is only activated at runtime when */
+ /* when the _environment_ variable "FT_DEBUG_MEMORY" is also defined! */
+ /* */
+/* #define FT_DEBUG_MEMORY */
+
+
+
+ /*************************************************************************/
+ /* */
+ /* Module errors */
+ /* */
+ /* If this macro is set (which is _not_ the default), the higher byte */
+ /* of an error code gives the module in which the error has occurred, */
+ /* while the lower byte is the real error code. */
+ /* */
+ /* Setting this macro makes sense for debugging purposes only, since */
+ /* it would break source compatibility of certain programs that use */
+ /* FreeType 2. */
+ /* */
+ /* More details can be found in the files ftmoderr.h and fterrors.h. */
+ /* */
+#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** S F N T D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */
+ /* embedded bitmaps in all formats using the SFNT module (namely */
+ /* TrueType & OpenType). */
+ /* */
+#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */
+ /* load and enumerate the glyph Postscript names in a TrueType or */
+ /* OpenType file. */
+ /* */
+ /* Note that when you do not compile the `PSNames' module by undefining */
+ /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */
+ /* contain additional code used to read the PS Names table from a font. */
+ /* */
+ /* (By default, the module uses `PSNames' to extract glyph names.) */
+ /* */
+#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */
+ /* access the internal name table in a SFNT-based format like TrueType */
+ /* or OpenType. The name table contains various strings used to */
+ /* describe the font, like family name, copyright, version, etc. It */
+ /* does not contain any glyph name though. */
+ /* */
+ /* Accessing SFNT names is done through the functions declared in */
+ /* `freetype/ftnames.h'. */
+ /* */
+#define TT_CONFIG_OPTION_SFNT_NAMES
+
+
+ /*************************************************************************/
+ /* */
+ /* TrueType CMap support */
+ /* */
+ /* Here you can fine-tune which TrueType CMap table format shall be */
+ /* supported. */
+#define TT_CONFIG_CMAP_FORMAT_0
+#define TT_CONFIG_CMAP_FORMAT_2
+#define TT_CONFIG_CMAP_FORMAT_4
+#define TT_CONFIG_CMAP_FORMAT_6
+#define TT_CONFIG_CMAP_FORMAT_8
+#define TT_CONFIG_CMAP_FORMAT_10
+#define TT_CONFIG_CMAP_FORMAT_12
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */
+ /* a bytecode interpreter in the TrueType driver. Note that there are */
+ /* important patent issues related to the use of the interpreter. */
+ /* */
+ /* By undefining this, you will only compile the code necessary to load */
+ /* TrueType glyphs without hinting. */
+ /* */
+ /* do not #undef this macro here, since the build system might */
+ /* define for certain configurations */
+ /* */
+/*#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER*/
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */
+ /* bytecode interpreter with a huge switch statement, rather than a call */
+ /* table. This results in smaller and faster code for a number of */
+ /* architectures. */
+ /* */
+ /* Note however that on some compiler/processor combinations, undefining */
+ /* this macro will generate faster, though larger, code. */
+ /* */
+#define TT_CONFIG_OPTION_INTERPRETER_SWITCH
+
+
+ /*************************************************************************/
+ /* */
+ /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */
+ /* TrueType glyph loader to use Apple's definition of how to handle */
+ /* component offsets in composite glyphs. */
+ /* */
+ /* Apple and MS disagree on the default behavior of component offsets */
+ /* in composites. Apple says that they should be scaled by the scale */
+ /* factors in the transformation matrix (roughly, it's more complex) */
+ /* while MS says they should not. OpenType defines two bits in the */
+ /* composite flags array which can be used to disambiguate, but old */
+ /* fonts will not have them. */
+ /* */
+ /* http://partners.adobe.com/asn/developer/opentype/glyf.html */
+ /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */
+ /* */
+#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and */
+ /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */
+ /* required. */
+ /* */
+#define T1_MAX_DICT_DEPTH 5
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */
+ /* calls during glyph loading. */
+ /* */
+#define T1_MAX_SUBRS_CALLS 16
+
+
+ /*************************************************************************/
+ /* */
+ /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */
+ /* minimum of 16 is required. */
+ /* */
+ /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */
+ /* */
+#define T1_MAX_CHARSTRINGS_OPERANDS 256
+
+
+ /*************************************************************************/
+ /* */
+ /* Define this configuration macro if you want to prevent the */
+ /* compilation of `t1afm', which is in charge of reading Type 1 AFM */
+ /* files into an existing face. Note that if set, the T1 driver will be */
+ /* unable to produce kerning distances. */
+ /* */
+#undef T1_CONFIG_OPTION_NO_AFM
+
+
+ /*************************************************************************/
+ /* */
+ /* Define this configuration macro if you want to prevent the */
+ /* compilation of the Multiple Masters font support in the Type 1 */
+ /* driver. */
+ /* */
+#undef T1_CONFIG_OPTION_NO_MM_SUPPORT
+
+ /* */
+
+FT_END_HEADER
+
+
+#endif /* __FTOPTION_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/config/ftstdlib.h
@@ -1,0 +1,149 @@
+/***************************************************************************/
+/* */
+/* ftstdlib.h */
+/* */
+/* ANSI-specific library and header configuration file (specification */
+/* only). */
+/* */
+/* 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 file is used to group all #includes to the ANSI C library that */
+ /* FreeType normally requires. It also defines macros to rename the */
+ /* standard functions within the FreeType source code. */
+ /* */
+ /* Load a file which defines __FTSTDLIB_H__ before this one to override */
+ /* it. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTSTDLIB_H__
+#define __FTSTDLIB_H__
+
+
+ /**********************************************************************/
+ /* */
+ /* integer limits */
+ /* */
+ /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
+ /* of `int' and `long' in bytes at compile-time. So far, this works */
+ /* for all platforms the library has been tested on. */
+ /* */
+ /* Note that on the extremely rare platforms that do not provide */
+ /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
+ /* old Crays where `int' is 36 bits), we do not make any guarantee */
+ /* about the correct behaviour of FT2 with all fonts. */
+ /* */
+ /* In these case, "ftconfig.h" will refuse to compile anyway with a */
+ /* message like "couldn't find 32-bit type" or something similar. */
+ /* */
+ /* IMPORTANT NOTE: We do not define aliases for heap management and */
+ /* i/o routines (i.e. malloc/free/fopen/fread/...) */
+ /* since these functions should all be encapsulated */
+ /* by platform-specific implementations of */
+ /* "ftsystem.c". */
+ /* */
+ /**********************************************************************/
+
+
+#include <lib9.h>
+#define UINT_MAX 0xffffffffU
+#define ULONG_MAX 0xffffffffUL
+/*#include <limits.h>*/
+
+#define FT_UINT_MAX UINT_MAX
+#define FT_ULONG_MAX ULONG_MAX
+
+
+ /**********************************************************************/
+ /* */
+ /* character and string processing */
+ /* */
+ /**********************************************************************/
+
+
+#include <ctype.h>
+
+#define ft_isalnum isalnum
+#define ft_isupper isupper
+#define ft_islower islower
+#define ft_xdigit isxdigit
+
+
+/*#include <string.h>*/
+
+#define ft_strlen strlen
+#define ft_strcmp strcmp
+#define ft_strncmp strncmp
+#define ft_memcpy memcpy
+#define ft_strcpy strcpy
+#define ft_strncpy strncpy
+#define ft_memset memset
+#define ft_memmove memmove
+#define ft_memcmp memcmp
+
+#include <stdio.h>
+
+#define ft_sprintf sprintf
+
+
+ /**********************************************************************/
+ /* */
+ /* sorting */
+ /* */
+ /**********************************************************************/
+
+
+
+/*#include <stdlib.h>*/
+
+#define ft_qsort qsort
+
+/*#define ft_exit exit /* only used to exit from unhandled exceptions */
+
+#define ft_exit(a) exits("") /* only used to exit from unhandled exceptions */
+
+#define ft_atoi atoi
+
+
+ /**********************************************************************/
+ /* */
+ /* execution control */
+ /* */
+ /**********************************************************************/
+
+
+/*#include <setjmp.h>*/
+
+#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
+ /* jmp_buf is defined as a macro */
+ /* on certain platforms */
+
+#define ft_setjmp setjmp /* same thing here */
+#define ft_longjmp longjmp /* " */
+
+
+ /* the following is only used for debugging purposes, i.e. when */
+ /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
+ /* */
+/*
+#include <stdarg.h>
+*/
+
+
+#endif /* __FTSTDLIB_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/config/ftstdlib.h.orig
@@ -1,0 +1,140 @@
+/***************************************************************************/
+/* */
+/* ftstdlib.h */
+/* */
+/* ANSI-specific library and header configuration file (specification */
+/* only). */
+/* */
+/* 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 file is used to group all #includes to the ANSI C library that */
+ /* FreeType normally requires. It also defines macros to rename the */
+ /* standard functions within the FreeType source code. */
+ /* */
+ /* Load a file which defines __FTSTDLIB_H__ before this one to override */
+ /* it. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTSTDLIB_H__
+#define __FTSTDLIB_H__
+
+
+ /**********************************************************************/
+ /* */
+ /* integer limits */
+ /* */
+ /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
+ /* of `int' and `long' in bytes at compile-time. So far, this works */
+ /* for all platforms the library has been tested on. */
+ /* */
+ /* Note that on the extremely rare platforms that do not provide */
+ /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
+ /* old Crays where `int' is 36 bits), we do not make any guarantee */
+ /* about the correct behaviour of FT2 with all fonts. */
+ /* */
+ /* In these case, "ftconfig.h" will refuse to compile anyway with a */
+ /* message like "couldn't find 32-bit type" or something similar. */
+ /* */
+ /* IMPORTANT NOTE: We do not define aliases for heap management and */
+ /* i/o routines (i.e. malloc/free/fopen/fread/...) */
+ /* since these functions should all be encapsulated */
+ /* by platform-specific implementations of */
+ /* "ftsystem.c". */
+ /* */
+ /**********************************************************************/
+
+
+#include <limits.h>
+
+#define FT_UINT_MAX UINT_MAX
+#define FT_ULONG_MAX ULONG_MAX
+
+
+ /**********************************************************************/
+ /* */
+ /* character and string processing */
+ /* */
+ /**********************************************************************/
+
+
+#include <ctype.h>
+
+#define ft_isalnum isalnum
+#define ft_isupper isupper
+#define ft_islower islower
+#define ft_xdigit isxdigit
+
+
+#include <string.h>
+
+#define ft_strlen strlen
+#define ft_strcmp strcmp
+#define ft_strncmp strncmp
+#define ft_memcpy memcpy
+#define ft_strcpy strcpy
+#define ft_strncpy strncpy
+#define ft_memset memset
+#define ft_memmove memmove
+#define ft_memcmp memcmp
+
+#include <stdio.h>
+
+#define ft_sprintf sprintf
+
+
+ /**********************************************************************/
+ /* */
+ /* sorting */
+ /* */
+ /**********************************************************************/
+
+
+#include <stdlib.h>
+
+#define ft_qsort qsort
+#define ft_exit exit /* only used to exit from unhandled exceptions */
+
+#define ft_atoi atoi
+
+
+ /**********************************************************************/
+ /* */
+ /* execution control */
+ /* */
+ /**********************************************************************/
+
+
+#include <setjmp.h>
+
+#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
+ /* jmp_buf is defined as a macro */
+ /* on certain platforms */
+
+#define ft_setjmp setjmp /* same thing here */
+#define ft_longjmp longjmp /* " */
+
+
+ /* the following is only used for debugging purposes, i.e. when */
+ /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
+ /* */
+#include <stdarg.h>
+
+
+#endif /* __FTSTDLIB_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/freetype.h
@@ -1,0 +1,2860 @@
+/***************************************************************************/
+/* */
+/* freetype.h */
+/* */
+/* FreeType high-level API and common types (specification only). */
+/* */
+/* Copyright 1996-2001, 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FREETYPE_H__
+#define __FREETYPE_H__
+#pragma incomplete _off_ /* it's too hard */
+
+
+ /*************************************************************************/
+ /* */
+ /* The `raster' component duplicates some of the declarations in */
+ /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */
+ /* */
+
+
+ /*************************************************************************/
+ /* */
+ /* The FREETYPE_MAJOR and FREETYPE_MINOR macros are used to version the */
+ /* new FreeType design, which is able to host several kinds of font */
+ /* drivers. It starts at 2.0. */
+ /* */
+#define FREETYPE_MAJOR 2
+#define FREETYPE_MINOR 1
+#define FREETYPE_PATCH 3
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include FT_ERRORS_H
+#include FT_TYPES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S I C T Y P E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* base_interface */
+ /* */
+ /* <Title> */
+ /* Base Interface */
+ /* */
+ /* <Abstract> */
+ /* The FreeType 2 base font interface. */
+ /* */
+ /* <Description> */
+ /* This section describes the public high-level API of FreeType 2. */
+ /* */
+ /* <Order> */
+ /* FT_Library */
+ /* FT_Face */
+ /* FT_Size */
+ /* FT_GlyphSlot */
+ /* FT_CharMap */
+ /* FT_Encoding */
+ /* */
+ /* FT_FaceRec */
+ /* */
+ /* FT_FACE_FLAG_SCALABLE */
+ /* FT_FACE_FLAG_FIXED_SIZES */
+ /* FT_FACE_FLAG_FIXED_WIDTH */
+ /* FT_FACE_FLAG_HORIZONTAL */
+ /* FT_FACE_FLAG_VERTICAL */
+ /* FT_FACE_FLAG_SFNT */
+ /* FT_FACE_FLAG_KERNING */
+ /* FT_FACE_FLAG_MULTIPLE_MASTERS */
+ /* FT_FACE_FLAG_GLYPH_NAMES */
+ /* FT_FACE_FLAG_EXTERNAL_STREAM */
+ /* FT_FACE_FLAG_FAST_GLYPHS */
+ /* */
+ /* FT_STYLE_FLAG_BOLD */
+ /* FT_STYLE_FLAG_ITALIC */
+ /* */
+ /* FT_SizeRec */
+ /* FT_Size_Metrics */
+ /* */
+ /* FT_GlyphSlotRec */
+ /* FT_Glyph_Metrics */
+ /* FT_SubGlyph */
+ /* */
+ /* FT_Bitmap_Size */
+ /* */
+ /* FT_Init_FreeType */
+ /* FT_Done_FreeType */
+ /* FT_Library_Version */
+ /* */
+ /* FT_New_Face */
+ /* FT_Done_Face */
+ /* FT_New_Memory_Face */
+ /* FT_Open_Face */
+ /* FT_Open_Args */
+ /* FT_Open_Flags */
+ /* FT_Parameter */
+ /* FT_Attach_File */
+ /* FT_Attach_Stream */
+ /* */
+ /* FT_Set_Char_Size */
+ /* FT_Set_Pixel_Sizes */
+ /* FT_Set_Transform */
+ /* FT_Load_Glyph */
+ /* FT_Get_Char_Index */
+ /* FT_Get_Name_Index */
+ /* FT_Load_Char */
+ /* */
+ /* FT_LOAD_DEFAULT */
+ /* FT_LOAD_RENDER */
+ /* FT_LOAD_MONOCHROME */
+ /* FT_LOAD_LINEAR_DESIGN */
+ /* FT_LOAD_NO_SCALE */
+ /* FT_LOAD_NO_HINTING */
+ /* FT_LOAD_NO_BITMAP */
+ /* FT_LOAD_CROP_BITMAP */
+ /* */
+ /* FT_LOAD_VERTICAL_LAYOUT */
+ /* FT_LOAD_IGNORE_TRANSFORM */
+ /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */
+ /* FT_LOAD_FORCE_AUTOHINT */
+ /* FT_LOAD_NO_RECURSE */
+ /* FT_LOAD_PEDANTIC */
+ /* */
+ /* FT_Render_Glyph */
+ /* FT_Render_Mode */
+ /* FT_Get_Kerning */
+ /* FT_Kerning_Mode */
+ /* FT_Get_Glyph_Name */
+ /* FT_Get_Postscript_Name */
+ /* */
+ /* FT_CharMapRec */
+ /* FT_Select_Charmap */
+ /* FT_Set_Charmap */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Glyph_Metrics */
+ /* */
+ /* <Description> */
+ /* A structure used to model the metrics of a single glyph. Note */
+ /* that values are expressed in 26.6 fractional pixel format or in */
+ /* font units, depending on context. */
+ /* */
+ /* <Fields> */
+ /* width :: The glyph's width. */
+ /* */
+ /* height :: The glyph's height. */
+ /* */
+ /* horiBearingX :: Horizontal left side bearing. */
+ /* */
+ /* horiBearingY :: Horizontal top side bearing. */
+ /* */
+ /* horiAdvance :: Horizontal advance width. */
+ /* */
+ /* vertBearingX :: Vertical left side bearing. */
+ /* */
+ /* vertBearingY :: Vertical top side bearing. */
+ /* */
+ /* vertAdvance :: Vertical advance height. */
+ /* */
+ typedef struct FT_Glyph_Metrics_
+ {
+ FT_Pos width; /* glyph width */
+ FT_Pos height; /* glyph height */
+
+ FT_Pos horiBearingX; /* left side bearing in horizontal layouts */
+ FT_Pos horiBearingY; /* top side bearing in horizontal layouts */
+ FT_Pos horiAdvance; /* advance width for horizontal layout */
+
+ FT_Pos vertBearingX; /* left side bearing in vertical layouts */
+ FT_Pos vertBearingY; /* top side bearing in vertical layouts */
+ FT_Pos vertAdvance; /* advance height for vertical layout */
+
+ } FT_Glyph_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Bitmap_Size */
+ /* */
+ /* <Description> */
+ /* An extremely simple structure used to model the size of a bitmap */
+ /* strike (i.e., a bitmap instance of the font for a given */
+ /* resolution) in a fixed-size font face. This is used for the */
+ /* `available_sizes' field of the FT_Face_Properties structure. */
+ /* */
+ /* <Fields> */
+ /* height :: The character height in pixels. */
+ /* */
+ /* width :: The character width in pixels. */
+ /* */
+ typedef struct FT_Bitmap_Size_
+ {
+ FT_Short height;
+ FT_Short width;
+
+ } FT_Bitmap_Size;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Library */
+ /* */
+ /* <Description> */
+ /* A handle to a FreeType library instance. Each `library' is */
+ /* completely independent from the others; it is the `root' of a set */
+ /* of objects like fonts, faces, sizes, etc. */
+ /* */
+ /* It also embeds a memory manager (see @FT_Memory), as well as a */
+ /* scan-line converter object (see @FT_Raster). */
+ /* */
+ /* <Note> */
+ /* Library objects are normally created by @FT_Init_FreeType, and */
+ /* destroyed with @FT_Done_FreeType. */
+ /* */
+ typedef struct FT_LibraryRec_ *FT_Library;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Module */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType module object. Each module can be a */
+ /* font driver, a renderer, or anything else that provides services */
+ /* to the formers. */
+ /* */
+ typedef struct FT_ModuleRec_* FT_Module;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Driver */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType font driver object. Each font driver */
+ /* is a special module capable of creating faces from font files. */
+ /* */
+ typedef struct FT_DriverRec_* FT_Driver;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Renderer */
+ /* */
+ /* <Description> */
+ /* A handle to a given FreeType renderer. A renderer is a special */
+ /* module in charge of converting a glyph image to a bitmap, when */
+ /* necessary. Each renderer supports a given glyph image format, and */
+ /* one or more target surface depths. */
+ /* */
+ typedef struct FT_RendererRec_* FT_Renderer;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face */
+ /* */
+ /* <Description> */
+ /* A handle to a given typographic face object. A face object models */
+ /* a given typeface, in a given style. */
+ /* */
+ /* <Note> */
+ /* Each face object also owns a single @FT_GlyphSlot object, as well */
+ /* as one or more @FT_Size objects. */
+ /* */
+ /* Use @FT_New_Face or @FT_Open_Face to create a new face object from */
+ /* a given filepathname or a custom input stream. */
+ /* */
+ /* Use @FT_Done_Face to destroy it (along with its slot and sizes). */
+ /* */
+ /* <Also> */
+ /* The @FT_FaceRec details the publicly accessible fields of a given */
+ /* face object. */
+ /* */
+ typedef struct FT_FaceRec_* FT_Face;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size */
+ /* */
+ /* <Description> */
+ /* A handle to a given size object. Such an object models the data */
+ /* that depends on the current _resolution_ and _character size_ in a */
+ /* given @FT_Face. */
+ /* */
+ /* <Note> */
+ /* Each face object owns one or more sizes. There is however a */
+ /* single _active_ size for the face at any time that will be used by */
+ /* functions like @FT_Load_Glyph, @FT_Get_Kerning, etc. */
+ /* */
+ /* You can use the @FT_Activate_Size API to change the current */
+ /* active size of any given face. */
+ /* */
+ /* <Also> */
+ /* The @FT_SizeRec structure details the publicly accessible fields */
+ /* of a given face object. */
+ /* */
+ typedef struct FT_SizeRec_* FT_Size;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_GlyphSlot */
+ /* */
+ /* <Description> */
+ /* A handle to a given `glyph slot'. A slot is a container where it */
+ /* is possible to load any one of the glyphs contained in its parent */
+ /* face. */
+ /* */
+ /* In other words, each time you call @FT_Load_Glyph or */
+ /* @FT_Load_Char, the slot's content is erased by the new glyph data, */
+ /* i.e. the glyph's metrics, its image (bitmap or outline), and */
+ /* other control information. */
+ /* */
+ /* <Also> */
+ /* @FT_GlyphSlotRec details the publicly accessible glyph fields. */
+ /* */
+ typedef struct FT_GlyphSlotRec_* FT_GlyphSlot;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_CharMap */
+ /* */
+ /* <Description> */
+ /* A handle to a given character map. A charmap is used to translate */
+ /* character codes in a given encoding into glyph indexes for its */
+ /* parent's face. Some font formats may provide several charmaps per */
+ /* font. */
+ /* */
+ /* Each face object owns zero or more charmaps, but only one of them */
+ /* can be "active" and used by @FT_Get_Char_Index or @FT_Load_Char. */
+ /* */
+ /* The list of available charmaps in a face is available through the */
+ /* "face->num_charmaps" and "face->charmaps" fields of @FT_FaceRec. */
+ /* */
+ /* The currently active charmap is available as "face->charmap". */
+ /* You should call @FT_Set_Charmap to change it. */
+ /* */
+ /* <Note> */
+ /* When a new face is created (either through @FT_New_Face or */
+ /* @FT_Open_Face), the library looks for a Unicode charmap within */
+ /* the list and automatically activates it. */
+ /* */
+ typedef struct FT_CharMapRec_* FT_CharMap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_ENC_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four letter tags into an unsigned long. It is */
+ /* used to define "encoding" identifiers (see @FT_Encoding). */
+ /* */
+ /* <Note> */
+ /* Since many 16bit compilers don't like 32bit enumerations, you */
+ /* should redefine this macro in case of problems to something like */
+ /* this: */
+ /* */
+ /* #define FT_ENC_TAG( value, a, b, c, d ) (value) */
+ /* */
+ /* to get a simple enumeration without assigning special numbers. */
+ /* */
+
+#ifndef FT_ENC_TAG
+#define FT_ENC_TAG( value, a, b, c, d ) \
+ value = ( ( (FT_UInt32)(a) << 24 ) | \
+ ( (FT_UInt32)(b) << 16 ) | \
+ ( (FT_UInt32)(c) << 8 ) | \
+ (FT_UInt32)(d) )
+
+#endif /* FT_ENC_TAG */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Encoding */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify encodings supported by charmaps. */
+ /* Used in the @FT_Select_Charmap API function. */
+ /* */
+ /* <Note> */
+ /* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
+ /* all character codes must be expressed as FT_Longs. */
+ /* */
+ /* The values of this type correspond to specific character */
+ /* repertories (i.e. charsets), and not to text encoding methods */
+ /* (like UTF-8, UTF-16, GB2312_EUC, etc.). */
+ /* */
+ /* Other encodings might be defined in the future. */
+ /* */
+ /* <Values> */
+ /* FT_ENCODING_NONE :: */
+ /* The encoding value 0 is reserved. */
+ /* */
+ /* FT_ENCODING_UNICODE :: */
+ /* Corresponds to the Unicode character set. This value covers */
+ /* all versions of the Unicode repertoire, including ASCII and */
+ /* Latin-1. Most fonts include a Unicode charmap, but not all */
+ /* of them. */
+ /* */
+ /* FT_ENCODING_MS_SYMBOL :: */
+ /* Corresponds to the Microsoft Symbol encoding, used to encode */
+ /* mathematical symbols in the 32..255 character code range. For */
+ /* more information, see `http://www.ceviz.net/symbol.htm'. */
+ /* */
+ /* FT_ENCODING_MS_SJIS :: */
+ /* Corresponds to Microsoft's Japanese SJIS encoding. More info */
+ /* at `http://langsupport.japanreference.com/encoding.shtml'. */
+ /* See note on multi-byte encodings below. */
+ /* */
+ /* FT_ENCODING_MS_GB2312 :: */
+ /* Corresponds to the encoding system for Simplified Chinese, as */
+ /* used in China. Only found in some TrueType fonts. */
+ /* */
+ /* FT_ENCODING_MS_BIG5 :: */
+ /* Corresponds to the encoding system for Traditional Chinese, as */
+ /* used in Taiwan and Hong Kong. Only found in some TrueType fonts. */
+ /* */
+ /* FT_ENCODING_MS_WANSUNG :: */
+ /* Corresponds to the Korean encoding system known as Wansung. */
+ /* This is a Microsoft encoding that is only found in some TrueType */
+ /* fonts. For more information, see */
+ /* `http://www.microsoft.com/typography/unicode/949.txt'. */
+ /* */
+ /* FT_ENCODING_MS_JOHAB :: */
+ /* The Korean standard character set (KS C-5601-1992), which */
+ /* corresponds to Windows code page 1361. This character set */
+ /* includes all possible Hangeul character combinations. */
+ /* Only found on some rare TrueType fonts. */
+ /* */
+ /* FT_ENCODING_ADOBE_LATIN_1 :: */
+ /* Corresponds to a Latin-1 encoding as defined in a Type 1 */
+ /* Postscript font. It is limited to 256 character codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_STANDARD :: */
+ /* Corresponds to the Adobe Standard encoding, as found in Type 1, */
+ /* CFF, and OpenType/CFF fonts. It is limited to 256character */
+ /* codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_EXPERT :: */
+ /* Corresponds to the Adobe Expert encoding, as found in Type 1, */
+ /* CFF, and OpenType/CFF fonts. It is limited to 256 character */
+ /* codes. */
+ /* */
+ /* FT_ENCODING_ADOBE_CUSTOM :: */
+ /* Corresponds to a custom encoding, as found in Type 1, CFF, and */
+ /* OpenType/CFF fonts. It is limited to 256 character codes. */
+ /* */
+ /* FT_ENCODING_APPLE_ROMAN :: */
+ /* Corresponds to the 8-bit Apple roman encoding. Many TrueType and */
+ /* OpenType fonts contain a charmap for this encoding, since older */
+ /* versions of Mac OS are able to use it. */
+ /* */
+ /* FT_ENCODING_OLD_LATIN_2 :: */
+ /* This value is deprecated and was never used nor reported by */
+ /* FreeType. Don't use or test for it. */
+ /* */
+ /* <Note> */
+ /* By default, FreeType automatically synthetizes a Unicode charmap */
+ /* for Postscript fonts, using their glyph names dictionaries. */
+ /* However, it will also report the encodings defined explicitly in */
+ /* the font file, for the cases when they are needed, with the Adobe */
+ /* values as well. */
+ /* */
+ typedef enum FT_Encoding_
+ {
+ FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),
+
+ FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),
+ FT_ENC_TAG( FT_ENCODING_UNICODE, 'u', 'n', 'i', 'c' ),
+
+ FT_ENC_TAG( FT_ENCODING_MS_SJIS, 's', 'j', 'i', 's' ),
+ FT_ENC_TAG( FT_ENCODING_MS_GB2312, 'g', 'b', ' ', ' ' ),
+ FT_ENC_TAG( FT_ENCODING_MS_BIG5, 'b', 'i', 'g', '5' ),
+ FT_ENC_TAG( FT_ENCODING_MS_WANSUNG, 'w', 'a', 'n', 's' ),
+ FT_ENC_TAG( FT_ENCODING_MS_JOHAB, 'j', 'o', 'h', 'a' ),
+
+ FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT, 'A', 'D', 'B', 'E' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM, 'A', 'D', 'B', 'C' ),
+ FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1, 'l', 'a', 't', '1' ),
+
+ FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),
+
+ FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )
+
+ } FT_Encoding;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* ft_encoding_xxx */
+ /* */
+ /* <Description> */
+ /* These constants are deprecated; use the corresponding @FT_Encoding */
+ /* values instead. */
+ /* */
+ /* <Values> */
+ /* ft_encoding_none :: see @FT_ENCODING_NONE */
+ /* ft_encoding_unicode :: see @FT_ENCODING_UNICODE */
+ /* ft_encoding_latin_2 :: see @FT_ENCODING_OLD_LATIN_2 */
+ /* ft_encoding_symbol :: see @FT_ENCODING_MS_SYMBOL */
+ /* ft_encoding_sjis :: see @FT_ENCODING_MS_SJIS */
+ /* ft_encoding_gb2312 :: see @FT_ENCODING_MS_GB2312 */
+ /* ft_encoding_big5 :: see @FT_ENCODING_MS_BIG5 */
+ /* ft_encoding_wansung :: see @FT_ENCODING_MS_WANSUNG */
+ /* ft_encoding_johab :: see @FT_ENCODING_MS_JOHAB */
+ /* */
+ /* ft_encoding_adobe_standard :: see @FT_ENCODING_ADOBE_STANDARD */
+ /* ft_encoding_adobe_expert :: see @FT_ENCODING_ADOBE_EXPERT */
+ /* ft_encoding_adobe_custom :: see @FT_ENCODING_ADOBE_CUSTOM */
+ /* ft_encoding_latin_1 :: see @FT_ENCODING_ADOBE_LATIN_1 */
+ /* */
+ /* ft_encoding_apple_roman :: see @FT_ENCODING_APPLE_ROMAN */
+ /* */
+#define ft_encoding_none FT_ENCODING_NONE
+#define ft_encoding_unicode FT_ENCODING_UNICODE
+#define ft_encoding_symbol FT_ENCODING_MS_SYMBOL
+#define ft_encoding_latin_1 FT_ENCODING_ADOBE_LATIN_1
+#define ft_encoding_latin_2 FT_ENCODING_OLD_LATIN_2
+#define ft_encoding_sjis FT_ENCODING_MS_SJIS
+#define ft_encoding_gb2312 FT_ENCODING_MS_GB2312
+#define ft_encoding_big5 FT_ENCODING_MS_BIG5
+#define ft_encoding_wansung FT_ENCODING_MS_WANSUNG
+#define ft_encoding_johab FT_ENCODING_MS_JOHAB
+
+#define ft_encoding_adobe_standard FT_ENCODING_ADOBE_STANDARD
+#define ft_encoding_adobe_expert FT_ENCODING_ADOBE_EXPERT
+#define ft_encoding_adobe_custom FT_ENCODING_ADOBE_CUSTOM
+#define ft_encoding_apple_roman FT_ENCODING_APPLE_ROMAN
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_CharMapRec */
+ /* */
+ /* <Description> */
+ /* The base charmap structure. */
+ /* */
+ /* <Fields> */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* encoding :: An @FT_Encoding tag identifying the charmap. Use */
+ /* this with @FT_Select_Charmap. */
+ /* */
+ /* platform_id :: An ID number describing the platform for the */
+ /* following encoding ID. This comes directly from */
+ /* the TrueType specification and should be emulated */
+ /* for other formats. */
+ /* */
+ /* encoding_id :: A platform specific encoding number. This also */
+ /* comes from the TrueType specification and should be */
+ /* emulated similarly. */
+ /* */
+ typedef struct FT_CharMapRec_
+ {
+ FT_Face face;
+ FT_Encoding encoding;
+ FT_UShort platform_id;
+ FT_UShort encoding_id;
+
+ } FT_CharMapRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S E O B J E C T C L A S S E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Face_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an FT_Face_InternalRec structure, used to */
+ /* model private data of a given @FT_Face object. */
+ /* */
+ /* This structure might change between releases of FreeType 2 and is */
+ /* not generally available to client applications. */
+ /* */
+ typedef struct FT_Face_InternalRec_* FT_Face_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_FaceRec */
+ /* */
+ /* <Description> */
+ /* FreeType root face class structure. A face object models the */
+ /* resolution and point-size independent data found in a font file. */
+ /* */
+ /* <Fields> */
+ /* num_faces :: In the case where the face is located in a */
+ /* collection (i.e., a file which embeds */
+ /* several faces), this is the total number of */
+ /* faces found in the resource. 1 by default. */
+ /* */
+ /* 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 */
+ /* collections (which embed several fonts in a */
+ /* single resource/file). */
+ /* */
+ /* face_flags :: A set of bit flags that give important */
+ /* information about the face; see the */
+ /* @FT_FACE_FLAG_XXX constants for details. */
+ /* */
+ /* style_flags :: A set of bit flags indicating the style of */
+ /* the face (i.e., italic, bold, underline, */
+ /* etc). See the @FT_STYLE_FLAG_XXX */
+ /* constants. */
+ /* */
+ /* num_glyphs :: The total number of glyphs in the face. */
+ /* */
+ /* family_name :: The face's family name. This is an ASCII */
+ /* string, usually in English, which describes */
+ /* the typeface's family (like `Times New */
+ /* Roman', `Bodoni', `Garamond', etc). This */
+ /* is a least common denominator used to list */
+ /* fonts. Some formats (TrueType & OpenType) */
+ /* provide localized and Unicode versions of */
+ /* this string. Applications should use the */
+ /* format specific interface to access them. */
+ /* */
+ /* style_name :: The face's style name. This is an ASCII */
+ /* string, usually in English, which describes */
+ /* the typeface's style (like `Italic', */
+ /* `Bold', `Condensed', etc). Not all font */
+ /* formats provide a style name, so this field */
+ /* is optional, and can be set to NULL. As */
+ /* for `family_name', some formats provide */
+ /* localized/Unicode versions of this string. */
+ /* Applications should use the format specific */
+ /* interface to access them. */
+ /* */
+ /* num_fixed_sizes :: The number of fixed sizes available in this */
+ /* face. This should be set to 0 for scalable */
+ /* fonts, unless its face includes a complete */
+ /* set of glyphs (called a `strike') for the */
+ /* specified sizes. */
+ /* */
+ /* available_sizes :: An array of sizes specifying the available */
+ /* bitmap/graymap sizes that are contained in */
+ /* in the font face. Should be set to NULL if */
+ /* the field `num_fixed_sizes' is set to 0. */
+ /* */
+ /* num_charmaps :: The total number of character maps in the */
+ /* face. */
+ /* */
+ /* charmaps :: A table of pointers to the face's charmaps. */
+ /* Used to scan the list of available charmaps */
+ /* -- this table might change after a call to */
+ /* @FT_Attach_File or @FT_Attach_Stream (e.g. */
+ /* if used to hook an additional encoding or */
+ /* CMap to the face object). */
+ /* */
+ /* generic :: A field reserved for client uses. See the */
+ /* @FT_Generic type description. */
+ /* */
+ /* bbox :: The font bounding box. Coordinates are */
+ /* expressed in font units (see units_per_EM). */
+ /* The box is large enough to contain any */
+ /* glyph from the font. Thus, bbox.yMax can */
+ /* be seen as the `maximal ascender', */
+ /* bbox.yMin as the `minimal descender', and */
+ /* the maximal glyph width is given by */
+ /* `bbox.xMax-bbox.xMin' (not to be confused */
+ /* with the maximal _advance_width_). Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* units_per_EM :: The number of font units per EM square for */
+ /* this face. This is typically 2048 for */
+ /* TrueType fonts, 1000 for Type1 fonts, and */
+ /* should be set to the (unrealistic) value 1 */
+ /* for fixed-sizes fonts. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* ascender :: The face's ascender is the vertical */
+ /* distance from the baseline to the topmost */
+ /* point of any glyph in the face. This */
+ /* field's value is positive, expressed in */
+ /* font units. Some font designs use a value */
+ /* different from `bbox.yMax'. Only relevant */
+ /* for scalable formats. */
+ /* */
+ /* descender :: The face's descender is the vertical */
+ /* distance from the baseline to the */
+ /* bottommost point of any glyph in the face. */
+ /* This field's value is *negative*, expressed */
+ /* in font units. Some font designs use a */
+ /* value different from `bbox.yMin'. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* height :: The face's height is the vertical distance */
+ /* from one baseline to the next when writing */
+ /* several lines of text. Its value is always */
+ /* positive, expressed in font units. The */
+ /* value can be computed as */
+ /* `ascender+descender+line_gap' where the */
+ /* value of `line_gap' is also called */
+ /* `external leading'. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* max_advance_width :: The maximal advance width, in font units, */
+ /* for all glyphs in this face. This can be */
+ /* used to make word wrapping computations */
+ /* faster. Only relevant for scalable */
+ /* formats. */
+ /* */
+ /* max_advance_height :: The maximal advance height, in font units, */
+ /* for all glyphs in this face. This is only */
+ /* relevant for vertical layouts, and should */
+ /* be set to the `height' for fonts that do */
+ /* not provide vertical metrics. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* underline_position :: The position, in font units, of the */
+ /* underline line for this face. It's the */
+ /* center of the underlining stem. Only */
+ /* relevant for scalable formats. */
+ /* */
+ /* underline_thickness :: The thickness, in font units, of the */
+ /* underline for this face. Only relevant for */
+ /* scalable formats. */
+ /* */
+ /* glyph :: The face's associated glyph slot(s). This */
+ /* object is created automatically with a new */
+ /* face object. However, certain kinds of */
+ /* applications (mainly tools like converters) */
+ /* can need more than one slot to ease their */
+ /* task. */
+ /* */
+ /* size :: The current active size for this face. */
+ /* */
+ /* charmap :: The current active charmap for this face. */
+ /* */
+ typedef struct FT_FaceRec_
+ {
+ FT_Long num_faces;
+ FT_Long face_index;
+
+ FT_Long face_flags;
+ FT_Long style_flags;
+
+ FT_Long num_glyphs;
+
+ FT_String* family_name;
+ FT_String* style_name;
+
+ FT_Int num_fixed_sizes;
+ FT_Bitmap_Size* available_sizes;
+
+ FT_Int num_charmaps;
+ FT_CharMap* charmaps;
+
+ FT_Generic generic;
+
+ /*# the following are only relevant to scalable outlines */
+ FT_BBox bbox;
+
+ FT_UShort units_per_EM;
+ FT_Short ascender;
+ FT_Short descender;
+ FT_Short height;
+
+ FT_Short max_advance_width;
+ FT_Short max_advance_height;
+
+ FT_Short underline_position;
+ FT_Short underline_thickness;
+
+ FT_GlyphSlot glyph;
+ FT_Size size;
+ FT_CharMap charmap;
+
+ /*@private begin */
+
+ FT_Driver driver;
+ FT_Memory memory;
+ FT_Stream stream;
+
+ FT_ListRec sizes_list;
+
+ FT_Generic autohint;
+ void* extensions;
+
+ FT_Face_Internal internal;
+
+ /*@private end */
+
+ } FT_FaceRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_FACE_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* 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. */
+ /* */
+ /* <Values> */
+ /* FT_FACE_FLAG_SCALABLE :: */
+ /* Indicates that the face provides vectorial outlines. This */
+ /* doesn't prevent embedded bitmaps, i.e., a face can have both */
+ /* this bit and @FT_FACE_FLAG_FIXED_SIZES set */
+ /* */
+ /* FT_FACE_FLAG_FIXED_SIZES :: */
+ /* Indicates that the face contains `fixed sizes', i.e., bitmap */
+ /* strikes for some given pixel sizes. See the `num_fixed_sizes' */
+ /* and `available_sizes' fields of @FT_FaceRec. */
+ /* */
+ /* FT_FACE_FLAG_FIXED_WIDTH :: */
+ /* Indicates that the face contains fixed-width characters (like */
+ /* Courier, Lucido, MonoType, etc.). */
+ /* */
+ /* FT_FACE_FLAG_SFNT :: */
+ /* Indicates that the face uses the `sfnt' storage scheme. For */
+ /* now, this means TrueType and OpenType. */
+ /* */
+ /* FT_FACE_FLAG_HORIZONTAL :: */
+ /* Indicates that the face contains horizontal glyph metrics. This */
+ /* should be set for all common formats. */
+ /* */
+ /* FT_FACE_FLAG_VERTICAL :: */
+ /* Indicates that the face contains vertical glyph metrics. This */
+ /* is only available in some formats, not all of them. */
+ /* */
+ /* FT_FACE_FLAG_KERNING :: */
+ /* Indicates that the face contains kerning information. If set, */
+ /* the kerning distance can be retrieved through the function */
+ /* @FT_Get_Kerning. Note that if unset, this function will always */
+ /* return the vector (0,0). */
+ /* */
+ /* FT_FACE_FLAG_FAST_GLYPHS :: */
+ /* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. */
+ /* */
+ /* FT_FACE_FLAG_MULTIPLE_MASTERS :: */
+ /* Indicates that the font contains multiple masters and is capable */
+ /* of interpolating between them. See the multiple-masters */
+ /* specific API for details. */
+ /* */
+ /* FT_FACE_FLAG_GLYPH_NAMES :: */
+ /* Indicates that the font contains glyph names that can be */
+ /* retrieved through @FT_Get_Glyph_Names. Note that some TrueType */
+ /* fonts contain broken glyph name tables. Use the function */
+ /* @FT_Has_PS_Glyph_Name when needed. */
+ /* */
+ /* FT_FACE_FLAG_EXTERNAL_STREAM :: */
+ /* Used internally by FreeType to indicate that a face's stream was */
+ /* provided by the client application and should not be destroyed */
+ /* when @FT_Done_Face is called. Don't read or test this flag. */
+ /* */
+#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
+#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
+#define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 )
+#define FT_FACE_FLAG_SFNT ( 1L << 3 )
+#define FT_FACE_FLAG_HORIZONTAL ( 1L << 4 )
+#define FT_FACE_FLAG_VERTICAL ( 1L << 5 )
+#define FT_FACE_FLAG_KERNING ( 1L << 6 )
+#define FT_FACE_FLAG_FAST_GLYPHS ( 1L << 7 )
+#define FT_FACE_FLAG_MULTIPLE_MASTERS ( 1L << 8 )
+#define FT_FACE_FLAG_GLYPH_NAMES ( 1L << 9 )
+#define FT_FACE_FLAG_EXTERNAL_STREAM ( 1L << 10 )
+
+ /* */
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_HAS_HORIZONTAL( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains */
+ /* horizontal metrics (this is true for all font formats though). */
+ /* */
+ /* @also: */
+ /* @FT_HAS_VERTICAL can be used to check for vertical metrics. */
+ /* */
+#define FT_HAS_HORIZONTAL( face ) \
+ ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_HAS_VERTICAL( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains vertical */
+ /* metrics. */
+ /* */
+#define FT_HAS_VERTICAL( face ) \
+ ( face->face_flags & FT_FACE_FLAG_VERTICAL )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_HAS_KERNING( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains kerning */
+ /* data that can be accessed with @FT_Get_Kerning. */
+ /* */
+#define FT_HAS_KERNING( face ) \
+ ( face->face_flags & FT_FACE_FLAG_KERNING )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_IS_SCALABLE( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains a */
+ /* scalable font face (true for TrueType, Type 1, CID, and */
+ /* OpenType/CFF font formats. */
+ /* */
+#define FT_IS_SCALABLE( face ) \
+ ( face->face_flags & FT_FACE_FLAG_SCALABLE )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_IS_SFNT( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains a font */
+ /* whose format is based on the SFNT storage scheme. This usually */
+ /* means: TrueType fonts, OpenType fonts, as well as SFNT-based */
+ /* embedded bitmap fonts. */
+ /* */
+ /* If this macro is true, all functions defined in @FT_SFNT_NAMES_H */
+ /* and @FT_TRUETYPE_TABLES_H are available. */
+ /* */
+#define FT_IS_SFNT( face ) \
+ ( face->face_flags & FT_FACE_FLAG_SFNT )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_IS_FIXED_WIDTH( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains a font */
+ /* face that contains fixed-width (or "monospace", "fixed-pitch", */
+ /* etc.) glyphs. */
+ /* */
+#define FT_IS_FIXED_WIDTH( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_IS_FIXED_SIZES( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains some */
+ /* embedded bitmaps. See the `fixed_sizes' field of the @FT_FaceRec */
+ /* structure. */
+ /* */
+#define FT_HAS_FIXED_SIZES( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
+
+
+ /* */
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_HAS_FAST_GLYPHS( face ) */
+ /* */
+ /* @description: */
+ /* Deprecated; indicates that the face contains so-called "fast" */
+ /* glyph bitmaps. */
+ /* */
+#define FT_HAS_FAST_GLYPHS( face ) \
+ ( face->face_flags & FT_FACE_FLAG_FAST_GLYPHS )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_HAS_GLYPH_NAMES( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains some */
+ /* glyph names that can be accessed through @FT_Get_Glyph_Names. */
+ /* */
+#define FT_HAS_GLYPH_NAMES( face ) \
+ ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )
+
+
+ /*************************************************************************/
+ /* */
+ /* @macro: */
+ /* FT_HAS_MULTIPLE_MASTERS( face ) */
+ /* */
+ /* @description: */
+ /* A macro that returns true whenever a face object contains some */
+ /* multiple masters. The functions provided by */
+ /* @FT_MULTIPLE_MASTERS_H are then available to choose the exact */
+ /* design you want. */
+ /* */
+#define FT_HAS_MULTIPLE_MASTERS( face ) \
+ ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Constant> */
+ /* FT_STYLE_FLAG_XXX */
+ /* */
+ /* <Description> */
+ /* A list of bit-flags used to indicate the style of a given face. */
+ /* These are used in the `style_flags' field of @FT_FaceRec. */
+ /* */
+ /* <Values> */
+ /* FT_STYLE_FLAG_ITALIC :: */
+ /* Indicates that a given face is italicized. */
+ /* */
+ /* FT_STYLE_FLAG_BOLD :: */
+ /* Indicates that a given face is bold. */
+ /* */
+#define FT_STYLE_FLAG_ITALIC ( 1 << 0 )
+#define FT_STYLE_FLAG_BOLD ( 1 << 1 )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Size_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an FT_Size_InternalRec structure, used to */
+ /* model private data of a given FT_Size object. */
+ /* */
+ typedef struct FT_Size_InternalRec_* FT_Size_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* FreeType base size metrics */
+ /* */
+ /* <Struct> */
+ /* FT_Size_Metrics */
+ /* */
+ /* <Description> */
+ /* The size metrics structure returned scaled important distances for */
+ /* a given size object. */
+ /* */
+ /* <Fields> */
+ /* x_ppem :: The character width, expressed in integer pixels. */
+ /* This is the width of the EM square expressed in */
+ /* pixels, hence the term `ppem' (pixels per EM). */
+ /* */
+ /* y_ppem :: The character height, expressed in integer pixels. */
+ /* This is the height of the EM square expressed in */
+ /* pixels, hence the term `ppem' (pixels per EM). */
+ /* */
+ /* x_scale :: A simple 16.16 fixed point format coefficient used */
+ /* to scale horizontal distances expressed in font */
+ /* units to fractional (26.6) pixel coordinates. */
+ /* */
+ /* y_scale :: A simple 16.16 fixed point format coefficient used */
+ /* to scale vertical distances expressed in font */
+ /* units to fractional (26.6) pixel coordinates. */
+ /* */
+ /* ascender :: The ascender, expressed in 26.6 fixed point */
+ /* pixels. Always positive. */
+ /* */
+ /* descender :: The descender, expressed in 26.6 fixed point */
+ /* pixels. Always positive. */
+ /* */
+ /* height :: The text height, expressed in 26.6 fixed point */
+ /* pixels. Always positive. */
+ /* */
+ /* max_advance :: Maximum horizontal advance, expressed in 26.6 */
+ /* fixed point pixels. Always positive. */
+ /* */
+ /* <Note> */
+ /* The values of `ascender', `descender', and `height' are only the */
+ /* scaled versions of `face->ascender', `face->descender', and */
+ /* `face->height'. */
+ /* */
+ /* Unfortunately, due to glyph hinting, these values might not be */
+ /* exact for certain fonts, they thus must be treated as unreliable */
+ /* with an error margin of at least one pixel! */
+ /* */
+ /* Indeed, the only way to get the exact pixel ascender and descender */
+ /* is to render _all_ glyphs. As this would be a definite */
+ /* performance hit, it is up to client applications to perform such */
+ /* computations. */
+ /* */
+ typedef struct FT_Size_Metrics_
+ {
+ FT_UShort x_ppem; /* horizontal pixels per EM */
+ FT_UShort y_ppem; /* vertical pixels per EM */
+
+ FT_Fixed x_scale; /* two scales used to convert font units */
+ FT_Fixed y_scale; /* to 26.6 frac. pixel coordinates.. */
+
+ FT_Pos ascender; /* ascender in 26.6 frac. pixels */
+ FT_Pos descender; /* descender in 26.6 frac. pixels */
+ FT_Pos height; /* text height in 26.6 frac. pixels */
+ FT_Pos max_advance; /* max horizontal advance, in 26.6 pixels */
+
+ } FT_Size_Metrics;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SizeRec */
+ /* */
+ /* <Description> */
+ /* FreeType root size class structure. A size object models the */
+ /* resolution and pointsize dependent data of a given face. */
+ /* */
+ /* <Fields> */
+ /* face :: Handle to the parent face object. */
+ /* */
+ /* generic :: A typeless pointer, which is unused by the FreeType */
+ /* library or any of its drivers. It can be used by */
+ /* client applications to link their own data to each size */
+ /* object. */
+ /* */
+ /* metrics :: Metrics for this size object. This field is read-only. */
+ /* */
+ typedef struct FT_SizeRec_
+ {
+ FT_Face face; /* parent face object */
+ FT_Generic generic; /* generic pointer for client uses */
+ FT_Size_Metrics metrics; /* size metrics */
+ FT_Size_Internal internal;
+
+ } FT_SizeRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_SubGlyph */
+ /* */
+ /* <Description> */
+ /* The subglyph structure is an internal object used to describe */
+ /* subglyphs (for example, in the case of composites). */
+ /* */
+ /* <Note> */
+ /* The subglyph implementation is not part of the high-level API, */
+ /* hence the forward structure declaration. */
+ /* */
+ typedef struct FT_SubGlyphRec_* FT_SubGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Slot_Internal */
+ /* */
+ /* <Description> */
+ /* An opaque handle to an FT_Slot_InternalRec structure, used to */
+ /* model private data of a given FT_GlyphSlot object. */
+ /* */
+ typedef struct FT_Slot_InternalRec_* FT_Slot_Internal;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_GlyphSlotRec */
+ /* */
+ /* <Description> */
+ /* FreeType root glyph slot class structure. A glyph slot is a */
+ /* container where individual glyphs can be loaded, be they */
+ /* vectorial or bitmap/graymaps. */
+ /* */
+ /* <Fields> */
+ /* library :: A handle to the FreeType library instance */
+ /* this slot belongs to. */
+ /* */
+ /* face :: A handle to the parent face object. */
+ /* */
+ /* next :: In some cases (like some font tools), several */
+ /* glyph slots per face object can be a good */
+ /* thing. As this is rare, the glyph slots are */
+ /* listed through a direct, single-linked list */
+ /* using its `next' field. */
+ /* */
+ /* generic :: A typeless pointer which is unused by the */
+ /* FreeType library or any of its drivers. It */
+ /* can be used by client applications to link */
+ /* their own data to each glyph slot object. */
+ /* */
+ /* metrics :: The metrics of the last loaded glyph in the */
+ /* slot. The returned values depend on the last */
+ /* load flags (see the @FT_Load_Glyph API */
+ /* function) and can be expressed either in 26.6 */
+ /* fractional pixels or font units. */
+ /* */
+ /* Note that even when the glyph image is */
+ /* transformed, the metrics are not. */
+ /* */
+ /* linearHoriAdvance :: For scalable formats only, this field holds */
+ /* the linearly scaled horizontal advance width */
+ /* for the glyph (i.e. the scaled and unhinted */
+ /* value of the hori advance). This can be */
+ /* important to perform correct WYSIWYG layout. */
+ /* */
+ /* Note that this value is expressed by default */
+ /* in 16.16 pixels. However, when the glyph is */
+ /* loaded with the FT_LOAD_LINEAR_DESIGN flag, */
+ /* this field contains simply the value of the */
+ /* advance in original font units. */
+ /* */
+ /* linearVertAdvance :: For scalable formats only, this field holds */
+ /* the linearly scaled vertical advance height */
+ /* for the glyph. See linearHoriAdvance for */
+ /* comments. */
+ /* */
+ /* advance :: This is the transformed advance width for the */
+ /* glyph. */
+ /* */
+ /* format :: This field indicates the format of the image */
+ /* contained in the glyph slot. Typically */
+ /* FT_GLYPH_FORMAT_BITMAP, */
+ /* FT_GLYPH_FORMAT_OUTLINE, and */
+ /* FT_GLYPH_FORMAT_COMPOSITE, but others are */
+ /* possible. */
+ /* */
+ /* bitmap :: This field is used as a bitmap descriptor */
+ /* when the slot format is */
+ /* FT_GLYPH_FORMAT_BITMAP. Note that the */
+ /* address and content of the bitmap buffer can */
+ /* change between calls of @FT_Load_Glyph and a */
+ /* few other functions. */
+ /* */
+ /* bitmap_left :: This is the bitmap's left bearing expressed */
+ /* in integer pixels. Of course, this is only */
+ /* valid if the format is */
+ /* FT_GLYPH_FORMAT_BITMAP. */
+ /* */
+ /* bitmap_top :: This is the bitmap's top bearing expressed in */
+ /* integer pixels. Remember that this is the */
+ /* distance from the baseline to the top-most */
+ /* glyph scanline, upwards y-coordinates being */
+ /* *positive*. */
+ /* */
+ /* outline :: The outline descriptor for the current glyph */
+ /* image if its format is */
+ /* ft_glyph_bitmap_outline. */
+ /* */
+ /* num_subglyphs :: The number of subglyphs in a composite glyph. */
+ /* This format is only valid for the composite */
+ /* glyph format, that should normally only be */
+ /* loaded with the FT_LOAD_NO_RECURSE flag. */
+ /* */
+ /* subglyphs :: An array of subglyph descriptors for */
+ /* composite glyphs. There are `num_subglyphs' */
+ /* elements in there. */
+ /* */
+ /* control_data :: Certain font drivers can also return the */
+ /* control data for a given glyph image (e.g. */
+ /* TrueType bytecode, Type 1 charstrings, etc.). */
+ /* This field is a pointer to such data. */
+ /* */
+ /* control_len :: This is the length in bytes of the control */
+ /* data. */
+ /* */
+ /* other :: Really wicked formats can use this pointer to */
+ /* present their own glyph image to client apps. */
+ /* Note that the app will need to know about the */
+ /* image format. */
+ /* */
+ /* <Note> */
+ /* If @FT_Load_Glyph is called with default flags (see */
+ /* @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in */
+ /* its native format (e.g. a vectorial outline for TrueType and */
+ /* Type 1 formats). */
+ /* */
+ /* This image can later be converted into a bitmap by calling */
+ /* @FT_Render_Glyph. This function finds the current renderer for */
+ /* the native image's format then invokes it. */
+ /* */
+ /* The renderer is in charge of transforming the native image through */
+ /* the slot's face transformation fields, then convert it into a */
+ /* bitmap that is returned in `slot->bitmap'. */
+ /* */
+ /* Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */
+ /* to specify the position of the bitmap relative to the current pen */
+ /* position (e.g. coordinates [0,0] on the baseline). Of course, */
+ /* `slot->format' is also changed to `FT_GLYPH_FORMAT_BITMAP' . */
+ /* */
+ typedef struct FT_GlyphSlotRec_
+ {
+ FT_Library library;
+ FT_Face face;
+ FT_GlyphSlot next;
+ FT_UInt flags;
+ FT_Generic generic;
+
+ FT_Glyph_Metrics metrics;
+ FT_Fixed linearHoriAdvance;
+ FT_Fixed linearVertAdvance;
+ FT_Vector advance;
+
+ FT_Glyph_Format format;
+
+ FT_Bitmap bitmap;
+ FT_Int bitmap_left;
+ FT_Int bitmap_top;
+
+ FT_Outline outline;
+
+ FT_UInt num_subglyphs;
+ FT_SubGlyph subglyphs;
+
+ void* control_data;
+ long control_len;
+
+ void* other;
+
+ FT_Slot_Internal internal;
+
+ } FT_GlyphSlotRec;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* F U N C T I O N S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Init_FreeType */
+ /* */
+ /* <Description> */
+ /* Initializes a new FreeType library object. The set of modules */
+ /* that are registered by this function is determined at build time. */
+ /* */
+ /* <Output> */
+ /* alibrary :: A handle to a new library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Init_FreeType( FT_Library *alibrary );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Library_Version */
+ /* */
+ /* <Description> */
+ /* Return the version of the FreeType library being used. This is */
+ /* useful when dynamically linking to the library, since one cannot */
+ /* use the macros FT_FREETYPE_MAJOR, FT_FREETYPE_MINOR, and */
+ /* FT_FREETYPE_PATCH. */
+ /* */
+ /* <Input> */
+ /* library :: A source library handle. */
+ /* */
+ /* <Output> */
+ /* amajor :: The major version number. */
+ /* */
+ /* aminor :: The minor version number. */
+ /* */
+ /* apatch :: The patch version number. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a 'library' argument is because */
+ /* certain programs implement library initialization in a custom way */
+ /* that doesn't use `FT_Init_FreeType'. */
+ /* */
+ /* In such cases, the library version might not be available before */
+ /* the library object has been created. */
+ /* */
+ FT_EXPORT( void )
+ FT_Library_Version( FT_Library library,
+ FT_Int *amajor,
+ FT_Int *aminor,
+ FT_Int *apatch );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_FreeType */
+ /* */
+ /* <Description> */
+ /* Destroys a given FreeType library object and all of its childs, */
+ /* including resources, drivers, faces, sizes, etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the target library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_FreeType( FT_Library library );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Open_Flags */
+ /* */
+ /* <Description> */
+ /* An enumeration used to list the bit flags used within the */
+ /* `flags' field of the @FT_Open_Args structure. */
+ /* */
+ /* <Fields> */
+ /* FT_OPEN_MEMORY :: This is a memory-based stream. */
+ /* */
+ /* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
+ /* */
+ /* FT_OPEN_PATHNAME :: Create a new input stream from a C */
+ /* path name. */
+ /* */
+ /* FT_OPEN_DRIVER :: Use the `driver' field. */
+ /* */
+ /* FT_OPEN_PARAMS :: Use the `num_params' & `params' field. */
+ /* */
+ /* <Note> */
+ /* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
+ /* flags are mutually exclusive. */
+ /* */
+ typedef enum
+ {
+ FT_OPEN_MEMORY = 1,
+ FT_OPEN_STREAM = 2,
+ FT_OPEN_PATHNAME = 4,
+ FT_OPEN_DRIVER = 8,
+ FT_OPEN_PARAMS = 16
+
+ } FT_Open_Flags;
+
+#define FT_OPEN_MEMORY FT_OPEN_MEMORY
+#define FT_OPEN_STREAM FT_OPEN_STREAM
+#define FT_OPEN_PATHNAME FT_OPEN_PATHNAME
+#define FT_OPEN_DRIVER FT_OPEN_DRIVER
+#define FT_OPEN_PARAMS FT_OPEN_PARAMS
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Parameter */
+ /* */
+ /* <Description> */
+ /* A simple structure used to pass more or less generic parameters */
+ /* to @FT_Open_Face. */
+ /* */
+ /* <Fields> */
+ /* tag :: A 4-byte identification tag. */
+ /* */
+ /* data :: A pointer to the parameter data. */
+ /* */
+ /* <Note> */
+ /* The id and function of parameters are driver-specific. */
+ /* */
+ typedef struct FT_Parameter_
+ {
+ FT_ULong tag;
+ FT_Pointer data;
+
+ } FT_Parameter;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Open_Args */
+ /* */
+ /* <Description> */
+ /* A structure used to indicate how to open a new font file/stream. */
+ /* A pointer to such a structure can be used as a parameter for the */
+ /* functions @FT_Open_Face and @FT_Attach_Stream. */
+ /* */
+ /* <Fields> */
+ /* flags :: A set of bit flags indicating how to use the */
+ /* structure. */
+ /* */
+ /* memory_base :: The first byte of the file in memory. */
+ /* */
+ /* memory_size :: The size in bytes of the file in memory. */
+ /* */
+ /* pathname :: A pointer to an 8-bit file pathname. */
+ /* */
+ /* stream :: A handle to a source stream object. */
+ /* */
+ /* driver :: This field is exclusively used by @FT_Open_Face; */
+ /* it simply specifies the font driver to use to open */
+ /* the face. If set to 0, FreeType will try to load */
+ /* the face with each one of the drivers in its list. */
+ /* */
+ /* num_params :: The number of extra parameters. */
+ /* */
+ /* params :: Extra parameters passed to the font driver when */
+ /* opening a new face. */
+ /* */
+ /* <Note> */
+ /* The stream type is determined by the contents of `flags' which */
+ /* are tested in the following order by @FT_Open_Face: */
+ /* */
+ /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */
+ /* memory file of `memory_size' bytes,located at `memory_address'. */
+ /* */
+ /* Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a */
+ /* custom input stream `stream' is used. */
+ /* */
+ /* Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this */
+ /* is a normal file and use `pathname' to open it. */
+ /* */
+ /* If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face will only try to */
+ /* open the file with the driver whose handler is in `driver'. */
+ /* */
+ /* If the `FT_OPEN_PARAMS' bit is set, the parameters given by */
+ /* `num_params' and `params' will be used. They are ignored */
+ /* otherwise. */
+ /* */
+ typedef struct FT_Open_Args_
+ {
+ FT_Open_Flags flags;
+ const FT_Byte* memory_base;
+ FT_Long memory_size;
+ FT_String* pathname;
+ FT_Stream stream;
+ FT_Module driver;
+ FT_Int num_params;
+ FT_Parameter* params;
+
+ } FT_Open_Args;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face */
+ /* */
+ /* <Description> */
+ /* Creates a new face object from a given resource and typeface index */
+ /* using a pathname to the font file. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* pathname :: A path 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> */
+ /* Unlike FreeType 1.x, this function automatically creates a glyph */
+ /* slot for the face object which can be accessed directly through */
+ /* `face->glyph'. */
+ /* */
+ /* @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. */
+ /* */
+ /* Each new face object created with this function also owns a */
+ /* default @FT_Size object, accessible as `face->size'. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face( FT_Library library,
+ const char* filepathname,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Memory_Face */
+ /* */
+ /* <Description> */
+ /* Creates a new face object from a given resource and typeface index */
+ /* using a font file already loaded into memory. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* file_base :: A pointer to the beginning of the font data. */
+ /* */
+ /* file_size :: The size of the memory chunk used by the font data. */
+ /* */
+ /* 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> */
+ /* The font data bytes are used _directly_ by the @FT_Face object. */
+ /* This means that they are not copied, and that the client is */
+ /* responsible for releasing/destroying them _after_ the */
+ /* corresponding call to @FT_Done_Face . */
+ /* */
+ /* Unlike FreeType 1.x, this function automatically creates a glyph */
+ /* slot for the face object which can be accessed directly through */
+ /* `face->glyph'. */
+ /* */
+ /* @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. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Memory_Face( FT_Library library,
+ const FT_Byte* file_base,
+ FT_Long file_size,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Open_Face */
+ /* */
+ /* <Description> */
+ /* Opens a face object from a given resource and typeface index using */
+ /* an `FT_Open_Args' structure. If the face object doesn't exist, it */
+ /* will be created. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* args :: A pointer to an `FT_Open_Args' structure which must */
+ /* be filled by the caller. */
+ /* */
+ /* 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> */
+ /* Unlike FreeType 1.x, this function automatically creates a glyph */
+ /* 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 */
+ /* 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. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Open_Face( FT_Library library,
+ const FT_Open_Args* args,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_File */
+ /* */
+ /* <Description> */
+ /* `Attaches' a given font file to an existing face. This is usually */
+ /* to read additional information for a single face object. For */
+ /* example, it is used to read the AFM files that come with Type 1 */
+ /* fonts in order to add kerning data and other metrics. */
+ /* */
+ /* <InOut> */
+ /* face :: The target face object. */
+ /* */
+ /* <Input> */
+ /* filepathname :: An 8-bit pathname naming the `metrics' file. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If your font file is in memory, or if you want to provide your */
+ /* own input stream object, use @FT_Attach_Stream. */
+ /* */
+ /* The meaning of the `attach' action (i.e., what really happens when */
+ /* the new file is read) is not fixed by FreeType itself. It really */
+ /* depends on the font format (and thus the font driver). */
+ /* */
+ /* Client applications are expected to know what they are doing */
+ /* when invoking this function. Most drivers simply do not implement */
+ /* file attachments. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Attach_File( FT_Face face,
+ const char* filepathname );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Attach_Stream */
+ /* */
+ /* <Description> */
+ /* This function is similar to @FT_Attach_File with the exception */
+ /* that it reads the attachment from an arbitrary stream. */
+ /* */
+ /* <InOut> */
+ /* face :: The target face object. */
+ /* */
+ /* <Input> */
+ /* parameters :: A pointer to an FT_Open_Args structure used to */
+ /* describe the input stream to FreeType. */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The meaning of the `attach' (i.e. what really happens when the */
+ /* new file is read) is not fixed by FreeType itself. It really */
+ /* depends on the font format (and thus the font driver). */
+ /* */
+ /* Client applications are expected to know what they are doing */
+ /* when invoking this function. Most drivers simply do not implement */
+ /* file attachments. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Attach_Stream( FT_Face face,
+ FT_Open_Args* parameters );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Face */
+ /* */
+ /* <Description> */
+ /* Discards a given face object, as well as all of its child slots */
+ /* and sizes. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a target face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_Face( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Char_Size */
+ /* */
+ /* <Description> */
+ /* Sets the character dimensions of a given face object. The */
+ /* `char_width' and `char_height' values are used for the width and */
+ /* height, respectively, expressed in 26.6 fractional points. */
+ /* */
+ /* If the horizontal or vertical resolution values are zero, a */
+ /* default value of 72dpi is used. Similarly, if one of the */
+ /* character dimensions is zero, its value is set equal to the other. */
+ /* */
+ /* <InOut> */
+ /* size :: A handle to a target size object. */
+ /* */
+ /* <Input> */
+ /* char_width :: The character width, in 26.6 fractional points. */
+ /* */
+ /* char_height :: The character height, in 26.6 fractional */
+ /* points. */
+ /* */
+ /* horz_resolution :: The horizontal resolution. */
+ /* */
+ /* vert_resolution :: The vertical resolution. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* When dealing with fixed-size faces (i.e., non-scalable formats), */
+ /* use the function @FT_Set_Pixel_Sizes. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Char_Size( FT_Face face,
+ FT_F26Dot6 char_width,
+ FT_F26Dot6 char_height,
+ FT_UInt horz_resolution,
+ FT_UInt vert_resolution );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Pixel_Sizes */
+ /* */
+ /* <Description> */
+ /* Sets the character dimensions of a given face object. The width */
+ /* and height are expressed in integer pixels. */
+ /* */
+ /* If one of the character dimensions is zero, its value is set equal */
+ /* to the other. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the target face object. */
+ /* */
+ /* <Input> */
+ /* pixel_width :: The character width, in integer pixels. */
+ /* */
+ /* pixel_height :: The character height, in integer pixels. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* */
+ /* <Note> */
+ /* The values of `pixel_width' and `pixel_height' correspond to the */
+ /* pixel values of the _typographic_ character size, which are NOT */
+ /* necessarily the same as the dimensions of the glyph `bitmap */
+ /* cells'. */
+ /* */
+ /* The `character size' is really the size of an abstract square */
+ /* called the `EM', used to design the font. However, depending */
+ /* on the font design, glyphs will be smaller or greater than the */
+ /* EM. */
+ /* */
+ /* This means that setting the pixel size to, say, 8x8 doesn't */
+ /* guarantee in any way that you will get glyph bitmaps that all fit */
+ /* within an 8x8 cell (sometimes even far from it). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Pixel_Sizes( FT_Face face,
+ FT_UInt pixel_width,
+ FT_UInt pixel_height );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Glyph */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph within a given glyph slot, */
+ /* for a given size. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the target face object where the glyph */
+ /* will be loaded. */
+ /* */
+ /* <Input> */
+ /* glyph_index :: The index of the glyph in the font file. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* @FT_LOAD_XXX constants can be used to control the */
+ /* glyph loading process (e.g., whether the outline */
+ /* should be scaled, whether to load bitmaps or not, */
+ /* whether to hint the outline, etc). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If the glyph image is not a bitmap, and if the bit flag */
+ /* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
+ /* transformed with the information passed to a previous call to */
+ /* @FT_Set_Transform. */
+ /* */
+ /* Note that this also transforms the `face.glyph.advance' field, but */
+ /* *not* the values in `face.glyph.metrics'. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Load_Glyph( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Int32 load_flags );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Load_Char */
+ /* */
+ /* <Description> */
+ /* A function used to load a single glyph within a given glyph slot, */
+ /* for a given size, according to its character code. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to a target face object where the glyph */
+ /* will be loaded. */
+ /* */
+ /* <Input> */
+ /* char_code :: The glyph's character code, according to the */
+ /* current charmap used in the face. */
+ /* */
+ /* load_flags :: A flag indicating what to load for this glyph. The */
+ /* @FT_LOAD_XXX constants can be used to control the */
+ /* glyph loading process (e.g., whether the outline */
+ /* should be scaled, whether to load bitmaps or not, */
+ /* whether to hint the outline, etc). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If the face has no current charmap, or if the character code */
+ /* is not defined in the charmap, this function will return an */
+ /* error. */
+ /* */
+ /* If the glyph image is not a bitmap, and if the bit flag */
+ /* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
+ /* transformed with the information passed to a previous call to */
+ /* @FT_Set_Transform. */
+ /* */
+ /* Note that this also transforms the `face.glyph.advance' field, but */
+ /* *not* the values in `face.glyph.metrics'. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Load_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_Int32 load_flags );
+
+
+ /****************************************************************************
+ *
+ * @enum:
+ * FT_LOAD_XXX
+ *
+ * @description:
+ * A list of bit-field constants, used with @FT_Load_Glyph to indicate
+ * what kind of operations to perform during glyph loading.
+ *
+ * @values:
+ * FT_LOAD_DEFAULT ::
+ * Corresponding to 0, this value is used a default glyph load. In this
+ * case, the following will happen:
+ *
+ * 1. FreeType looks for a bitmap for the glyph corresponding to the
+ * face's current size. If one is found, the function returns. The
+ * bitmap data can be accessed from the glyph slot (see note below).
+ *
+ * 2. If no embedded bitmap is searched or found, FreeType looks for a
+ * scalable outline. If one is found, it is loaded from the font
+ * file, scaled to device pixels, then "hinted" to the pixel grid in
+ * order to optimize it. The outline data can be accessed from the
+ * glyph slot (see note below).
+ *
+ * Note that by default, the glyph loader doesn't render outlines into
+ * bitmaps. The following flags are used to modify this default
+ * behaviour to more specific and useful cases.
+ *
+ * FT_LOAD_NO_SCALE ::
+ * Don't scale the vector outline being loaded to 26.6 fractional
+ * pixels, but kept in font units. Note that this also disables
+ * hinting and the loading of embedded bitmaps. You should only use it
+ * when you want to retrieve the original glyph outlines in font units.
+ *
+ * FT_LOAD_NO_HINTING ::
+ * Don't hint glyph outlines after their scaling to device pixels.
+ * This generally generates "blurrier" glyphs in anti-aliased modes.
+ *
+ * This flag is ignored if @FT_LOAD_NO_SCALE is set.
+ *
+ * FT_LOAD_RENDER ::
+ * Render the glyph outline immediately into a bitmap before the glyph
+ * loader returns. By default, the glyph is rendered for the
+ * @FT_RENDER_MODE_NORMAL mode, which corresponds to 8-bit anti-aliased
+ * bitmaps using 256 opacity levels. You can use either
+ * @FT_LOAD_TARGET_MONO or @FT_LOAD_MONOCHROME to render 1-bit
+ * monochrome bitmaps.
+ *
+ * This flag is ignored if @FT_LOAD_NO_SCALE is set.
+ *
+ * FT_LOAD_NO_BITMAP ::
+ * Don't look for bitmaps when loading the glyph. Only scalable
+ * outlines will be loaded when available, and scaled, hinted, or
+ * rendered depending on other bit flags.
+ *
+ * This does not prevent you from rendering outlines to bitmaps
+ * with @FT_LOAD_RENDER, however.
+ *
+ * FT_LOAD_VERTICAL_LAYOUT ::
+ * Prepare the glyph image for vertical text layout. This basically
+ * means that `face.glyph.advance' will correspond to the vertical
+ * advance height (instead of the default horizontal advance width),
+ * and that the glyph image will be translated to match the vertical
+ * bearings positions.
+ *
+ * FT_LOAD_FORCE_AUTOHINT ::
+ * Force the use of the FreeType auto-hinter when a glyph outline is
+ * loaded. You shouldn't need this in a typical application, since it
+ * is mostly used to experiment with its algorithm.
+ *
+ * FT_LOAD_CROP_BITMAP ::
+ * Indicates that the glyph loader should try to crop the bitmap (i.e.,
+ * remove all space around its black bits) when loading it. This is
+ * only useful when loading embedded bitmaps in certain fonts, since
+ * bitmaps rendered with @FT_LOAD_RENDER are always cropped by default.
+ *
+ * FT_LOAD_PEDANTIC ::
+ * Indicates that the glyph loader should perform pedantic
+ * verifications during glyph loading, rejecting invalid fonts. This
+ * is mostly used to detect broken glyphs in fonts. By default,
+ * FreeType tries to handle broken fonts also.
+ *
+ * FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::
+ * Indicates that the glyph loader should ignore the global advance
+ * width defined in the font. As far as we know, this is only used by
+ * the X-TrueType font server, in order to deal correctly with the
+ * incorrect metrics contained in DynaLab's TrueType CJK fonts.
+ *
+ * FT_LOAD_NO_RECURSE ::
+ * This flag is only used internally. It merely indicates that the
+ * glyph loader should not load composite glyphs recursively. Instead,
+ * it should set the `num_subglyph' and `subglyphs' values of the glyph
+ * slot accordingly, and set "glyph->format" to
+ * @FT_GLYPH_FORMAT_COMPOSITE.
+ *
+ * The description of sub-glyphs is not available to client
+ * applications for now.
+ *
+ * FT_LOAD_IGNORE_TRANSFORM ::
+ * Indicates that the glyph loader should not try to transform the
+ * loaded glyph image. This doesn't prevent scaling, hinting, or
+ * rendering.
+ *
+ * FT_LOAD_MONOCHROME ::
+ * This flag is used with @FT_LOAD_RENDER to indicate that you want
+ * to render a 1-bit monochrome glyph bitmap from a vectorial outline.
+ *
+ * Note that this has no effect on the hinting algorithm used by the
+ * glyph loader. You should better use @FT_LOAD_TARGET_MONO if you
+ * want to render monochrome-optimized glyph images instead.
+ *
+ * FT_LOAD_LINEAR_DESIGN ::
+ * Return the linearly scaled metrics expressed in original font units
+ * instead of the default 16.16 pixel values.
+ *
+ * FT_LOAD_NO_AUTOHINT ::
+ * Indicates that the auto-hinter should never be used to hint glyph
+ * 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.
+ */
+#define FT_LOAD_NO_SCALE 0x1
+#define FT_LOAD_NO_HINTING 0x2
+#define FT_LOAD_RENDER 0x4
+#define FT_LOAD_NO_BITMAP 0x8
+#define FT_LOAD_VERTICAL_LAYOUT 0x10
+#define FT_LOAD_FORCE_AUTOHINT 0x20
+#define FT_LOAD_CROP_BITMAP 0x40
+#define FT_LOAD_PEDANTIC 0x80
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH 0x200
+#define FT_LOAD_NO_RECURSE 0x400
+#define FT_LOAD_IGNORE_TRANSFORM 0x800
+#define FT_LOAD_MONOCHROME 0x1000
+#define FT_LOAD_LINEAR_DESIGN 0x2000
+
+ /* temporary hack! */
+#define FT_LOAD_SBITS_ONLY 0x4000
+#define FT_LOAD_NO_AUTOHINT 0x8000U
+
+ /* */
+
+#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
+#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
+
+#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 )
+#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
+#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
+
+#define FT_LOAD_DEFAULT 0x0
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Transform */
+ /* */
+ /* <Description> */
+ /* A function used to set the transformation that is applied to glyph */
+ /* images just before they are converted to bitmaps in a glyph slot */
+ /* when @FT_Render_Glyph is called. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation's 2x2 matrix. Use 0 for */
+ /* the identity matrix. */
+ /* delta :: A pointer to the translation vector. Use 0 for the null */
+ /* vector. */
+ /* */
+ /* <Note> */
+ /* The transformation is only applied to scalable image formats after */
+ /* the glyph has been loaded. It means that hinting is unaltered by */
+ /* the transformation and is performed on the character size given in */
+ /* the last call to @FT_Set_Char_Sizes or @FT_Set_Pixel_Sizes. */
+ /* */
+ FT_EXPORT( void )
+ FT_Set_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Render_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration type that lists the render modes supported by */
+ /* FreeType 2. Each mode corresponds to a specific type of scanline */
+ /* conversion performed on the outline, as well as specific */
+ /* hinting optimizations. */
+ /* */
+ /* <Values> */
+ /* FT_RENDER_MODE_NORMAL :: */
+ /* This is the default render mode; it corresponds to 8-bit */
+ /* 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 STILL EXPERIMENTAL, */
+ /* FOR NOW, THIS WILL PRODUCE RESULTS SIMILAR TO NORMAL MODE !! */
+ /* */
+ /* FT_RENDER_MODE_MONO :: */
+ /* This mode corresponds to 1-bit bitmaps. */
+ /* */
+ /* FT_RENDER_MODE_LCD :: */
+ /* This mode corresponds to horizontal RGB/BGR sub-pixel displays, */
+ /* like LCD-screens. It produces 8-bit bitmaps that are 3 times */
+ /* the width of the original glyph outline in pixels, and which use */
+ /* the @FT_PIXEL_MODE_LCD mode. THIS IS STILL EXPERIMENTAL, DO NOT */
+ /* USE FOR NOW !! */
+ /* */
+ /* FT_RENDER_MODE_LCD_V :: */
+ /* This mode corresponds to vertical RGB/BGR sub-pixel displays */
+ /* (like PDA screens, rotated LCD displays, etc.). It produces */
+ /* 8-bit bitmaps that are 3 times the height of the original */
+ /* glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode. */
+ /* */
+ /* <Note> */
+ /* The LCD-optimized glyph bitmaps produced by FT_Render_Glyph are */
+ /* _not filtered_ to reduce color-fringes. It is up to the caller to */
+ /* perform this pass. THIS IS STILL EXPERIMENTAL, DO NOT USE FOR NOW */
+ /* !! */
+ /* */
+ typedef enum FT_Render_Mode_
+ {
+ FT_RENDER_MODE_NORMAL = 0,
+ FT_RENDER_MODE_LIGHT,
+ FT_RENDER_MODE_MONO,
+ FT_RENDER_MODE_LCD,
+ FT_RENDER_MODE_LCD_V,
+
+ FT_RENDER_MODE_MAX
+
+ } FT_Render_Mode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* ft_render_mode_xxx */
+ /* */
+ /* <Description> */
+ /* These constats are deprecated. Use the corresponding */
+ /* @FT_Render_Mode values instead. */
+ /* */
+ /* <Values> */
+ /* ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL */
+ /* ft_render_mode_mono :: see @FT_RENDER_MODE_MONO */
+ /* */
+#define ft_render_mode_normal FT_RENDER_MODE_NORMAL
+#define ft_render_mode_mono FT_RENDER_MODE_MONO
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Render_Glyph */
+ /* */
+ /* <Description> */
+ /* Converts a given glyph image to a bitmap. It does so by */
+ /* inspecting the glyph image format, find the relevant renderer, and */
+ /* invoke it. */
+ /* */
+ /* <InOut> */
+ /* slot :: A handle to the glyph slot containing the image to */
+ /* convert. */
+ /* */
+ /* <Input> */
+ /* render_mode :: This is the render mode used to render the glyph */
+ /* image into a bitmap. See FT_Render_Mode for a list */
+ /* of possible values. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Render_Glyph( FT_GlyphSlot slot,
+ FT_Render_Mode render_mode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Kerning_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration used to specify which kerning values to return in */
+ /* @FT_Get_Kerning. */
+ /* */
+ /* <Values> */
+ /* FT_KERNING_DEFAULT :: Return scaled and grid-fitted kerning */
+ /* distances (value is 0). */
+ /* */
+ /* FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning */
+ /* distances. */
+ /* */
+ /* FT_KERNING_UNSCALED :: Return the kerning vector in original font */
+ /* units. */
+ /* */
+ typedef enum FT_Kerning_Mode_
+ {
+ FT_KERNING_DEFAULT = 0,
+ FT_KERNING_UNFITTED,
+ FT_KERNING_UNSCALED
+
+ } FT_Kerning_Mode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* ft_kerning_default */
+ /* */
+ /* <Description> */
+ /* This constant is deprecated. Please use @FT_KERNING_DEFAULT */
+ /* instead. */
+ /* */
+#define ft_kerning_default FT_KERNING_DEFAULT
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* ft_kerning_unfitted */
+ /* */
+ /* <Description> */
+ /* This constant is deprecated. Please use @FT_KERNING_UNFITTED */
+ /* instead. */
+ /* */
+#define ft_kerning_unfitted FT_KERNING_UNFITTED
+
+
+ /*************************************************************************/
+ /* */
+ /* <Const> */
+ /* ft_kerning_unscaled */
+ /* */
+ /* <Description> */
+ /* This constant is deprecated. Please use @FT_KERNING_UNSCALED */
+ /* instead. */
+ /* */
+#define ft_kerning_unscaled FT_KERNING_UNSCALED
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Kerning */
+ /* */
+ /* <Description> */
+ /* Returns the kerning vector between two glyphs of a same face. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* left_glyph :: The index of the left glyph in the kern pair. */
+ /* */
+ /* right_glyph :: The index of the right glyph in the kern pair. */
+ /* */
+ /* kern_mode :: See @FT_Kerning_Mode for more information. */
+ /* Determines the scale/dimension of the returned */
+ /* kerning vector. */
+ /* */
+ /* <Output> */
+ /* akerning :: The kerning vector. This is in font units for */
+ /* scalable formats, and in pixels for fixed-sizes */
+ /* formats. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* Only horizontal layouts (left-to-right & right-to-left) are */
+ /* supported by this method. Other layouts, or more sophisticated */
+ /* kernings, are out of the scope of this API function -- they can be */
+ /* implemented through format-specific interfaces. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Kerning( FT_Face face,
+ FT_UInt left_glyph,
+ FT_UInt right_glyph,
+ FT_UInt kern_mode,
+ FT_Vector *akerning );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph_Name */
+ /* */
+ /* <Description> */
+ /* Retrieves the ASCII name of a given glyph in a face. This only */
+ /* works for those faces where FT_HAS_GLYPH_NAME(face) returns true. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a source face object. */
+ /* */
+ /* glyph_index :: The glyph index. */
+ /* */
+ /* buffer_max :: The maximal number of bytes available in the */
+ /* buffer. */
+ /* */
+ /* <Output> */
+ /* buffer :: A pointer to a target buffer where the name will be */
+ /* copied to. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* An error is returned if the face doesn't provide glyph names or if */
+ /* the glyph index is invalid. In all cases of failure, the first */
+ /* byte of `buffer' will be set to 0 to indicate an empty name. */
+ /* */
+ /* The glyph name is truncated to fit within the buffer if it is too */
+ /* long. The returned string is always zero-terminated. */
+ /* */
+ /* This function is not compiled within the library if the config */
+ /* macro FT_CONFIG_OPTION_NO_GLYPH_NAMES is defined in */
+ /* `include/freetype/config/ftoptions.h' */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Glyph_Name( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Postscript_Name */
+ /* */
+ /* <Description> */
+ /* Retrieves the ASCII Postscript name of a given face, if available. */
+ /* This should only work with Postscript and TrueType fonts. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* A pointer to the face's Postscript name. NULL if un-available. */
+ /* */
+ /* <Note> */
+ /* The returned pointer is owned by the face and will be destroyed */
+ /* with it. */
+ /* */
+ FT_EXPORT( const char* )
+ FT_Get_Postscript_Name( FT_Face face );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Select_Charmap */
+ /* */
+ /* <Description> */
+ /* Selects a given charmap by its encoding tag (as listed in */
+ /* `freetype.h'). */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* encoding :: A handle to the selected charmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function will return an error if no charmap in the face */
+ /* corresponds to the encoding queried here. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Select_Charmap( FT_Face face,
+ FT_Encoding encoding );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Charmap */
+ /* */
+ /* <Description> */
+ /* Selects a given charmap for character code to glyph index */
+ /* decoding. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Input> */
+ /* charmap :: A handle to the selected charmap. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function will return an error if the charmap is not part of */
+ /* the face (i.e., if it is not listed in the face->charmaps[] */
+ /* table). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_Charmap( FT_Face face,
+ FT_CharMap charmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Char_Index */
+ /* */
+ /* <Description> */
+ /* Returns the glyph index of a given character code. This function */
+ /* uses a charmap object to do the translation. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* charcode :: The character code. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0 means `undefined character code'. */
+ /* */
+ /* <Note> */
+ /* FreeType computes its own glyph indices which are not necessarily */
+ /* the same as used in the font in case the font is based on glyph */
+ /* indices. Reason for this behaviour is to assure that index 0 is */
+ /* never used, representing the missing glyph. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Char_Index( FT_Face face,
+ FT_ULong charcode );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_First_Char */
+ /* */
+ /* <Description> */
+ /* This function is used to return the first character code in the */
+ /* current charmap of a given face. It will also return the */
+ /* corresponding glyph index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Output> */
+ /* agindex :: Glyph index of first character code. 0 if charmap is */
+ /* empty. */
+ /* */
+ /* <Return> */
+ /* The charmap's first character code. */
+ /* */
+ /* <Note> */
+ /* You should use this function with @FT_Get_Next_Char to be able to */
+ /* parse all character codes available in a given charmap. The code */
+ /* should look like this: */
+ /* */
+ /* { */
+ /* FT_ULong charcode; */
+ /* FT_UInt gindex; */
+ /* */
+ /* */
+ /* charcode = FT_Get_First_Char( face, &gindex ); */
+ /* while ( gindex != 0 ) */
+ /* { */
+ /* ... do something with (charcode,gindex) pair ... */
+ /* */
+ /* charcode = FT_Get_Next_Char( face, charcode, &gindex ); */
+ /* } */
+ /* } */
+ /* */
+ /* Note that `*agindex' will be set to 0 if the charmap is empty. */
+ /* The result itself can be 0 in two cases: if the charmap is empty */
+ /* or when the value 0 is the first valid character code. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_First_Char( FT_Face face,
+ FT_UInt *agindex );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Next_Char */
+ /* */
+ /* <Description> */
+ /* This function is used to return the next character code in the */
+ /* current charmap of a given face following the value 'char_code', */
+ /* as well as the corresponding glyph index. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* char_code :: The starting character code. */
+ /* */
+ /* <Output> */
+ /* agindex :: Glyph index of first character code. 0 if charmap */
+ /* is empty. */
+ /* */
+ /* <Return> */
+ /* The charmap's next character code. */
+ /* */
+ /* <Note> */
+ /* You should use this function with @FT_Get_First_Char to walk */
+ /* through all character codes available in a given charmap. See */
+ /* the note for this function for a simple code example. */
+ /* */
+ /* Note that `*agindex' will be set to 0 when there are no more codes */
+ /* in the charmap. */
+ /* */
+ FT_EXPORT( FT_ULong )
+ FT_Get_Next_Char( FT_Face face,
+ FT_ULong char_code,
+ FT_UInt *agindex );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Name_Index */
+ /* */
+ /* <Description> */
+ /* Returns the glyph index of a given glyph name. This function uses */
+ /* driver specific objects to do the translation. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* glyph_name :: The glyph name. */
+ /* */
+ /* <Return> */
+ /* The glyph index. 0 means `undefined character code'. */
+ /* */
+ FT_EXPORT( FT_UInt )
+ FT_Get_Name_Index( FT_Face face,
+ FT_String* glyph_name );
+
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* computations */
+ /* */
+ /* <Title> */
+ /* Computations */
+ /* */
+ /* <Abstract> */
+ /* Crunching fixed numbers and vectors */
+ /* */
+ /* <Description> */
+ /* This section contains various functions used to perform */
+ /* computations on 16.16 fixed-float numbers or 2d vectors. */
+ /* */
+ /* <Order> */
+ /* FT_MulDiv */
+ /* FT_MulFix */
+ /* FT_DivFix */
+ /* FT_RoundFix */
+ /* FT_CeilFix */
+ /* FT_FloorFix */
+ /* FT_Vector_Transform */
+ /* FT_Matrix_Multiply */
+ /* FT_Matrix_Invert */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulDiv */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation `(a*b)/c' */
+ /* 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_EXPORT( FT_Long )
+ FT_MulDiv( FT_Long a,
+ FT_Long b,
+ FT_Long c );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */
+ /* used to multiply a given value by a 16.16 fixed float factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*b)/0x10000'. */
+ /* */
+ /* <Note> */
+ /* This function has been optimized for the case where the absolute */
+ /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
+ /* As this happens mainly when scaling from notional units to */
+ /* fractional pixels in FreeType, it resulted in noticeable speed */
+ /* improvements between versions 2.x and 1.x. */
+ /* */
+ /* As a conclusion, always try to place a 16.16 factor as the */
+ /* _second_ argument of this function; this can make a great */
+ /* difference. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_MulFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_DivFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to perform the computation */
+ /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
+ /* used to divide a given value by a 16.16 fixed float factor. */
+ /* */
+ /* <Input> */
+ /* a :: The first multiplier. */
+ /* b :: The second multiplier. Use a 16.16 factor here whenever */
+ /* possible (see note below). */
+ /* */
+ /* <Return> */
+ /* The result of `(a*0x10000)/b'. */
+ /* */
+ /* <Note> */
+ /* The optimization for FT_DivFix() is simple: If (a << 16) fits in */
+ /* 32 bits, then the division is computed directly. Otherwise, we */
+ /* use a specialized version of the old @FT_MulDiv64. */
+ /* */
+ FT_EXPORT( FT_Long )
+ FT_DivFix( FT_Long a,
+ FT_Long b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_RoundFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to round a 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number to be rounded. */
+ /* */
+ /* <Return> */
+ /* The result of `(a + 0x8000) & -0x10000'. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_RoundFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_CeilFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to compute the ceiling function of a */
+ /* 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number for which the ceiling function is to be computed. */
+ /* */
+ /* <Return> */
+ /* The result of `(a + 0x10000 - 1) & -0x10000'. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_CeilFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_FloorFix */
+ /* */
+ /* <Description> */
+ /* A very simple function used to compute the floor function of a */
+ /* 16.16 fixed number. */
+ /* */
+ /* <Input> */
+ /* a :: The number for which the floor function is to be computed. */
+ /* */
+ /* <Return> */
+ /* The result of `a & -0x10000'. */
+ /* */
+ FT_EXPORT( FT_Fixed )
+ FT_FloorFix( FT_Fixed a );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Vector_Transform */
+ /* */
+ /* <Description> */
+ /* Transforms a single vector through a 2x2 matrix. */
+ /* */
+ /* <InOut> */
+ /* vector :: The target vector to transform. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the source 2x2 matrix. */
+ /* */
+ /* <Note> */
+ /* The result is undefined if either `vector' or `matrix' is invalid. */
+ /* */
+ FT_EXPORT( void )
+ FT_Vector_Transform( FT_Vector* vec,
+ FT_Matrix* matrix );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FREETYPE_H__ */
+
+
+/* END */
+
--- /dev/null
+++ b/include/freetype/ft2build.h
@@ -1,0 +1,40 @@
+/***************************************************************************/
+/* */
+/* ft2build.h */
+/* */
+/* FreeType 2 build and setup macros. */
+/* (Generic version) */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file corresponds to the default "ft2build.h" file for */
+ /* FreeType 2. It uses the "freetype" include root. */
+ /* */
+ /* Note that specific platforms might use a different configuration. */
+ /* See builds/unix/ft2unix.h for an example. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FT2_BUILD_GENERIC_H__
+#define __FT2_BUILD_GENERIC_H__
+
+#pragma incomplete _off_ /* it's too hard */
+
+#include <freetype/config/ftheader.h>
+#endif /* __FT2_BUILD_GENERIC_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftbbox.h
@@ -1,0 +1,83 @@
+/***************************************************************************/
+/* */
+/* ftbbox.h */
+/* */
+/* FreeType exact bbox computation (specification). */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This component has a _single_ role: to compute exact outline bounding */
+ /* boxes. */
+ /* */
+ /* It is separated from the rest of the engine for various technical */
+ /* reasons. It may well be integrated in `ftoutln' later. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTBBOX_H__
+#define __FTBBOX_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_BBox */
+ /* */
+ /* <Description> */
+ /* Computes the exact bounding box of an outline. This is slower */
+ /* than computing the control box. However, it uses an advanced */
+ /* algorithm which returns _very_ quickly when the two boxes */
+ /* coincide. Otherwise, the outline Bezier arcs are walked over to */
+ /* extract their extrema. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline. */
+ /* */
+ /* <Output> */
+ /* abbox :: The outline's exact bounding box. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Get_BBox( FT_Outline* outline,
+ FT_BBox *abbox );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTBBOX_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftbdf.h
@@ -1,0 +1,84 @@
+/***************************************************************************/
+/* */
+/* ftbdf.h */
+/* */
+/* FreeType API for accessing BDF-specific strings (specification). */
+/* */
+/* 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTBDF_H__
+#define __FTBDF_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* bdf_fonts */
+ /* */
+ /* <Title> */
+ /* BDF Fonts */
+ /* */
+ /* <Abstract> */
+ /* BDF-specific APIs */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of BDF-specific functions. */
+ /* */
+ /*************************************************************************/
+
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_Get_BDF_Charset_ID
+ *
+ * @description:
+ * Retrieves a BDF font character set identity, according to
+ * the BDF specification.
+ *
+ * @input:
+ * face ::
+ * handle to input face
+ *
+ * @output:
+ * acharset_encoding ::
+ * Charset encoding, as a C string, owned by the face.
+ *
+ * acharset_registry ::
+ * Charset registry, as a C string, owned by the face.
+ *
+ * @return:
+ * FreeType rror code. 0 means success.
+ *
+ * @note:
+ * This function only works with BDF faces, returning an error otherwise.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_BDF_Charset_ID( FT_Face face,
+ const char* *acharset_encoding,
+ const char* *acharset_registry );
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTBDF_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftcache.h
@@ -1,0 +1,415 @@
+/***************************************************************************/
+/* */
+/* ftcache.h */
+/* */
+/* FreeType Cache subsystem (specification). */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /********* *********/
+ /********* WARNING, THIS IS BETA CODE. *********/
+ /********* *********/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+#ifndef __FTCACHE_H__
+#define __FTCACHE_H__
+
+
+#include <ft2build.h>
+#include FT_GLYPH_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* cache_subsystem */
+ /* */
+ /* <Title> */
+ /* Cache Sub-System */
+ /* */
+ /* <Abstract> */
+ /* How to cache face, size, and glyph data with FreeType 2. */
+ /* */
+ /* <Description> */
+ /* This section describes the FreeType 2 cache sub-system which is */
+ /* stile in beta. */
+ /* */
+ /* <Order> */
+ /* FTC_Manager */
+ /* FTC_FaceID */
+ /* FTC_Face_Requester */
+ /* */
+ /* FTC_Manager_New */
+ /* FTC_Manager_Lookup_Face */
+ /* FTC_Manager_Lookup_Size */
+ /* */
+ /* FTC_Node */
+ /* FTC_Node_Ref */
+ /* FTC_Node_Unref */
+ /* */
+ /* FTC_Font */
+ /* FTC_ImageDesc */
+ /* FTC_ImageCache */
+ /* FTC_ImageCache_New */
+ /* FTC_ImageCache_Lookup */
+ /* */
+ /* FTC_SBit */
+ /* FTC_SBitCache */
+ /* FTC_SBitCache_New */
+ /* FTC_SBitCache_Lookup */
+ /* */
+ /* */
+ /* FTC_Image_Desc */
+ /* FTC_Image_Cache */
+ /* FTC_Image_Cache_Lookup */
+ /* */
+ /* FTC_SBit_Cache */
+ /* FTC_SBit_Cache_Lookup */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** BASIC TYPE DEFINITIONS *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_FaceID */
+ /* */
+ /* <Description> */
+ /* A generic pointer type that is used to identity face objects. The */
+ /* contents of such objects is application-dependent. */
+ /* */
+ typedef FT_Pointer FTC_FaceID;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FTC_Face_Requester */
+ /* */
+ /* <Description> */
+ /* A callback function provided by client applications. It is used */
+ /* to translate a given @FTC_FaceID into a new valid @FT_Face object. */
+ /* */
+ /* <Input> */
+ /* face_id :: The face ID to resolve. */
+ /* */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* data :: Application-provided request data. */
+ /* */
+ /* <Output> */
+ /* aface :: A new @FT_Face handle. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The face requester should not perform funny things on the returned */
+ /* face object, like creating a new @FT_Size for it, or setting a */
+ /* transformation through @FT_Set_Transform! */
+ /* */
+ typedef FT_Error
+ (*FTC_Face_Requester)( FTC_FaceID face_id,
+ FT_Library library,
+ FT_Pointer request_data,
+ FT_Face* aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FTC_FontRec */
+ /* */
+ /* <Description> */
+ /* A simple structure used to describe a given `font' to the cache */
+ /* manager. Note that a `font' is the combination of a given face */
+ /* with a given character size. */
+ /* */
+ /* <Fields> */
+ /* face_id :: The ID of the face to use. */
+ /* */
+ /* pix_width :: The character width in integer pixels. */
+ /* */
+ /* pix_height :: The character height in integer pixels. */
+ /* */
+ typedef struct FTC_FontRec_
+ {
+ FTC_FaceID face_id;
+ FT_UShort pix_width;
+ FT_UShort pix_height;
+
+ } FTC_FontRec;
+
+
+ /* */
+
+
+#define FTC_FONT_COMPARE( f1, f2 ) \
+ ( (f1)->face_id == (f2)->face_id && \
+ (f1)->pix_width == (f2)->pix_width && \
+ (f1)->pix_height == (f2)->pix_height )
+
+#define FT_POINTER_TO_ULONG( p ) ((FT_ULong)(FT_Pointer)(p))
+
+#define FTC_FACE_ID_HASH( i ) \
+ ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
+ ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
+
+#define FTC_FONT_HASH( f ) \
+ (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \
+ ((f)->pix_width << 8) ^ \
+ ((f)->pix_height) )
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_Font */
+ /* */
+ /* <Description> */
+ /* A simple handle to an @FTC_FontRec structure. */
+ /* */
+ typedef FTC_FontRec* FTC_Font;
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** CACHE MANAGER OBJECT *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_Manager */
+ /* */
+ /* <Description> */
+ /* This object is used to cache one or more @FT_Face objects, along */
+ /* with corresponding @FT_Size objects. */
+ /* */
+ typedef struct FTC_ManagerRec_* FTC_Manager;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FTC_Node */
+ /* */
+ /* <Description> */
+ /* An opaque handle to a cache node object. Each cache node is */
+ /* reference-counted. A node with a count of 0 might be flushed */
+ /* out of a full cache whenever a lookup request is performed. */
+ /* */
+ /* If you lookup nodes, you have the ability to "acquire" them, i.e., */
+ /* to increment their reference count. This will prevent the node */
+ /* from being flushed out of the cache until you explicitly "release" */
+ /* it (see @FTC_Node_Release). */
+ /* */
+ /* See also @FTC_BitsetCache_Lookup and @FTC_ImageCache_Lookup. */
+ /* */
+ typedef struct FTC_NodeRec_* FTC_Node;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_New */
+ /* */
+ /* <Description> */
+ /* Creates a new cache manager. */
+ /* */
+ /* <Input> */
+ /* library :: The parent FreeType library handle to use. */
+ /* */
+ /* max_faces :: Maximum number of faces to keep alive in manager. */
+ /* Use 0 for defaults. */
+ /* */
+ /* max_sizes :: Maximum number of sizes to keep alive in manager. */
+ /* Use 0 for defaults. */
+ /* */
+ /* 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). */
+ /* */
+ /* <Output> */
+ /* amanager :: A handle to a new manager object. 0 in case of */
+ /* failure. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_Manager_New( FT_Library library,
+ FT_UInt max_faces,
+ FT_UInt max_sizes,
+ FT_ULong max_bytes,
+ FTC_Face_Requester requester,
+ FT_Pointer req_data,
+ FTC_Manager *amanager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Reset */
+ /* */
+ /* <Description> */
+ /* Empties a given cache manager. This simply gets rid of all the */
+ /* currently cached @FT_Face and @FT_Size objects within the manager. */
+ /* */
+ /* <InOut> */
+ /* manager :: A handle to the manager. */
+ /* */
+ FT_EXPORT( void )
+ FTC_Manager_Reset( FTC_Manager manager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Done */
+ /* */
+ /* <Description> */
+ /* Destroys a given manager after emptying it. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the target cache manager object. */
+ /* */
+ FT_EXPORT( void )
+ FTC_Manager_Done( FTC_Manager manager );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Lookup_Face */
+ /* */
+ /* <Description> */
+ /* Retrieves the @FT_Face object that corresponds to a given face ID */
+ /* through a cache manager. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the cache manager. */
+ /* */
+ /* face_id :: The ID of the face object. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to the face 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 @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. */
+ /* */
+ /* 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 );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FTC_Manager_Lookup_Size */
+ /* */
+ /* <Description> */
+ /* Retrieves the @FT_Face and @FT_Size objects that correspond to a */
+ /* given @FTC_SizeID. */
+ /* */
+ /* <Input> */
+ /* manager :: A handle to the cache manager. */
+ /* */
+ /* size_id :: The ID of the `font size' to use. */
+ /* */
+ /* <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. */
+ /* */
+ /* <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. */
+ /* */
+ /* 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. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FTC_Manager_Lookup_Size( FTC_Manager manager,
+ FTC_Font font,
+ FT_Face *aface,
+ FT_Size *asize );
+
+
+FT_END_HEADER
+
+#endif /* __FTCACHE_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftchapters.h
@@ -1,0 +1,69 @@
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* core_api */
+/* */
+/* <Title> */
+/* Core API */
+/* */
+/* <Sections> */
+/* basic_types */
+/* base_interface */
+/* glyph_management */
+/* mac_specific */
+/* sizes_management */
+/* header_file_macros */
+/* */
+/***************************************************************************/
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* format_specific */
+/* */
+/* <Title> */
+/* Format-Specific API */
+/* */
+/* <Sections> */
+/* multiple_masters */
+/* truetype_tables */
+/* type1_tables */
+/* sfnt_names */
+/* bdf_fonts */
+/* pfr_fonts */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* cache_subsystem */
+/* */
+/* <Title> */
+/* Cache Sub-System */
+/* */
+/* <Sections> */
+/* cache_subsystem */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* <Chapter> */
+/* support_api */
+/* */
+/* <Title> */
+/* Support API */
+/* */
+/* <Sections> */
+/* computations */
+/* list_processing */
+/* outline_processing */
+/* raster */
+/* system_interface */
+/* module_management */
+/* */
+/***************************************************************************/
+
--- /dev/null
+++ b/include/freetype/fterrdef.h
@@ -1,0 +1,229 @@
+/***************************************************************************/
+/* */
+/* fterrdef.h */
+/* */
+/* FreeType error codes (specification). */
+/* */
+/* 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. */
+/* */
+/***************************************************************************/
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** LIST OF ERROR CODES/MESSAGES *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+ /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
+ /* including this file. */
+
+
+ /* generic errors */
+
+ FT_NOERRORDEF_( Ok, 0x00, \
+ "no error" )
+
+ FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
+ "cannot open resource" )
+ FT_ERRORDEF_( Unknown_File_Format, 0x02, \
+ "unknown file format" )
+ FT_ERRORDEF_( Invalid_File_Format, 0x03, \
+ "broken file" )
+ FT_ERRORDEF_( Invalid_Version, 0x04, \
+ "invalid FreeType version" )
+ FT_ERRORDEF_( Lower_Module_Version, 0x05, \
+ "module version is too low" )
+ FT_ERRORDEF_( Invalid_Argument, 0x06, \
+ "invalid argument" )
+ FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
+ "unimplemented feature" )
+ FT_ERRORDEF_( Invalid_Table, 0x08, \
+ "broken table" )
+ FT_ERRORDEF_( Invalid_Offset, 0x09, \
+ "broken offset within table" )
+
+ /* glyph/character errors */
+
+ FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
+ "invalid glyph index" )
+ FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
+ "invalid character code" )
+ FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
+ "unsupported glyph image format" )
+ FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
+ "cannot render this glyph format" )
+ FT_ERRORDEF_( Invalid_Outline, 0x14, \
+ "invalid outline" )
+ FT_ERRORDEF_( Invalid_Composite, 0x15, \
+ "invalid composite glyph" )
+ FT_ERRORDEF_( Too_Many_Hints, 0x16, \
+ "too many hints" )
+ FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
+ "invalid pixel size" )
+
+ /* handle errors */
+
+ FT_ERRORDEF_( Invalid_Handle, 0x20, \
+ "invalid object handle" )
+ FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
+ "invalid library handle" )
+ FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
+ "invalid module handle" )
+ FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
+ "invalid face handle" )
+ FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
+ "invalid size handle" )
+ FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
+ "invalid glyph slot handle" )
+ FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
+ "invalid charmap handle" )
+ FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
+ "invalid cache manager handle" )
+ FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
+ "invalid stream handle" )
+
+ /* driver errors */
+
+ FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
+ "too many modules" )
+ FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
+ "too many extensions" )
+
+ /* memory errors */
+
+ FT_ERRORDEF_( Out_Of_Memory, 0x40, \
+ "out of memory" )
+ FT_ERRORDEF_( Unlisted_Object, 0x41, \
+ "unlisted object" )
+
+ /* stream errors */
+
+ FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
+ "cannot open stream" )
+ FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
+ "invalid stream seek" )
+ FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
+ "invalid stream skip" )
+ FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
+ "invalid stream read" )
+ FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
+ "invalid stream operation" )
+ FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
+ "invalid frame operation" )
+ FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
+ "nested frame access" )
+ FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
+ "invalid frame read" )
+
+ /* raster errors */
+
+ FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
+ "raster uninitialized" )
+ FT_ERRORDEF_( Raster_Corrupted, 0x61, \
+ "raster corrupted" )
+ FT_ERRORDEF_( Raster_Overflow, 0x62, \
+ "raster overflow" )
+ FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
+ "negative height while rastering" )
+
+ /* cache errors */
+
+ FT_ERRORDEF_( Too_Many_Caches, 0x70, \
+ "too many registered caches" )
+
+ /* TrueType and SFNT errors */
+
+ FT_ERRORDEF_( Invalid_Opcode, 0x80, \
+ "invalid opcode" )
+ FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
+ "too few arguments" )
+ FT_ERRORDEF_( Stack_Overflow, 0x82, \
+ "stack overflow" )
+ FT_ERRORDEF_( Code_Overflow, 0x83, \
+ "code overflow" )
+ FT_ERRORDEF_( Bad_Argument, 0x84, \
+ "bad argument" )
+ FT_ERRORDEF_( Divide_By_Zero, 0x85, \
+ "division by zero" )
+ FT_ERRORDEF_( Invalid_Reference, 0x86, \
+ "invalid reference" )
+ FT_ERRORDEF_( Debug_OpCode, 0x87, \
+ "found debug opcode" )
+ FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
+ "found ENDF opcode in execution stream" )
+ FT_ERRORDEF_( Nested_DEFS, 0x89, \
+ "nested DEFS" )
+ FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
+ "invalid code range" )
+ FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
+ "execution context too long" )
+ FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
+ "too many function definitions" )
+ FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
+ "too many instruction definitions" )
+ FT_ERRORDEF_( Table_Missing, 0x8E, \
+ "SFNT font table missing" )
+ FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
+ "horizontal header (hhea) table missing" )
+ FT_ERRORDEF_( Locations_Missing, 0x90, \
+ "locations (loca) table missing" )
+ FT_ERRORDEF_( Name_Table_Missing, 0x91, \
+ "name table missing" )
+ FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
+ "character map (cmap) table missing" )
+ FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
+ "horizontal metrics (hmtx) table missing" )
+ FT_ERRORDEF_( Post_Table_Missing, 0x94, \
+ "PostScript (post) table missing" )
+ FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
+ "invalid horizontal metrics" )
+ FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
+ "invalid character map (cmap) format" )
+ FT_ERRORDEF_( Invalid_PPem, 0x97, \
+ "invalid ppem value" )
+ FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
+ "invalid vertical metrics" )
+ FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
+ "could not find context" )
+ FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
+ "invalid PostScript (post) table format" )
+ FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
+ "invalid PostScript (post) table" )
+
+ /* CFF, CID, and Type 1 errors */
+
+ FT_ERRORDEF_( Syntax_Error, 0xA0, \
+ "opcode syntax error" )
+ FT_ERRORDEF_( Stack_Underflow, 0xA1, \
+ "argument stack underflow" )
+
+ /* BDF errors */
+
+ FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
+ "`STARTFONT' field missing" )
+ FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
+ "`FONT' field missing" )
+ FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
+ "`SIZE' field missing" )
+ FT_ERRORDEF_( Missing_Chars_Field, 0xB3, \
+ "`CHARS' field missing" )
+ FT_ERRORDEF_( Missing_Startchar_Field, 0xB4, \
+ "`STARTCHAR' field missing" )
+ FT_ERRORDEF_( Missing_Encoding_Field, 0xB5, \
+ "`ENCODING' field missing" )
+ FT_ERRORDEF_( Missing_Bbx_Field, 0xB6, \
+ "`BBX' field missing" )
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/fterrors.h
@@ -1,0 +1,207 @@
+/***************************************************************************/
+/* */
+/* fterrors.h */
+/* */
+/* FreeType error code handling (specification). */
+/* */
+/* Copyright 1996-2001, 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 special header file is used to define the handling of FT2 */
+ /* enumeration constants. It can also be used to generate error message */
+ /* strings with a small macro trick explained below. */
+ /* */
+ /* I - Error Formats */
+ /* ----------------- */
+ /* */
+ /* Since release 2.1, the error constants have changed. The lower */
+ /* byte of the error value gives the "generic" error code, while the */
+ /* higher byte indicates in which module the error occurred. */
+ /* */
+ /* You can use the macro FT_ERROR_BASE(x) macro to extract the generic */
+ /* error code from an FT_Error value. */
+ /* */
+ /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
+ /* undefined in ftoption.h in order to make the higher byte always */
+ /* zero, in case you need to be compatible with previous versions of */
+ /* FreeType 2. */
+ /* */
+ /* */
+ /* II - Error Message strings */
+ /* -------------------------- */
+ /* */
+ /* The error definitions below are made through special macros that */
+ /* allow client applications to build a table of error message strings */
+ /* if they need it. The strings are not included in a normal build of */
+ /* FreeType 2 to save space (most client applications do not use */
+ /* them). */
+ /* */
+ /* To do so, you have to define the following macros before including */
+ /* this file: */
+ /* */
+ /* FT_ERROR_START_LIST :: */
+ /* This macro is called before anything else to define the start of */
+ /* the error list. It is followed by several FT_ERROR_DEF calls */
+ /* (see below). */
+ /* */
+ /* FT_ERROR_DEF( e, v, s ) :: */
+ /* This macro is called to define one single error. */
+ /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
+ /* `v' is the error numerical value. */
+ /* `s' is the corresponding error string. */
+ /* */
+ /* FT_ERROR_END_LIST :: */
+ /* This macro ends the list. */
+ /* */
+ /* Additionally, you have to undefine __FTERRORS_H__ before #including */
+ /* this file. */
+ /* */
+ /* Here is a simple example: */
+ /* */
+ /* { */
+ /* #undef __FTERRORS_H__ */
+ /* #define FT_ERRORDEF( e, v, s ) { e, s }, */
+ /* #define FT_ERROR_START_LIST { */
+ /* #define FT_ERROR_END_LIST { 0, 0 } }; */
+ /* */
+ /* const struct */
+ /* { */
+ /* int err_code; */
+ /* const char* err_msg */
+ /* } ft_errors[] = */
+ /* */
+ /* #include FT_ERRORS_H */
+ /* } */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTERRORS_H__
+#define __FTERRORS_H__
+
+
+ /* include module base error codes */
+#include FT_MODULE_ERRORS_H
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** SETUP MACROS *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#undef FT_NEED_EXTERN_C
+
+#undef FT_ERR_XCAT
+#undef FT_ERR_CAT
+
+#define FT_ERR_XCAT( x, y ) x ## y
+#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
+
+
+ /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
+ /* By default, we use `FT_Err_'. */
+ /* */
+#ifndef FT_ERR_PREFIX
+#define FT_ERR_PREFIX FT_Err_
+#endif
+
+
+ /* FT_ERR_BASE is used as the base for module-specific errors. */
+ /* */
+#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+
+#ifndef FT_ERR_BASE
+#define FT_ERR_BASE FT_Mod_Err_Base
+#endif
+
+#else
+
+#undef FT_ERR_BASE
+#define FT_ERR_BASE 0
+
+#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
+
+
+ /* If FT_ERRORDEF is not defined, we need to define a simple */
+ /* enumeration type. */
+ /* */
+#ifndef FT_ERRORDEF
+
+#define FT_ERRORDEF( e, v, s ) e = v,
+#define FT_ERROR_START_LIST enum {
+#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
+
+#ifdef __cplusplus
+#define FT_NEED_EXTERN_C
+ extern "C" {
+#endif
+
+#endif /* !FT_ERRORDEF */
+
+
+ /* this macro is used to define an error */
+#define FT_ERRORDEF_( e, v, s ) \
+ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
+
+ /* this is only used for FT_Err_Ok, which must be 0! */
+#define FT_NOERRORDEF_( e, v, s ) \
+ FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
+
+
+#ifdef FT_ERROR_START_LIST
+ FT_ERROR_START_LIST
+#endif
+
+
+ /* no include the error codes */
+#include FT_ERROR_DEFINITIONS_H
+
+
+#ifdef FT_ERROR_END_LIST
+ FT_ERROR_END_LIST
+#endif
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** SIMPLE CLEANUP *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+#ifdef FT_NEED_EXTERN_C
+ }
+#endif
+
+#undef FT_ERROR_START_LIST
+#undef FT_ERROR_END_LIST
+
+#undef FT_ERRORDEF
+#undef FT_ERRORDEF_
+#undef FT_NOERRORDEF_
+
+#undef FT_NEED_EXTERN_C
+#undef FT_ERR_PREFIX
+#undef FT_ERR_BASE
+#undef FT_ERR_CONCAT
+
+#endif /* __FTERRORS_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftglyph.h
@@ -1,0 +1,517 @@
+/***************************************************************************/
+/* */
+/* ftglyph.h */
+/* */
+/* FreeType convenience functions to handle glyphs (specification). */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file contains the definition of several convenience functions */
+ /* that can be used by client applications to easily retrieve glyph */
+ /* bitmaps and outlines from a given face. */
+ /* */
+ /* These functions should be optional if you are writing a font server */
+ /* or text layout engine on top of FreeType. However, they are pretty */
+ /* handy for many other simple uses of the library. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTGLYPH_H__
+#define __FTGLYPH_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* glyph_management */
+ /* */
+ /* <Title> */
+ /* Glyph Management */
+ /* */
+ /* <Abstract> */
+ /* Generic interface to manage individual glyph data. */
+ /* */
+ /* <Description> */
+ /* This section contains definitions used to manage glyph data */
+ /* through generic FT_Glyph objects. Each of them can contain a */
+ /* bitmap, a vector outline, or even images in other formats. */
+ /* */
+ /*************************************************************************/
+
+
+ /* forward declaration to a private type */
+ typedef struct FT_Glyph_Class_ FT_Glyph_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Glyph */
+ /* */
+ /* <Description> */
+ /* Handle to an object used to model generic glyph images. It is a */
+ /* pointer to the @FT_GlyphRec structure and can contain a glyph */
+ /* bitmap or pointer. */
+ /* */
+ /* <Note> */
+ /* Glyph objects are not owned by the library. You must thus release */
+ /* them manually (through @FT_Done_Glyph) _before_ calling */
+ /* @FT_Done_FreeType. */
+ /* */
+ typedef struct FT_GlyphRec_* FT_Glyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_GlyphRec */
+ /* */
+ /* <Description> */
+ /* The root glyph structure contains a given glyph image plus its */
+ /* advance width in 16.16 fixed float format. */
+ /* */
+ /* <Fields> */
+ /* library :: A handle to the FreeType library object. */
+ /* */
+ /* clazz :: A pointer to the glyph's class. Private. */
+ /* */
+ /* format :: The format of the glyph's image. */
+ /* */
+ /* advance :: A 16.16 vector that gives the glyph's advance width. */
+ /* */
+ typedef struct FT_GlyphRec_
+ {
+ FT_Library library;
+ const FT_Glyph_Class* clazz;
+ FT_Glyph_Format format;
+ FT_Vector advance;
+
+ } FT_GlyphRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_BitmapGlyph */
+ /* */
+ /* <Description> */
+ /* A handle to an object used to model a bitmap glyph image. This is */
+ /* a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec. */
+ /* */
+ typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_BitmapGlyphRec */
+ /* */
+ /* <Description> */
+ /* A structure used for bitmap glyph images. This really is a */
+ /* `sub-class' of `FT_GlyphRec'. */
+ /* */
+ /* <Fields> */
+ /* root :: The root FT_Glyph fields. */
+ /* */
+ /* left :: The left-side bearing, i.e., the horizontal distance */
+ /* from the current pen position to the left border of the */
+ /* glyph bitmap. */
+ /* */
+ /* top :: The top-side bearing, i.e., the vertical distance from */
+ /* the current pen position to the top border of the glyph */
+ /* bitmap. This distance is positive for upwards-y! */
+ /* */
+ /* bitmap :: A descriptor for the bitmap. */
+ /* */
+ /* <Note> */
+ /* You can typecast FT_Glyph to FT_BitmapGlyph if you have */
+ /* glyph->format == FT_GLYPH_FORMAT_BITMAP. This lets you access */
+ /* the bitmap's contents easily. */
+ /* */
+ /* The corresponding pixel buffer is always owned by the BitmapGlyph */
+ /* and is thus created and destroyed with it. */
+ /* */
+ typedef struct FT_BitmapGlyphRec_
+ {
+ FT_GlyphRec root;
+ FT_Int left;
+ FT_Int top;
+ FT_Bitmap bitmap;
+
+ } FT_BitmapGlyphRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_OutlineGlyph */
+ /* */
+ /* <Description> */
+ /* A handle to an object used to model an outline glyph image. This */
+ /* is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */
+ /* */
+ typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_OutlineGlyphRec */
+ /* */
+ /* <Description> */
+ /* A structure used for outline (vectorial) glyph images. This */
+ /* really is a `sub-class' of `FT_GlyphRec'. */
+ /* */
+ /* <Fields> */
+ /* root :: The root FT_Glyph fields. */
+ /* */
+ /* outline :: A descriptor for the outline. */
+ /* */
+ /* <Note> */
+ /* You can typecast FT_Glyph to FT_OutlineGlyph if you have */
+ /* glyph->format == FT_GLYPH_FORMAT_OUTLINE. This lets you access */
+ /* the outline's content easily. */
+ /* */
+ /* As the outline is extracted from a glyph slot, its coordinates are */
+ /* expressed normally in 26.6 pixels, unless the flag */
+ /* FT_LOAD_NO_SCALE was used in FT_Load_Glyph() or FT_Load_Char(). */
+ /* */
+ /* The outline's tables are always owned by the object and are */
+ /* destroyed with it. */
+ /* */
+ typedef struct FT_OutlineGlyphRec_
+ {
+ FT_GlyphRec root;
+ FT_Outline outline;
+
+ } FT_OutlineGlyphRec;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Glyph */
+ /* */
+ /* <Description> */
+ /* A function used to extract a glyph image from a slot. */
+ /* */
+ /* <Input> */
+ /* slot :: A handle to the source glyph slot. */
+ /* */
+ /* <Output> */
+ /* aglyph :: A handle to the glyph object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Glyph( FT_GlyphSlot slot,
+ FT_Glyph *aglyph );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Copy */
+ /* */
+ /* <Description> */
+ /* A function used to copy a glyph image. */
+ /* */
+ /* <Input> */
+ /* source :: A handle to the source glyph object. */
+ /* */
+ /* <Output> */
+ /* target :: A handle to the target glyph object. 0 in case of */
+ /* error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_Copy( FT_Glyph source,
+ FT_Glyph *target );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Transform */
+ /* */
+ /* <Description> */
+ /* Transforms a glyph image if its format is scalable. */
+ /* */
+ /* <InOut> */
+ /* glyph :: A handle to the target glyph object. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to a 2x2 matrix to apply. */
+ /* */
+ /* delta :: A pointer to a 2d vector to apply. Coordinates are */
+ /* expressed in 1/64th of a pixel. */
+ /* */
+ /* <Return> */
+ /* FreeType error code (the glyph format is not scalable if it is */
+ /* not zero). */
+ /* */
+ /* <Note> */
+ /* The 2x2 transformation matrix is also applied to the glyph's */
+ /* advance vector. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_Transform( FT_Glyph glyph,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+ /* */
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_Get_CBox */
+ /* */
+ /* <Description> */
+ /* Returns a glyph's `control box'. The control box encloses all the */
+ /* outline's points, including Bezier control points. Though it */
+ /* coincides with the exact bounding box for most glyphs, it can be */
+ /* slightly larger in some situations (like when rotating an outline */
+ /* which contains Bezier outside arcs). */
+ /* */
+ /* Computing the control box is very fast, while getting the bounding */
+ /* box can take much more time as it needs to walk over all segments */
+ /* and arcs in the outline. To get the latter, you can use the */
+ /* `ftbbox' component which is dedicated to this single task. */
+ /* */
+ /* <Input> */
+ /* glyph :: A handle to the source glyph object. */
+ /* */
+ /* mode :: The mode which indicates how to interpret the returned */
+ /* bounding box values. */
+ /* */
+ /* <Output> */
+ /* acbox :: The glyph coordinate bounding box. Coordinates are */
+ /* expressed in 1/64th of pixels if it is grid-fitted. */
+ /* */
+ /* <Note> */
+ /* Coordinates are relative to the glyph origin, using the Y-upwards */
+ /* convention. */
+ /* */
+ /* If the glyph has been loaded with FT_LOAD_NO_SCALE, `bbox_mode' */
+ /* must be set to `ft_glyph_bbox_unscaled' to get unscaled font */
+ /* units. */
+ /* */
+ /* If `bbox_mode' is set to `ft_glyph_bbox_subpixels' the bbox */
+ /* coordinates are returned in 26.6 pixels (i.e. 1/64th of pixels). */
+ /* */
+ /* Note that the maximum coordinates are exclusive, which means that */
+ /* one can compute the width and height of the glyph image (be it in */
+ /* integer or 26.6 pixels) as: */
+ /* */
+ /* width = bbox.xMax - bbox.xMin; */
+ /* height = bbox.yMax - bbox.yMin; */
+ /* */
+ /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
+ /* `ft_glyph_bbox_gridfit', the coordinates will also be grid-fitted, */
+ /* which corresponds to: */
+ /* */
+ /* bbox.xMin = FLOOR(bbox.xMin); */
+ /* bbox.yMin = FLOOR(bbox.yMin); */
+ /* bbox.xMax = CEILING(bbox.xMax); */
+ /* bbox.yMax = CEILING(bbox.yMax); */
+ /* */
+ /* To get the bbox in pixel coordinates, set `bbox_mode' to */
+ /* `ft_glyph_bbox_truncate'. */
+ /* */
+ /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
+ /* to `ft_glyph_bbox_pixels'. */
+ /* */
+ /* The default value for `bbox_mode' is `ft_glyph_bbox_pixels'. */
+ /* */
+ enum
+ {
+ ft_glyph_bbox_unscaled = 0, /* return unscaled font units */
+ ft_glyph_bbox_subpixels = 0, /* return unfitted 26.6 coordinates */
+ ft_glyph_bbox_gridfit = 1, /* return grid-fitted 26.6 coordinates */
+ ft_glyph_bbox_truncate = 2, /* return coordinates in integer pixels */
+ ft_glyph_bbox_pixels = 3 /* return grid-fitted pixel coordinates */
+ };
+
+
+ FT_EXPORT( void )
+ FT_Glyph_Get_CBox( FT_Glyph glyph,
+ FT_UInt bbox_mode,
+ FT_BBox *acbox );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Glyph_To_Bitmap */
+ /* */
+ /* <Description> */
+ /* Converts a given glyph object to a bitmap glyph object. */
+ /* */
+ /* <InOut> */
+ /* the_glyph :: A pointer to a handle to the target glyph. */
+ /* */
+ /* <Input> */
+ /* render_mode :: An enumeration that describe how the data is */
+ /* rendered. */
+ /* */
+ /* origin :: A pointer to a vector used to translate the glyph */
+ /* image before rendering. Can be 0 (if no */
+ /* translation). The origin is expressed in */
+ /* 26.6 pixels. */
+ /* */
+ /* destroy :: A boolean that indicates that the original glyph */
+ /* image should be destroyed by this function. It is */
+ /* never destroyed in case of error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The glyph image is translated with the `origin' vector before */
+ /* rendering. In case of error, it it translated back to its */
+ /* original position and the glyph is left untouched. */
+ /* */
+ /* The first parameter is a pointer to a FT_Glyph handle, that will */
+ /* be replaced by this function. Typically, you would use (omitting */
+ /* error handling): */
+ /* */
+ /* */
+ /* { */
+ /* FT_Glyph glyph; */
+ /* FT_BitmapGlyph glyph_bitmap; */
+ /* */
+ /* */
+ /* // load glyph */
+ /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
+ /* */
+ /* // extract glyph image */
+ /* error = FT_Get_Glyph( face->glyph, &glyph ); */
+ /* */
+ /* // convert to a bitmap (default render mode + destroy old) */
+ /* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) */
+ /* { */
+ /* error = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_default, */
+ /* 0, 1 ); */
+ /* if ( error ) // glyph unchanged */
+ /* ... */
+ /* } */
+ /* */
+ /* // access bitmap content by typecasting */
+ /* glyph_bitmap = (FT_BitmapGlyph)glyph; */
+ /* */
+ /* // do funny stuff with it, like blitting/drawing */
+ /* ... */
+ /* */
+ /* // discard glyph image (bitmap or not) */
+ /* FT_Done_Glyph( glyph ); */
+ /* } */
+ /* */
+ /* */
+ /* This function will always fail if the glyph's format isn't */
+ /* scalable. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
+ FT_Render_Mode render_mode,
+ FT_Vector* origin,
+ FT_Bool destroy );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Glyph */
+ /* */
+ /* <Description> */
+ /* Destroys a given glyph. */
+ /* */
+ /* <Input> */
+ /* glyph :: A handle to the target glyph object. */
+ /* */
+ FT_EXPORT( void )
+ FT_Done_Glyph( FT_Glyph glyph );
+
+
+ /* other helpful functions */
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* computations */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Matrix_Multiply */
+ /* */
+ /* <Description> */
+ /* Performs the matrix operation `b = a*b'. */
+ /* */
+ /* <Input> */
+ /* a :: A pointer to matrix `a'. */
+ /* */
+ /* <InOut> */
+ /* b :: A pointer to matrix `b'. */
+ /* */
+ /* <Note> */
+ /* The result is undefined if either `a' or `b' is zero. */
+ /* */
+ FT_EXPORT( void )
+ FT_Matrix_Multiply( FT_Matrix* a,
+ FT_Matrix* b );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Matrix_Invert */
+ /* */
+ /* <Description> */
+ /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
+ /* */
+ /* <InOut> */
+ /* matrix :: A pointer to the target matrix. Remains untouched in */
+ /* case of error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Matrix_Invert( FT_Matrix* matrix );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTGLYPH_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftgzip.h
@@ -1,0 +1,86 @@
+/***************************************************************************/
+/* */
+/* ftgzip.h */
+/* */
+/* Gzip-compressed stream support. */
+/* */
+/* 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTXF86_H__
+#define __FTXF86_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+FT_BEGIN_HEADER
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* gzip */
+ /* */
+ /* <Title> */
+ /* GZIP Streams */
+ /* */
+ /* <Abstract> */
+ /* Using gzip-compressed font files */
+ /* */
+ /* <Description> */
+ /* This section contains the declaration of Gzip-specific functions. */
+ /* */
+ /*************************************************************************/
+
+ /************************************************************************
+ *
+ * @type: FT_Stream_OpenGzip
+ *
+ * @description:
+ * open a new stream to parse gzip-compressed font files. This is
+ * mainly used to support the compressed *.pcf.gz fonts that come
+ * with XFree86
+ *
+ * @input:
+ * stream :: target embedding stream
+ * source :: source stream, used to
+ *
+ * @return:
+ * error code. 0 means success
+ *
+ * @note:
+ * the source stream must be opened _before_ calling this function.
+ *
+ * calling @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, gzip compression recognition is
+ * automatic 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 gzip 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 zlib support.
+ */
+ FT_EXPORT( FT_Error )
+ FT_Stream_OpenGzip( FT_Stream stream,
+ FT_Stream source );
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTXF86_H__ */
--- /dev/null
+++ b/include/freetype/ftimage.h
@@ -1,0 +1,1241 @@
+/***************************************************************************/
+/* */
+/* ftimage.h */
+/* */
+/* FreeType glyph image formats and default raster interface */
+/* (specification). */
+/* */
+/* Copyright 1996-2001, 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. */
+/* */
+/***************************************************************************/
+
+ /*************************************************************************/
+ /* */
+ /* Note: A `raster' is simply a scan-line converter, used to render */
+ /* FT_Outlines into FT_Bitmaps. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTIMAGE_H__
+#define __FTIMAGE_H__
+
+
+/* _STANDALONE_ is from ftgrays.c */
+#ifndef _STANDALONE_
+#include <ft2build.h>
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Pos */
+ /* */
+ /* <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. */
+ /* */
+ typedef signed long FT_Pos;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Vector */
+ /* */
+ /* <Description> */
+ /* A simple structure used to store a 2D vector; coordinates are of */
+ /* the FT_Pos type. */
+ /* */
+ /* <Fields> */
+ /* x :: The horizontal coordinate. */
+ /* y :: The vertical coordinate. */
+ /* */
+ typedef struct FT_Vector_
+ {
+ FT_Pos x;
+ FT_Pos y;
+
+ } FT_Vector;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_BBox */
+ /* */
+ /* <Description> */
+ /* A structure used to hold an outline's bounding box, i.e., the */
+ /* coordinates of its extrema in the horizontal and vertical */
+ /* directions. */
+ /* */
+ /* <Fields> */
+ /* xMin :: The horizontal minimum (left-most). */
+ /* */
+ /* yMin :: The vertical minimum (bottom-most). */
+ /* */
+ /* xMax :: The horizontal maximum (right-most). */
+ /* */
+ /* yMax :: The vertical maximum (top-most). */
+ /* */
+ typedef struct FT_BBox_
+ {
+ FT_Pos xMin, yMin;
+ FT_Pos xMax, yMax;
+
+ } FT_BBox;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Pixel_Mode */
+ /* */
+ /* <Description> */
+ /* An enumeration type used to describe the format of pixels in a */
+ /* given bitmap. Note that additional formats may be added in the */
+ /* future. */
+ /* */
+ /* <Values> */
+ /* FT_PIXEL_MODE_NONE :: */
+ /* Value 0 is reserved. */
+ /* */
+ /* FT_PIXEL_MODE_MONO :: */
+ /* A monochrome bitmap, using 1 bit per pixel. Note that pixels */
+ /* are stored in most-significant order (MSB), which means that */
+ /* the left-most pixel in a byte has value 128. */
+ /* */
+ /* FT_PIXEL_MODE_GRAY :: */
+ /* An 8-bit bitmap, generally used to represent anti-aliased glyph */
+ /* images. Each pixel is stored in one byte. Note that the number */
+ /* of value "gray" levels is stored in the `num_bytes' field of */
+ /* the @FT_Bitmap structure (it generally is 256). */
+ /* */
+ /* FT_PIXEL_MODE_GRAY2 :: */
+ /* A 2-bit/pixel bitmap, used to represent embedded anti-aliased */
+ /* bitmaps in font files according to the OpenType specification. */
+ /* We haven't found a single font using this format, however. */
+ /* */
+ /* FT_PIXEL_MODE_GRAY4 :: */
+ /* A 4-bit/pixel bitmap, used to represent embedded anti-aliased */
+ /* bitmaps in font files according to the OpenType specification. */
+ /* We haven't found a single font using this format, however. */
+ /* */
+ /* FT_PIXEL_MODE_LCD :: */
+ /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
+ /* images used for display on LCD displays; the bitmap's width is */
+ /* three times wider than the original glyph image. See also */
+ /* @FT_RENDER_MODE_LCD. */
+ /* */
+ /* FT_PIXEL_MODE_LCD_V :: */
+ /* An 8-bit bitmap, used to represent RGB or BGR decimated glyph */
+ /* images used for display on rotated LCD displays; the bitmap's */
+ /* height is three times taller than the original glyph image. */
+ /* See also @FT_RENDER_MODE_LCD_V. */
+ /* */
+ typedef enum FT_Pixel_Mode_
+ {
+ FT_PIXEL_MODE_NONE = 0,
+ FT_PIXEL_MODE_MONO,
+ FT_PIXEL_MODE_GRAY,
+ FT_PIXEL_MODE_GRAY2,
+ FT_PIXEL_MODE_GRAY4,
+ FT_PIXEL_MODE_LCD,
+ FT_PIXEL_MODE_LCD_V,
+
+ FT_PIXEL_MODE_MAX /* do not remove */
+
+ } FT_Pixel_Mode;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* ft_pixel_mode_xxx */
+ /* */
+ /* <Description> */
+ /* A list of deprecated constants. Use the corresponding */
+ /* @FT_Pixel_Mode values instead. */
+ /* */
+ /* <Values> */
+ /* ft_pixel_mode_none :: see @FT_PIXEL_MODE_NONE */
+ /* ft_pixel_mode_mono :: see @FT_PIXEL_MODE_MONO */
+ /* ft_pixel_mode_grays :: see @FT_PIXEL_MODE_GRAY */
+ /* ft_pixel_mode_pal2 :: see @FT_PIXEL_MODE_GRAY2 */
+ /* ft_pixel_mode_pal4 :: see @FT_PIXEL_MODE_GRAY4 */
+ /* */
+#define ft_pixel_mode_none FT_PIXEL_MODE_NONE
+#define ft_pixel_mode_mono FT_PIXEL_MODE_MONO
+#define ft_pixel_mode_grays FT_PIXEL_MODE_GRAY
+#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
+#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
+
+ /* */
+
+#if 0
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Palette_Mode */
+ /* */
+ /* <Description> */
+ /* THIS TYPE IS DEPRECATED. DO NOT USE IT! */
+ /* */
+ /* An enumeration type used to describe the format of a bitmap */
+ /* palette, used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8. */
+ /* */
+ /* <Fields> */
+ /* ft_palette_mode_rgb :: The palette is an array of 3-bytes RGB */
+ /* records. */
+ /* */
+ /* ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA */
+ /* records. */
+ /* */
+ /* <Note> */
+ /* As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by */
+ /* FreeType, these types are not handled by the library itself. */
+ /* */
+ typedef enum FT_Palette_Mode_
+ {
+ ft_palette_mode_rgb = 0,
+ ft_palette_mode_rgba,
+
+ ft_palettte_mode_max /* do not remove */
+
+ } FT_Palette_Mode;
+
+ /* */
+
+#endif
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Bitmap */
+ /* */
+ /* <Description> */
+ /* A structure used to describe a bitmap or pixmap to the raster. */
+ /* Note that we now manage pixmaps of various depths through the */
+ /* `pixel_mode' field. */
+ /* */
+ /* <Fields> */
+ /* rows :: The number of bitmap rows. */
+ /* */
+ /* width :: The number of pixels in bitmap row. */
+ /* */
+ /* pitch :: The pitch's absolute value is the number of bytes */
+ /* taken by one bitmap row, including padding. */
+ /* However, the pitch is positive when the bitmap has */
+ /* a `down' flow, and negative when it has an `up' */
+ /* flow. In all cases, the pitch is an offset to add */
+ /* to a bitmap pointer in order to go down one row. */
+ /* */
+ /* buffer :: A typeless pointer to the bitmap buffer. This */
+ /* value should be aligned on 32-bit boundaries in */
+ /* most cases. */
+ /* */
+ /* num_grays :: This field is only used with */
+ /* `FT_PIXEL_MODE_GRAY'; it gives the number of gray */
+ /* levels used in the bitmap. */
+ /* */
+ /* pixel_mode :: The pixel_mode, i.e., how pixel bits are stored. */
+ /* */
+ /* palette_mode :: This field is only used with paletted pixel modes; */
+ /* it indicates how the palette is stored. */
+ /* */
+ /* palette :: A typeless pointer to the bitmap palette; only */
+ /* used for paletted pixel modes. */
+ /* */
+ /* <Note> */
+ /* For now, the only pixel mode supported by FreeType are mono and */
+ /* grays. However, drivers might be added in the future to support */
+ /* more `colorful' options. */
+ /* */
+ /* When using pixel modes pal2, pal4 and pal8 with a void `palette' */
+ /* field, a gray pixmap with respectively 4, 16, and 256 levels of */
+ /* gray is assumed. This, in order to be compatible with some */
+ /* embedded bitmap formats defined in the TrueType specification. */
+ /* */
+ /* Note that no font was found presenting such embedded bitmaps, so */
+ /* this is currently completely unhandled by the library. */
+ /* */
+ typedef struct FT_Bitmap_
+ {
+ int rows;
+ int width;
+ int pitch;
+ unsigned char* buffer;
+ short num_grays;
+ char pixel_mode;
+ char palette_mode;
+ void* palette;
+
+ } FT_Bitmap;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Outline */
+ /* */
+ /* <Description> */
+ /* This structure is used to describe an outline to the scan-line */
+ /* converter. */
+ /* */
+ /* <Fields> */
+ /* n_contours :: The number of contours in the outline. */
+ /* */
+ /* n_points :: The number of points in the outline. */
+ /* */
+ /* points :: A pointer to an array of `n_points' FT_Vector */
+ /* elements, giving the outline's point coordinates. */
+ /* */
+ /* tags :: A pointer to an array of `n_points' chars, giving */
+ /* each outline point's type. If bit 0 is unset, the */
+ /* point is `off' the curve, i.e. a Bezier control */
+ /* point, while it is `on' when set. */
+ /* */
+ /* Bit 1 is meaningful for `off' points only. If set, */
+ /* it indicates a third-order Bezier arc control point; */
+ /* and a second-order control point if unset. */
+ /* */
+ /* contours :: An array of `n_contours' shorts, giving the end */
+ /* point of each contour within the outline. For */
+ /* example, the first contour is defined by the points */
+ /* `0' to `contours[0]', the second one is defined by */
+ /* the points `contours[0]+1' to `contours[1]', etc. */
+ /* */
+ /* flags :: A set of bit flags used to characterize the outline */
+ /* and give hints to the scan-converter and hinter on */
+ /* how to convert/grid-fit it. See FT_Outline_Flags. */
+ /* */
+ typedef struct FT_Outline_
+ {
+ short n_contours; /* number of contours in glyph */
+ short n_points; /* number of points in the glyph */
+
+ FT_Vector* points; /* the outline's points */
+ char* tags; /* the points flags */
+ short* contours; /* the contour end points */
+
+ int flags; /* outline masks */
+
+ } FT_Outline;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Outline_Flags */
+ /* */
+ /* <Description> */
+ /* A simple type used to enumerates the flags in an outline's */
+ /* `outline_flags' field. */
+ /* */
+ /* <Values> */
+ /* FT_OUTLINE_NONE :: Value 0 is reserved. */
+ /* */
+ /* FT_OUTLINE_OWNER :: If set, this flag indicates that the */
+ /* outline's field arrays (i.e. */
+ /* `points', `flags' & `contours') are */
+ /* `owned' by the outline object, and */
+ /* should thus be freed when it is */
+ /* destroyed. */
+ /* */
+ /* FT_OUTLINE_EVEN_ODD_FILL :: By default, outlines are filled using */
+ /* the non-zero winding rule. If set to */
+ /* 1, the outline will be filled using */
+ /* the even-odd fill rule (only works */
+ /* with the smooth raster). */
+ /* */
+ /* FT_OUTLINE_REVERSE_FILL :: By default, outside contours of an */
+ /* outline are oriented in clock-wise */
+ /* direction, as defined in the TrueType */
+ /* specification. This flag is set if */
+ /* the outline uses the opposite */
+ /* direction (typically for Type 1 */
+ /* fonts). This flag is ignored by the */
+ /* scan-converter. However, it is very */
+ /* important for the auto-hinter. */
+ /* */
+ /* FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will */
+ /* try to detect drop-outs in an outline */
+ /* and correct the glyph bitmap to */
+ /* ensure consistent shape continuity. */
+ /* If set, this flag hints the scan-line */
+ /* converter to ignore such cases. */
+ /* */
+ /* FT_OUTLINE_HIGH_PRECISION :: This flag indicates that the */
+ /* scan-line converter should try to */
+ /* convert this outline to bitmaps with */
+ /* the highest possible quality. It is */
+ /* typically set for small character */
+ /* sizes. Note that this is only a */
+ /* hint, that might be completely */
+ /* ignored by a given scan-converter. */
+ /* */
+ /* FT_OUTLINE_SINGLE_PASS :: This flag is set to force a given */
+ /* scan-converter to only use a single */
+ /* pass over the outline to render a */
+ /* bitmap glyph image. Normally, it is */
+ /* set for very large character sizes. */
+ /* It is only a hint, that might be */
+ /* completely ignored by a given */
+ /* scan-converter. */
+ /* */
+ typedef enum FT_Outline_Flags_
+ {
+ FT_OUTLINE_NONE = 0,
+ FT_OUTLINE_OWNER = 1,
+ FT_OUTLINE_EVEN_ODD_FILL = 2,
+ FT_OUTLINE_REVERSE_FILL = 4,
+ FT_OUTLINE_IGNORE_DROPOUTS = 8,
+ FT_OUTLINE_HIGH_PRECISION = 256,
+ FT_OUTLINE_SINGLE_PASS = 512
+
+ } FT_Outline_Flags;
+
+
+ /*************************************************************************
+ *
+ * @enum:
+ * ft_outline_xxx
+ *
+ * @description:
+ * These constants are deprecated. Please use the corresponding
+ * @FT_OUTLINE_XXX values.
+ *
+ * @values:
+ * ft_outline_none :: See @FT_OUTLINE_NONE.
+ * ft_outline_owner :: See @FT_OUTLINE_OWNER.
+ * ft_outline_even_odd_fill :: See @FT_OUTLINE_EVEN_ODD_FILL.
+ * ft_outline_reverse_fill :: See @FT_OUTLINE_REVERSE_FILL.
+ * ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.
+ * ft_outline_high_precision :: See @FT_OUTLINE_HIGH_PRECISION.
+ * ft_outline_single_pass :: See @FT_OUTLINE_SINGLE_PASS.
+ */
+#define ft_outline_none FT_OUTLINE_NONE
+#define ft_outline_owner FT_OUTLINE_OWNER
+#define ft_outline_even_odd_fill FT_OUTLINE_EVEN_ODD_FILL
+#define ft_outline_reverse_fill FT_OUTLINE_REVERSE_FILL
+#define ft_outline_ignore_dropouts FT_OUTLINE_IGNORE_DROPOUTS
+#define ft_outline_high_precision FT_OUTLINE_HIGH_PRECISION
+#define ft_outline_single_pass FT_OUTLINE_SINGLE_PASS
+
+ /* */
+
+#define FT_CURVE_TAG( flag ) ( flag & 3 )
+
+#define FT_CURVE_TAG_ON 1
+#define FT_CURVE_TAG_CONIC 0
+#define FT_CURVE_TAG_CUBIC 2
+
+#define FT_CURVE_TAG_TOUCH_X 8 /* reserved for the TrueType hinter */
+#define FT_CURVE_TAG_TOUCH_Y 16 /* reserved for the TrueType hinter */
+
+#define FT_CURVE_TAG_TOUCH_BOTH ( FT_CURVE_TAG_TOUCH_X | \
+ FT_CURVE_TAG_TOUCH_Y )
+
+#define FT_Curve_Tag_On FT_CURVE_TAG_ON
+#define FT_Curve_Tag_Conic FT_CURVE_TAG_CONIC
+#define FT_Curve_Tag_Cubic FT_CURVE_TAG_CUBIC
+#define FT_Curve_Tag_Touch_X FT_CURVE_TAG_TOUCH_X
+#define FT_Curve_Tag_Touch_Y FT_CURVE_TAG_TOUCH_Y
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_MoveToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `move */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `move to' is emitted to start a new contour in an outline. */
+ /* */
+ /* <Input> */
+ /* to :: A pointer to the target point of the `move to'. */
+ /* */
+ /* user :: A typeless pointer which is passed from the caller of the */
+ /* decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int
+ (*FT_Outline_MoveToFunc)( FT_Vector* to,
+ void* user );
+
+#define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_LineToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `line */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `line to' is emitted to indicate a segment in the outline. */
+ /* */
+ /* <Input> */
+ /* to :: A pointer to the target point of the `line to'. */
+ /* */
+ /* user :: A typeless pointer which is passed from the caller of the */
+ /* decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int
+ (*FT_Outline_LineToFunc)( FT_Vector* to,
+ void* user );
+
+#define FT_Outline_LineTo_Func FT_Outline_LineToFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_ConicToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type use to describe the signature of a `conic */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `conic to' is emitted to indicate a second-order Bezier arc in */
+ /* the outline. */
+ /* */
+ /* <Input> */
+ /* control :: An intermediate control point between the last position */
+ /* and the new target in `to'. */
+ /* */
+ /* to :: A pointer to the target end point of the conic arc. */
+ /* */
+ /* user :: A typeless pointer which is passed from the caller of */
+ /* the decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int
+ (*FT_Outline_ConicToFunc)( FT_Vector* control,
+ FT_Vector* to,
+ void* user );
+
+#define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Outline_CubicToFunc */
+ /* */
+ /* <Description> */
+ /* A function pointer type used to describe the signature of a `cubic */
+ /* to' function during outline walking/decomposition. */
+ /* */
+ /* A `cubic to' is emitted to indicate a third-order Bezier arc. */
+ /* */
+ /* <Input> */
+ /* control1 :: A pointer to the first Bezier control point. */
+ /* */
+ /* control2 :: A pointer to the second Bezier control point. */
+ /* */
+ /* to :: A pointer to the target end point. */
+ /* */
+ /* user :: A typeless pointer which is passed from the caller of */
+ /* the decomposition function. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ typedef int
+ (*FT_Outline_CubicToFunc)( FT_Vector* control1,
+ FT_Vector* control2,
+ FT_Vector* to,
+ void* user );
+
+#define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Outline_Funcs */
+ /* */
+ /* <Description> */
+ /* A structure to hold various function pointers used during outline */
+ /* decomposition in order to emit segments, conic, and cubic Beziers, */
+ /* as well as `move to' and `close to' operations. */
+ /* */
+ /* <Fields> */
+ /* move_to :: The `move to' emitter. */
+ /* */
+ /* line_to :: The segment emitter. */
+ /* */
+ /* conic_to :: The second-order Bezier arc emitter. */
+ /* */
+ /* cubic_to :: The third-order Bezier arc emitter. */
+ /* */
+ /* shift :: The shift that is applied to coordinates before they */
+ /* are sent to the emitter. */
+ /* */
+ /* delta :: The delta that is applied to coordinates before they */
+ /* are sent to the emitter, but after the shift. */
+ /* */
+ /* <Note> */
+ /* The point coordinates sent to the emitters are the transformed */
+ /* version of the original coordinates (this is important for high */
+ /* accuracy during scan-conversion). The transformation is simple: */
+ /* */
+ /* x' = (x << shift) - delta */
+ /* y' = (x << shift) - delta */
+ /* */
+ /* Set the value of `shift' and `delta' to 0 to get the original */
+ /* point coordinates. */
+ /* */
+ typedef struct FT_Outline_Funcs_
+ {
+ FT_Outline_MoveToFunc move_to;
+ FT_Outline_LineToFunc line_to;
+ FT_Outline_ConicToFunc conic_to;
+ FT_Outline_CubicToFunc cubic_to;
+
+ int shift;
+ FT_Pos delta;
+
+ } FT_Outline_Funcs;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* basic_types */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Macro> */
+ /* FT_IMAGE_TAG */
+ /* */
+ /* <Description> */
+ /* This macro converts four letter tags into an unsigned long. */
+ /* */
+ /* <Note> */
+ /* Since many 16bit compilers don't like 32bit enumerations, you */
+ /* should redefine this macro in case of problems to something like */
+ /* this: */
+ /* */
+ /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) (value) */
+ /* */
+ /* to get a simple enumeration without assigning special numbers. */
+ /* */
+#ifndef FT_IMAGE_TAG
+#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
+ value = ( ( (unsigned long)_x1 << 24 ) | \
+ ( (unsigned long)_x2 << 16 ) | \
+ ( (unsigned long)_x3 << 8 ) | \
+ (unsigned long)_x4 )
+#endif /* FT_IMAGE_TAG */
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Glyph_Format */
+ /* */
+ /* <Description> */
+ /* An enumeration type used to describe the format of a given glyph */
+ /* image. Note that this version of FreeType only supports two image */
+ /* formats, even though future font drivers will be able to register */
+ /* their own format. */
+ /* */
+ /* <Values> */
+ /* FT_GLYPH_FORMAT_NONE :: */
+ /* The value 0 is reserved and does describe a glyph format. */
+ /* */
+ /* FT_GLYPH_FORMAT_COMPOSITE :: */
+ /* The glyph image is a composite of several other images. This */
+ /* format is _only_ used with @FT_LOAD_FLAG_NO_RECURSE, and is */
+ /* used to report compound glyphs (like accented characters). */
+ /* */
+ /* FT_GLYPH_FORMAT_BITMAP :: */
+ /* The glyph image is a bitmap, and can be described as an */
+ /* @FT_Bitmap. You generally need to access the `bitmap' field of */
+ /* the @FT_GlyphSlotRec structure to read it. */
+ /* */
+ /* FT_GLYPH_FORMAT_OUTLINE :: */
+ /* The glyph image is a vertorial outline made of line segments */
+ /* and Bezier arcs; it can be described as an @FT_Outline; you */
+ /* generally want to access the `outline' field of the */
+ /* @FT_GlyphSlotRec structure to read it. */
+ /* */
+ /* FT_GLYPH_FORMAT_PLOTTER :: */
+ /* The glyph image is a vectorial path with no inside/outside */
+ /* contours. Some Type 1 fonts, like those in the Hershey family, */
+ /* contain glyphs in this format. These are described as */
+ /* @FT_Outline, but FreeType isn't currently capable of rendering */
+ /* them correctly. */
+ /* */
+ typedef enum FT_Glyph_Format_
+ {
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
+
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
+
+ } FT_Glyph_Format;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* ft_glyph_format_xxx */
+ /* */
+ /* <Description> */
+ /* A list of decprecated constants. Use the corresponding */
+ /* @FT_Glyph_Format values instead. */
+ /* */
+ /* <Values> */
+ /* ft_glyph_format_none :: see @FT_GLYPH_FORMAT_NONE */
+ /* ft_glyph_format_composite :: see @FT_GLYPH_FORMAT_COMPOSITE */
+ /* ft_glyph_format_bitmap :: see @FT_GLYPH_FORMAT_BITMAP */
+ /* ft_glyph_format_outline :: see @FT_GLYPH_FORMAT_OUTLINE */
+ /* ft_glyph_format_plotter :: see @FT_GLYPH_FORMAT_PLOTTER */
+ /* */
+#define ft_glyph_format_none FT_GLYPH_FORMAT_NONE
+#define ft_glyph_format_composite FT_GLYPH_FORMAT_COMPOSITE
+#define ft_glyph_format_bitmap FT_GLYPH_FORMAT_BITMAP
+#define ft_glyph_format_outline FT_GLYPH_FORMAT_OUTLINE
+#define ft_glyph_format_plotter FT_GLYPH_FORMAT_PLOTTER
+
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+ /***** *****/
+ /***** R A S T E R D E F I N I T I O N S *****/
+ /***** *****/
+ /*************************************************************************/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* A raster is a scan converter, in charge of rendering an outline into */
+ /* a a bitmap. This section contains the public API for rasters. */
+ /* */
+ /* Note that in FreeType 2, all rasters are now encapsulated within */
+ /* specific modules called `renderers'. See `freetype/ftrender.h' for */
+ /* more details on renderers. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* raster */
+ /* */
+ /* <Title> */
+ /* Scanline converter */
+ /* */
+ /* <Abstract> */
+ /* How vectorial outlines are converted into bitmaps and pixmaps. */
+ /* */
+ /* <Description> */
+ /* This section contains technical definitions. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Raster */
+ /* */
+ /* <Description> */
+ /* A handle (pointer) to a raster object. Each object can be used */
+ /* independently to convert an outline into a bitmap or pixmap. */
+ /* */
+ typedef struct FT_RasterRec_* FT_Raster;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Span */
+ /* */
+ /* <Description> */
+ /* A structure used to model a single span of gray (or black) pixels */
+ /* when rendering a monochrome or anti-aliased bitmap. */
+ /* */
+ /* <Fields> */
+ /* x :: The span's horizontal start position. */
+ /* */
+ /* len :: The span's length in pixels. */
+ /* */
+ /* coverage :: The span color/coverage, ranging from 0 (background) */
+ /* to 255 (foreground). Only used for anti-aliased */
+ /* rendering. */
+ /* */
+ /* <Note> */
+ /* This structure is used by the span drawing callback type named */
+ /* FT_SpanFunc which takes the y-coordinate of the span as a */
+ /* a parameter. */
+ /* */
+ /* The coverage value is always between 0 and 255, even if the number */
+ /* of gray levels have been set through FT_Set_Gray_Levels(). */
+ /* */
+ typedef struct FT_Span_
+ {
+ short x;
+ unsigned short len;
+ unsigned char coverage;
+
+ } FT_Span;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_SpanFunc */
+ /* */
+ /* <Description> */
+ /* A function used as a call-back by the anti-aliased renderer in */
+ /* order to let client applications draw themselves the gray pixel */
+ /* spans on each scan line. */
+ /* */
+ /* <Input> */
+ /* y :: The scanline's y-coordinate. */
+ /* */
+ /* count :: The number of spans to draw on this scanline. */
+ /* */
+ /* spans :: A table of `count' spans to draw on the scanline. */
+ /* */
+ /* user :: User-supplied data that is passed to the callback. */
+ /* */
+ /* <Note> */
+ /* This callback allows client applications to directly render the */
+ /* gray spans of the anti-aliased bitmap to any kind of surfaces. */
+ /* */
+ /* This can be used to write anti-aliased outlines directly to a */
+ /* given background bitmap, and even perform translucency. */
+ /* */
+ /* Note that the `count' field cannot be greater than a fixed value */
+ /* defined by the FT_MAX_GRAY_SPANS configuration macro in */
+ /* ftoption.h. By default, this value is set to 32, which means that */
+ /* if there are more than 32 spans on a given scanline, the callback */
+ /* will be called several times with the same `y' parameter in order */
+ /* to draw all callbacks. */
+ /* */
+ /* Otherwise, the callback is only called once per scan-line, and */
+ /* only for those scanlines that do have `gray' pixels on them. */
+ /* */
+ typedef void
+ (*FT_SpanFunc)( int y,
+ int count,
+ FT_Span* spans,
+ void* user );
+
+#define FT_Raster_Span_Func FT_SpanFunc
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_BitTest_Func */
+ /* */
+ /* <Description> */
+ /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
+ /* */
+ /* A function used as a call-back by the monochrome scan-converter */
+ /* to test whether a given target pixel is already set to the drawing */
+ /* `color'. These tests are crucial to implement drop-out control */
+ /* per-se the TrueType spec. */
+ /* */
+ /* <Input> */
+ /* y :: The pixel's y-coordinate. */
+ /* */
+ /* x :: The pixel's x-coordinate. */
+ /* */
+ /* user :: User-supplied data that is passed to the callback. */
+ /* */
+ /* <Return> */
+ /* 1 if the pixel is `set', 0 otherwise. */
+ /* */
+ typedef int
+ (*FT_Raster_BitTest_Func)( int y,
+ int x,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_BitSet_Func */
+ /* */
+ /* <Description> */
+ /* THIS TYPE IS DEPRECATED. DO NOT USE IT. */
+ /* */
+ /* A function used as a call-back by the monochrome scan-converter */
+ /* to set an individual target pixel. This is crucial to implement */
+ /* drop-out control according to the TrueType specification. */
+ /* */
+ /* <Input> */
+ /* y :: The pixel's y-coordinate. */
+ /* */
+ /* x :: The pixel's x-coordinate. */
+ /* */
+ /* user :: User-supplied data that is passed to the callback. */
+ /* */
+ /* <Return> */
+ /* 1 if the pixel is `set', 0 otherwise. */
+ /* */
+ typedef void
+ (*FT_Raster_BitSet_Func)( int y,
+ int x,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Enum> */
+ /* FT_Raster_Flag */
+ /* */
+ /* <Description> */
+ /* An enumeration to list the bit flags as used in the `flags' field */
+ /* of a FT_Raster_Params structure. */
+ /* */
+ /* <Values> */
+ /* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
+ /* */
+ /* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
+ /* anti-aliased glyph image should be */
+ /* generated. Otherwise, it will be */
+ /* monochrome (1-bit) */
+ /* */
+ /* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
+ /* rendering. In this mode, client */
+ /* applications must provide their own span */
+ /* callback. This lets them directly */
+ /* draw or compose over an existing bitmap. */
+ /* If this bit is not set, the target */
+ /* pixmap's buffer _must_ be zeroed before */
+ /* rendering. */
+ /* */
+ /* Note that for now, direct rendering is */
+ /* only possible with anti-aliased glyphs. */
+ /* */
+ /* FT_RASTER_FLAG_CLIP :: This flag is only used in direct */
+ /* rendering mode. If set, the output will */
+ /* be clipped to a box specified in the */
+ /* "clip_box" field of the FT_Raster_Params */
+ /* structure. */
+ /* */
+ /* Note that by default, the glyph bitmap */
+ /* is clipped to the target pixmap, except */
+ /* in direct rendering mode where all spans */
+ /* are generated if no clipping box is set. */
+ /* */
+ typedef enum
+ {
+ FT_RASTER_FLAG_DEFAULT = 0,
+ FT_RASTER_FLAG_AA = 1,
+ FT_RASTER_FLAG_DIRECT = 2,
+ FT_RASTER_FLAG_CLIP = 4
+
+ } FT_Raster_Flag;
+
+#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
+#define ft_raster_flag_aa FT_RASTER_FLAG_AA
+#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
+#define ft_raster_flag_clip FT_RASTER_FLAG_CLIP
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Raster_Params */
+ /* */
+ /* <Description> */
+ /* A structure to hold the arguments used by a raster's render */
+ /* function. */
+ /* */
+ /* <Fields> */
+ /* target :: The target bitmap. */
+ /* */
+ /* source :: A pointer to the source glyph image (e.g. an */
+ /* FT_Outline). */
+ /* */
+ /* flags :: The rendering flags. */
+ /* */
+ /* gray_spans :: The gray span drawing callback. */
+ /* */
+ /* black_spans :: The black span drawing callback. */
+ /* */
+ /* bit_test :: The bit test callback. UNIMPLEMENTED! */
+ /* */
+ /* bit_set :: The bit set callback. UNIMPLEMENTED! */
+ /* */
+ /* user :: User-supplied data that is passed to each drawing */
+ /* callback. */
+ /* */
+ /* clip_box :: An optional clipping box. It is only used in */
+ /* direct rendering mode. Note that coordinates here */
+ /* should be expressed in _integer_ pixels (and not in */
+ /* 26.6 fixed-point units). */
+ /* */
+ /* <Note> */
+ /* An anti-aliased glyph bitmap is drawn if the FT_RASTER_FLAG_AA bit */
+ /* flag is set in the `flags' field, otherwise a monochrome bitmap */
+ /* will be generated. */
+ /* */
+ /* If the FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
+ /* raster will call the `gray_spans' callback to draw gray pixel */
+ /* spans, in the case of an aa glyph bitmap, it will call */
+ /* `black_spans', and `bit_test' and `bit_set' in the case of a */
+ /* monochrome bitmap. This allows direct composition over a */
+ /* pre-existing bitmap through user-provided callbacks to perform the */
+ /* span drawing/composition. */
+ /* */
+ /* Note that the `bit_test' and `bit_set' callbacks are required when */
+ /* rendering a monochrome bitmap, as they are crucial to implement */
+ /* correct drop-out control as defined in the TrueType specification. */
+ /* */
+ typedef struct FT_Raster_Params_
+ {
+ FT_Bitmap* target;
+ void* source;
+ int flags;
+ FT_SpanFunc gray_spans;
+ FT_SpanFunc black_spans;
+ FT_Raster_BitTest_Func bit_test; /* doesn't work! */
+ FT_Raster_BitSet_Func bit_set; /* doesn't work! */
+ void* user;
+ FT_BBox clip_box;
+
+ } FT_Raster_Params;
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_NewFunc */
+ /* */
+ /* <Description> */
+ /* A function used to create a new raster object. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the memory allocator. */
+ /* */
+ /* <Output> */
+ /* raster :: A handle to the new raster object. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The `memory' parameter is a typeless pointer in order to avoid */
+ /* un-wanted dependencies on the rest of the FreeType code. In */
+ /* practice, it is a FT_Memory, i.e., a handle to the standard */
+ /* FreeType memory allocator. However, this field can be completely */
+ /* ignored by a given raster implementation. */
+ /* */
+ typedef int
+ (*FT_Raster_NewFunc)( void* memory,
+ FT_Raster* raster );
+
+#define FT_Raster_New_Func FT_Raster_NewFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_DoneFunc */
+ /* */
+ /* <Description> */
+ /* A function used to destroy a given raster object. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the raster object. */
+ /* */
+ typedef void
+ (*FT_Raster_DoneFunc)( FT_Raster raster );
+
+#define FT_Raster_Done_Func FT_Raster_DoneFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_ResetFunc */
+ /* */
+ /* <Description> */
+ /* FreeType provides an area of memory called the `render pool', */
+ /* available to all registered rasters. This pool can be freely used */
+ /* during a given scan-conversion but is shared by all rasters. Its */
+ /* content is thus transient. */
+ /* */
+ /* This function is called each time the render pool changes, or just */
+ /* after a new raster object is created. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the new raster object. */
+ /* */
+ /* pool_base :: The address in memory of the render pool. */
+ /* */
+ /* pool_size :: The size in bytes of the render pool. */
+ /* */
+ /* <Note> */
+ /* Rasters can ignore the render pool and rely on dynamic memory */
+ /* allocation if they want to (a handle to the memory allocator is */
+ /* passed to the raster constructor). However, this is not */
+ /* recommended for efficiency purposes. */
+ /* */
+ typedef void
+ (*FT_Raster_ResetFunc)( FT_Raster raster,
+ unsigned char* pool_base,
+ unsigned long pool_size );
+
+#define FT_Raster_Reset_Func FT_Raster_ResetFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_SetModeFunc */
+ /* */
+ /* <Description> */
+ /* This function is a generic facility to change modes or attributes */
+ /* in a given raster. This can be used for debugging purposes, or */
+ /* simply to allow implementation-specific `features' in a given */
+ /* raster module. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the new raster object. */
+ /* */
+ /* mode :: A 4-byte tag used to name the mode or property. */
+ /* */
+ /* args :: A pointer to the new mode/property to use. */
+ /* */
+ typedef int
+ (*FT_Raster_SetModeFunc)( FT_Raster raster,
+ unsigned long mode,
+ void* args );
+
+#define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_Raster_RenderFunc */
+ /* */
+ /* <Description> */
+ /* Invokes a given raster to scan-convert a given glyph image into a */
+ /* target bitmap. */
+ /* */
+ /* <Input> */
+ /* raster :: A handle to the raster object. */
+ /* */
+ /* params :: A pointer to a FT_Raster_Params structure used to store */
+ /* the rendering parameters. */
+ /* */
+ /* <Return> */
+ /* Error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The exact format of the source image depends on the raster's glyph */
+ /* format defined in its FT_Raster_Funcs structure. It can be an */
+ /* FT_Outline or anything else in order to support a large array of */
+ /* glyph formats. */
+ /* */
+ /* Note also that the render function can fail and return a */
+ /* FT_Err_Unimplemented_Feature error code if the raster used does */
+ /* not support direct composition. */
+ /* */
+ /* XXX: For now, the standard raster doesn't support direct */
+ /* composition but this should change for the final release (see */
+ /* the files demos/src/ftgrays.c and demos/src/ftgrays2.c for */
+ /* examples of distinct implementations which support direct */
+ /* composition). */
+ /* */
+ typedef int
+ (*FT_Raster_RenderFunc)( FT_Raster raster,
+ FT_Raster_Params* params );
+
+#define FT_Raster_Render_Func FT_Raster_RenderFunc
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Raster_Funcs */
+ /* */
+ /* <Description> */
+ /* A structure used to describe a given raster class to the library. */
+ /* */
+ /* <Fields> */
+ /* glyph_format :: The supported glyph format for this raster. */
+ /* */
+ /* raster_new :: The raster constructor. */
+ /* */
+ /* raster_reset :: Used to reset the render pool within the raster. */
+ /* */
+ /* raster_render :: A function to render a glyph into a given bitmap. */
+ /* */
+ /* raster_done :: The raster destructor. */
+ /* */
+ typedef struct FT_Raster_Funcs_
+ {
+ FT_Glyph_Format glyph_format;
+ FT_Raster_NewFunc raster_new;
+ FT_Raster_ResetFunc raster_reset;
+ FT_Raster_SetModeFunc raster_set_mode;
+ FT_Raster_RenderFunc raster_render;
+ FT_Raster_DoneFunc raster_done;
+
+ } FT_Raster_Funcs;
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTIMAGE_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftincrem.h
@@ -1,0 +1,286 @@
+/***************************************************************************/
+/* */
+/* ftincrem.h */
+/* */
+/* FreeType incremental loading (specification). */
+/* */
+/* 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTINCREM_H__
+#define __FTINCREM_H__
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental
+ *
+ * @description:
+ * An opaque type describing a user-provided object used to implement
+ * "incremental" glyph loading within FreeType. This is used to support
+ * embedded fonts in certain environments (e.g. Postscript interpreters),
+ * where the glyph data isn't in the font file, or must be overridden by
+ * different values.
+ *
+ * @note:
+ * It is up to client applications to create and implement @FT_Incremental
+ * objects, as long as they provide implementations for the methods
+ * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
+ * and @FT_Incremental_GetGlyphMetricsFunc.
+ *
+ * See the description of @FT_Incremental_InterfaceRec to understand how
+ * to use incremental objects with FreeType.
+ */
+ typedef struct FT_IncrementalRec_* FT_Incremental;
+
+
+ /***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_Metrics
+ *
+ * @description:
+ * A small structure used to contain the basic glyph metrics returned
+ * by the @FT_Incremental_GetGlyphMetricsFunc method.
+ *
+ * @fields:
+ * bearing_x ::
+ * Left bearing, in font units.
+ *
+ * bearing_y ::
+ * Top bearing, in font units.
+ *
+ * advance ::
+ * Glyph advance, in font units.
+ *
+ * @note:
+ * These correspond to horizontal or vertical metrics depending on the
+ * value of the 'vertical' argument to the function
+ * @FT_Incremental_GetGlyphMetricsFunc.
+ */
+ typedef struct FT_Incremental_MetricsRec_
+ {
+ FT_Long bearing_x;
+ FT_Long bearing_y;
+ FT_Long advance;
+
+ } FT_Incremental_MetricsRec, *FT_Incremental_Metrics;
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_GetGlyphDataFunc
+ *
+ * @description:
+ * A function called by FreeType to access a given glyph's data bytes
+ * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
+ * enabled.
+ *
+ * Note that the format of the glyph's data bytes depends on the font
+ * file format. For TrueType, it must correspond to the raw bytes within
+ * the 'glyf' table. For Postscript formats, it must correspond to the
+ * *unencrypted* charstring bytes, without any 'lenIV' header. It is
+ * undefined for any other format.
+ *
+ * @input:
+ * incremental ::
+ * Handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * glyph_index ::
+ * Index of relevant glyph.
+ *
+ * @output:
+ * adata ::
+ * A structure describing the returned glyph data bytes (which will be
+ * accessed as a read-only byte block).
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @note:
+ * If this function returns succesfully the method
+ * @FT_Incremental_FreeGlyphDataFunc will be called later to release
+ * the data bytes.
+ *
+ * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
+ * compound glyphs.
+ */
+ typedef FT_Error
+ (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
+ FT_UInt glyph_index,
+ FT_Data* adata );
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_FreeGlyphDataFunc
+ *
+ * @description:
+ * A function used to release the glyph data bytes returned by a
+ * successful call to @FT_Incremental_GetGlyphDataFunc.
+ *
+ * @input:
+ * incremental ::
+ * A handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * data ::
+ * A structure describing the glyph data bytes (which will be accessed
+ * as a read-only byte block).
+ */
+ typedef void
+ (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
+ FT_Data* data );
+
+
+ /***************************************************************************
+ *
+ * @type:
+ * FT_Incremental_GetGlyphMetricsFunc
+ *
+ * @description:
+ * A function used to retrieve the basic metrics of a given glyph index
+ * before accessing its data. This is necessary because, in certain
+ * formats like TrueType, the metrics are stored in a different place from
+ * the glyph images proper.
+ *
+ * @input:
+ * incremental ::
+ * A handle to an opaque @FT_Incremental handle provided by the client
+ * application.
+ *
+ * glyph_index ::
+ * Index of relevant glyph.
+ *
+ * vertical ::
+ * If true, return vertical metrics.
+ *
+ * @output:
+ * ametrics ::
+ * The glyph metrics in font units.
+ *
+ * afound ::
+ * True if there are metrics at all.
+ *
+ */
+ typedef FT_Error
+ (*FT_Incremental_GetGlyphMetricsFunc)
+ ( FT_Incremental incremental,
+ FT_UInt glyph_index,
+ FT_Bool vertical,
+ FT_Incremental_MetricsRec *ametrics,
+ FT_Bool *afound );
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_FuncsRec
+ *
+ * @description:
+ * A table of functions for accessing fonts that load data
+ * incrementally. Used in @FT_Incremental_Interface.
+ *
+ * @fields:
+ * get_glyph_data ::
+ * The function to get glyph data. Must not be null.
+ *
+ * free_glyph_data ::
+ * The function to release glyph data. Must not be null.
+ *
+ * get_glyph_metrics ::
+ * The function to get glyph metrics. May be null if the font does
+ * not provide overriding glyph metrics.
+ */
+ typedef struct FT_Incremental_FuncsRec_
+ {
+ FT_Incremental_GetGlyphDataFunc get_glyph_data;
+ FT_Incremental_FreeGlyphDataFunc free_glyph_data;
+ FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
+
+ } FT_Incremental_FuncsRec;
+
+
+ /***************************************************************************
+ *
+ * @struct:
+ * FT_Incremental_InterfaceRec
+ *
+ * @description:
+ * A structure to be used with @FT_Open_Face to indicate that the user
+ * wants to support incremental glyph loading. You should use it with
+ * @FT_PARAM_TAG_INCREMENTAL as in the following example:
+ *
+ * {
+ * FT_Incremental_InterfaceRec inc_int;
+ * FT_Parameter parameter;
+ * FT_Open_Args open_args;
+ *
+ *
+ * // set up incremental descriptor
+ * inc_int.funcs = my_funcs;
+ * inc_int.object = my_object;
+ *
+ * // set up optional parameter
+ * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
+ * parameter.data = &inc_int;
+ *
+ * // set up FT_Open_Args structure
+ * open_args.flags = (FT_Open_Flags)( FT_OPEN_PATHNAME |
+ * FT_OPEN_PARAMS );
+ * open_args.pathname = my_font_pathname;
+ * open_args.num_params = 1;
+ * open_args.params = ¶meter; // we use one optional argument
+ *
+ * // open the font
+ * error = FT_Open_Face( library, &open_args, index, &face );
+ * ...
+ * }
+ */
+ typedef struct FT_Incremental_InterfaceRec_
+ {
+ const FT_Incremental_FuncsRec* funcs;
+ FT_Incremental object;
+
+ } FT_Incremental_InterfaceRec;
+
+
+ /***************************************************************************
+ *
+ * @constant:
+ * FT_PARAM_TAG_INCREMENTAL
+ *
+ * @description:
+ * A constant used as the tag of @FT_Parameter structures to indicate
+ * an incremental loading object to be used by FreeType.
+ *
+ */
+#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
+
+ /* */
+
+FT_END_HEADER
+
+#endif /* __FTINCREM_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftlist.h
@@ -1,0 +1,268 @@
+/***************************************************************************/
+/* */
+/* ftlist.h */
+/* */
+/* Generic list support for FreeType (specification). */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* This file implements functions relative to list processing. Its */
+ /* data structures are defined in `freetype.h'. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTLIST_H__
+#define __FTLIST_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* list_processing */
+ /* */
+ /* <Title> */
+ /* List Processing */
+ /* */
+ /* <Abstract> */
+ /* Simple management of lists. */
+ /* */
+ /* <Description> */
+ /* This section contains various definitions related to list */
+ /* processing using doubly-linked nodes. */
+ /* */
+ /* <Order> */
+ /* FT_List */
+ /* FT_ListNode */
+ /* FT_ListRec */
+ /* FT_ListNodeRec */
+ /* */
+ /* FT_List_Add */
+ /* FT_List_Insert */
+ /* FT_List_Find */
+ /* FT_List_Remove */
+ /* FT_List_Up */
+ /* FT_List_Iterate */
+ /* FT_List_Iterator */
+ /* FT_List_Finalize */
+ /* FT_List_Destructor */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Find */
+ /* */
+ /* <Description> */
+ /* Finds the list node for a given listed object. */
+ /* */
+ /* <Input> */
+ /* list :: A pointer to the parent list. */
+ /* data :: The address of the listed object. */
+ /* */
+ /* <Return> */
+ /* List node. NULL if it wasn't found. */
+ /* */
+ FT_EXPORT( FT_ListNode )
+ FT_List_Find( FT_List list,
+ void* data );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Add */
+ /* */
+ /* <Description> */
+ /* Appends an element to the end of a list. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to the parent list. */
+ /* node :: The node to append. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Add( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Insert */
+ /* */
+ /* <Description> */
+ /* Inserts an element at the head of a list. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to parent list. */
+ /* node :: The node to insert. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Insert( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Remove */
+ /* */
+ /* <Description> */
+ /* Removes a node from a list. This function doesn't check whether */
+ /* the node is in the list! */
+ /* */
+ /* <Input> */
+ /* node :: The node to remove. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to the parent list. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Remove( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Up */
+ /* */
+ /* <Description> */
+ /* Moves a node to the head/top of a list. Used to maintain LRU */
+ /* lists. */
+ /* */
+ /* <InOut> */
+ /* list :: A pointer to the parent list. */
+ /* node :: The node to move. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Up( FT_List list,
+ FT_ListNode node );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_List_Iterator */
+ /* */
+ /* <Description> */
+ /* An FT_List iterator function which is called during a list parse */
+ /* by FT_List_Iterate(). */
+ /* */
+ /* <Input> */
+ /* node :: The current iteration list node. */
+ /* */
+ /* user :: A typeless pointer passed to FT_List_Iterate(). */
+ /* Can be used to point to the iteration's state. */
+ /* */
+ typedef FT_Error
+ (*FT_List_Iterator)( FT_ListNode node,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Iterate */
+ /* */
+ /* <Description> */
+ /* Parses a list and calls a given iterator function on each element. */
+ /* Note that parsing is stopped as soon as one of the iterator calls */
+ /* returns a non-zero value. */
+ /* */
+ /* <Input> */
+ /* list :: A handle to the list. */
+ /* iterator :: An interator function, called on each node of the */
+ /* list. */
+ /* user :: A user-supplied field which is passed as the second */
+ /* argument to the iterator. */
+ /* */
+ /* <Return> */
+ /* The result (a FreeType error code) of the last iterator call. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_List_Iterate( FT_List list,
+ FT_List_Iterator iterator,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* FT_List_Destructor */
+ /* */
+ /* <Description> */
+ /* An FT_List iterator function which is called during a list */
+ /* finalization by FT_List_Finalize() to destroy all elements in a */
+ /* given list. */
+ /* */
+ /* <Input> */
+ /* system :: The current system object. */
+ /* */
+ /* data :: The current object to destroy. */
+ /* */
+ /* user :: A typeless pointer passed to FT_List_Iterate(). It can */
+ /* be used to point to the iteration's state. */
+ /* */
+ typedef void
+ (*FT_List_Destructor)( FT_Memory memory,
+ void* data,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_List_Finalize */
+ /* */
+ /* <Description> */
+ /* Destroys all elements in the list as well as the list itself. */
+ /* */
+ /* <Input> */
+ /* list :: A handle to the list. */
+ /* */
+ /* destroy :: A list destructor that will be applied to each element */
+ /* of the list. */
+ /* */
+ /* memory :: The current memory object which handles deallocation. */
+ /* */
+ /* user :: A user-supplied field which is passed as the last */
+ /* argument to the destructor. */
+ /* */
+ FT_EXPORT( void )
+ FT_List_Finalize( FT_List list,
+ FT_List_Destructor destroy,
+ FT_Memory memory,
+ void* user );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTLIST_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftmac.h
@@ -1,0 +1,128 @@
+/***************************************************************************/
+/* */
+/* ftmac.h */
+/* */
+/* Additional Mac-specific API. */
+/* */
+/* Copyright 1996-2001 by */
+/* Just van Rossum, 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. */
+/* */
+/***************************************************************************/
+
+
+/***************************************************************************/
+/* */
+/* NOTE: Include this file after <freetype/freetype.h> and after the */
+/* Mac-specific <Types.h> header (or any other Mac header that */
+/* includes <Types.h>); we use Handle type. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMAC_H__
+#define __FTMAC_H__
+
+
+#include <ft2build.h>
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* mac_specific */
+ /* */
+ /* <Title> */
+ /* Mac-Specific Interface */
+ /* */
+ /* <Abstract> */
+ /* Only available on the Macintosh. */
+ /* */
+ /* <Description> */
+ /* The following definitions are only available if FreeType is */
+ /* compiled on a Macintosh. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Face_From_FOND */
+ /* */
+ /* <Description> */
+ /* Creates a new face object from an FOND resource. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library resource. */
+ /* */
+ /* <Input> */
+ /* fond :: An FOND resource. */
+ /* */
+ /* face_index :: Only supported for the -1 `sanity check' special */
+ /* case. */
+ /* */
+ /* <Output> */
+ /* aface :: A handle to a new face object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Notes> */
+ /* This function can be used to create FT_Face abjects from fonts */
+ /* that are installed in the system like so: */
+ /* */
+ /* { */
+ /* fond = GetResource( 'FOND', fontName ); */
+ /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
+ /* } */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Face_From_FOND( FT_Library library,
+ Handle fond,
+ FT_Long face_index,
+ FT_Face *aface );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_GetFile_From_Mac_Name */
+ /* */
+ /* <Description> */
+ /* Returns an FSSpec for the disk file containing the named font. */
+ /* */
+ /* <Input> */
+ /* fontName :: Mac OS name of the font (eg. Times New Roman Bold). */
+ /* */
+ /* <Output> */
+ /* pathSpec :: FSSpec to the file. For passing to @FT_New_Face. */
+ /* */
+ /* face_index :: Index of the face. For passing to @FT_New_Face. */
+ /* */
+ /* <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_END_HEADER
+
+
+#endif /* __FTMAC_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftmm.h
@@ -1,0 +1,203 @@
+/***************************************************************************/
+/* */
+/* ftmm.h */
+/* */
+/* FreeType Multiple Master font interface (specification). */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMM_H__
+#define __FTMM_H__
+
+
+#include <ft2build.h>
+#include FT_TYPE1_TABLES_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* multiple_masters */
+ /* */
+ /* <Title> */
+ /* Multiple Masters */
+ /* */
+ /* <Abstract> */
+ /* How to manage Multiple Masters fonts. */
+ /* */
+ /* <Description> */
+ /* The following types and functions are used to manage Multiple */
+ /* Master fonts, i.e. the selection of specific design instances by */
+ /* setting design axis coordinates. */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_MM_Axis */
+ /* */
+ /* <Description> */
+ /* A simple structure used to model a given axis in design space for */
+ /* Multiple Masters fonts. */
+ /* */
+ /* <Fields> */
+ /* name :: The axis's name. */
+ /* */
+ /* minimum :: The axis's minimum design coordinate. */
+ /* */
+ /* maximum :: The axis's maximum design coordinate. */
+ /* */
+ typedef struct FT_MM_Axis_
+ {
+ FT_String* name;
+ FT_Long minimum;
+ FT_Long maximum;
+
+ } FT_MM_Axis;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Multi_Master */
+ /* */
+ /* <Description> */
+ /* A structure used to model the axes and space of a Multiple Masters */
+ /* font. */
+ /* */
+ /* <Fields> */
+ /* num_axis :: Number of axes. Cannot exceed 4. */
+ /* */
+ /* num_designs :: Number of designs; should ne normally 2^num_axis */
+ /* even though the Type 1 specification strangely */
+ /* allows for intermediate designs to be present. This */
+ /* number cannot exceed 16. */
+ /* */
+ /* axis :: A table of axis descriptors. */
+ /* */
+ typedef struct FT_Multi_Master_
+ {
+ FT_UInt num_axis;
+ FT_UInt num_designs;
+ FT_MM_Axis axis[T1_MAX_MM_AXIS];
+
+ } FT_Multi_Master;
+
+ /* */
+
+ 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> */
+ /* FT_Get_Multi_Master */
+ /* */
+ /* <Description> */
+ /* Retrieves the Multiple Master descriptor of a given font. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Output> */
+ /* amaster :: The Multiple Masters descriptor. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Get_Multi_Master( FT_Face face,
+ FT_Multi_Master *amaster );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_MM_Design_Coordinates */
+ /* */
+ /* <Description> */
+ /* For Multiple Masters fonts, choose an interpolated font design */
+ /* through design coordinates. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of design coordinates (must be equal to */
+ /* the number of axes in the font). */
+ /* */
+ /* coords :: An array of design coordinates. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_MM_Design_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Long* coords );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_MM_Blend_Coordinates */
+ /* */
+ /* <Description> */
+ /* For Multiple Masters fonts, choose an interpolated font design */
+ /* through normalized blend coordinates. */
+ /* */
+ /* <InOut> */
+ /* face :: A handle to the source face. */
+ /* */
+ /* <Input> */
+ /* num_coords :: The number of design coordinates (must be equal to */
+ /* the number of axes in the font). */
+ /* */
+ /* coords :: The design coordinates array (each element must be */
+ /* between 0 and 1.0). */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Set_MM_Blend_Coordinates( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTMM_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftmoderr.h
@@ -1,0 +1,149 @@
+/***************************************************************************/
+/* */
+/* ftmoderr.h */
+/* */
+/* FreeType module error offsets (specification). */
+/* */
+/* Copyright 2001, 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 file is used to define the FreeType module error offsets. */
+ /* */
+ /* 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 0xB03, the error */
+ /* `T1_Err_Invalid_File_Format' has value 0xC03, etc. */
+ /* */
+ /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
+ /* to make the higher byte always zero (disabling the module error */
+ /* mechanism). */
+ /* */
+ /* It can also be used to create a module error message table easily */
+ /* with something like */
+ /* */
+ /* { */
+ /* #undef __FTMODERR_H__ */
+ /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
+ /* #define FT_MODERR_START_LIST { */
+ /* #define FT_MODERR_END_LIST { 0, 0 } }; */
+ /* */
+ /* const struct */
+ /* { */
+ /* int mod_err_offset; */
+ /* const char* mod_err_msg */
+ /* } ft_mod_errors[] = */
+ /* */
+ /* #include FT_MODULE_ERRORS_H */
+ /* } */
+ /* */
+ /* To use such a table, all errors must be ANDed with 0xFF00 to remove */
+ /* the error code. */
+ /* */
+ /*************************************************************************/
+
+
+#ifndef __FTMODERR_H__
+#define __FTMODERR_H__
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** SETUP MACROS *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#undef FT_NEED_EXTERN_C
+
+#ifndef FT_MODERRDEF
+
+#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
+#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
+#else
+#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
+#endif
+
+#define FT_MODERR_START_LIST enum {
+#define FT_MODERR_END_LIST FT_Mod_Err_Max };
+
+#ifdef __cplusplus
+#define FT_NEED_EXTERN_C
+ extern "C" {
+#endif
+
+#endif /* !FT_MODERRDEF */
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** LIST MODULE ERROR BASES *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#ifdef FT_MODERR_START_LIST
+ FT_MODERR_START_LIST
+#endif
+
+
+ FT_MODERRDEF( Base, 0x000, "base module" )
+ FT_MODERRDEF( Autohint, 0x100, "autohinter module" )
+ FT_MODERRDEF( Cache, 0x200, "cache module" )
+ FT_MODERRDEF( CFF, 0x300, "CFF module" )
+ FT_MODERRDEF( CID, 0x400, "CID module" )
+ FT_MODERRDEF( PCF, 0x500, "PCF module" )
+ FT_MODERRDEF( PSaux, 0x600, "PS auxiliary module" )
+ FT_MODERRDEF( PSnames, 0x700, "PS names module" )
+ FT_MODERRDEF( Raster, 0x800, "raster module" )
+ FT_MODERRDEF( SFNT, 0x900, "SFNT module" )
+ FT_MODERRDEF( Smooth, 0xA00, "smooth raster module" )
+ FT_MODERRDEF( TrueType, 0xB00, "TrueType module" )
+ FT_MODERRDEF( Type1, 0xC00, "Type 1 module" )
+ FT_MODERRDEF( Winfonts, 0xD00, "Windows FON/FNT module" )
+ FT_MODERRDEF( PFR, 0xE00, "PFR module" )
+
+
+#ifdef FT_MODERR_END_LIST
+ FT_MODERR_END_LIST
+#endif
+
+
+ /*******************************************************************/
+ /*******************************************************************/
+ /***** *****/
+ /***** CLEANUP *****/
+ /***** *****/
+ /*******************************************************************/
+ /*******************************************************************/
+
+
+#ifdef FT_NEED_EXTERN_C
+ }
+#endif
+
+#undef FT_MODERR_START_LIST
+#undef FT_MODERR_END_LIST
+#undef FT_MODERRDEF
+#undef FT_NEED_EXTERN_C
+
+
+#endif /* __FTMODERR_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftmodule.h
@@ -1,0 +1,307 @@
+/***************************************************************************/
+/* */
+/* ftmodule.h */
+/* */
+/* FreeType modules public interface (specification). */
+/* */
+/* Copyright 1996-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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTMODULE_H__
+#define __FTMODULE_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* module_management */
+ /* */
+ /* <Title> */
+ /* Module Management */
+ /* */
+ /* <Abstract> */
+ /* How to add, upgrade, and remove modules from FreeType. */
+ /* */
+ /* <Description> */
+ /* The definitions below are used to manage modules within FreeType. */
+ /* Modules can be added, upgraded, and removed at runtime. */
+ /* */
+ /*************************************************************************/
+
+
+ /* module bit flags */
+ typedef enum FT_Module_Flags_
+ {
+ ft_module_font_driver = 1, /* this module is a font driver */
+ ft_module_renderer = 2, /* this module is a renderer */
+ ft_module_hinter = 4, /* this module is a glyph hinter */
+ ft_module_styler = 8, /* this module is a styler */
+
+ ft_module_driver_scalable = 0x100, /* the driver supports scalable */
+ /* fonts */
+ ft_module_driver_no_outlines = 0x200, /* the driver does not support */
+ /* vector outlines */
+ ft_module_driver_has_hinter = 0x400 /* the driver provides its own */
+ /* hinter */
+
+ } FT_Module_Flags;
+
+
+ typedef void
+ (*FT_Module_Interface)( void );
+
+ typedef FT_Error
+ (*FT_Module_Constructor)( FT_Module module );
+
+ typedef void
+ (*FT_Module_Destructor)( FT_Module module );
+
+ typedef FT_Module_Interface
+ (*FT_Module_Requester)( FT_Module module,
+ const char* name );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Module_Class */
+ /* */
+ /* <Description> */
+ /* The module class descriptor. */
+ /* */
+ /* <Fields> */
+ /* module_flags :: Bit flags describing the module. */
+ /* */
+ /* module_size :: The size of one module object/instance in */
+ /* bytes. */
+ /* */
+ /* module_name :: The name of the module. */
+ /* */
+ /* module_version :: The version, as a 16.16 fixed number */
+ /* (major.minor). */
+ /* */
+ /* module_requires :: The version of FreeType this module requires */
+ /* (starts at version 2.0, i.e 0x20000) */
+ /* */
+ /* module_init :: A function used to initialize (not create) a */
+ /* new module object. */
+ /* */
+ /* module_done :: A function used to finalize (not destroy) a */
+ /* given module object */
+ /* */
+ /* get_interface :: Queries a given module for a specific */
+ /* interface by name. */
+ /* */
+ typedef struct FT_Module_Class_
+ {
+ FT_ULong module_flags;
+ FT_Long module_size;
+ const FT_String* module_name;
+ FT_Fixed module_version;
+ FT_Fixed module_requires;
+
+ const void* module_interface;
+
+ FT_Module_Constructor module_init;
+ FT_Module_Destructor module_done;
+ FT_Module_Requester get_interface;
+
+ } FT_Module_Class;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Add_Module */
+ /* */
+ /* <Description> */
+ /* Adds a new module to a given library instance. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* <Input> */
+ /* clazz :: A pointer to class descriptor for the module. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* An error will be returned if a module already exists by that name, */
+ /* or if the module requires a version of FreeType that is too great. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Add_Module( FT_Library library,
+ const FT_Module_Class* clazz );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Module */
+ /* */
+ /* <Description> */
+ /* Finds a module by its name. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* module_name :: The module's name (as an ASCII string). */
+ /* */
+ /* <Return> */
+ /* A module handle. 0 if none was found. */
+ /* */
+ /* <Note> */
+ /* You should better be familiar with FreeType internals to know */
+ /* which module to look for :-) */
+ /* */
+ FT_EXPORT( FT_Module )
+ FT_Get_Module( FT_Library library,
+ const char* module_name );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Remove_Module */
+ /* */
+ /* <Description> */
+ /* Removes a given module from a library instance. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to a library object. */
+ /* */
+ /* <Input> */
+ /* module :: A handle to a module object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The module object is destroyed by the function in case of success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Remove_Module( FT_Library library,
+ FT_Module module );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Library */
+ /* */
+ /* <Description> */
+ /* This function is used to create a new FreeType library instance */
+ /* from a given memory object. It is thus possible to use libraries */
+ /* with distinct memory allocators within the same program. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the original memory object. */
+ /* */
+ /* <Output> */
+ /* alibrary :: A pointer to handle of a new library object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_New_Library( FT_Memory memory,
+ FT_Library *alibrary );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Library */
+ /* */
+ /* <Description> */
+ /* Discards a given library object. This closes all drivers and */
+ /* discards all resource objects. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the target library. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Done_Library( FT_Library library );
+
+
+
+ typedef void
+ (*FT_DebugHook_Func)( void* arg );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Set_Debug_Hook */
+ /* */
+ /* <Description> */
+ /* Sets a debug hook function for debugging the interpreter of a font */
+ /* format. */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to the library object. */
+ /* */
+ /* <Input> */
+ /* hook_index :: The index of the debug hook. You should use the */
+ /* values defined in ftobjs.h, e.g. */
+ /* FT_DEBUG_HOOK_TRUETYPE. */
+ /* */
+ /* debug_hook :: The function used to debug the interpreter. */
+ /* */
+ /* <Note> */
+ /* Currently, four debug hook slots are available, but only two (for */
+ /* the TrueType and the Type 1 interpreter) are defined. */
+ /* */
+ FT_EXPORT( void )
+ FT_Set_Debug_Hook( FT_Library library,
+ FT_UInt hook_index,
+ FT_DebugHook_Func debug_hook );
+
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Add_Default_Modules */
+ /* */
+ /* <Description> */
+ /* Adds the set of default drivers to a given library object. */
+ /* This is only useful when you create a library object with */
+ /* FT_New_Library() (usually to plug a custom memory manager). */
+ /* */
+ /* <InOut> */
+ /* library :: A handle to a new library object. */
+ /* */
+ FT_EXPORT( void )
+ FT_Add_Default_Modules( FT_Library library );
+
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* __FTMODULE_H__ */
+
+
+/* END */
--- /dev/null
+++ b/include/freetype/ftoutln.h
@@ -1,0 +1,400 @@
+/***************************************************************************/
+/* */
+/* ftoutln.h */
+/* */
+/* Support for the FT_Outline type used to store glyph shapes of */
+/* most scalable font formats (specification). */
+/* */
+/* Copyright 1996-2001, 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. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __FTOUTLN_H__
+#define __FTOUTLN_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Section> */
+ /* outline_processing */
+ /* */
+ /* <Title> */
+ /* Outline Processing */
+ /* */
+ /* <Abstract> */
+ /* Functions to create, transform, and render vectorial glyph images. */
+ /* */
+ /* <Description> */
+ /* This section contains routines used to create and destroy scalable */
+ /* glyph images known as `outlines'. These can also be measured, */
+ /* transformed, and converted into bitmaps and pixmaps. */
+ /* */
+ /* <Order> */
+ /* FT_Outline */
+ /* FT_Outline_Flags */
+ /* FT_Outline_New */
+ /* FT_Outline_Done */
+ /* FT_Outline_Copy */
+ /* FT_Outline_Translate */
+ /* FT_Outline_Transform */
+ /* FT_Outline_Reverse */
+ /* FT_Outline_Check */
+ /* */
+ /* FT_Outline_Get_CBox */
+ /* FT_Outline_Get_BBox */
+ /* */
+ /* FT_Outline_Get_Bitmap */
+ /* FT_Outline_Render */
+ /* */
+ /* FT_Outline_Decompose */
+ /* FT_Outline_Funcs */
+ /* FT_Outline_MoveTo_Func */
+ /* FT_Outline_LineTo_Func */
+ /* FT_Outline_ConicTo_Func */
+ /* FT_Outline_CubicTo_Func */
+ /* */
+ /*************************************************************************/
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Decompose */
+ /* */
+ /* <Description> */
+ /* Walks over an outline's structure to decompose it into individual */
+ /* segments and Bezier arcs. This function is also able to emit */
+ /* `move to' and `close to' operations to indicate the start and end */
+ /* of new contours in the outline. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source target. */
+ /* */
+ /* func_interface :: A table of `emitters', i.e,. function pointers */
+ /* called during decomposition to indicate path */
+ /* operations. */
+ /* */
+ /* <InOut> */
+ /* user :: A typeless pointer which is passed to each */
+ /* emitter during the decomposition. It can be */
+ /* used to store the state during the */
+ /* decomposition. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means sucess. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Decompose( FT_Outline* outline,
+ const FT_Outline_Funcs* func_interface,
+ void* user );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_New */
+ /* */
+ /* <Description> */
+ /* Creates a new outline of a given size. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to the library object from where the */
+ /* outline is allocated. Note however that the new */
+ /* outline will NOT necessarily be FREED, when */
+ /* destroying the library, by FT_Done_FreeType(). */
+ /* */
+ /* numPoints :: The maximal number of points within the outline. */
+ /* */
+ /* numContours :: The maximal number of contours within the outline. */
+ /* */
+ /* <Output> */
+ /* anoutline :: A handle to the new outline. NULL in case of */
+ /* error. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The reason why this function takes a `library' parameter is simply */
+ /* to use the library's memory allocator. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_New( FT_Library library,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+ FT_EXPORT( FT_Error )
+ FT_Outline_New_Internal( FT_Memory memory,
+ FT_UInt numPoints,
+ FT_Int numContours,
+ FT_Outline *anoutline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Done */
+ /* */
+ /* <Description> */
+ /* Destroys an outline created with FT_Outline_New(). */
+ /* */
+ /* <Input> */
+ /* library :: A handle of the library object used to allocate the */
+ /* outline. */
+ /* */
+ /* outline :: A pointer to the outline object to be discarded. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* If the outline's `owner' field is not set, only the outline */
+ /* descriptor will be released. */
+ /* */
+ /* The reason why this function takes an `library' parameter is */
+ /* simply to use FT_Free(). */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Done( FT_Library library,
+ FT_Outline* outline );
+
+
+ FT_EXPORT( FT_Error )
+ FT_Outline_Done_Internal( FT_Memory memory,
+ FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Check */
+ /* */
+ /* <Description> */
+ /* Check the contents of an outline descriptor. */
+ /* */
+ /* <Input> */
+ /* outline :: A handle to a source outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Check( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_CBox */
+ /* */
+ /* <Description> */
+ /* Returns an outline's `control box'. The control box encloses all */
+ /* the outline's points, including Bezier control points. Though it */
+ /* coincides with the exact bounding box for most glyphs, it can be */
+ /* slightly larger in some situations (like when rotating an outline */
+ /* which contains Bezier outside arcs). */
+ /* */
+ /* Computing the control box is very fast, while getting the bounding */
+ /* box can take much more time as it needs to walk over all segments */
+ /* and arcs in the outline. To get the latter, you can use the */
+ /* `ftbbox' component which is dedicated to this single task. */
+ /* */
+ /* <Input> */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <Output> */
+ /* acbox :: The outline's control box. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Get_CBox( FT_Outline* outline,
+ FT_BBox *acbox );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Translate */
+ /* */
+ /* <Description> */
+ /* Applies a simple translation to the points of an outline. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Input> */
+ /* xOffset :: The horizontal offset. */
+ /* */
+ /* yOffset :: The vertical offset. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Translate( FT_Outline* outline,
+ FT_Pos xOffset,
+ FT_Pos yOffset );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Copy */
+ /* */
+ /* <Description> */
+ /* Copies an outline into another one. Both objects must have the */
+ /* same sizes (number of points & number of contours) when this */
+ /* function is called. */
+ /* */
+ /* <Input> */
+ /* source :: A handle to the source outline. */
+ /* */
+ /* <Output> */
+ /* target :: A handle to the target outline. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Copy( FT_Outline* source,
+ FT_Outline *target );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Transform */
+ /* */
+ /* <Description> */
+ /* Applies a simple 2x2 matrix to all of an outline's points. Useful */
+ /* for applying rotations, slanting, flipping, etc. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Input> */
+ /* matrix :: A pointer to the transformation matrix. */
+ /* */
+ /* <Note> */
+ /* You can use FT_Outline_Translate() if you need to translate the */
+ /* outline's points. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Transform( FT_Outline* outline,
+ FT_Matrix* matrix );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Reverse */
+ /* */
+ /* <Description> */
+ /* Reverses the drawing direction of an outline. This is used to */
+ /* ensure consistent fill conventions for mirrored glyphs. */
+ /* */
+ /* <InOut> */
+ /* outline :: A pointer to the target outline descriptor. */
+ /* */
+ /* <Note> */
+ /* This functions toggles the bit flag `FT_OUTLINE_REVERSE_FILL' in */
+ /* the outline's `flags' field. */
+ /* */
+ /* It shouldn't be used by a normal client application, unless it */
+ /* knows what it is doing. */
+ /* */
+ FT_EXPORT( void )
+ FT_Outline_Reverse( FT_Outline* outline );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Get_Bitmap */
+ /* */
+ /* <Description> */
+ /* Renders an outline within a bitmap. The outline's image is simply */
+ /* OR-ed to the target bitmap. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <Output> */
+ /* abitmap :: A pointer to the target bitmap descriptor. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* This function does NOT CREATE the bitmap, it only renders an */
+ /* outline image within the one you pass to it! */
+ /* */
+ /* It will use the raster correponding to the default glyph format. */
+ /* */
+ FT_EXPORT( FT_Error )
+ FT_Outline_Get_Bitmap( FT_Library library,
+ FT_Outline* outline,
+ FT_Bitmap *abitmap );
+
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Outline_Render */
+ /* */
+ /* <Description> */
+ /* Renders an outline within a bitmap using the current scan-convert. */
+ /* This functions uses an FT_Raster_Params structure as an argument, */
+ /* allowing advanced features like direct composition, translucency, */
+ /* etc. */
+ /* */
+ /* <Input> */
+ /* library :: A handle to a FreeType library object. */
+ /* */
+ /* outline :: A pointer to the source outline descriptor. */
+ /* */
+ /* <InOut> */
+ /* params :: A pointer to a FT_Raster_Params structure used to */
+ /* describe the rendering operation. */
+ /* */
+ /* <Return>